2002-11-29 22:09:52 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2006-05-05 00:42:37 +00:00
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
2006-01-18 17:39:49 +00:00
|
|
|
* Copyright (C) 2001-2006 The ScummVM project
|
2002-11-29 22:09:52 +00:00
|
|
|
*
|
|
|
|
* 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.
|
2006-05-05 00:42:37 +00:00
|
|
|
|
2002-11-29 22:09:52 +00:00
|
|
|
* 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.
|
2006-05-05 00:42:37 +00:00
|
|
|
|
2002-11-29 22:09:52 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-11-29 22:09:52 +00:00
|
|
|
*
|
2006-05-05 00:42:37 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
2002-11-29 22:09:52 +00:00
|
|
|
*/
|
|
|
|
|
2006-09-29 08:14:27 +00:00
|
|
|
#ifndef AGOS_SOUND_H
|
|
|
|
#define AGOS_SOUND_H
|
2003-10-03 19:42:27 +00:00
|
|
|
|
2002-11-29 22:09:52 +00:00
|
|
|
#include "sound/mixer.h"
|
2006-09-29 08:14:27 +00:00
|
|
|
#include "agos/intern.h"
|
2003-10-10 13:55:08 +00:00
|
|
|
#include "common/str.h"
|
2002-11-29 22:09:52 +00:00
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
namespace AGOS {
|
2003-10-03 19:42:27 +00:00
|
|
|
|
2003-06-15 12:22:19 +00:00
|
|
|
class BaseSound;
|
2003-06-15 11:48:04 +00:00
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
class AGOSEngine;
|
2005-11-12 06:01:24 +00:00
|
|
|
|
2004-01-03 01:28:00 +00:00
|
|
|
class Sound {
|
2002-11-29 22:09:52 +00:00
|
|
|
private:
|
2006-09-29 09:44:30 +00:00
|
|
|
AGOSEngine *_vm;
|
2003-01-11 16:00:55 +00:00
|
|
|
|
2005-05-10 23:48:48 +00:00
|
|
|
Audio::Mixer *_mixer;
|
2003-05-20 15:17:21 +00:00
|
|
|
|
2003-06-15 12:22:19 +00:00
|
|
|
BaseSound *_voice;
|
|
|
|
BaseSound *_effects;
|
2002-11-29 22:09:52 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _effectsPaused;
|
|
|
|
bool _ambientPaused;
|
2006-04-17 12:05:45 +00:00
|
|
|
bool _sfx5Paused;
|
2002-11-29 22:09:52 +00:00
|
|
|
|
2003-01-11 16:00:55 +00:00
|
|
|
uint16 *_filenums;
|
|
|
|
uint32 *_offsets;
|
2005-05-08 12:33:25 +00:00
|
|
|
uint16 _lastVoiceFile;
|
2003-01-11 16:00:55 +00:00
|
|
|
|
2005-05-11 00:01:44 +00:00
|
|
|
Audio::SoundHandle _voiceHandle;
|
|
|
|
Audio::SoundHandle _effectsHandle;
|
|
|
|
Audio::SoundHandle _ambientHandle;
|
2006-04-17 12:05:45 +00:00
|
|
|
Audio::SoundHandle _sfx5Handle;
|
2002-11-29 22:09:52 +00:00
|
|
|
|
2005-05-08 12:33:25 +00:00
|
|
|
bool _hasEffectsFile;
|
|
|
|
bool _hasVoiceFile;
|
|
|
|
uint _ambientPlaying;
|
2002-11-29 22:09:52 +00:00
|
|
|
|
2005-05-08 12:33:25 +00:00
|
|
|
public:
|
2006-09-29 09:44:30 +00:00
|
|
|
Sound(AGOSEngine *vm, const GameSpecificSettings *gss, Audio::Mixer *mixer);
|
2004-01-03 01:28:00 +00:00
|
|
|
~Sound();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2006-04-15 05:24:44 +00:00
|
|
|
void loadVoiceFile(const GameSpecificSettings *gss);
|
|
|
|
void loadSfxFile(const GameSpecificSettings *gss);
|
|
|
|
|
2004-06-27 22:14:35 +00:00
|
|
|
void readSfxFile(const char *filename);
|
2005-05-10 22:56:25 +00:00
|
|
|
void loadSfxTable(Common::File *gameFile, uint32 base);
|
2004-06-27 22:14:35 +00:00
|
|
|
void readVoiceFile(const char *filename);
|
2002-11-29 22:09:52 +00:00
|
|
|
|
|
|
|
void playVoice(uint sound);
|
|
|
|
void playEffects(uint sound);
|
|
|
|
void playAmbient(uint sound);
|
2006-04-14 05:13:59 +00:00
|
|
|
|
2006-10-14 01:15:28 +00:00
|
|
|
// Elvira 1/2 and Waxworks specific
|
|
|
|
void playRawData(byte *soundData, uint sound, uint size);
|
|
|
|
|
2006-04-14 05:13:59 +00:00
|
|
|
// Feeble Files specific
|
2006-04-17 12:05:45 +00:00
|
|
|
void playAmbientData(byte *soundData, uint sound, uint pan, uint vol);
|
|
|
|
void playSfxData(byte *soundData, uint sound, uint pan, uint vol);
|
|
|
|
void playSfx5Data(byte *soundData, uint sound, uint pan, uint vol);
|
2006-04-23 15:42:02 +00:00
|
|
|
void playSoundData(Audio::SoundHandle *handle, byte *soundData, uint sound, int pan = 0, int vol = 0, bool loop = false);
|
2006-04-14 05:13:59 +00:00
|
|
|
void playVoiceData(byte *soundData, uint sound);
|
2006-04-20 02:23:17 +00:00
|
|
|
void switchVoiceFile(const GameSpecificSettings *gss, uint disc);
|
2002-11-29 22:09:52 +00:00
|
|
|
|
2005-05-08 12:33:25 +00:00
|
|
|
bool hasVoice() const;
|
|
|
|
bool isVoiceActive() const;
|
2006-09-29 06:58:59 +00:00
|
|
|
void stopAllSfx();
|
2006-04-18 13:28:42 +00:00
|
|
|
void stopSfx5();
|
2002-12-07 17:35:34 +00:00
|
|
|
void stopVoice();
|
2002-11-29 22:09:52 +00:00
|
|
|
void stopAll();
|
|
|
|
void effectsPause(bool b);
|
|
|
|
void ambientPause(bool b);
|
|
|
|
};
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
} // End of namespace AGOS
|
2003-10-03 19:42:27 +00:00
|
|
|
|
|
|
|
#endif
|