|
DixShtix | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.dixshtix.midi.Track
Wrapper class for array of Event.
The MTrk chunk type is where actual song data is stored. It is simply a stream of MIDI events (and non-MIDI events), preceded by delta-time values.
| Field Summary | |
(package private) byte[] |
data
A stream of bytes, usually full of Midi data. |
(package private) Event[] |
events
Musical (MIDI) events. |
static byte[] |
kDefaultType
Each Track has a type of 'MTrk'. |
(package private) byte[] |
tr_type
Four bytes indicating the Chunk type. |
| Fields inherited from interface com.dixshtix.midi.Chunk |
kMThd, kMTrk |
| Constructor Summary | |
Track(byte[] data)
Construct a MIDI Track from Midi data bytes. |
|
Track(byte[] data,
boolean eot_magic,
EventType[] incl,
EventType[] excl,
EventCallback pre_processor)
Construct a MIDI Track from Midi data bytes, with some pre-processing. |
|
Track(byte[] tr_type,
byte[] data)
Construct a Track from raw data, with possibly a non-std tr_type. |
|
Track(byte[] tr_type,
byte[] data,
Event[] events)
Construct a Track from raw data. |
|
Track(Event[] events,
boolean eot_magic,
boolean add_eot,
boolean running_status,
EventCallback unknown_processor)
Construct a MIDI Track from Midi events, with some processing. |
|
| Method Summary | |
byte[] |
getData()
Returns arbitrary array of bytes. |
Event[] |
getEvents()
Returns array of events. |
int |
getLength()
Track length in number of bytes. |
byte[] |
getType()
Returns Chunk Type of the Track. |
void |
setEvents(Event[] evnts)
Set the MIDI events, keeping the data synchronized. |
void |
setEvents(Event[] evnts,
boolean eot_magic,
boolean add_eot,
boolean running_status,
EventCallback unknown_processor)
Set the MIDI Events, with options when creating the data. |
java.lang.String |
toString()
Produce a short, human-readable string. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final byte[] kDefaultType
Chunk.kMTrkbyte[] tr_type
Chunk.kMTrk,
but other Tracks can exist and have non-Midi data.byte[] data
Event[] events
Event| Constructor Detail |
public Track(byte[] tr_type,
byte[] data,
Event[] events)
tr_type - Four characters which represent the track type.data - A stream of bytes.events - Possibly a stream of MIDI Events.public Track(byte[] data)
tr_type and constructs
events from the wonderful function
Event.decode(byte[],boolean,EventType[],EventType[],EventCallback,EventCallback).data - A stream of bytes.
public Track(byte[] data,
boolean eot_magic,
EventType[] incl,
EventType[] excl,
EventCallback pre_processor)
tr_type and constructs
events from the wonderful function
Event.decode(byte[],boolean,EventType[],EventType[],EventCallback,EventCallback).data - A stream of bytes.eot_magic - Substitute zero-length text for End of Track. Allows
for easy appends.incl - List of EventTypes to include, excluding all others.excl - List of EventTypes to exclude. Not compatible with incl.pre_processor - WriteBack to pre-massage event stream.
public Track(Event[] events,
boolean eot_magic,
boolean add_eot,
boolean running_status,
EventCallback unknown_processor)
events - Possibly a stream of MIDI Events.eot_magic - Use zero-length text events to mark end of Track.add_eot - Force array to end with End of Track Event.running_status - Compress Voice output (marginally).unknown_processor - Don't throw Errors if defined.Event.encode(Event[],boolean,boolean,boolean,EventCallback)
public Track(byte[] tr_type,
byte[] data)
tr_type - Four characters which represent the track type.data - A stream of bytes.| Method Detail |
public int getLength()
public byte[] getType()
public byte[] getData()
public Event[] getEvents()
public void setEvents(Event[] evnts)
public void setEvents(Event[] evnts,
boolean eot_magic,
boolean add_eot,
boolean running_status,
EventCallback unknown_processor)
evnts - Array of MIDI events in out internal format.eot_magic - Use zero-length text events to mark end of Track.add_eot - Force array to end with End of Track Event.running_status - Compress Voice output (marginally).unknown_processor - Don't throw Errors if defined.public java.lang.String toString()
toString in class java.lang.Object
|
DixShtix | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||