- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exponent::Midi::CMidiTrack Class Reference

List of all members.

## Detailed Description

Provides an extensible array of midi events.
.

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 ;)

Date:
  23/08/2004

Author:
  Paul Chana

Version:
  1.0.0 Initial version

Note:
  All contents of this source code are copyright 2005 Exp Digital Uk.
  This source file is covered by the licence conditions of the Infinity API. You should have recieved a copy
  with the source code. If you didnt, please refer to http://www.expdigital.co.uk All content is the Intellectual property of Exp Digital Uk.
  Certain sections of this code may come from other sources. They are credited where applicable.
  If you have comments, suggestions or bug reports please visit http://support.expdigital.co.uk

  Documented online at http://www.borg.com/~jglatt/tech/midifile.htm

Id
  CMidiTrack.hpp,v 1.3 2007/02/08 21:08:09 paul Exp

Definition at line 45 of file CMidiTrack.hpp.

## Public Member Functions

- void addEvent (CMidiEvent *event)
- void adjustDeltaTimeBy (const double offset)
- CMidiTrack ()
- const CMidiEvent * getEventAtIndex (const long index) const
- long getMidiChannel () const
- CMidiEvent * getMutableEventAtIndex (const long index)
- long getNumberOfEvents () const
- const CString & getTrackName () const
- void setMidiChannel (const long midiChannel)
- void setTrackName (const CString &name)
- virtual ~CMidiTrack ()

## Protected Attributes

- TCountedPointerArray< CMidiEvent > m_events
- long m_midiChannel
- CString m_trackName

## Constructor & Destructor Documentation

Exponent::Midi::CMidiTrack::CMidiTrack | ( |  | ) |

Construction

virtual Exponent::Midi::CMidiTrack::~CMidiTrack | ( |  | ) | `[virtual]`

Destruction

## Member Function Documentation

void Exponent::Midi::CMidiTrack::addEvent | ( | CMidiEvent * | event | ) |

Add a track

Parameters:

  | event | The midi event to add

void Exponent::Midi::CMidiTrack::adjustDeltaTimeBy | ( | const double | offset | ) |

Adjust event delta time by a ratio

Parameters:

  | 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

Parameters:

  | index | the index of the event you want

Return values:

  | 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

Return values:

  | 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

Parameters:

  | index | the index of the event you want

Return values:

  | 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

Return values:

  | 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

Return values:

  | 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

Parameters:

  | 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

Parameters:

  | name | The name of the track

Definition at line 85 of file CMidiTrack.hpp.

References m_trackName.

## Member Data Documentation

TCountedPointerArray<CMidiEvent> Exponent::Midi::CMidiTrack::m_events`[protected]`

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().