Package javax.sound.midi

Examples of javax.sound.midi.MetaEventListener


     * To accomplish this, we register a Listener to the Sequencer. It is
     * called when there are "meta" events. Meta event 47 is end of track.
     *
     * Thanks to Espen Riskedal for finding this trick.
     */
    sequencer.addMetaEventListener(new MetaEventListener() {
      @Override
      public void meta(MetaMessage event) {
        if (event.getType() == 47) {
          sequencer.close();
          if (synthesizer != null) {
View Full Code Here


     * To accomplish this, we register a Listener to the Sequencer. It is
     * called when there are "meta" events. Meta event 47 is end of track.
     *
     * Thanks to Espen Riskedal for finding this trick.
     */
    sequencer.addMetaEventListener(new MetaEventListener() {
      @Override
      public void meta(MetaMessage event) {
        if (event.getType() == 47) {
          sequencer.close();
          if (synthesizer != null) {
View Full Code Here

    if (sm_sequencer == null) {
      _logger.info("can't get a Sequencer");
      return;
    }

    sm_sequencer.addMetaEventListener(new MetaEventListener() {
      public void meta(MetaMessage event) {
        if (event.getType() == 47) {
          sm_sequencer.close();
          if (sm_synthesizer != null) {
            sm_synthesizer.close();
View Full Code Here

        Sequencer sequencer = MidiSystem.getSequencer();
        sequencer.open();
        Sequence sequence = MidiSystem.getSequence(new File(args[0]));
Debug.println(sequence);
        sequencer.setSequence(sequence);
        sequencer.addMetaEventListener(new MetaEventListener() {
            public void meta(MetaMessage meta) {
Debug.println(meta.getType());
                if (meta.getType() == 47) {
                    System.exit(0);
                }
View Full Code Here

TOP

Related Classes of javax.sound.midi.MetaEventListener

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.