22 #ifndef SCUMM_IMUSE_DRV_MIDI_H 23 #define SCUMM_IMUSE_DRV_MIDI_H 25 #include "audio/mididrv.h" 28 class IMuseChannel_Midi;
29 class IMuseChannel_MT32;
36 friend class IMSMidi::IMuseChannel_Midi;
42 void close()
override;
45 bool isOpen()
const override {
return _drv ? _drv->isOpen() :
false; }
46 uint32
property(
int prop, uint32 param)
override {
return _drv ? _drv->property(prop, param) : 0; }
47 void setTimerCallback(
void *timerParam,
Common::TimerManager::TimerProc timerProc)
override {
if (_drv) _drv->setTimerCallback(timerParam, timerProc); }
48 uint32
getBaseTempo()
override {
return _drv ? _drv->getBaseTempo() : 0; }
49 void send(uint32 b)
override {
if (_drv) _drv->send(b); };
50 void sysEx(
const byte *msg, uint16 length)
override {
if (_drv) _drv->sysEx(msg, length); }
51 virtual void setPitchBendRange(byte channel, uint range)
override {
if (_drv) _drv->setPitchBendRange(channel, range); }
58 IMSMidi::IMuseChannel_Midi *getPart(
int number);
59 virtual void createChannels();
60 virtual void createParts();
61 virtual void releaseChannels();
64 const bool _newSystem;
67 IMSMidi::IMuseChannel_Midi **_imsParts;
70 virtual void initDevice();
71 void initRolandGSMode();
72 virtual void deinitDevice();
74 void setNoteFlag(byte chan, byte note) {
if (_notesPlaying && chan < 16 && note < 128) _notesPlaying[note] |= (1 << chan); }
75 void clearNoteFlag(byte chan, byte note) {
if (_notesPlaying && chan < 16 && note < 128) _notesPlaying[note] &= ~(1 << chan); }
76 bool queryNoteFlag(byte chan, byte note)
const {
return (_notesPlaying && chan < 16 && note < 128) ? _notesPlaying[note] & (1 << chan) :
false; }
77 void setSustainFlag(byte chan, byte note) {
if (_notesSustained && chan < 16 && note < 128) _notesSustained[note] |= (1 << chan); }
78 void clearSustainFlag(byte chan, byte note) {
if (_notesSustained && chan < 16 && note < 128) _notesSustained[note] &= ~(1 << chan); }
79 bool querySustainFlag(byte chan, byte note)
const {
return (_notesSustained && chan < 16 && note < 128) ? _notesSustained[note] & (1 << chan) :
false; }
83 IMSMidi::ChannelNode *_idleChain;
84 IMSMidi::ChannelNode *_activeChain;
86 uint16 *_notesPlaying;
87 uint16 *_notesSustained;
91 friend class IMSMidi::IMuseChannel_MT32;
97 void initDevice()
override;
98 void deinitDevice()
override;
99 void createChannels()
override;
100 void createParts()
override;
101 void releaseChannels()
override;
104 void sendMT32Sysex(uint32 addr,
const byte *data, uint32 dataSize);
106 IMSMidi::ChannelNode *_hwRealChain;
108 const byte *_programsMapping;
void send(uint32 b) override
Definition: midi.h:49
bool isOpen() const override
Definition: midi.h:45
uint32 DeviceHandle
Definition: mididrv.h:318
void(* TimerProc)(void *refCon)
Definition: timer.h:42
Definition: mididrv.h:309
uint32 getBaseTempo() override
Definition: midi.h:48
Definition: mididrv.h:537
void sysEx(const byte *msg, uint16 length) override
Definition: midi.h:50
uint32 property(int prop, uint32 param) override
Definition: midi.h:46