2015-03-15 16:52:55 -04:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SHERLOCK_SOUND_H
|
|
|
|
#define SHERLOCK_SOUND_H
|
|
|
|
|
2015-03-15 21:25:07 -04:00
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "common/str.h"
|
|
|
|
|
2015-03-15 16:52:55 -04:00
|
|
|
namespace Sherlock {
|
|
|
|
|
2015-03-15 21:25:07 -04:00
|
|
|
class SherlockEngine;
|
|
|
|
|
2015-03-16 22:42:19 -04:00
|
|
|
enum WaitType {
|
|
|
|
WAIT_RETURN_IMMEDIATELY = 0, WAIT_FINISH = 1, WAIT_KBD_OR_FINISH = 2
|
|
|
|
};
|
|
|
|
|
2015-03-15 16:52:55 -04:00
|
|
|
class Sound {
|
2015-03-15 21:25:07 -04:00
|
|
|
private:
|
|
|
|
SherlockEngine *_vm;
|
2015-03-16 22:42:19 -04:00
|
|
|
public:
|
2015-05-01 18:21:13 -10:00
|
|
|
bool _digitized;
|
|
|
|
bool _music;
|
|
|
|
int _voices;
|
2015-03-21 18:18:12 -04:00
|
|
|
bool _soundOn;
|
|
|
|
bool _musicOn;
|
2015-04-10 23:35:26 -05:00
|
|
|
bool _speechOn;
|
2015-03-16 22:42:19 -04:00
|
|
|
bool _playingEpilogue;
|
2015-03-21 20:25:15 -04:00
|
|
|
bool _diskSoundPlaying;
|
2015-05-05 07:00:24 +02:00
|
|
|
bool _soundPlaying;
|
|
|
|
bool *_soundIsOn;
|
2015-03-21 20:25:15 -04:00
|
|
|
byte *_digiBuf;
|
2015-03-15 21:25:07 -04:00
|
|
|
public:
|
|
|
|
Sound(SherlockEngine *vm);
|
|
|
|
|
2015-05-01 18:21:13 -10:00
|
|
|
void syncSoundSettings();
|
2015-03-20 19:44:32 -04:00
|
|
|
void loadSound(const Common::String &name, int priority);
|
2015-04-20 23:47:34 +02:00
|
|
|
bool playSound(const Common::String &name, WaitType waitType = WAIT_RETURN_IMMEDIATELY);
|
2015-03-15 21:25:07 -04:00
|
|
|
void cacheSound(const Common::String &name, int index);
|
2015-03-21 18:18:12 -04:00
|
|
|
void playLoadedSound(int bufNum, int waitMode);
|
2015-03-15 16:52:55 -04:00
|
|
|
void playCachedSound(int index);
|
2015-03-22 09:51:37 -04:00
|
|
|
void freeLoadedSounds();
|
2015-03-15 16:52:55 -04:00
|
|
|
void clearCache();
|
2015-03-16 22:42:19 -04:00
|
|
|
void stopSound();
|
2015-03-18 22:32:41 -04:00
|
|
|
int loadSong(int songNumber);
|
|
|
|
void startSong();
|
|
|
|
void freeSong();
|
2015-05-07 19:33:44 +02:00
|
|
|
|
2015-03-15 21:25:07 -04:00
|
|
|
void playMusic(const Common::String &name);
|
|
|
|
void stopMusic();
|
2015-04-10 23:35:26 -05:00
|
|
|
void stopSndFuncPtr(int v1, int v2);
|
2015-04-21 01:12:16 -05:00
|
|
|
void waitTimerRoland(uint time);
|
2015-05-01 17:27:59 -10:00
|
|
|
void freeDigiSound();
|
2015-03-15 16:52:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Sherlock
|
|
|
|
|
|
|
|
#endif
|