ScummVM API documentation
speech_manager.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * Additional copyright for this file:
8 * Copyright (C) 1999-2000 Revolution Software Ltd.
9 * This code is based on source code created by Revolution Software,
10 * used with permission.
11 *
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 *
25 */
26
27#ifndef ICB_SPEECHMANAGER_H_INCLUDED_
28#define ICB_SPEECHMANAGER_H_INCLUDED_
29
30#include "engines/icb/common/px_common.h"
31#include "engines/icb/sound/direct_sound.h"
32
33#include "common/stream.h"
34
35#include "audio/audiostream.h"
36#include "audio/mixer.h"
37
38namespace ICB {
39
41private:
42 Audio::AudioStream *_audioStream;
43 Audio::SoundHandle _handle;
44 int32 m_speechVol; // The volume the each stream was started at
45
46 uint32 m_wavByteOffsetInCluster;
47 uint32 m_wavDataSize;
48
49 bool8 m_paused;
50 int32 m_lengthInCycles; // Assumes 12 frames per second
51
52public:
55
56 bool8 UpdateSpeech();
57
58 bool8 StartSpeech(const char *fileName, uint32 byteOffsetToWav, int32 vol = 128);
59 void StopSpeech();
60 void PauseSpeech();
61 void ResumeSpeech();
62 void SetSpeechVolume(int32 volume);
63 bool8 IsPlaying();
64 bool8 IsPaused() { return m_paused; }
65 int32 GetLength() { return m_lengthInCycles; }
66
67private:
68 bool8 OpenSpeech(Common::SeekableReadStream *stream);
69 void KillBuffer();
70 void SetVolume(int32 volume);
71};
72
73} // End of namespace ICB
74
75#endif
Definition: audiostream.h:50
Definition: mixer.h:49
Definition: stream.h:745
Definition: speech_manager.h:40