ScummVM API documentation
audio.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 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef HOLLYWOOD_RUNAWAY_AUDIO_H
23#define HOLLYWOOD_RUNAWAY_AUDIO_H
24
25#include "hollywood/sound.h"
26
27namespace Hollywood {
28
30public:
31 explicit RunawayAudio(Audio::Mixer *mixer) : _mixer(mixer) {}
33 void setMuseum(bool museum) { _museum = museum; }
34 void setChapter(byte chapter);
35 void playIntroMusic(uint16 cue = 2);
36 uint32 playMusic(uint16 cue, bool loop = true);
37 void playMusicEffect(uint16 cue, byte volume = Audio::Mixer::kMaxChannelVolume, byte channel = 0, bool loop = false);
38 void setMusicVolume(byte volume);
39 void setListenerPosition(int x);
40 int listenerPosition() const { return _listenerX; }
41 uint32 playSpeech(uint16 sample, bool global = false);
42 void playBackgroundSpeech(uint16 sample, byte channel);
43 void playEffect(uint16 cue, byte volume = Audio::Mixer::kMaxChannelVolume, byte channel = 0, bool loop = false);
44 void playEffectAt(uint16 cue, Common::Point position, byte volume = Audio::Mixer::kMaxChannelVolume, byte channel = 0, bool loop = false);
45 void playFootstep(byte surface, byte variant, byte volume = Audio::Mixer::kMaxChannelVolume, int x = -1);
46 void playPointer();
47 void playMenuMusic();
48 void stopMusic();
49 void stopSpeech();
50 void stopEffect();
51 void stopEffect(byte channel);
52 bool musicPlaying() const;
53 bool speechPlaying() const;
54 bool effectPlaying(byte channel = 0) const;
55
56private:
57 void playEffect(uint16 cue, byte volume, byte channel, bool loop, const Common::Point *position);
58 uint32 play(const char *archive, uint16 cue, uint tableCount, bool pairedTables,
59 byte flags, Audio::Mixer::SoundType type, SoundChannel &channel, byte volume, bool loop, uint rate,
60 const Common::Point *position = nullptr);
61 bool _museum = false;
62 byte _chapter = 3;
63 Audio::Mixer *_mixer;
64 SoundChannel _music, _speech, _effects[3], _footsteps[14], _pointer;
65 int _listenerX = 512;
66};
67
68} // End of namespace Hollywood
69
70#endif
Definition: mixer.h:70
@ kMaxChannelVolume
Definition: mixer.h:82
SoundType
Definition: mixer.h:73
Definition: audio.h:29
Definition: sound.h:32
Definition: rect.h:144