Exponent::Midi::CMidiSequence Class Reference

List of all members.

Detailed Description

Provides an extensible array of midi events. As this can cause dynamic allocation this class is not intended for real time usage when writing, reading is fine dynamically
.

It should be noted that midi sequences store a bunch of tracks. Each track contains a collection of CMidiEvents. In this case the delta time for each event is a sample from a notional
zero position, that is essentially the start of the song.

See also:
CMidiTrack

CMidiFile

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
CMidiSequence.hpp,v 1.2 2007/02/08 21:08:09 paul Exp

Definition at line 46 of file CMidiSequence.hpp.

Public Member Functions

Protected Attributes


Constructor & Destructor Documentation

Exponent::Midi::CMidiSequence::CMidiSequence ( const double  sampleRate  ) 

Construction

Parameters:
sampleRate The sample rate that we are playing back at

virtual Exponent::Midi::CMidiSequence::~CMidiSequence (  )  [virtual]

Destruction


Member Function Documentation

void Exponent::Midi::CMidiSequence::addTrack ( CMidiTrack track  ) 

Add a track

Parameters:
track The midi event track

void Exponent::Midi::CMidiSequence::compact (  ) 

Compact The list. Remove any dead tracks and then removes unused memory portions

CMidiTrack* Exponent::Midi::CMidiSequence::getMutableTrackAtIndex ( const long  index  ) 

Get the mutable track at index

Parameters:
index The index of the track you desire, must be >= 0 && < getNumberOfTracks
Return values:
CMidiTrack* The midi track or null on erorr

long Exponent::Midi::CMidiSequence::getNumberOfTracks (  )  const [inline]

Get the number of tracks

Return values:
long The total number of tracks

Definition at line 119 of file CMidiSequence.hpp.

References m_tracks.

double Exponent::Midi::CMidiSequence::getSampleRate (  )  const [inline]

Get the sample rate

Return values:
double The sample rate

Definition at line 101 of file CMidiSequence.hpp.

References m_sampleRate.

double Exponent::Midi::CMidiSequence::getTempo (  )  const [inline]

Get the tempo

Return values:
double The tempo

Definition at line 107 of file CMidiSequence.hpp.

References m_tempo.

const CTimeSignature& Exponent::Midi::CMidiSequence::getTimeSignature (  )  const [inline]

Get the time signature

Return values:
const CTimeSignature& The time signature

Definition at line 113 of file CMidiSequence.hpp.

References m_timeSignature.

const CMidiTrack* Exponent::Midi::CMidiSequence::getTrackAtIndex ( const long  index  )  const

Get track at index

Parameters:
index The index of the track you desire, must be >= 0 && < getNumberOfTracks
Return values:
const CMidiTrack* The midi track or null on erorr

void Exponent::Midi::CMidiSequence::setSampleRate ( const double  sampleRate  ) 

Set the sample rate. Note that this will cause the recomputation of all the events, which may take a long time. Be sure that you have got the time to perform this operation before you do it

Parameters:
sampleRate The new sample rate

void Exponent::Midi::CMidiSequence::setTempo ( const double  tempo  ) 

Set the tempo

Parameters:
tempo The tempo in bpm

void Exponent::Midi::CMidiSequence::setTimeSignature ( const CTimeSignature timeSignature  ) 

Set the time signature

Parameters:
timeSignature The time signature


Member Data Documentation

double Exponent::Midi::CMidiSequence::m_sampleRate [protected]

SAmple rate of the system

Definition at line 151 of file CMidiSequence.hpp.

Referenced by getSampleRate().

double Exponent::Midi::CMidiSequence::m_tempo [protected]

BPM of the midi sequence

Definition at line 149 of file CMidiSequence.hpp.

Referenced by getTempo().

CTimeSignature Exponent::Midi::CMidiSequence::m_timeSignature [protected]

The time signature

Definition at line 150 of file CMidiSequence.hpp.

Referenced by getTimeSignature().

TCountedPointerArray<CMidiTrack> Exponent::Midi::CMidiSequence::m_tracks [protected]

Tracks that we are dealing with

Definition at line 148 of file CMidiSequence.hpp.

Referenced by getNumberOfTracks().


Infinity API - Exponent::Midi::CMidiSequence Class Reference generated on 7 Mar 2007