22 #ifndef MADS_CORE_SOUND_MANAGER_H 23 #define MADS_CORE_SOUND_MANAGER_H 25 #include "audio/mt32gm.h" 26 #include "common/array.h" 27 #include "common/memstream.h" 28 #include "common/mutex.h" 29 #include "common/queue.h" 30 #include "native_sound_timer.h" 38 #define CALLBACKS_PER_SECOND 60 65 int dataOffset,
int dataSize);
66 virtual ~SoundDriver() {}
74 virtual int command(
int commandId,
int param) = 0;
79 virtual int stop() = 0;
84 virtual void pause(
bool paused);
89 virtual int poll() = 0;
94 virtual void noise() = 0;
97 virtual void setVolume(
int volume) { };
113 static const uint32 UPDATE_DELTA;
115 enum DriverType { SOUND_ADLIB, SOUND_MT32, SOUND_GM, SOUND_PCSPEAKER, SOUND_PAS };
117 DriverType _driverType;
119 uint32 _driverCallbackDelta;
120 uint32 _updateDeltaRemainder;
124 bool _newSoundsPaused =
false;
134 virtual void loadDriver(
int sectionNum) = 0;
138 bool supportsGeneralMidi =
false);
144 virtual void validate() = 0;
149 void init(
int sectionNumber);
155 return _driver !=
nullptr;
168 bool isDriverActive();
174 return _driverType == SOUND_PCSPEAKER;
190 void pauseNewCommands();
195 virtual void startQueuedCommands();
200 void syncSoundSettings();
208 int command(
int commandId,
int param = 0);
218 void pause(
bool pause);
229 static void timerCallback(
void *data);
virtual void stopAllNotes()
Definition: sound_manager.h:102
bool isLoaded() const
Definition: sound_manager.h:154
Definition: sound_manager.h:107
Common::MemoryReadStream getDataStream(int offset) const
Definition: sound_manager.h:50
Definition: native_sound_timer.h:33
Definition: sound_manager.h:105
bool usesPCSpeaker() const
Definition: sound_manager.h:173
size_type size() const
Definition: array.h:316
Definition: memstream.h:43
Definition: sound_manager.h:40
Definition: anim_timer.h:27