22 #ifndef PARALLACTION_MUSIC_H 23 #define PARALLACTION_MUSIC_H 25 #include "common/util.h" 26 #include "common/mutex.h" 28 #include "audio/mixer.h" 29 #include "audio/audiostream.h" 39 class Parallaction_ns;
41 class Parallaction_br;
48 virtual void execute(
int command,
const char *parm = 0) = 0;
56 virtual ~
SoundMan() {
delete _impl; }
57 void execute(
int command, int32 parm) {
62 void execute(
int command,
const char *parm = 0) {
64 _impl->execute(command, parm);
103 char _musicFile[PATH_LEN];
116 virtual void playSfx(
const char *filename, uint channel,
bool looping,
int volume = -1) { }
117 virtual void stopSfx(uint channel) { }
119 void setMusicFile(
const char *filename);
120 virtual void playMusic() = 0;
121 virtual void stopMusic() = 0;
122 virtual void playCharacterMusic(
const char *character) = 0;
123 virtual void playLocationMusic(
const char *location) = 0;
124 virtual void pause(
bool p) { }
125 void execute(
int command,
const char *parm)
override;
127 void setMusicVolume(
int value);
132 MidiPlayer *_midiPlayer;
135 bool isLocationSilent(
const char *locationName);
136 bool locationHasOwnSoftMusic(
const char *locationName);
142 void playMusic()
override;
143 void stopMusic()
override;
145 void playCharacterMusic(
const char *character)
override;
146 void playLocationMusic(
const char *location)
override;
148 void pause(
bool p)
override;
151 #define NUM_SFX_CHANNELS 4 158 uint32 beepSoundBufferSize;
159 int8 *beepSoundBuffer;
161 Channel _channels[NUM_SFX_CHANNELS];
168 void playMusic()
override;
169 void stopMusic()
override;
171 void playSfx(
const char *filename, uint channel,
bool looping,
int volume)
override;
172 void stopSfx(uint channel)
override;
174 void playCharacterMusic(
const char *character)
override;
175 void playLocationMusic(
const char *location)
override;
180 void execute(
int command,
const char *parm)
override { }
198 Channel _channels[NUM_SFX_CHANNELS];
200 virtual void playMusic() = 0;
201 virtual void stopMusic() = 0;
202 virtual void pause(
bool p) = 0;
208 virtual void playSfx(
const char *filename, uint channel,
bool looping,
int volume = -1) { }
209 void stopSfx(uint channel);
212 void execute(
int command,
const char *parm)
override;
213 void setMusicFile(
const char *parm);
215 void enableSfx(
bool enable);
216 void enableMusic(
bool enable);
217 bool isSfxEnabled()
const;
218 bool isMusicEnabled()
const;
223 MidiPlayer_MSC *_midiPlayer;
231 void playMusic()
override;
232 void stopMusic()
override;
233 void pause(
bool p)
override;
235 void playSfx(
const char *filename, uint channel,
bool looping,
int volume)
override;
249 void playMusic()
override;
250 void stopMusic()
override;
251 void pause(
bool p)
override;
253 void playSfx(
const char *filename, uint channel,
bool looping,
int volume)
override;
Definition: parallaction.h:377
int sprintf_s(char *dst, size_t size, MSVC_PRINTF const char *format,...) GCC_PRINTF(3
Definition: mididrv.h:309
Definition: audiostream.h:50
Definition: parallaction.h:489
Definition: midiparser.h:289