ScummVM API documentation
AGOS::MidiDriver_Accolade_MT32 Class Reference
Inheritance diagram for AGOS::MidiDriver_Accolade_MT32:
MidiDriver_MT32GM MidiDriver_Multisource MidiDriver MidiDriver_BASE

Public Member Functions

int open (MidiDriver *driver, bool nativeMT32) override
 
void send (int8 source, uint32 b) override
 
int8 mapSourceChannel (uint8 source, uint8 dataChannel) override
 
void deinitSource (uint8 source) override
 
void readDriverData (byte *driverData, uint16 driverDataSize, bool isMusicDrv)
 
void loadSfxInstrument (uint8 source, byte *instrumentData)
 
void changeSfxInstrument (uint8 source)
 
- Public Member Functions inherited from MidiDriver_MT32GM
 MidiDriver_MT32GM (MusicType midiType)
 
int open () override
 
void close () override
 
bool isOpen () const override
 
bool isReady (int8 source=-1) override
 
uint32 property (int prop, uint32 param) override
 
void send (uint32 b) override
 
void sysEx (const byte *msg, uint16 length) override
 
uint16 sysExNoDelay (const byte *msg, uint16 length) override
 
void sysExQueue (const byte *msg, uint16 length, int8 source=-1)
 
uint16 sysExMT32 (const byte *msg, uint16 length, const uint32 targetAddress, bool queue=false, bool delay=true, int8 source=-1)
 
void metaEvent (int8 source, byte type, byte *data, uint16 length) override
 
void stopAllNotes (bool stopSustainedNotes=false) override
 
void clearSysExQueue ()
 
MidiChannelallocateChannel () override
 
MidiChannelgetPercussionChannel () override
 
uint32 getBaseTempo () override
 
virtual bool allocateSourceChannels (uint8 source, uint8 numChannels)
 
- Public Member Functions inherited from MidiDriver_Multisource
void setSourceType (SourceType type)
 
void setSourceType (uint8 source, SourceType type)
 
void setSourceVolume (uint16 volume)
 
void setSourceVolume (uint8 source, uint16 volume)
 
void resetSourceVolume ()
 
void resetSourceVolume (uint8 source)
 
void setSourceNeutralVolume (uint16 volume)
 
void setSourceNeutralVolume (uint8 source, uint16 volume)
 
void startFade (uint16 duration, uint16 targetVolume)
 
void startFade (uint8 source, uint16 duration, uint16 targetVolume)
 
void abortFade (FadeAbortType abortType=FADE_ABORT_TYPE_END_VOLUME)
 
void abortFade (uint8 source, FadeAbortType abortType=FADE_ABORT_TYPE_END_VOLUME)
 
bool isFading ()
 
bool isFading (uint8 source)
 
void setControllerDefault (ControllerDefaultType type)
 
void setControllerDefault (ControllerDefaultType type, int16 value)
 
void setControllerDefaults (ControllerDefaultType type, int16 *values)
 
void clearControllerDefault (ControllerDefaultType type)
 
void setInstrumentRemapping (const byte *instrumentRemapping)
 
void syncSoundSettings ()
 
void setTimerCallback (void *timer_param, Common::TimerManager::TimerProc timer_proc) override
 
- Public Member Functions inherited from MidiDriver
void midiDriverCommonSend (uint32 b)
 
void midiDriverCommonSysEx (const byte *msg, uint16 length)
 
virtual void setPitchBendRange (byte channel, uint range)
 
void sendMT32Reset ()
 
void sendGMReset ()
 
virtual void setEngineSoundFont (Common::SeekableReadStream *soundFontData)
 
virtual bool acceptsSoundFontData ()
 
- Public Member Functions inherited from MidiDriver_BASE
void send (byte status, byte firstOp, byte secondOp)
 
void send (int8 source, byte status, byte firstOp, byte secondOp)
 
virtual void metaEvent (byte type, byte *data, uint16 length)
 

Protected Attributes

byte _channelRemapping [16]
 
byte _instrumentRemapping [128]
 
bool _channelLocks [MIDI_CHANNEL_COUNT]
 
- Protected Attributes inherited from MidiDriver_MT32GM
Common::Mutex _allocationMutex
 
Common::Mutex _activeNotesMutex
 
MidiDriver_driver
 
MusicType _midiType
 
bool _nativeMT32
 
bool _enableGS
 
bool _midiDataReversePanning
 
bool _midiDeviceReversePanning
 
bool _scaleGSPercussionVolumeToMT32
 
bool _isOpen
 
uint16 _outputChannelMask
 
int _baseFreq
 
