#include <MidiDriver.h>
Inheritance diagram for MidiDriver:
Public Types | |
TIMBRE_LIBRARY_U7VOICE_AD = 0 | |
TIMBRE_LIBRARY_U7VOICE_MT = 1 | |
TIMBRE_LIBRARY_XMIDI_AD = 2 | |
TIMBRE_LIBRARY_XMIDI_MT = 3 | |
TIMBRE_LIBRARY_SYX_FILE = 4 | |
TIMBRE_LIBRARY_XMIDI_FILE = 5 | |
TIMBRE_LIBRARY_FMOPL_SETGM = 6 | |
enum | TimbreLibraryType { TIMBRE_LIBRARY_U7VOICE_AD = 0, TIMBRE_LIBRARY_U7VOICE_MT = 1, TIMBRE_LIBRARY_XMIDI_AD = 2, TIMBRE_LIBRARY_XMIDI_MT = 3, TIMBRE_LIBRARY_SYX_FILE = 4, TIMBRE_LIBRARY_XMIDI_FILE = 5, TIMBRE_LIBRARY_FMOPL_SETGM = 6 } |
Public Member Functions | |
virtual int | initMidiDriver (uint32 sample_rate, bool stereo)=0 |
virtual void | destroyMidiDriver ()=0 |
bool | isInitialized () |
virtual int | maxSequences ()=0 |
virtual void | setGlobalVolume (int vol)=0 |
virtual void | startSequence (int seq_num, XMidiEventList *list, bool repeat, int vol, int branch=-1)=0 |
virtual void | finishSequence (int seq_num)=0 |
virtual void | pauseSequence (int seq_num)=0 |
virtual void | unpauseSequence (int seq_num)=0 |
virtual void | setSequenceVolume (int seq_num, int vol)=0 |
virtual void | setSequenceSpeed (int seq_num, int speed)=0 |
virtual bool | isSequencePlaying (int seq_num)=0 |
virtual uint32 | getSequenceCallbackData (int seq_num) |
virtual bool | isSampleProducer () |
virtual void | produceSamples (sint16 *samples, uint32 bytes) |
virtual bool | isFMSynth () |
virtual bool | isMT32 () |
virtual bool | noTimbreSupport () |
virtual void | loadTimbreLibrary (IDataSource *, TimbreLibraryType type) |
virtual | ~MidiDriver () |
Static Public Member Functions | |
static int | getDriverCount () |
static std::string | getDriverName (uint32 index) |
static MidiDriver * | createInstance (std::string driverName, uint32 sample_rate, bool stereo) |
Protected Member Functions | |
MidiDriver () | |
std::string | getConfigSetting (std::string name, std::string defaultval) |
Protected Attributes | |
bool | initialized |
Classes | |
struct | MidiDriverDesc |
Midi driver desription. More... |
Definition at line 26 of file MidiDriver.h.
TIMBRE_LIBRARY_U7VOICE_AD | |
TIMBRE_LIBRARY_U7VOICE_MT | |
TIMBRE_LIBRARY_XMIDI_AD | |
TIMBRE_LIBRARY_XMIDI_MT | |
TIMBRE_LIBRARY_SYX_FILE | |
TIMBRE_LIBRARY_XMIDI_FILE | |
TIMBRE_LIBRARY_FMOPL_SETGM |
Definition at line 41 of file MidiDriver.h.
MidiDriver::MidiDriver | ( | ) | [inline, protected] |
Definition at line 30 of file MidiDriver.h.
virtual MidiDriver::~MidiDriver | ( | ) | [inline, virtual] |
MidiDriver * MidiDriver::createInstance | ( | std::string | driverName, | |
uint32 | sample_rate, | |||
bool | stereo | |||
) | [static] |
Create an Instance of a MidiDriver
driverName | Name of the prefered driver to create |
Definition at line 125 of file MidiDriver.cpp.
References createInstance(), initMidiDriver(), InitMidiDriverVector(), midi_drivers, pout, and Pentagram::strcasecmp().
Referenced by createInstance(), and Pentagram::AudioMixer::openMidiOutput().
virtual void MidiDriver::destroyMidiDriver | ( | ) | [pure virtual] |
Destroy the driver.
Implemented in LowLevelMidiDriver.
Referenced by Pentagram::AudioMixer::closeMidiOutput().
virtual void MidiDriver::finishSequence | ( | int | seq_num | ) | [pure virtual] |
Finish playing a sequence, and free the data
seq_num | The Sequence number to stop |
Implemented in LowLevelMidiDriver.
Referenced by MusicProcess::playMusic_internal(), Pentagram::AudioMixer::reset(), and MusicProcess::run().
std::string MidiDriver::getConfigSetting | ( | std::string | name, | |
std::string | defaultval | |||
) | [protected] |
Get a configuration setting for the midi driver.
Definition at line 199 of file MidiDriver.cpp.
Referenced by WindowsMidiDriver::open(), FluidSynthMidiDriver::open(), ALSAMidiDriver::open(), and UnixSeqMidiDriver::UnixSeqMidiDriver().
int MidiDriver::getDriverCount | ( | ) | [static] |
Get the number of devices.
Definition at line 108 of file MidiDriver.cpp.
References InitMidiDriverVector(), and midi_drivers.
std::string MidiDriver::getDriverName | ( | uint32 | index | ) | [static] |
Get the name of a driver
index | Driver number |
Definition at line 115 of file MidiDriver.cpp.
References InitMidiDriverVector(), and midi_drivers.
virtual uint32 MidiDriver::getSequenceCallbackData | ( | int | seq_num | ) | [inline, virtual] |
Get the callback data for a specified sequence
seq_num | The Sequence to get callback data from |
Reimplemented in LowLevelMidiDriver.
Definition at line 107 of file MidiDriver.h.
Referenced by MusicProcess::playMusic_internal().
virtual int MidiDriver::initMidiDriver | ( | uint32 | sample_rate, | |
bool | stereo | |||
) | [pure virtual] |
Initialize the driver
sample_rate | The sample rate for software synths | |
stereo | Specifies if a software synth must produce stero sound |
Implemented in LowLevelMidiDriver.
Referenced by createInstance().
virtual bool MidiDriver::isFMSynth | ( | ) | [inline, virtual] |
Is this a FM Synth and should use the Adlib Tracks?
Reimplemented in FMOplMidiDriver.
Definition at line 118 of file MidiDriver.h.
Referenced by MusicProcess::playMusic_internal(), and MusicProcess::run().
bool MidiDriver::isInitialized | ( | ) | [inline] |
virtual bool MidiDriver::isMT32 | ( | ) | [inline, virtual] |
virtual bool MidiDriver::isSampleProducer | ( | ) | [inline, virtual] |
Is this a Software Synth/Sample producer.
Reimplemented in FluidSynthMidiDriver, FMOplMidiDriver, and TimidityMidiDriver.
Definition at line 110 of file MidiDriver.h.
Referenced by LowLevelMidiDriver::destroyMidiDriver(), LowLevelMidiDriver::initMidiDriver(), and Pentagram::AudioMixer::MixAudio().
virtual bool MidiDriver::isSequencePlaying | ( | int | seq_num | ) | [pure virtual] |
Check to see if a sequence is playing (doesn't check for pause state)
seq_num | The Sequence number to check |
Implemented in LowLevelMidiDriver.
Referenced by MusicProcess::playMusic_internal(), and MusicProcess::run().
virtual void MidiDriver::loadTimbreLibrary | ( | IDataSource * | , | |
TimbreLibraryType | type | |||
) | [inline, virtual] |
virtual int MidiDriver::maxSequences | ( | ) | [pure virtual] |
Get the maximum number of playing sequences supported by this this driver
Implemented in LowLevelMidiDriver.
Referenced by Pentagram::AudioMixer::reset().
virtual bool MidiDriver::noTimbreSupport | ( | ) | [inline, virtual] |
Is this a devices that does not Timbres?
Reimplemented in FluidSynthMidiDriver, and TimidityMidiDriver.
Definition at line 124 of file MidiDriver.h.
virtual void MidiDriver::pauseSequence | ( | int | seq_num | ) | [pure virtual] |
Pause the playback of a sequence
seq_num | The Sequence number to pause |
Implemented in LowLevelMidiDriver.
Referenced by MusicProcess::run().
Produce Samples when doing Software Synthesizing
samples | The buffer to fill with samples | |
bytes | The number of bytes of music to produce |
Reimplemented in LowLevelMidiDriver.
Definition at line 115 of file MidiDriver.h.
Referenced by Pentagram::AudioMixer::MixAudio().
virtual void MidiDriver::setGlobalVolume | ( | int | vol | ) | [pure virtual] |
Set the global volume level
vol | The new global volume level (0-255) |
Implemented in LowLevelMidiDriver.
Referenced by Pentagram::AudioMixer::openMidiOutput().
virtual void MidiDriver::setSequenceSpeed | ( | int | seq_num, | |
int | speed | |||
) | [pure virtual] |
Set the speed of a sequence
seq_num | The Sequence number to change it's speed | |
speed | The new speed for the sequence (percentage) |
Implemented in LowLevelMidiDriver.
Referenced by MusicProcess::playMusic_internal().
virtual void MidiDriver::setSequenceVolume | ( | int | seq_num, | |
int | vol | |||
) | [pure virtual] |
Set the volume of a sequence
seq_num | The Sequence number to set the volume for | |
vol | The new volume level for the sequence (0-255) |
Implemented in LowLevelMidiDriver.
virtual void MidiDriver::startSequence | ( | int | seq_num, | |
XMidiEventList * | list, | |||
bool | repeat, | |||
int | vol, | |||
int | branch = -1 | |||
) | [pure virtual] |
Start playing a sequence
seq_num | The Sequence number to use. | |
list | The XMidiEventList to play | |
repeat | If true, endlessly repeat the track | |
activate | If true, set the sequence as active | |
vol | The volume level to start playing the sequence at (0-255) |
Implemented in LowLevelMidiDriver.
Referenced by MusicProcess::playMusic_internal(), and MusicProcess::run().
virtual void MidiDriver::unpauseSequence | ( | int | seq_num | ) | [pure virtual] |
Unpause the playback of a sequence
seq_num | The Sequence number to unpause |
Implemented in LowLevelMidiDriver.
bool MidiDriver::initialized [protected] |
Definition at line 29 of file MidiDriver.h.
Referenced by LowLevelMidiDriver::destroyMidiDriver(), LowLevelMidiDriver::finishSequence(), LowLevelMidiDriver::initMidiDriver(), isInitialized(), LowLevelMidiDriver::pauseSequence(), LowLevelMidiDriver::produceSamples(), LowLevelMidiDriver::setGlobalVolume(), LowLevelMidiDriver::setSequenceSpeed(), LowLevelMidiDriver::setSequenceVolume(), LowLevelMidiDriver::startSequence(), LowLevelMidiDriver::threadMain(), LowLevelMidiDriver::unpauseSequence(), and LowLevelMidiDriver::~LowLevelMidiDriver().