Java Code Examples for javax.sound.midi.MetaMessage#getType()

The following examples show how to use javax.sound.midi.MetaMessage#getType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MetaMessageClone.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private static void checkClone(MetaMessage msg) throws Exception {
    System.out.print("Original: ");
    byte[] msgData=msg.getData();
    printMsg(msg, msgData);
    MetaMessage msg2=(MetaMessage) msg.clone();
    byte[] msg2Data=msg2.getData();
    System.out.print("Clone:    ");
    printMsg(msg2, msg2Data);

    if (msg2.getLength()!=msg.getLength()
        || msg.getType()!=msg2.getType()
        || msgData.length!=msg2Data.length) {
            throw new Exception("cloned MetaMessage is not equal.");
    }
    int max=Math.min(msgData.length, 10);
    for (int i=0; i<max; i++) {
        if (msgData[i]!=msg2Data[i]) {
            throw new Exception("Cloned MetaMessage data is not equal.");
        }
    }
}
 
Example 2
Source File: MetaCallback.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void meta(MetaMessage msg) {
    System.out.println(""+metaCount+": got "+msg);
    if (msg.getType() == 0x2F) {
        finished = true;
    } else if (msg.getData().length > 0 && msg.getType() == 1) {
        metaCount++;
    }
}
 
Example 3
Source File: MidiSynth.java    From jmg with GNU General Public License v2.0 5 votes vote down vote up
/**
    * Invoked when a Sequencer has encountered and processed a MetaMessage
    * in the Sequence it is processing.
    * @param MetaMessage meta - the meta-message that the sequencer
    *                           encountered
    */
   public void meta(MetaMessage metaEvent) {
	//System.out.println("JavaSound sequencer sent meta event");
	if (metaEvent.getType() == StopType) {
		if (msCycle) {
			rePlay();
		} else { 
			stop();
		}
	}
}
 
Example 4
Source File: JavaSoundAudioClip.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 5
Source File: JavaSoundAudioClip.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 6
Source File: JavaSoundAudioClip.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 7
Source File: JavaSoundAudioClip.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 8
Source File: JavaSoundAudioClip.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 9
Source File: JavaSoundAudioClip.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 10
Source File: JavaSoundAudioClip.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 11
Source File: JavaSoundAudioClip.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 12
Source File: TickLength.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void meta(MetaMessage p1) {
 if(p1.getType() ==47) {
   return;
 }
 System.out.println("getTickPosition:\t"+theSequencer.getTickPosition()
     +"\t Sequencer.getTickLength:\t"+theSequencer.getTickLength()
     +"\tReal Length:\t"+lastTick
     +"\t Sequence.getTickLength:\t"+theSequence.getTickLength()
     //(theSequencer.getTickLength()/64));
     );
}
 
Example 13
Source File: Looping.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void meta(MetaMessage m) {
    System.out.print("  Got MetaMessage: ");
    if (m.getType() == 47) {
        stopTime = System.currentTimeMillis();
        System.out.println(" End Of Track -- OK");
    } else {
        System.out.println(" unknown. Ignored.");
    }
}
 
Example 14
Source File: JavaSoundAudioClip.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public synchronized void meta(MetaMessage message) {

    if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

    if( message.getType() == 47 ) {
        if (sequencerloop){
            //notifyAll();
            sequencer.setMicrosecondPosition(0);
            loop();
        } else {
            stop();
        }
    }
}
 
Example 15
Source File: JavaSoundAudioClip.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void meta(MetaMessage message) {
    if( message.getType() == 47 ) {
        if (sequencerloop){
            //notifyAll();
            sequencer.setMicrosecondPosition(0);
            loop();
        } else {
            stop();
        }
    }
}
 
Example 16
Source File: JavaSoundAudioClip.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 17
Source File: JavaSoundAudioClip.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 18
Source File: JavaSoundAudioClip.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 19
Source File: JavaSoundAudioClip.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void meta( MetaMessage message ) {

        if (DEBUG || Printer.debug)Printer.debug("META EVENT RECEIVED!!!!! ");

        if( message.getType() == 47 ) {
            if (sequencerloop){
                //notifyAll();
                sequencer.setMicrosecondPosition(0);
                loop();
            } else {
                stop();
            }
        }
    }
 
Example 20
Source File: LMidiSound.java    From RipplePower with Apache License 2.0 4 votes vote down vote up
public void meta(MetaMessage msg) {
	if (msg.getType() == MIDI_EOT_MESSAGE) {
		this.sequencer.setMicrosecondPosition(0);
		this.sequencer.removeMetaEventListener(this);
	}
}