public final class com.sun.media.sound.MidiUtils
minor version: 0
major version: 59
flags: flags: (0x0031) ACC_PUBLIC, ACC_FINAL, ACC_SUPER
this_class: com.sun.media.sound.MidiUtils
super_class: java.lang.Object
{
public static final int DEFAULT_TEMPO_MPQ;
descriptor: I
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: 500000
public static final int META_END_OF_TRACK_TYPE;
descriptor: I
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: 47
public static final int META_TEMPO_TYPE;
descriptor: I
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: 81
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 // com.sun.media.sound.MidiUtils this
0: .line 48
aload 0 /* this */
invokespecial java.lang.Object.<init>:()V
1: .line 49
return
end local 0 // com.sun.media.sound.MidiUtils this
LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/sun/media/sound/MidiUtils;
public static boolean isMetaEndOfTrack(javax.sound.midi.MidiMessage);
descriptor: (Ljavax/sound/midi/MidiMessage;)Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=2, args_size=1
start local 0 // javax.sound.midi.MidiMessage midiMsg
0: .line 54
aload 0 /* midiMsg */
invokevirtual javax.sound.midi.MidiMessage.getLength:()I
iconst_3
if_icmpne 2
1: .line 55
aload 0 /* midiMsg */
invokevirtual javax.sound.midi.MidiMessage.getStatus:()I
sipush 255
if_icmpeq 3
2: .line 56
StackMap locals:
StackMap stack:
iconst_0
ireturn
3: .line 59
StackMap locals:
StackMap stack:
aload 0 /* midiMsg */
invokevirtual javax.sound.midi.MidiMessage.getMessage:()[B
astore 1 /* msg */
start local 1 // byte[] msg
4: .line 60
aload 1 /* msg */
iconst_1
baload
sipush 255
iand
bipush 47
if_icmpne 5
aload 1 /* msg */
iconst_2
baload
ifne 5
iconst_1
ireturn
StackMap locals: byte[]
StackMap stack:
5: iconst_0
ireturn
end local 1 // byte[] msg
end local 0 // javax.sound.midi.MidiMessage midiMsg
LocalVariableTable:
Start End Slot Name Signature
0 6 0 midiMsg Ljavax/sound/midi/MidiMessage;
4 6 1 msg [B
MethodParameters:
Name Flags
midiMsg
public static boolean isMetaTempo(javax.sound.midi.MidiMessage);
descriptor: (Ljavax/sound/midi/MidiMessage;)Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=2, args_size=1
start local 0 // javax.sound.midi.MidiMessage midiMsg
0: .line 67
aload 0 /* midiMsg */
invokevirtual javax.sound.midi.MidiMessage.getLength:()I
bipush 6
if_icmpne 2
1: .line 68
aload 0 /* midiMsg */
invokevirtual javax.sound.midi.MidiMessage.getStatus:()I
sipush 255
if_icmpeq 3
2: .line 69
StackMap locals:
StackMap stack:
iconst_0
ireturn
3: .line 72
StackMap locals:
StackMap stack:
aload 0 /* midiMsg */
invokevirtual javax.sound.midi.MidiMessage.getMessage:()[B
astore 1 /* msg */
start local 1 // byte[] msg
4: .line 74
aload 1 /* msg */
iconst_1
baload
sipush 255
iand
bipush 81
if_icmpne 5
aload 1 /* msg */
iconst_2
baload
iconst_3
if_icmpne 5
iconst_1
ireturn
StackMap locals: byte[]
StackMap stack:
5: iconst_0
ireturn
end local 1 // byte[] msg
end local 0 // javax.sound.midi.MidiMessage midiMsg
LocalVariableTable:
Start End Slot Name Signature
0 6 0 midiMsg Ljavax/sound/midi/MidiMessage;
4 6 1 msg [B
MethodParameters:
Name Flags
midiMsg
public static int getTempoMPQ(javax.sound.midi.MidiMessage);
descriptor: (Ljavax/sound/midi/MidiMessage;)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=3, args_size=1
start local 0 // javax.sound.midi.MidiMessage midiMsg
0: .line 83
aload 0 /* midiMsg */
invokevirtual javax.sound.midi.MidiMessage.getLength:()I
bipush 6
if_icmpne 2
1: .line 84
aload 0 /* midiMsg */
invokevirtual javax.sound.midi.MidiMessage.getStatus:()I
sipush 255
if_icmpeq 3
2: .line 85
StackMap locals:
StackMap stack:
iconst_m1
ireturn
3: .line 87
StackMap locals:
StackMap stack:
aload 0 /* midiMsg */
invokevirtual javax.sound.midi.MidiMessage.getMessage:()[B
astore 1 /* msg */
start local 1 // byte[] msg
4: .line 88
aload 1 /* msg */
iconst_1
baload
sipush 255
iand
bipush 81
if_icmpne 5
aload 1 /* msg */
iconst_2
baload
iconst_3
if_icmpeq 6
5: .line 89
StackMap locals: byte[]
StackMap stack:
iconst_m1
ireturn
6: .line 91
StackMap locals:
StackMap stack:
aload 1 /* msg */
iconst_5
baload
sipush 255
iand
7: .line 92
aload 1 /* msg */
iconst_4
baload
sipush 255
iand
bipush 8
ishl
8: .line 91
ior
9: .line 93
aload 1 /* msg */
iconst_3
baload
sipush 255
iand
bipush 16
ishl
10: .line 91
ior
istore 2 /* tempo */
start local 2 // int tempo
11: .line 94
iload 2 /* tempo */
ireturn
end local 2 // int tempo
end local 1 // byte[] msg
end local 0 // javax.sound.midi.MidiMessage midiMsg
LocalVariableTable:
Start End Slot Name Signature
0 12 0 midiMsg Ljavax/sound/midi/MidiMessage;
4 12 1 msg [B
11 12 2 tempo I
MethodParameters:
Name Flags
midiMsg
public static double convertTempo(double);
descriptor: (D)D
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=2, args_size=1
start local 0 // double tempo
0: .line 104
dload 0 /* tempo */
dconst_0
dcmpg
ifgt 2
1: .line 105
dconst_1
dstore 0 /* tempo */
2: .line 107
StackMap locals:
StackMap stack:
ldc 6.0E7
dload 0 /* tempo */
ddiv
dreturn
end local 0 // double tempo
LocalVariableTable:
Start End Slot Name Signature
0 3 0 tempo D
MethodParameters:
Name Flags
tempo
public static long ticks2microsec(long, double, int);
descriptor: (JDI)J
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=5, args_size=3
start local 0 // long tick
start local 2 // double tempoMPQ
start local 4 // int resolution
0: .line 117
lload 0 /* tick */
l2d
dload 2 /* tempoMPQ */
dmul
iload 4 /* resolution */
i2d
ddiv
d2l
lreturn
end local 4 // int resolution
end local 2 // double tempoMPQ
end local 0 // long tick
LocalVariableTable:
Start End Slot Name Signature
0 1 0 tick J
0 1 2 tempoMPQ D
0 1 4 resolution I
MethodParameters:
Name Flags
tick
tempoMPQ
resolution
public static long microsec2ticks(long, double, int);
descriptor: (JDI)J
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=5, args_size=3
start local 0 // long us
start local 2 // double tempoMPQ
start local 4 // int resolution
0: .line 128
lload 0 /* us */
l2d
iload 4 /* resolution */
i2d
dmul
dload 2 /* tempoMPQ */
ddiv
d2l
lreturn
end local 4 // int resolution
end local 2 // double tempoMPQ
end local 0 // long us
LocalVariableTable:
Start End Slot Name Signature
0 1 0 us J
0 1 2 tempoMPQ D
0 1 4 resolution I
MethodParameters:
Name Flags
us
tempoMPQ
resolution
public static long tick2microsecond(javax.sound.midi.Sequence, long, com.sun.media.sound.MidiUtils$TempoCache);
descriptor: (Ljavax/sound/midi/Sequence;JLcom/sun/media/sound/MidiUtils$TempoCache;)J
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=7, locals=13, args_size=3
start local 0 // javax.sound.midi.Sequence seq
start local 1 // long tick
start local 3 // com.sun.media.sound.MidiUtils$TempoCache cache
0: .line 137
aload 0 /* seq */
invokevirtual javax.sound.midi.Sequence.getDivisionType:()F
fconst_0
fcmpl
ifeq 3
1: .line 138
lload 1 /* tick */
l2d
aload 0 /* seq */
invokevirtual javax.sound.midi.Sequence.getDivisionType:()F
aload 0 /* seq */
invokevirtual javax.sound.midi.Sequence.getResolution:()I
i2f
fmul
f2d
ddiv
dstore 4 /* seconds */
start local 4 // double seconds
2: .line 139
ldc 1000000.0
dload 4 /* seconds */
dmul
d2l
lreturn
end local 4 // double seconds
3: .line 142
StackMap locals:
StackMap stack:
aload 3 /* cache */
ifnonnull 5
4: .line 143
new com.sun.media.sound.MidiUtils$TempoCache
dup
aload 0 /* seq */
invokespecial com.sun.media.sound.MidiUtils$TempoCache.<init>:(Ljavax/sound/midi/Sequence;)V
astore 3 /* cache */
5: .line 146
StackMap locals:
StackMap stack:
aload 0 /* seq */
invokevirtual javax.sound.midi.Sequence.getResolution:()I
istore 4 /* resolution */
start local 4 // int resolution
6: .line 148
aload 3 /* cache */
getfield com.sun.media.sound.MidiUtils$TempoCache.ticks:[J
astore 5 /* ticks */
start local 5 // long[] ticks
7: .line 149
aload 3 /* cache */
getfield com.sun.media.sound.MidiUtils$TempoCache.tempos:[I
astore 6 /* tempos */
start local 6 // int[] tempos
8: .line 150
aload 6 /* tempos */
arraylength
istore 7 /* cacheCount */
start local 7 // int cacheCount
9: .line 153
aload 3 /* cache */
getfield com.sun.media.sound.MidiUtils$TempoCache.snapshotIndex:I
istore 8 /* snapshotIndex */
start local 8 // int snapshotIndex
10: .line 154
aload 3 /* cache */
getfield com.sun.media.sound.MidiUtils$TempoCache.snapshotMicro:I
istore 9 /* snapshotMicro */
start local 9 // int snapshotMicro
11: .line 157
lconst_0
lstore 10 /* us */
start local 10 // long us
12: .line 159
iload 8 /* snapshotIndex */
ifle 15
13: .line 160
iload 8 /* snapshotIndex */
iload 7 /* cacheCount */
if_icmpge 15
14: .line 161
aload 5 /* ticks */
iload 8 /* snapshotIndex */
laload
lload 1 /* tick */
lcmp
ifle 17
15: .line 162
StackMap locals: javax.sound.midi.Sequence long com.sun.media.sound.MidiUtils$TempoCache int long[] int[] int int int long
StackMap stack:
iconst_0
istore 9 /* snapshotMicro */
16: .line 163
iconst_0
istore 8 /* snapshotIndex */
17: .line 165
StackMap locals:
StackMap stack:
iload 7 /* cacheCount */
ifle 30
18: .line 167
iload 8 /* snapshotIndex */
iconst_1
iadd
istore 12 /* i */
start local 12 // int i
19: .line 168
goto 23
20: .line 169
StackMap locals: int
StackMap stack:
iload 9 /* snapshotMicro */
i2l
aload 5 /* ticks */
iload 12 /* i */
laload
aload 5 /* ticks */
iload 12 /* i */
iconst_1
isub
laload
lsub
aload 6 /* tempos */
iload 12 /* i */
iconst_1
isub
iaload
i2d
iload 4 /* resolution */
invokestatic com.sun.media.sound.MidiUtils.ticks2microsec:(JDI)J
ladd
l2i
istore 9 /* snapshotMicro */
21: .line 170
iload 12 /* i */
istore 8 /* snapshotIndex */
22: .line 171
iinc 12 /* i */ 1
23: .line 168
StackMap locals:
StackMap stack:
iload 12 /* i */
iload 7 /* cacheCount */
if_icmpge 24
aload 5 /* ticks */
iload 12 /* i */
laload
lload 1 /* tick */
lcmp
ifle 20
24: .line 173
StackMap locals:
StackMap stack:
iload 9 /* snapshotMicro */
i2l
25: .line 174
lload 1 /* tick */
aload 5 /* ticks */
iload 8 /* snapshotIndex */
laload
lsub
26: .line 175
aload 6 /* tempos */
iload 8 /* snapshotIndex */
iaload
i2d
27: .line 176
iload 4 /* resolution */
28: .line 174
invokestatic com.sun.media.sound.MidiUtils.ticks2microsec:(JDI)J
29: .line 173
ladd
lstore 10 /* us */
end local 12 // int i
30: .line 178
StackMap locals:
StackMap stack:
aload 3 /* cache */
iload 8 /* snapshotIndex */
putfield com.sun.media.sound.MidiUtils$TempoCache.snapshotIndex:I
31: .line 179
aload 3 /* cache */
iload 9 /* snapshotMicro */
putfield com.sun.media.sound.MidiUtils$TempoCache.snapshotMicro:I
32: .line 180
lload 10 /* us */
lreturn
end local 10 // long us
end local 9 // int snapshotMicro
end local 8 // int snapshotIndex
end local 7 // int cacheCount
end local 6 // int[] tempos
end local 5 // long[] ticks
end local 4 // int resolution
end local 3 // com.sun.media.sound.MidiUtils$TempoCache cache
end local 1 // long tick
end local 0 // javax.sound.midi.Sequence seq
LocalVariableTable:
Start End Slot Name Signature
0 33 0 seq Ljavax/sound/midi/Sequence;
0 33 1 tick J
0 33 3 cache Lcom/sun/media/sound/MidiUtils$TempoCache;
2 3 4 seconds D
6 33 4 resolution I
7 33 5 ticks [J
8 33 6 tempos [I
9 33 7 cacheCount I
10 33 8 snapshotIndex I
11 33 9 snapshotMicro I
12 33 10 us J
19 30 12 i I
MethodParameters:
Name Flags
seq
tick
cache
public static long microsecond2tick(javax.sound.midi.Sequence, long, com.sun.media.sound.MidiUtils$TempoCache);
descriptor: (Ljavax/sound/midi/Sequence;JLcom/sun/media/sound/MidiUtils$TempoCache;)J
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=7, locals=15, args_size=3
start local 0 // javax.sound.midi.Sequence seq
start local 1 // long micros
start local 3 // com.sun.media.sound.MidiUtils$TempoCache cache
0: .line 188
aload 0 /* seq */
invokevirtual javax.sound.midi.Sequence.getDivisionType:()F
fconst_0
fcmpl
ifeq 12
1: .line 189
lload 1 /* micros */
l2d
2: .line 190
aload 0 /* seq */
invokevirtual javax.sound.midi.Sequence.getDivisionType:()F
f2d
3: .line 189
dmul
4: .line 191
aload 0 /* seq */
invokevirtual javax.sound.midi.Sequence.getResolution:()I
i2d
5: .line 189
dmul
6: .line 192
ldc 1000000.0
7: .line 189
ddiv
dstore 4 /* dTick */
start local 4 // double dTick
8: .line 193
dload 4 /* dTick */
d2l
lstore 6 /* tick */
start local 6 // long tick
9: .line 194
aload 3 /* cache */
ifnull 11
10: .line 195
aload 3 /* cache */
aload 3 /* cache */
lload 6 /* tick */
invokevirtual com.sun.media.sound.MidiUtils$TempoCache.getTempoMPQAt:(J)F
f2i
putfield com.sun.media.sound.MidiUtils$TempoCache.currTempo:I
11: .line 197
StackMap locals: double long
StackMap stack:
lload 6 /* tick */
lreturn
end local 6 // long tick
end local 4 // double dTick
12: .line 200
StackMap locals:
StackMap stack:
aload 3 /* cache */
ifnonnull 14
13: .line 201
new com.sun.media.sound.MidiUtils$TempoCache
dup
aload 0 /* seq */
invokespecial com.sun.media.sound.MidiUtils$TempoCache.<init>:(Ljavax/sound/midi/Sequence;)V
astore 3 /* cache */
14: .line 203
StackMap locals:
StackMap stack:
aload 3 /* cache */
getfield com.sun.media.sound.MidiUtils$TempoCache.ticks:[J
astore 4 /* ticks */
start local 4 // long[] ticks
15: .line 204
aload 3 /* cache */
getfield com.sun.media.sound.MidiUtils$TempoCache.tempos:[I
astore 5 /* tempos */
start local 5 // int[] tempos
16: .line 205
aload 5 /* tempos */
arraylength
istore 6 /* cacheCount */
start local 6 // int cacheCount
17: .line 207
aload 0 /* seq */
invokevirtual javax.sound.midi.Sequence.getResolution:()I
istore 7 /* resolution */
start local 7 // int resolution
18: .line 209
lconst_0
lstore 8 /* us */
start local 8 // long us
19: lconst_0
lstore 10 /* tick */
start local 10 // long tick
20: iconst_1
istore 12 /* i */
start local 12 // int i
21: .line 213
lload 1 /* micros */
lconst_0
lcmp
ifle 32
iload 6 /* cacheCount */
ifle 32
22: .line 215
goto 30
23: .line 216
StackMap locals: javax.sound.midi.Sequence long com.sun.media.sound.MidiUtils$TempoCache long[] int[] int int long long int
StackMap stack:
lload 8 /* us */
aload 4 /* ticks */
iload 12 /* i */
laload
aload 4 /* ticks */
iload 12 /* i */
iconst_1
isub
laload
lsub
24: .line 217
aload 5 /* tempos */
iload 12 /* i */
iconst_1
isub
iaload
i2d
iload 7 /* resolution */
25: .line 216
invokestatic com.sun.media.sound.MidiUtils.ticks2microsec:(JDI)J
ladd
lstore 13 /* nextTime */
start local 13 // long nextTime
26: .line 218
lload 13 /* nextTime */
lload 1 /* micros */
lcmp
ifle 28
27: .line 219
goto 31
28: .line 221
StackMap locals: long
StackMap stack:
lload 13 /* nextTime */
lstore 8 /* us */
29: .line 222
iinc 12 /* i */ 1
end local 13 // long nextTime
30: .line 215
StackMap locals:
StackMap stack:
iload 12 /* i */
iload 6 /* cacheCount */
if_icmplt 23
31: .line 224
StackMap locals:
StackMap stack:
aload 4 /* ticks */
iload 12 /* i */
iconst_1
isub
laload
lload 1 /* micros */
lload 8 /* us */
lsub
aload 5 /* tempos */
iload 12 /* i */
iconst_1
isub
iaload
i2d
iload 7 /* resolution */
invokestatic com.sun.media.sound.MidiUtils.microsec2ticks:(JDI)J
ladd
lstore 10 /* tick */
32: .line 228
StackMap locals:
StackMap stack:
aload 3 /* cache */
aload 5 /* tempos */
iload 12 /* i */
iconst_1
isub
iaload
putfield com.sun.media.sound.MidiUtils$TempoCache.currTempo:I
33: .line 229
lload 10 /* tick */
lreturn
end local 12 // int i
end local 10 // long tick
end local 8 // long us
end local 7 // int resolution
end local 6 // int cacheCount
end local 5 // int[] tempos
end local 4 // long[] ticks
end local 3 // com.sun.media.sound.MidiUtils$TempoCache cache
end local 1 // long micros
end local 0 // javax.sound.midi.Sequence seq
LocalVariableTable:
Start End Slot Name Signature
0 34 0 seq Ljavax/sound/midi/Sequence;
0 34 1 micros J
0 34 3 cache Lcom/sun/media/sound/MidiUtils$TempoCache;
8 12 4 dTick D
9 12 6 tick J
15 34 4 ticks [J
16 34 5 tempos [I
17 34 6 cacheCount I
18 34 7 resolution I
19 34 8 us J
20 34 10 tick J
21 34 12 i I
26 30 13 nextTime J
MethodParameters:
Name Flags
seq
micros
cache
public static int tick2index(javax.sound.midi.Track, long);
descriptor: (Ljavax/sound/midi/Track;J)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=8, args_size=2
start local 0 // javax.sound.midi.Track track
start local 1 // long tick
0: .line 241
iconst_0
istore 3 /* ret */
start local 3 // int ret
1: .line 242
lload 1 /* tick */
lconst_0
lcmp
ifle 17
2: .line 243
iconst_0
istore 4 /* low */
start local 4 // int low
3: .line 244
aload 0 /* track */
invokevirtual javax.sound.midi.Track.size:()I
iconst_1
isub
istore 5 /* high */
start local 5 // int high
4: .line 245
goto 16
5: .line 247
StackMap locals: int int int
StackMap stack:
iload 4 /* low */
iload 5 /* high */
iadd
iconst_1
ishr
istore 3 /* ret */
6: .line 249
aload 0 /* track */
iload 3 /* ret */
invokevirtual javax.sound.midi.Track.get:(I)Ljavax/sound/midi/MidiEvent;
invokevirtual javax.sound.midi.MidiEvent.getTick:()J
lstore 6 /* t */
start local 6 // long t
7: .line 250
lload 6 /* t */
lload 1 /* tick */
lcmp
ifne 9
8: .line 251
goto 17
9: .line 252
StackMap locals: long
StackMap stack:
lload 6 /* t */
lload 1 /* tick */
lcmp
ifge 15
10: .line 254
iload 4 /* low */
iload 5 /* high */
iconst_1
isub
if_icmpne 13
11: .line 256
iinc 3 /* ret */ 1
12: .line 257
goto 17
13: .line 259
StackMap locals:
StackMap stack:
iload 3 /* ret */
istore 4 /* low */
14: .line 260
goto 16
15: .line 262
StackMap locals:
StackMap stack:
iload 3 /* ret */
istore 5 /* high */
end local 6 // long t
16: .line 245
StackMap locals:
StackMap stack:
iload 4 /* low */
iload 5 /* high */
if_icmplt 5
end local 5 // int high
end local 4 // int low
17: .line 266
StackMap locals:
StackMap stack:
iload 3 /* ret */
ireturn
end local 3 // int ret
end local 1 // long tick
end local 0 // javax.sound.midi.Track track
LocalVariableTable:
Start End Slot Name Signature
0 18 0 track Ljavax/sound/midi/Track;
0 18 1 tick J
1 18 3 ret I
3 17 4 low I
4 17 5 high I
7 16 6 t J
MethodParameters:
Name Flags
track
tick
}
SourceFile: "MidiUtils.java"
NestMembers:
com.sun.media.sound.MidiUtils$TempoCache
InnerClasses:
public final TempoCache = com.sun.media.sound.MidiUtils$TempoCache of com.sun.media.sound.MidiUtils