예제 #1
0
  public void handleMidiCommand(MidiCommand cmd) {
    // Do any of the currently in-effect maps match this event?
    Cue cue = getCurrentCue();
    if (cue != null) {
      Iterator<EventMapper> iter = cue.getEventMaps().iterator();
      while (iter.hasNext()) {
        EventMapper em = iter.next();
        MidiCommand out[] = em.mapEvent(cmd);
        if (out != null) {
          for (int i = 0; i < out.length; i++) {
            if (out[i] != null && getTarget() != null) getTarget().handleMidiCommand(out[i]);
          }
        }
      }
    }

    if (ignoreEvents()) {
      return;
    }

    for (int i = 0; i < cachedTriggers.length; i++) {
      boolean triggered = false;

      Trigger trig = cachedTriggers[i];
      if (trig.match(cmd)) {
        triggered = true;
        executeTrigger(trig);
      }
      if (triggered) break;
    }
    // no match, just ignore the message.

  }
예제 #2
0
 private void addCurrentTriggers() {
   Cue cue = getCurrentCue();
   if (cue != null) {
     Iterator<Trigger> iter = cue.getTriggers().iterator();
     while (iter.hasNext()) {
       Trigger t = iter.next();
       addTrigger(t);
     }
   }
 }