2003-03-08 12:46:51 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2006-01-18 17:39:49 +00:00
|
|
|
* Copyright (C) 2003-2006 The ScummVM project
|
2003-03-08 12:46:51 +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.
|
|
|
|
|
|
|
|
* 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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-03-08 12:46:51 +00:00
|
|
|
*
|
2006-02-11 10:03:24 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2003-03-08 12:46:51 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2003-05-30 11:07:30 +00:00
|
|
|
#ifndef SKYSOUND_H
|
|
|
|
#define SKYSOUND_H
|
|
|
|
|
2005-06-24 15:23:51 +00:00
|
|
|
#include "common/stdafx.h"
|
2003-10-05 20:21:20 +00:00
|
|
|
#include "common/scummsys.h"
|
2003-03-08 12:46:51 +00:00
|
|
|
#include "sound/mixer.h"
|
2003-10-05 20:21:20 +00:00
|
|
|
|
2004-01-03 01:58:58 +00:00
|
|
|
namespace Sky {
|
|
|
|
|
2004-01-03 15:57:57 +00:00
|
|
|
class Disk;
|
2003-03-08 12:46:51 +00:00
|
|
|
|
2003-07-23 19:33:34 +00:00
|
|
|
enum {
|
|
|
|
SOUND_CH0 = 0,
|
|
|
|
SOUND_CH1 = 1,
|
|
|
|
SOUND_BG = 2,
|
|
|
|
SOUND_VOICE = 3,
|
|
|
|
SOUND_SPEECH = 4
|
|
|
|
};
|
|
|
|
|
2003-07-04 20:14:11 +00:00
|
|
|
struct SfxQueue {
|
|
|
|
uint8 count, fxNo, chan, vol;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define MAX_QUEUED_FX 4
|
|
|
|
|
2004-01-03 15:57:57 +00:00
|
|
|
class Sound {
|
2003-03-08 12:46:51 +00:00
|
|
|
protected:
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2005-05-10 23:48:48 +00:00
|
|
|
Audio::Mixer *_mixer;
|
2005-05-11 00:01:44 +00:00
|
|
|
Audio::SoundHandle _voiceHandle;
|
|
|
|
Audio::SoundHandle _effectHandle;
|
|
|
|
Audio::SoundHandle _bgSoundHandle;
|
|
|
|
Audio::SoundHandle _ingameSound0, _ingameSound1, _ingameSpeech;
|
2003-07-04 20:14:11 +00:00
|
|
|
|
|
|
|
uint16 _saveSounds[2];
|
2003-03-08 12:46:51 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2005-05-11 00:01:44 +00:00
|
|
|
void playSound(uint32 id, byte *sound, uint32 size, Audio::SoundHandle *handle);
|
2003-03-08 12:46:51 +00:00
|
|
|
|
|
|
|
public:
|
2005-05-10 23:48:48 +00:00
|
|
|
Sound(Audio::Mixer *mixer, Disk *pDisk, uint8 pVolume);
|
2004-01-03 15:57:57 +00:00
|
|
|
~Sound(void);
|
2003-03-08 12:46:51 +00:00
|
|
|
|
2003-05-16 15:33:18 +00:00
|
|
|
void loadSection(uint8 pSection);
|
2003-07-04 20:14:11 +00:00
|
|
|
void playSound(uint16 sound, uint16 volume, uint8 channel);
|
|
|
|
void fnStartFx(uint32 sound, uint8 channel);
|
2003-06-09 23:37:51 +00:00
|
|
|
bool startSpeech(uint16 textNum);
|
2005-03-12 18:56:09 +00:00
|
|
|
bool speechFinished(void) { return !_mixer->isSoundHandleActive(_ingameSpeech); };
|
2003-10-25 14:25:24 +00:00
|
|
|
void fnPauseFx(void);
|
|
|
|
void fnUnPauseFx(void);
|
2003-07-04 20:14:11 +00:00
|
|
|
void fnStopFx(void);
|
2003-07-12 01:12:00 +00:00
|
|
|
void stopSpeech(void);
|
2003-07-04 20:14:11 +00:00
|
|
|
void checkFxQueue(void);
|
|
|
|
void restoreSfx(void);
|
|
|
|
uint8 _soundsTotal;
|
2003-05-16 15:33:18 +00:00
|
|
|
|
|
|
|
private:
|
2004-01-03 15:57:57 +00:00
|
|
|
Disk *_skyDisk;
|
2003-05-29 16:47:14 +00:00
|
|
|
uint16 _sfxBaseOfs;
|
2003-05-30 11:07:30 +00:00
|
|
|
uint8 *_soundData;
|
2005-12-05 05:02:43 +00:00
|
|
|
uint8 *_sfxInfo;
|
2003-08-20 12:12:11 +00:00
|
|
|
uint8 _mainSfxVolume;
|
2003-06-01 03:44:07 +00:00
|
|
|
|
|
|
|
static uint16 _speechConvertTable[8];
|
2003-07-04 20:14:11 +00:00
|
|
|
static SfxQueue _sfxQueue[MAX_QUEUED_FX];
|
2003-03-08 12:46:51 +00:00
|
|
|
};
|
|
|
|
|
2004-01-03 01:58:58 +00:00
|
|
|
} // End of namespace Sky
|
|
|
|
|
2003-05-30 11:07:30 +00:00
|
|
|
#endif
|