MidiChannelControlData_controlData [MIDI_CHANNEL_COUNT]
 
int8 _channelMap [MAXIMUM_SOURCES][MIDI_CHANNEL_COUNT]
 
uint16 _availableChannels [MAXIMUM_SOURCES]
 
const byte * _mt32ToGMInstrumentMap
 
const byte * _gmToMT32InstrumentMap
 
uint8 _maximumActiveNotes
 
ActiveNote_activeNotes
 
uint32 _sysExDelay
 
Common::List< SysExData_sysExQueue
 
Common::Mutex _sysExQueueMutex
 
- Protected Attributes inherited from MidiDriver_Multisource
MidiSource _sources [MAXIMUM_SOURCES]
 
ControllerDefaults _controllerDefaults
 
const byte * _instrumentRemapping
 
bool _userVolumeScaling
 
uint16 _userMusicVolume
 
uint16 _userSfxVolume
 
bool _userMute
 
Common::Mutex _fadingMutex
 
uint16 _fadeDelay
 
uint32 _timerRate
 
void * _timer_param
 
Common::TimerManager::TimerProc _timer_proc
 
- Protected Attributes inherited from MidiDriver_BASE
bool _midiDumpEnable
 
uint32 _prevMillis
 
Common::Array< byte > _midiDumpCache
 

Static Protected Attributes

static const uint8 SFX_PROGRAM_BASE = 0x75
 
static const uint8 SYSEX_INSTRUMENT_ASSIGNMENT [7]
 
- Static Protected Attributes inherited from MidiDriver_MT32GM
static const uint8 MAXIMUM_MT32_ACTIVE_NOTES = 48
 
static const uint8 MAXIMUM_GM_ACTIVE_NOTES = 96
 
- Static Protected Attributes inherited from MidiDriver_Multisource
static const uint16 FADING_DELAY = 25 * 1000
 

Additional Inherited Members

- Public Types inherited from MidiDriver_Multisource
enum  SourceType { SOURCE_TYPE_UNDEFINED, SOURCE_TYPE_MUSIC, SOURCE_TYPE_SFX }
 
enum  FadeAbortType { FADE_ABORT_TYPE_END_VOLUME, FADE_ABORT_TYPE_CURRENT_VOLUME, FADE_ABORT_TYPE_START_VOLUME }
 
enum  ControllerDefaultType {
  CONTROLLER_DEFAULT_PROGRAM, CONTROLLER_DEFAULT_INSTRUMENT_BANK, CONTROLLER_DEFAULT_DRUMKIT, CONTROLLER_DEFAULT_CHANNEL_PRESSURE,
  CONTROLLER_DEFAULT_PITCH_BEND, CONTROLLER_DEFAULT_MODULATION, CONTROLLER_DEFAULT_VOLUME, CONTROLLER_DEFAULT_PANNING,
  CONTROLLER_DEFAULT_EXPRESSION, CONTROLLER_DEFAULT_SUSTAIN, CONTROLLER_DEFAULT_RPN, CONTROLLER_DEFAULT_PITCH_BEND_SENSITIVITY
}
 
- Public Types inherited from MidiDriver
enum  DeviceStringType { kDriverName, kDriverId, kDeviceName, kDeviceId }
 
enum  { MERR_CANNOT_CONNECT = 1, MERR_DEVICE_NOT_AVAILABLE = 3, MERR_ALREADY_OPEN = 4 }
 
enum  {
  PROP_OLD_ADLIB = 2, PROP_CHANNEL_MASK = 3, PROP_SCUMM_OPL3 = 4, PROP_USER_VOLUME_SCALING = 5,
  PROP_MIDI_DATA_REVERSE_PANNING = 6, PROP_OPL_ACCURACY_MODE = 7, PROP_OPL_CHANNEL_ALLOCATION_MODE = 8, PROP_MILES_VERSION = 9,
  PROP_OPL_RHYTHM_MODE_IGNORE_NOTE_OFF = 10
}
 
typedef uint32 DeviceHandle
 
- Static Public Member Functions inherited from MidiDriver_MT32GM
static void timerCallback (void *data)
 
- Static Public Member Functions inherited from MidiDriver
static Common::String musicType2GUIO (uint32 musicType)
 
static MidiDrivercreateMidi (DeviceHandle handle)
 
static DeviceHandle detectDevice (int flags)
 
static DeviceHandle getDeviceHandle (const Common::String &identifier)
 
static bool checkDevice (DeviceHandle handle, int flags, bool quiet)
 
static MusicType getMusicType (DeviceHandle handle)
 
static Common::String getDeviceString (DeviceHandle handle, DeviceStringType type)
 
