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 64 int dataOffset,
int dataSize);
65 virtual ~SoundDriver() {}
73 virtual int command(
int commandId,
int param) = 0;
78 virtual int stop() = 0;
83 virtual int poll() = 0;
88 virtual void noise() = 0;
93 virtual void setVolume(
int volume) = 0;
104 static const uint32 UPDATE_DELTA;
106 enum DriverType { SOUND_ADLIB, SOUND_MT32, SOUND_GM, SOUND_PCSPEAKER, SOUND_PAS };
108 DriverType _driverType;
110 uint32 _driverCallbackDelta;
111 uint32 _updateDeltaRemainder;
115 bool _newSoundsPaused =
false;
117 int _masterVolume = 255;
126 virtual void loadDriver(
int sectionNum) = 0;
130 bool supportsGeneralMidi =
false);
136 virtual void validate() = 0;
141 void init(
int sectionNumber);
147 return _driver !=
nullptr;
153 bool isDriverActive();
159 return _driverType == SOUND_PCSPEAKER;
175 void pauseNewCommands();
180 virtual void startQueuedCommands();
185 void setVolume(
int volume);
193 int command(
int commandId,
int param = 0);
209 static void timerCallback(
void *data);
bool isLoaded() const
Definition: sound_manager.h:146
Definition: sound_manager.h:98
Common::MemoryReadStream getDataStream(int offset) const
Definition: sound_manager.h:49
Definition: native_sound_timer.h:33
Definition: sound_manager.h:96
bool usesPCSpeaker() const
Definition: sound_manager.h:158
size_type size() const
Definition: array.h:316
Definition: memstream.h:43
Definition: sound_manager.h:40
Definition: anim_timer.h:27