25 #include "audio/mididrv.h" 26 #include "audio/midiplayer.h" 27 #include "common/array.h" 28 #include "common/path.h" 29 #include "common/scummsys.h" 48 void playFile(
const Common::Path &path,
bool loop =
false);
72 bool playMidiFile(
const Common::Path &path,
bool loop =
false);
76 void setVolume(uint16 volume);
81 void setSmfVolumeFromAttenuation(uint16 gameAttenuation);
88 void setSmfDucked(
bool ducked, uint16 talkVolPercent = 50);
89 bool isPlaybackReady()
const {
return _adlibPlaybackReady; }
90 bool isMidiFilePlaying()
const;
91 bool hasAdlibBackend()
const {
return _opl !=
nullptr; }
94 void send(uint32 b)
override;
95 void metaEvent(byte type,
const byte *data, uint16 length)
override;
98 static constexpr
int kDebugRingSize = 512;
99 static constexpr
int kChannels = 9;
102 uint8 channel = 0xFF;
108 uint8 masterVolume = 0;
109 uint16 activeMusicSlot = 0;
110 uint8 statusFlags = 0;
111 uint32 nextEventTimer = 0;
112 uint16 numOplChannels = 0;
113 float regHistory[kChannels][kDebugRingSize] = {};
120 void writeReg(byte reg, byte value);
121 uint8 readReg(byte reg)
const {
return _regShadow[reg]; }
123 void noteOn(byte channel, byte note, byte velocity);
124 void noteOff(byte channel, byte note);
125 void programChange(byte channel, byte program);
126 void controlChange(byte channel, byte control, byte value);
128 void loadInstrument(uint8 voice, uint8 program);
129 void setFrequency(uint8 voice, uint8 note, uint8 pitchBend);
131 void updateDebugState();
136 bool _adlibPlaybackReady =
true;
139 byte _regShadow[256];
141 uint8 _numOplChannels;
144 uint8 _voiceAge[kChannels];
145 uint8 _voiceMidiChannel[kChannels];
146 uint8 _voiceInstrument[kChannels];
147 uint8 _voiceNote[kChannels];
150 uint8 _channelPrograms[16];
151 uint8 _channelPitchBend[16];
158 uint16 _instrumentDataOffset;
162 int _smfVolumeBeforeDuck;
164 void stopAdlibPlayback();
165 void stopSmfPlayback();
166 bool ensureSmfPlayer();
Definition: midiplayer.h:63
Definition: mididrv.h:114
Definition: actionbar.h:31
Definition: midiparser.h:354