static const char * getErrorName (int error_code)
 
- Static Public Attributes inherited from MidiDriver_MT32GM
static const byte MT32_DEFAULT_INSTRUMENTS [8]
 
static const byte MT32_DEFAULT_PANNING [8]
 
static const uint8 MT32_DEFAULT_CHANNEL_VOLUME = 102
 
static const uint8 GM_DEFAULT_CHANNEL_VOLUME = 100
 
static const uint8 GS_DRUMKIT_FALLBACK_MAP [128]
 
static const uint8 MT32_DISPLAY_NUM_CHARS = 20
 
static const uint32 MT32_DISPLAY_MEMORY_ADDRESS = 0x20 << 14
 
- Static Public Attributes inherited from MidiDriver_Multisource
static const uint8 MAXIMUM_SOURCES = 10
 
static const uint16 DEFAULT_SOURCE_NEUTRAL_VOLUME = 255
 
- Static Public Attributes inherited from MidiDriver
static const byte _mt32ToGm [128]
 
static const byte _gmToMt32 [128]
 
- Static Public Attributes inherited from MidiDriver_BASE
static const uint8 MIDI_CHANNEL_COUNT = 16
 
static const uint8 MIDI_RHYTHM_CHANNEL = 9
 
static const byte MIDI_COMMAND_NOTE_OFF = 0x80
 
static const byte MIDI_COMMAND_NOTE_ON = 0x90
 
static const byte MIDI_COMMAND_POLYPHONIC_AFTERTOUCH = 0xA0
 
static const byte MIDI_COMMAND_CONTROL_CHANGE = 0xB0
 
static const byte MIDI_COMMAND_PROGRAM_CHANGE = 0xC0
 
static const byte MIDI_COMMAND_CHANNEL_AFTERTOUCH = 0xD0
 
static const byte MIDI_COMMAND_PITCH_BEND = 0xE0
 
static const byte MIDI_COMMAND_SYSTEM = 0xF0
 
static const byte MIDI_CONTROLLER_BANK_SELECT_MSB = 0x00
 
static const byte MIDI_CONTROLLER_MODULATION = 0x01
 
static const byte MIDI_CONTROLLER_DATA_ENTRY_MSB = 0x06
 
static const byte MIDI_CONTROLLER_VOLUME = 0x07
 
static const byte MIDI_CONTROLLER_BALANCE = 0x08
 
static const byte MIDI_CONTROLLER_PANNING = 0x0A
 
static const byte MIDI_CONTROLLER_EXPRESSION = 0x0B
 
static const byte MIDI_CONTROLLER_BANK_SELECT_LSB = 0x20
 
static const byte MIDI_CONTROLLER_DATA_ENTRY_LSB = 0x26
 
static const byte MIDI_CONTROLLER_SUSTAIN = 0x40
 
static const byte MIDI_CONTROLLER_PORTAMENTO = 0x41
 
static const byte MIDI_CONTROLLER_SOSTENUTO = 0x42
 
static const byte MIDI_CONTROLLER_SOFT = 0x43
 
static const byte MIDI_CONTROLLER_REVERB = 0x5B
 
static const byte MIDI_CONTROLLER_CHORUS = 0x5D
 
static const byte MIDI_CONTROLLER_RPN_LSB = 0x64
 
static const byte MIDI_CONTROLLER_RPN_MSB = 0x65
 
static const byte MIDI_CONTROLLER_ALL_SOUND_OFF = 0x78
 
static const byte MIDI_CONTROLLER_RESET_ALL_CONTROLLERS = 0x79
 
static const byte MIDI_CONTROLLER_ALL_NOTES_OFF = 0x7B
 
static const byte MIDI_CONTROLLER_OMNI_ON = 0x7C
 
static const byte MIDI_CONTROLLER_OMNI_OFF = 0x7D
 
static const byte MIDI_CONTROLLER_MONO_ON = 0x7E
 
static const byte MIDI_CONTROLLER_POLY_ON = 0x7F
 
static const uint16 MIDI_RPN_PITCH_BEND_SENSITIVITY = 0x0000
 
static const uint16 MIDI_RPN_MASTER_TUNING_FINE = 0x0001
 
static const uint16 MIDI_RPN_MASTER_TUNING_COARSE = 0x0002
 
static const uint16 MIDI_RPN_NULL = 0x7F7F
 
static const uint8 MIDI_META_END_OF_TRACK = 0x2F
 
static const uint8 MIDI_META_SEQUENCER = 0x7F
 
static const uint16 MIDI_PITCH_BEND_DEFAULT = 0x2000
 
