diff options
author | Willem Jan Palenstijn | 2013-04-18 23:55:01 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:47:44 +0200 |
commit | 102299630901d08a44ef3aec367fcbcae065b9fe (patch) | |
tree | 98db4bbe0c54176c0a43e2f5076f8b3d63b8065c /engines/hopkins/sound.h | |
parent | 583f9abaf98f64895546b75573e9442ca47426e3 (diff) | |
parent | 78ba3210a57094086d44b25d5a8507c33ce9bef3 (diff) | |
download | scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.tar.gz scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.tar.bz2 scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.zip |
Merge branch 'master'
Diffstat (limited to 'engines/hopkins/sound.h')
-rw-r--r-- | engines/hopkins/sound.h | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/engines/hopkins/sound.h b/engines/hopkins/sound.h new file mode 100644 index 0000000000..f1d047ae8b --- /dev/null +++ b/engines/hopkins/sound.h @@ -0,0 +1,138 @@ +/* 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 HOPKINS_SOUND_H +#define HOPKINS_SOUND_H + +#include "common/scummsys.h" +#include "common/str.h" +#include "audio/audiostream.h" +#include "audio/decoders/wave.h" +#include "audio/mixer.h" + +namespace Hopkins { + +class VoiceItem { +public: + bool _status; + int _wavIndex; +}; + +class SwavItem { +public: + bool _active; + Audio::RewindableAudioStream *_audioStream; + Audio::SoundHandle _soundHandle; + bool _freeSampleFl; +}; + +class MusicItem { +public: + bool _active; +}; + +class SoundItem { +public: + bool _active; +}; + +#define VOICE_COUNT 3 +#define SWAV_COUNT 50 +#define SOUND_COUNT 10 + +class HopkinsEngine; + +class SoundManager { +private: + HopkinsEngine *_vm; + + Audio::SoundHandle _musicHandle; + int _currentSoundIndex; + bool _modPlayingFl; + int _oldSoundNumber; + + VoiceItem _voice[VOICE_COUNT]; + SwavItem _sWav[SWAV_COUNT]; + SoundItem _sound[SOUND_COUNT]; + MusicItem _music; + + void playMod(const Common::String &file); + void loadMusic(const Common::String &file); + void playMusic(); + void stopMusic(); + void delMusic(); + bool checkVoiceStatus(int voiceIndex); + bool loadVoice(const Common::String &filename, size_t fileOffset, size_t entryLength, SwavItem &item); + void stopVoice(int voiceIndex); + void playVoice(); + void delWav(int wavIndex); + void checkVoiceActivity(); + Common::String setExtension(const Common::String &str, const Common::String &ext); + Audio::RewindableAudioStream *makeSoundStream(Common::SeekableReadStream *stream); + bool removeWavSample(int wavIndex); + void loadWavSample(int wavIndex, const Common::String &filename, bool freeSample); + void playWavSample(int voiceIndex, int wavIndex); + +public: + bool _musicOffFl; + bool _soundOffFl; + bool _voiceOffFl; + bool _textOffFl; + bool _soundFl; + bool _skipRefreshFl; + int _musicVolume; + int _soundVolume; + int _voiceVolume; + int _specialSoundNum; +public: + SoundManager(HopkinsEngine *vm); + ~SoundManager(); + + void loadAnimSound(); + void playAnimSound(int soundNumber); + + void loadSample(int wavIndex, const Common::String &file); + void playSample(int wavIndex, int voiceMode = 9); + void removeSample(int soundIndex); + + void checkSoundEnd(); + void checkSounds(); + void playSoundFile(const Common::String &file); + void playSound(int soundNumber); + void stopSound(); + + void updateScummVMSoundSettings(); + void syncSoundSettings(); + bool mixVoice(int voiceId, int voiceMode, bool displTxtFl = false); + + void setMODMusicVolume(int volume); + void setMODSampleVolume(); + void setMODVoiceVolume(); + + void loadWav(const Common::String &file, int wavIndex); + void playWav(int wavIndex); + void directPlayWav(const Common::String &file2); +}; + +} // End of namespace Hopkins + +#endif /* HOPKINS_SOUND_H */ |