25 #include "lure/luredefs.h" 26 #include "lure/disk.h" 27 #include "lure/memory.h" 29 #include "common/mutex.h" 30 #include "common/singleton.h" 31 #include "common/ptr.h" 33 #include "audio/adlib_ms.h" 34 #include "audio/mididrv.h" 35 #include "audio/mt32gm.h" 42 #define NUM_CHANNELS 16 43 #define LURE_MAX_SOURCES 10 61 void queueUpdatePos();
62 uint8 randomQueuePos();
63 uint32 songOffset(uint16 songNum)
const;
64 uint32 songLength(uint16 songNum)
const;
68 int8 source, uint8 numChannels,
void *soundData, uint32 size, uint8 volume);
70 void setVolume(
int volume);
71 int getVolume()
const {
return _volume; }
73 void playSong(uint16 songNum);
74 void stopSong() { stopMusic(); }
79 void queueTuneList(int16 tuneList);
80 bool queueSong(uint16 songNum);
84 void send(uint32 b)
override;
85 void send(int8 source, uint32 b)
override;
86 void metaEvent(byte type, byte *data, uint16 length)
override;
87 void metaEvent(int8 source, byte type, byte *data, uint16 length)
override;
91 uint8 soundNumber()
const {
return _soundNumber; }
92 int8 getSource()
const {
return _source; }
93 bool isPlaying()
const {
return _isPlaying; }
94 bool isMusic()
const {
return _isMusic; }
109 SoundList _activeSounds;
112 MusicList _playingSounds;
113 bool _sourcesInUse[LURE_MAX_SOURCES];
121 void musicInterface_TidySounds();
122 static void onTimer(
void *data);
132 void loadSection(uint16 sectionId);
133 bool initCustomTimbres(
bool canAbort =
false);
135 void addSound(uint8 soundIndex,
bool tidyFlag =
true);
136 void addSound2(uint8 soundIndex);
137 void stopSound(uint8 soundIndex);
138 void killSound(uint8 soundNumber);
139 void setVolume(uint8 soundNumber, uint8 volume);
142 uint8 descIndexOf(uint8 soundNumber);
145 void restoreSounds();
149 bool getPaused()
const {
return _paused; }
150 bool hasNativeMT32()
const {
return _nativeMT32; }
151 bool isRoland()
const {
return _isRoland; }
155 void musicInterface_Play(uint8 soundNumber,
bool isMusic =
false, uint8 numChannels = 4, uint8 volume = 0x80);
156 void musicInterface_Stop(uint8 soundNumber);
157 bool musicInterface_CheckPlaying(uint8 soundNumber);
158 void musicInterface_SetVolume(uint8 soundNumber, uint8 volume);
159 void musicInterface_KillAll();
160 void musicInterface_ContinuePlaying();
161 void musicInterface_TrashReverb();
169 static const uint16 OPL_FREQUENCY_LOOKUP[];
176 void channelAftertouch(uint8 channel, uint8 pressure, uint8 source)
override;
179 void metaEvent(int8 source, byte type, byte *data, uint16 length)
override;
182 InstrumentInfo determineInstrument(uint8 channel, uint8 source, uint8 note)
override;
183 uint16 calculateFrequency(uint8 channel, uint8 source, uint8 note)
override;
186 int32 calculatePitchBend(uint8 channel, uint8 source, uint16 oplFrequency)
override;
187 uint8 calculateUnscaledVolume(uint8 channel, uint8 source, uint8 velocity,
OplInstrumentDefinition &instrumentDef, uint8 operatorNum)
override;
193 uint8 _pitchBendSensitivity;
198 #define Sound (::Lure::SoundManager::instance())
Definition: mididrv_ms.h:86
Definition: adlib_ms.h:629
Definition: adlib_ms.h:289
void send(uint32 b) override
Definition: mididrv.h:112
Definition: res_struct.h:240
Definition: mididrv.h:537
Definition: list_intern.h:51
Definition: adlib_ms.h:79
Definition: midiparser.h:289
Definition: singleton.h:42