ScummVM API documentation
sound.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 LASTEXPRESS_SOUND_H
23 #define LASTEXPRESS_SOUND_H
24 
25 #include "lastexpress/shared.h"
26 
27 #include "common/str.h"
28 
29 namespace LastExpress {
30 
31 class LastExpressEngine;
32 class SoundQueue;
33 
34 class SoundManager {
35 public:
37  ~SoundManager();
38 
39  // Sound playing
40  // the original game uses byte in playSound but unsigned in playSoundWithSubtitles for activateDelay, no idea why
41  void playSound(EntityIndex entity, Common::String filename, SoundFlag flag = kSoundVolumeEntityDefault, byte activateDelay = 0);
42  bool playSoundWithSubtitles(Common::String filename, uint32 flag, EntityIndex entity, unsigned activateDelay = 0);
43  void playSoundEvent(EntityIndex entity, byte action, byte activateDelay = 0);
44  void playDialog(EntityIndex entity, EntityIndex entityDialog, SoundFlag flag, byte a4);
45  void playSteam(CityIndex index);
46  void playFightSound(byte action, byte a4);
47  void playLocomotiveSound();
48  void playWarningCompartment(EntityIndex entity, ObjectIndex compartment);
49  void playAmbientSound(int param);
50 
51  // Dialog & Letters
52  void readText(int id);
53  const char *getDialogName(EntityIndex entity) const;
54 
55  // Sound bites
56  void excuseMe(EntityIndex entity, EntityIndex entity2 = kEntityPlayer, SoundFlag flag = kVolumeNone);
57  void excuseMeCath();
58  const char *justCheckingCath() const;
59  const char *wrongDoorCath() const;
60  const char *justAMinuteCath() const;
61 
62  // Flags
63  SoundFlag getSoundFlag(EntityIndex index) const;
64 
65  // Accessors
66  SoundQueue *getQueue() { return _queue; }
67  uint32 getAmbientSoundDuration() { return _ambientSoundDuration; }
68  bool needToChangeAmbientVolume();
69  SoundFlag getChangedAmbientVolume() { return _ambientScheduledVolume; }
70 
71  // Setters
72  void clearAmbientVolumeChange() { _ambientScheduledVolume = kVolumeNone; }
73 
74 private:
75  LastExpressEngine *_engine;
76  SoundQueue *_queue;
77 
78  // Compartment warnings by Mertens or Coudert
79  uint32 _lastWarning[12];
80 
81  // Ambient sound
82  int _ambientSoundDuration;
83  uint32 _ambientVolumeChangeTimeMS, _ambientVolumeChangeDelayMS;
84  SoundFlag _ambientScheduledVolume;
85 };
86 
87 } // End of namespace LastExpress
88 
89 #endif // LASTEXPRESS_SOUND_H
Definition: str.h:59
Definition: lastexpress.h:69
Definition: queue.h:37
Definition: animation.h:45
Definition: sound.h:34