XMIDI Class Reference

#include <xmidi.h>

Collaboration diagram for XMIDI:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 XMIDI (DataSource *source, int pconvert)
 ~XMIDI ()
int number_of_tracks ()
XMIDIEventListGetEventList (uint32 track)

Protected Attributes

uint16 num_tracks

Private Member Functions

 XMIDI ()
void CreateNewEvent (int time)
int GetVLQ (DataSource *source, uint32 &quant)
int GetVLQ2 (DataSource *source, uint32 &quant)
void AdjustTimings (uint32 ppqn)
void ApplyFirstState (first_state &fs, int chan_mask)
int ConvertNote (const int time, const unsigned char status, DataSource *source, const int size)
int ConvertEvent (const int time, const unsigned char status, DataSource *source, const int size, first_state &fs)
int ConvertSystemMessage (const int time, const unsigned char status, DataSource *source)
int ConvertFiletoList (DataSource *source, const bool is_xmi, first_state &fs)
int ExtractTracksFromXmi (DataSource *source)
int ExtractTracksFromMid (DataSource *source, const uint32 ppqn, const int num_tracks, const bool type1)
int ExtractTracks (DataSource *source)

Private Attributes

XMIDIEventList ** events
midi_eventlist
midi_eventcurrent
midi_eventnotes_on
bool bank127 [16]
int convert_type
bool do_reverb
bool do_chorus
int chorus_value
int reverb_value

Static Private Attributes

static const char mt32asgm [128]
static const char mt32asgs [256]
static GammaTable< unsigned
char > 
VolumeCurve

Classes

struct  first_state

Detailed Description

Definition at line 231 of file xmidi.h.


Constructor & Destructor Documentation

XMIDI::XMIDI ( DataSource source,
int  pconvert 
)

Definition at line 370 of file xmidi.cc.

References bank127, and ExtractTracks().

Here is the call graph for this function:

XMIDI::~XMIDI (  ) 

Definition at line 379 of file xmidi.cc.

References events, Free(), and num_tracks.

Here is the call graph for this function:

XMIDI::XMIDI (  )  [private]


Member Function Documentation

int XMIDI::number_of_tracks (  )  [inline]

Definition at line 260 of file xmidi.h.

References num_tracks.

XMIDIEventList * XMIDI::GetEventList ( uint32  track  ) 

Definition at line 392 of file xmidi.cc.

References events, and num_tracks.

Referenced by ExultMenu::run(), MyMidiPlayer::start_sound_effect(), and MyMidiPlayer::start_track().

void XMIDI::CreateNewEvent ( int  time  )  [private]

Definition at line 410 of file xmidi.cc.

References current, list, midi_event::next, and midi_event::time.

Referenced by ConvertEvent(), ConvertNote(), and ConvertSystemMessage().

int XMIDI::GetVLQ ( DataSource source,
uint32 quant 
) [private]

Definition at line 457 of file xmidi.cc.

References DataSource::read1().

Referenced by ConvertFiletoList(), ConvertNote(), and ConvertSystemMessage().

Here is the call graph for this function:

int XMIDI::GetVLQ2 ( DataSource source,
uint32 quant 
) [private]

Definition at line 484 of file xmidi.cc.

References DataSource::read1(), and DataSource::skip().

Referenced by ConvertFiletoList().

Here is the call graph for this function:

void XMIDI::AdjustTimings ( uint32  ppqn  )  [private]

Definition at line 843 of file xmidi.cc.

References midi_event::duration, NoteStack::FindAndPop(), list, MIDI_STATUS_NOTE_ON, midi_event::next, NoteStack::Push(), and midi_event::time.

Referenced by ExtractTracksFromMid().

Here is the call graph for this function:

void XMIDI::ApplyFirstState ( first_state fs,
int  chan_mask 
) [private]

Definition at line 509 of file xmidi.cc.

References XMIDI::first_state::bank, chorus_value, convert_type, midi_event::data, do_chorus, do_reverb, list, MIDI_STATUS_CONTROLLER, MIDI_STATUS_PROG_CHANGE, XMIDI::first_state::pan, XMIDI::first_state::patch, PATCH_VOL_PAN_BIAS, reverb_value, XMIDI::first_state::vol, and VolumeCurve.

Referenced by ExtractTracksFromMid(), and ExtractTracksFromXmi().

int XMIDI::ConvertNote ( const int  time,
const unsigned char  status,
DataSource source,
const int  size 
) [private]

Definition at line 1019 of file xmidi.cc.

References convert_type, CreateNewEvent(), current, midi_event::data, midi_event::duration, GetVLQ(), MIDI_STATUS_NOTE_ON, DataSource::read1(), midi_event::status, and VolumeCurve.

Referenced by ConvertFiletoList().

Here is the call graph for this function:

int XMIDI::ConvertEvent ( const int  time,
const unsigned char  status,
DataSource source,
const int  size,
first_state fs 
) [private]

Definition at line 915 of file xmidi.cc.

References XMIDI::first_state::bank, bank127, convert_type, CreateNewEvent(), current, midi_event::data, MIDI_STATUS_CONTROLLER, mt32asgm, mt32asgs, XMIDI::first_state::pan, XMIDI::first_state::patch, DataSource::read1(), midi_event::status, midi_event::time, XMIDI::first_state::vol, VolumeCurve, XMIDI_CONVERT_GS127_TO_GS, XMIDI_CONVERT_MT32_TO_GM, XMIDI_CONVERT_MT32_TO_GS, XMIDI_CONVERT_MT32_TO_GS127, and XMIDI_CONVERT_NOCONVERSION.

Referenced by ConvertFiletoList().

Here is the call graph for this function:

