22 #ifndef PELROCK_SOUND_H 23 #define PELROCK_SOUND_H 25 #include "audio/mixer.h" 26 #include "common/file.h" 27 #include "common/scummsys.h" 28 #include "common/str.h" 39 extern const char *SOUND_FILENAMES[];
56 const int kMaxChannels = 15;
57 const int kAmbientSoundSlotBase = 4;
63 void playSound(byte index,
int channel = -1,
int loopCount = 1);
64 void playSound(
const char *filename,
int channel,
int loopCount = 1);
65 void playSound(byte *soundData, uint32 size,
int channel);
67 void stopSound(
int channel);
69 void setVolumeSfx(
int volume);
70 void setVolumeMusic(
int volume);
71 void setVolumeMaster(
int volume);
72 int getVolumeSfx()
const;
73 int getVolumeMusic()
const;
74 int getVolumeMaster()
const;
76 bool isPlaying()
const;
77 bool isPlaying(
int channel)
const;
78 bool isSoundIndexPlaying(byte index)
const;
79 void loadSoundIndex();
81 bool isMusicPlaying();
82 void playMusicTrack(
int trackNumber,
bool loop =
true);
89 int tickAmbientSound(uint32 frameCount);
94 bool isPaused()
const {
return _isPaused; }
95 byte getCurrentMusicTrack()
const {
return _currentMusicTrack; }
98 int playSound(
SonidoFile sound,
int channel = -1,
int loopCount = 1);
99 SoundFormat detectFormat(byte *data, uint32 size);
100 int getSampleRate(byte *data, SoundFormat format);
101 int findFreeChannel();
108 byte _sfxSoundIndex[kMaxChannels];
110 bool _isPaused =
false;
111 byte _currentMusicTrack = 0;
114 uint32 _cdTrackStart = 0;
115 uint32 _cdTrackDuration = 0;
116 uint32 _cdPlayStartTime = 0;
122 #endif // PELROCK_SOUND_H