Package org.open2jam.parsers

Examples of org.open2jam.parsers.Event


        EventList new_list = new EventList();
 
        timing.add(timer, bpm);
       
  //there is always a 1st measure
  Event m = new Event(Event.Channel.MEASURE, measure, 0, 0, Event.Flag.NONE);
  m.setTime(timer);
  new_list.add(m);

        for(Event e : list)
        {
            while(e.getMeasure() > measure)
            {
                timer += (BEATS_PER_MSEC * (frac_measure-measure_pointer)) / my_bpm;
                m = new Event(Event.Channel.MEASURE, measure, 0, 0, Event.Flag.NONE);
                m.setTime(timer);
                new_list.add(m);
                measure++;
                frac_measure = 1;
                measure_pointer = 0;
            }
View Full Code Here


    **/
    void update_note_buffer(double now, double now_display)
    {
        while(buffer_iterator.hasNext() && getViewport() - distance.calculate(now_display, buffer_timer, speed, null) > -10)
        {
            Event e = buffer_iterator.next();

            buffer_timer = e.getTime();
           
            switch(e.getChannel())
            {
                case MEASURE:
                    MeasureEntity m = (MeasureEntity) skin.getEntityMap().get("MEASURE_MARK").copy();
                    m.setTime(e.getTime());
                    m.setOnJudge(increaseMeasureRunnable);
                    entities_matrix.add(m);
       
                break;
                   
                case NOTE_1:case NOTE_2:
                case NOTE_3:case NOTE_4:
                case NOTE_5:case NOTE_6:case NOTE_7:
                if(e.getFlag() == Event.Flag.NONE){
        if(ln_buffer.containsKey(e.getChannel()))
      Logger.global.log(Level.WARNING, "There is a none in the current long {0} @ "+e.getTotalPosition(), e.getChannel());
                    NoteEntity n = (NoteEntity) skin.getEntityMap().get(e.getChannel().toString()).copy();
                    n.setTime(e.getTime());
       
                    assignSample(n, e);
       
        entities_matrix.add(n);
                    note_channels.get(n.getChannel()).add(n);
                }
                else if(e.getFlag() == Event.Flag.HOLD){
        if(ln_buffer.containsKey(e.getChannel()))
      Logger.global.log(Level.WARNING, "There is a hold in the current long {0} @ "+e.getTotalPosition(), e.getChannel());
                    LongNoteEntity ln = (LongNoteEntity) skin.getEntityMap().get("LONG_"+e.getChannel()).copy();
                    ln.setTime(e.getTime());
       
                    assignSample(ln, e);
       
        entities_matrix.add(ln);
        ln_buffer.put(e.getChannel(),ln);
                    note_channels.get(ln.getChannel()).add(ln);
                }
                else if(e.getFlag() == Event.Flag.RELEASE){
                    LongNoteEntity lne = ln_buffer.remove(e.getChannel());
                    if(lne == null){
                        Logger.global.log(Level.WARNING, "Attempted to RELEASE note {0} @ "+e.getTotalPosition(), e.getChannel());
                    }else{
                        lne.setEndTime(e.getTime());
                    }
                }
                break;
    case BGA:
        if(!bgaEntity.isVideo) {
      Sprite sprite = null;
      if(bga_sprites.containsKey((int)e.getValue()))
          sprite = bga_sprites.get((int)e.getValue());
      if(sprite == null) break;
      sprite.setScale(1f, 1f);
      bgaEntity.setSprite(sprite);
        }
       
        bgaEntity.setTime(e.getTime());
    break;
       
                //TODO ADD SUPPORT
                case NOTE_SC:
                case NOTE_8:case NOTE_9:
View Full Code Here

TOP

Related Classes of org.open2jam.parsers.Event

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.