22 #ifndef DGDS_SOUND_DRIVERS_MIDIDRIVER_H 23 #define DGDS_SOUND_DRIVERS_MIDIDRIVER_H 25 #include "dgds/sound/scispan.h" 26 #include "dgds/dgds.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) 85 virtual int open() {
return _driver->
open(); }
86 virtual void close() { _driver->
close(); }
87 void send(uint32 b)
override { _driver->
send(b); }
88 virtual uint32 getBaseTempo() {
return _driver->
getBaseTempo(); }
89 virtual bool hasRhythmChannel()
const = 0;
92 virtual byte getPlayId()
const = 0;
93 virtual int getPolyphony()
const = 0;
94 virtual int getFirstChannel()
const {
return 0; }
95 virtual int getLastChannel()
const {
return 15; }
97 virtual void setVolume(byte volume) {
99 _driver->
property(MIDI_PROP_MASTER_VOLUME, volume);
102 virtual int getVolume() {
103 return _driver ? _driver->
property(MIDI_PROP_MASTER_VOLUME, 0xffff) : 0;
107 int8 getReverb()
const {
return _reverb; }
109 virtual void setReverb(int8 reverb) { _reverb = reverb; }
111 virtual void playSwitch(
bool play) {
114 for (
int i = 0; i < MIDI_CHANNELS; ++i)
115 _driver->
send(0xb0 + i, SCI_MIDI_CHANNEL_NOTES_OFF, 0);
128 extern MidiPlayer *MidiPlayer_PCSpeaker_create();
133 #endif // DGDS_SOUND_DRIVERS_MIDIDRIVER_H virtual uint32 property(int prop, uint32 param)
Definition: mididrv.h:495
virtual uint32 getBaseTempo()=0
void send(uint32 b) override
Definition: mididriver.h:87
void(* TimerProc)(void *refCon)
Definition: timer.h:42
Definition: mididriver.h:77
Definition: mididrv.h:309
Definition: mididrv.h:112
Definition: sci_resource.h:43
virtual void send(uint32 b)=0