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
36namespace Colony {
37
38class ColonyEngine;
39
40class Sound {
41public:
43 ~Sound();
44
45 void init();
46 void play(int soundID, bool loop = false);
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 kDiDit,
66 kSink,
67 kClatter,
68 kStop,
69 kTeleport,
70 kSlug,
71 kTunnel1,
72 kTunnel2,
73 kLift,
74 kDrop,
75 kGlass,
76 kDoor,
77 kStars1,
78 kStars2,
79 kStars3,
80 kStars4,
81 kToilet,
82 kBath,
83 kMars,
84 kBeamMe,
85 kDave,
86 kSwish,
87 kEnd
88 };
89
90private:
91 ColonyEngine *_vm = nullptr;
92 Audio::PCSpeaker *_speaker = nullptr;
93 Common::MacResManager *_resMan = nullptr;
94 Common::MacResManager *_appResMan = nullptr;
95 Audio::SoundHandle _handle;
96
97 void playPCSpeaker(int soundID);
98 bool playMacSound(int soundID, bool loop);
99 bool playResource(int resID, bool loop, int sampleRate = 11127);
100};
101
102} // End of namespace Colony
103
104#endif // COLONY_SOUND_H
Definition: pcspk.h:36
Definition: mixer.h:49
Definition: colony.h:474
Definition: sound.h:40
Definition: macresman.h:126