22 #ifndef SCI_SOUND_DRIVERS_MIDIDRIVER_H 23 #define SCI_SOUND_DRIVERS_MIDIDRIVER_H 27 #include "audio/mididrv.h" 28 #include "common/error.h" 29 #include "common/platform.h" 47 class ResourceManager;
51 MIDI_PROP_MASTER_VOLUME = 0
54 #define MIDI_RHYTHM_CHANNEL 9 58 #define SCI_MIDI_TIME_EXPANSION_PREFIX 0xF8 59 #define SCI_MIDI_TIME_EXPANSION_LENGTH 240 61 #define SCI_MIDI_EOT 0xFC 62 #define SCI_MIDI_SET_SIGNAL 0xCF 63 #define SCI_MIDI_SET_POLYPHONY 0x4B 64 #define SCI_MIDI_RESET_ON_SUSPEND 0x4C 65 #define SCI_MIDI_CHANNEL_MUTE 0x4E 66 #define SCI_MIDI_SET_REVERB 0x50 67 #define SCI_MIDI_HOLD 0x52 68 #define SCI_MIDI_CUMULATIVE_CUE 0x60 69 #define SCI_MIDI_CHANNEL_SOUND_OFF 0x78 70 #define SCI_MIDI_CHANNEL_NOTES_OFF 0x7B 72 #define SCI_MIDI_SET_SIGNAL_LOOP 0x7F 75 #define SCI_MIDI_CONTROLLER(status) ((status & 0xF0) == 0xB0) 90 virtual void close() { _driver->
close(); }
91 void send(uint32 b)
override { _driver->
send(b); }
92 virtual uint32 getBaseTempo() {
return _driver->
getBaseTempo(); }
93 virtual bool hasRhythmChannel()
const = 0;
96 virtual byte getPlayId()
const = 0;
97 virtual int getPolyphony()
const = 0;
98 virtual int getFirstChannel()
const {
return 0; }
99 virtual int getLastChannel()
const {
return 15; }
101 virtual void setVolume(byte volume) {
103 _driver->
property(MIDI_PROP_MASTER_VOLUME, volume);
106 virtual int getVolume() {
107 return _driver ? _driver->
property(MIDI_PROP_MASTER_VOLUME, 0xffff) : 0;
111 int8 getReverb()
const {
return _reverb; }
113 virtual void setReverb(int8 reverb) { _reverb = reverb; }
115 virtual void playSwitch(
bool play) {
118 for (
int i = 0; i < MIDI_CHANNELS; ++i)
119 _driver->
send(0xb0 + i, SCI_MIDI_CHANNEL_NOTES_OFF, 0);
135 virtual const char *reportMissingFiles() {
return 0; }
156 #endif // SCI_SOUND_DRIVERS_MIDIDRIVER_H void send(uint32 b) override
Definition: mididriver.h:91
virtual uint32 property(int prop, uint32 param)
Definition: mididrv.h:495
virtual uint32 getBaseTempo()=0
SciVersion
Definition: detection.h:135
MusicType
Definition: mididrv.h:44
void(* TimerProc)(void *refCon)
Definition: timer.h:42
Definition: mididrv.h:309
Definition: resource.h:327
Definition: mididrv.h:112
Definition: mididriver.h:77
virtual void send(uint32 b)=0