*
*/
public void test_getMicrosecondLength() throws Exception {
Sequence seq = new Sequence(Sequence.PPQ, 15, 2);
Track tr = seq.createTrack();
MidiEvent event1 = new MidiEvent(new MidiMessage1(new byte[] {1, 2, 3}), -10L);
MidiEvent event2 = new MidiEvent(new MidiMessage1(new byte[] {23, -16, 4}), 3L);
MidiEvent event3 = new MidiEvent(new MidiMessage1(new byte[] {3, -67, -1}), 6L);
/*------- Sequence.PPQ -------*/
tr.add(event2);
assertEquals(100000, seq.getMicrosecondLength());
Track tr1 = seq.createTrack();
tr1.add(event1);
tr1.add(event2);
tr1.add(event3);
assertEquals(200000, seq.getMicrosecondLength());
seq.deleteTrack(tr1);
assertEquals(100000, seq.getMicrosecondLength());
seq.deleteTrack(tr);
assertEquals(0, seq.getMicrosecondLength());
/*------- Sequence.SMPTE_24 -------*/
event2 = new MidiEvent(new MidiMessage1(new byte[] {23, -16, 4}), 0L);
seq = new Sequence(Sequence.SMPTE_24, 17, 2);
tr = seq.createTrack();
tr.add(event2);
assertEquals(0, seq.getMicrosecondLength());
tr1 = seq.createTrack();
tr1.add(event1);
tr1.add(event2);
tr1.add(event3);
assertEquals(14705, seq.getMicrosecondLength());
seq.deleteTrack(tr1);
assertEquals(0, seq.getMicrosecondLength());
/*------- Sequence.SMPTE_25 -------*/
event2 = new MidiEvent(new MidiMessage1(new byte[] {23, -16, 4}), 3L);
event3 = new MidiEvent(new MidiMessage1(new byte[] {3, -67, -1}), 97913L);
seq = new Sequence(Sequence.SMPTE_25, -5, 2);
tr = seq.createTrack();
tr.add(event2);
assertEquals(-24000, seq.getMicrosecondLength());
tr1 = seq.createTrack();