int XMIDI::ConvertSystemMessage ( const int  time,
const unsigned char  status,
DataSource source 
) [private]

Definition at line 1064 of file xmidi.cc.

References midi_event::buffer, CreateNewEvent(), current, midi_event::data, GetVLQ(), midi_event::len, DataSource::read(), DataSource::read1(), and midi_event::status.

Referenced by ConvertFiletoList(), and ExtractTracksFromXmi().

Here is the call graph for this function:

int XMIDI::ConvertFiletoList ( DataSource source,
const bool  is_xmi,
first_state fs 
) [private]

Definition at line 1094 of file xmidi.cc.

References ConvertEvent(), ConvertNote(), ConvertSystemMessage(), DataSource::getPos(), DataSource::getSize(), GetVLQ(), GetVLQ2(), MIDI_STATUS_AFTERTOUCH, MIDI_STATUS_CONTROLLER, MIDI_STATUS_NOTE_OFF, MIDI_STATUS_NOTE_ON, MIDI_STATUS_PITCH_WHEEL, MIDI_STATUS_PRESSURE, MIDI_STATUS_PROG_CHANGE, MIDI_STATUS_SYSEX, DataSource::read1(), and DataSource::seek().

Referenced by ExtractTracksFromMid(), and ExtractTracksFromXmi().

Here is the call graph for this function:

int XMIDI::ExtractTracksFromXmi ( DataSource source  )  [private]

Definition at line 1186 of file xmidi.cc.

References ApplyFirstState(), ConvertFiletoList(), ConvertSystemMessage(), current, XMIDIEventList::events, events, DataSource::getPos(), DataSource::getSize(), len, list, num_tracks, DataSource::read(), DataSource::read4high(), DataSource::seek(), and DataSource::skip().

Referenced by ExtractTracks().

Here is the call graph for this function:

int XMIDI::ExtractTracksFromMid ( DataSource source,
const uint32  ppqn,
const int  num_tracks,
const bool  type1 
) [private]

Definition at line 1245 of file xmidi.cc.

References AdjustTimings(), ApplyFirstState(), ConvertFiletoList(), XMIDIEventList::events, events, DataSource::getPos(), DataSource::getSize(), len, list, DataSource::read(), DataSource::read4high(), DataSource::seek(), and DataSource::skip().

Referenced by ExtractTracks().

Here is the call graph for this function:

int XMIDI::ExtractTracks ( DataSource source  )  [private]

Definition at line 1299 of file xmidi.cc.

References chorus_value, config, do_chorus, do_reverb, events, ExtractTracksFromMid(), ExtractTracksFromXmi(), Free(), GammaTable< T >::get_gamma(), DataSource::getPos(), len, num_tracks, DataSource::read(), DataSource::read2(), DataSource::read2high(), DataSource::read4(), DataSource::read4high(), reverb_value, s, DataSource::seek(), Configuration::set(), GammaTable< T >::set_gamma(), DataSource::skip(), snprintf, Configuration::value(), and VolumeCurve.

Referenced by XMIDI().

Here is the call graph for this function:


Member Data Documentation

uint16 XMIDI::num_tracks [protected]

Definition at line 234 of file xmidi.h.

Referenced by ExtractTracks(), ExtractTracksFromXmi(), GetEventList(), number_of_tracks(), and ~XMIDI().

XMIDIEventList** XMIDI::events [private]

Definition at line 237 of file xmidi.h.

Referenced by ExtractTracks(), ExtractTracksFromMid(), ExtractTracksFromXmi(), GetEventList(), and ~XMIDI().

midi_event* XMIDI::list [private]

Definition at line 239 of file xmidi.h.

Referenced by AdjustTimings(), ApplyFirstState(), CreateNewEvent(), ExtractTracksFromMid(), and ExtractTracksFromXmi().

midi_event* XMIDI::current [private]

Definition at line 240 of file xmidi.h.

Referenced by ConvertEvent(), ConvertNote(), ConvertSystemMessage(), CreateNewEvent(), and ExtractTracksFromXmi().

midi_event* XMIDI::notes_on [private]

Definition at line 241 of file xmidi.h.

const char XMIDI::mt32asgm [static, private]

Definition at line 243 of file xmidi.h.

Referenced by ConvertEvent().

const char XMIDI::mt32asgs [static, private]

Definition at line 244 of file xmidi.h.

Referenced by ConvertEvent().

bool XMIDI::bank127[16] [private]

Definition at line 245 of file xmidi.h.

Referenced by ConvertEvent(), and XMIDI().

int XMIDI::convert_type [private]

Definition at line 246 of file xmidi.h.

Referenced by ApplyFirstState(), ConvertEvent(), and ConvertNote().

bool XMIDI::do_reverb [private]

Definition at line 248 of file xmidi.h.

Referenced by ApplyFirstState(), and ExtractTracks().

bool XMIDI::do_chorus [private]

Definition at line 249 of file xmidi.h.

Referenced by ApplyFirstState(), and ExtractTracks().

int XMIDI::chorus_value [private]

Definition at line 250 of file xmidi.h.

Referenced by ApplyFirstState(), and ExtractTracks().

int XMIDI::reverb_value [private]

Definition at line 251 of file xmidi.h.

Referenced by ApplyFirstState(), and ExtractTracks().

GammaTable< unsigned char > XMIDI::VolumeCurve [static, private]

Definition at line 254 of file xmidi.h.

Referenced by ApplyFirstState(), ConvertEvent(), ConvertNote(), and ExtractTracks().


The documentation for this class was generated from the following files:
Generated on Mon Jul 9 15:06:13 2007 for ExultEngine by  doxygen 1.5.1