Provides an extensible array of midi events. As this can cause dynamic allocation this class is not intended for real time usage when writing
It should be noted that the delta times are stored as longs, as samples from the start of the track. Given that this value is in the range of
0 - 2147483647 this gives us a maximum track length of 13.51 *hours* assuming that you are running at a 44.1 sample rate. This value is obviously variable
depending upon the samplerate, however, even running at 96khz you end up with at least 7 hours.. which should be enough for any musical work ;)
Documented online at http://www.borg.com/~jglatt/tech/midifile.htm
Definition at line 45 of file CMidiTrack.hpp.
Exponent::Midi::CMidiTrack::CMidiTrack | ( | ) |
Construction
virtual Exponent::Midi::CMidiTrack::~CMidiTrack | ( | ) | [virtual] |
Destruction
void Exponent::Midi::CMidiTrack::addEvent | ( | CMidiEvent * | event | ) |
Add a track
event | The midi event to add |
void Exponent::Midi::CMidiTrack::adjustDeltaTimeBy | ( | const double | offset | ) |
Adjust event delta time by a ratio
offset | The offset ratio that you want to apply to all event delta positions |
const CMidiEvent* Exponent::Midi::CMidiTrack::getEventAtIndex | ( | const long | index | ) | const [inline] |
Get the event at the index
index | the index of the event you want |
const | CMidiEvent* The midi event or null on error |
Definition at line 110 of file CMidiTrack.hpp.
References m_events.
long Exponent::Midi::CMidiTrack::getMidiChannel | ( | ) | const [inline] |
Get the midi channel
long | The midi channel |
Definition at line 91 of file CMidiTrack.hpp.
References m_midiChannel.
CMidiEvent* Exponent::Midi::CMidiTrack::getMutableEventAtIndex | ( | const long | index | ) | [inline] |
Get the event at the index
index | the index of the event you want |
CMidiEvent* | The midi event or null on error |
Definition at line 117 of file CMidiTrack.hpp.
References m_events.
long Exponent::Midi::CMidiTrack::getNumberOfEvents | ( | ) | const [inline] |
Get the number of events
long | The number of events |
Definition at line 103 of file CMidiTrack.hpp.
References m_events.
const CString& Exponent::Midi::CMidiTrack::getTrackName | ( | ) | const [inline] |
Get the track name
const | CString & The name of the track |
Definition at line 97 of file CMidiTrack.hpp.
References m_trackName.
void Exponent::Midi::CMidiTrack::setMidiChannel | ( | const long | midiChannel | ) | [inline] |
Set the midi channel, events not on this midi channel are ignored
midiChannel | The midi channel to use |
Definition at line 79 of file CMidiTrack.hpp.
References m_midiChannel.
void Exponent::Midi::CMidiTrack::setTrackName | ( | const CString & | name | ) | [inline] |
Set the track name
name | The name of the track |
Definition at line 85 of file CMidiTrack.hpp.
References m_trackName.
events that we are dealing with
Definition at line 131 of file CMidiTrack.hpp.
Referenced by getEventAtIndex(), getMutableEventAtIndex(), and getNumberOfEvents().
long Exponent::Midi::CMidiTrack::m_midiChannel [protected] |
The midi channel of this track
Definition at line 132 of file CMidiTrack.hpp.
Referenced by getMidiChannel(), and setMidiChannel().
CString Exponent::Midi::CMidiTrack::m_trackName [protected] |
The name of the track
Definition at line 133 of file CMidiTrack.hpp.
Referenced by getTrackName(), and setTrackName().