static const uint8 MIDI_PANNING_DEFAULT = 0x40
 
static const uint8 MIDI_EXPRESSION_DEFAULT = 0x7F
 
static const uint16 MIDI_MASTER_TUNING_FINE_DEFAULT = 0x2000
 
static const uint8 MIDI_MASTER_TUNING_COARSE_DEFAULT = 0x40
 
static const uint8 MT32_PITCH_BEND_SENSITIVITY_DEFAULT = 0x0C
 
static const uint8 GM_PITCH_BEND_SENSITIVITY_DEFAULT = 0x02
 
static const uint8 GS_RHYTHM_FIRST_NOTE = 0x1B
 
static const uint8 GS_RHYTHM_LAST_NOTE = 0x58
 
- Protected Member Functions inherited from MidiDriver_MT32GM
virtual void initControlData ()
 
virtual void initMidiDevice ()
 
virtual void initMT32 (bool initForGM)
 
virtual void initGM (bool initForMT32, bool enableGS)
 
virtual void processEvent (int8 source, uint32 b, uint8 outputChannel, MidiChannelControlData &controlData, bool channelLockedByOtherSource=false)
 
virtual void applyControllerDefaults (uint8 source, MidiChannelControlData &controlData, uint8 outputChannel, bool channelLockedByOtherSource)
 
virtual void noteOnOff (byte outputChannel, byte command, byte note, byte velocity, int8 source, MidiChannelControlData &controlData)
 
virtual void polyAftertouch (byte outputChannel, byte note, byte pressure, int8 source, MidiChannelControlData &controlData, bool channelLockedByOtherSource=false)
 
virtual void controlChange (byte outputChannel, byte controllerNumber, byte controllerValue, int8 source, MidiChannelControlData &controlData, bool channelLockedByOtherSource=false)
 
virtual void programChange (byte outputChannel, byte patchId, int8 source, MidiChannelControlData &controlData, bool channelLockedByOtherSource=false)
 
virtual void channelAftertouch (byte outputChannel, byte pressure, int8 source, MidiChannelControlData &controlData, bool channelLockedByOtherSource=false)
 
virtual void pitchBend (byte outputChannel, uint8 pitchBendLsb, uint8 pitchBendMsb, int8 source, MidiChannelControlData &controlData, bool channelLockedByOtherSource=false)
 
virtual bool addActiveNote (uint8 outputChannel, uint8 note, int8 source)
 
virtual bool removeActiveNote (uint8 outputChannel, uint8 note, int8 source)
 
virtual void removeActiveNotes (uint8 outputChannel, bool sustainedNotes)
 
bool isOutputChannelUsed (int8 outputChannel)
 
virtual byte mapMT32InstrumentToGM (byte mt32Instrument)
 
virtual byte mapGMInstrumentToMT32 (byte gmInstrument)
 
byte correctInstrumentBank (byte outputChannel, byte patchId)
 
void applySourceVolume (uint8 source) override
 
void stopAllNotes (uint8 source, uint8 channel) override
 
void onTimer () override
 
- Protected Member Functions inherited from MidiDriver_Multisource
void updateFading ()
 
- Protected Member Functions inherited from MidiDriver_BASE
void midiDumpInit ()
 
int midiDumpVarLength (const uint32 &delta)
 
void midiDumpDelta ()
 
void midiDumpDo (uint32 b)
 
void midiDumpSysEx (const byte *msg, uint16 length)
 
void midiDumpFinish ()
 

Member Function Documentation

◆ send()

void AGOS::MidiDriver_Accolade_MT32::send ( int8  source,
uint32  b 
)
overridevirtual

Send a MIDI command from a specific source. If the MIDI driver does not support multiple sources, the source parameter is ignored.

Reimplemented from MidiDriver_MT32GM.

◆ mapSourceChannel()

int8 AGOS::MidiDriver_Accolade_MT32::mapSourceChannel ( uint8  source,
uint8  dataChannel 
)
overridevirtual

Returns the MIDI output channel mapped to the specified data channel. If the data channel has not been mapped yet, a new mapping to one of the output channels available to the source will be created.

Parameters
sourceThe source using the data channel
dataChannelThe data channel to map
Returns
The mapped output channel, or -1 if no mapping is possible

Reimplemented from MidiDriver_MT32GM.

◆ deinitSource()

void AGOS::MidiDriver_Accolade_MT32::deinitSource ( uint8  source)
overridevirtual

Deinitializes a source. This will abort active fades, free any output channels allocated to the source and stop active notes.

Reimplemented from MidiDriver_MT32GM.


The documentation for this class was generated from the following file: