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  * Based on the original sources
21  * https://github.com/Croquetx/thecolony
22  * Copyright (C) 1988, David A. Smith
23  *
24  * Distributed under Apache Version 2.0 License
25  *
26  */
27 
28 #ifndef COLONY_SOUND_H
29 #define COLONY_SOUND_H
30 
31 #include "audio/mixer.h"
32 #include "audio/softsynth/pcspk.h"
33 #include "common/macresman.h"
34 #include "common/ptr.h"
35 
36 namespace Colony {
37 
38 class ColonyEngine;
39 
40 class Sound {
41 public:
42  Sound(ColonyEngine *vm);
43  ~Sound();
44 
45  void init();
46  void play(int soundID);
47  void stop();
48  bool isPlaying() const;
49 
50  enum {
51  kKlaxon,
52  kAirlock,
53  kOuch,
54  kChime,
55  kBang,
56  kShoot,
57  kEat,
58  kBonk,
59  kBzzz,
60  kExplode,
61  kElevator,
62  kPShot,
63  kTest,
64  kDit,
65  kSink,
66  kClatter,
67  kStop,
68  kTeleport,
69  kSlug,
70  kTunnel2,
71  kLift,
72  kDrop,
73  kGlass,
74  kDoor,
75  kStars1,
76  kStars2,
77  kStars3,
78  kStars4,
79  kToilet,
80  kBath,
81  kMars,
82  kBeamMe
83  };
84 
85 private:
86  ColonyEngine *_vm = nullptr;
87  Audio::PCSpeaker *_speaker = nullptr;
88  Common::MacResManager *_resMan = nullptr;
89  Common::MacResManager *_appResMan = nullptr;
90  Audio::SoundHandle _handle;
91 
92  void playPCSpeaker(int soundID);
93  bool playMacSound(int soundID);
94  bool playResource(int resID);
95 };
96 
97 } // End of namespace Colony
98 
99 #endif // COLONY_SOUND_H
Definition: macresman.h:126
Definition: colony.h:53
Definition: mixer.h:49
Definition: colony.h:405
Definition: sound.h:40
Definition: pcspk.h:34