This data representing the contents of a MIDI file.
More...
#include <MidiData.h>
This data representing the contents of a MIDI file.
Instances of this class can be used to read or write MIDI file data. They can also be passed to the MidiPlayer class or the MidiMsgRecorderDestination class for playback or recording, respectively.
◆ FormatType
This is the type of MIDI data you're dealing with. As of this writing, there is no support for VARIOUS_TRACKS, but the others are supported.
| Enumerator |
|---|
| SINGLE_TRACK | |
| MULTI_TRACK | |
| VARIOUS_TRACKS | |
◆ MidiData()
◆ ~MidiData()
◆ AddTrack()
| void MidiData::AddTrack |
( |
Track * | track | ) |
|
◆ CalculateTrackLengthInSeconds()
| bool MidiData::CalculateTrackLengthInSeconds |
( |
uint32_t | i, |
|
|
double & | totalTimeSeconds, |
|
|
Error & | error ) const |
Calculate and return the time duration (in seconds) of the MIDI data for a given track.
- Parameters
-
| [in] | i | This is the zero-based track number. Use GetNumTracks to know how many tracks there are. |
| [out] | totalTimeSeconds | The playback length of the track measured in seconds. |
| [out] | error | An Error object instance containing error information if something went wrong. |
- Returns
- True is returned on success, otherwise false, and the error parameter should have reasons for the failure.
◆ Clear()
Remove all tracks from this MIDI file data object.
◆ Clone()
The derived implimentation should return a new derived instance of the class in question with identical, but separate data.
Implements AudioDataLib::FileData.
◆ Create()
◆ Destroy()
| void MidiData::Destroy |
( |
MidiData * | midiData | ) |
|
|
static |
◆ DumpCSV()
| void MidiData::DumpCSV |
( |
FILE * | fp | ) |
const |
|
overridevirtual |
Derivative implimentations should produce a command-separated list of human-readable data which can also be loaded as a CVS in spreadsheet software.
- Parameters
-
| [in] | fp | A pointer to a FILE object to which the text should be written. |
Implements AudioDataLib::FileData.
◆ DumpInfo()
| void MidiData::DumpInfo |
( |
FILE * | fp | ) |
const |
|
overridevirtual |
Derivative implimentations should produce informative, human-readable text about the file data.
- Parameters
-
| [in] | fp | A pointer to a FILE object to which the text should be written. |
Implements AudioDataLib::FileData.
◆ GetFormatType()
| FormatType AudioDataLib::MidiData::GetFormatType |
( |
| ) |
const |
|
inline |
◆ GetNumTracks()
| uint32_t AudioDataLib::MidiData::GetNumTracks |
( |
| ) |
const |
|
inline |
◆ GetTiming()
| const Timing & AudioDataLib::MidiData::GetTiming |
( |
| ) |
const |
|
inline |
◆ GetTrack() [1/2]
◆ GetTrack() [2/2]
◆ RemoveTrack()
| bool MidiData::RemoveTrack |
( |
uint32_t | i | ) |
|
◆ SetFormatType()
| void AudioDataLib::MidiData::SetFormatType |
( |
FormatType | formatType | ) |
|
|
inline |
◆ SetTiming()
| void AudioDataLib::MidiData::SetTiming |
( |
Timing | timing | ) |
|
|
inline |
◆ MidiFileFormat
◆ formatType
◆ timing
| Timing AudioDataLib::MidiData::timing |
|
protected |
◆ trackArray
| std::vector<Track*>* AudioDataLib::MidiData::trackArray |
|
protected |
The documentation for this class was generated from the following files: