65 |
/** |
/** |
66 |
* The MIDI tracks used by this sequence. |
* The MIDI tracks used by this sequence. |
67 |
*/ |
*/ |
68 |
protected Vector tracks; |
protected Vector<Track> tracks; |
69 |
|
|
70 |
/** |
/** |
71 |
* Tempo-based timing. Resolution is specified in ticks per beat. |
* Tempo-based timing. Resolution is specified in ticks per beat. |
107 |
this.divisionType = divisionType; |
this.divisionType = divisionType; |
108 |
this.resolution = resolution; |
this.resolution = resolution; |
109 |
|
|
110 |
tracks = new Vector(numTracks); |
tracks = new Vector<Track>(numTracks); |
111 |
while (numTracks > 0) |
while (numTracks > 0) |
112 |
tracks.set(--numTracks, new Track()); |
tracks.set(--numTracks, new Track()); |
113 |
} |
} |
189 |
*/ |
*/ |
190 |
public Track[] getTracks() |
public Track[] getTracks() |
191 |
{ |
{ |
192 |
return (Track[]) tracks.toArray(new Track[tracks.size()]); |
return tracks.toArray(new Track[tracks.size()]); |
193 |
} |
} |
194 |
|
|
195 |
/** |
/** |
224 |
public long getTickLength() |
public long getTickLength() |
225 |
{ |
{ |
226 |
long length = 0; |
long length = 0; |
227 |
Iterator itr = tracks.iterator(); |
Iterator<Track> itr = tracks.iterator(); |
228 |
while (itr.hasNext()) |
while (itr.hasNext()) |
229 |
{ |
{ |
230 |
Track track = (Track) itr.next(); |
Track track = itr.next(); |
231 |
long trackTicks = track.ticks(); |
long trackTicks = track.ticks(); |
232 |
if (trackTicks > length) |
if (trackTicks > length) |
233 |
length = trackTicks; |
length = trackTicks; |