ScummVM API documentation
sound_pc_v1.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 KYRA_SOUND_ADLIB_H
23 #define KYRA_SOUND_ADLIB_H
24 
25 #include "kyra/sound/sound.h"
26 
27 #include "common/mutex.h"
28 
29 namespace Kyra {
30 class PCSoundDriver;
31 
49 class SoundPC_v1 : public Sound {
50 public:
51  SoundPC_v1(KyraEngine_v1 *vm, Audio::Mixer *mixer, kType type);
52  ~SoundPC_v1() override;
53 
54  kType getMusicType() const override { return _type; }
55 
56  bool init() override;
57  void process() override;
58 
59  void updateVolumeSettings() override;
60 
61  void initAudioResourceInfo(int set, void *info) override;
62  void selectAudioResourceSet(int set) override;
63  bool hasSoundFile(uint file) const override;
64  void loadSoundFile(uint file) override;
65  void loadSoundFile(const Common::Path &file) override;
66 
67  void playTrack(uint8 track) override;
68  void haltTrack() override;
69  bool isPlaying() const override;
70 
71  void playSoundEffect(uint16 track, uint8 volume = 0xFF) override;
72 
73  void beginFadeOut() override;
74 
75  int checkTrigger() override;
76  void resetTrigger() override;
77 private:
78  void internalLoadFile(const Common::Path &file);
79 
80  void play(uint8 track, uint8 volume);
81 
82  const SoundResourceInfo_PC *res() const {return _resInfo[_currentResourceSet]; }
83  SoundResourceInfo_PC *_resInfo[3];
84  int _currentResourceSet;
85 
86  PCSoundDriver *_driver;
87 
88  int _version;
89  kType _type;
90  uint8 _trackEntries[500];
91  uint8 *_soundDataPtr;
92  int _sfxPlayingSound;
93 
94  Common::Path _soundFileLoaded;
95 
96  int _numSoundTriggers;
97  const int *_soundTriggers;
98 
99  static const int _kyra1NumSoundTriggers;
100  static const int _kyra1SoundTriggers[];
101 };
102 
103 } // End of namespace Kyra
104 
105 #endif
void process() override
void beginFadeOut() override
bool isPlaying() const override
int checkTrigger() override
void initAudioResourceInfo(int set, void *info) override
void playTrack(uint8 track) override
bool init() override
Definition: sound.h:40
bool hasSoundFile(uint file) const override
void updateVolumeSettings() override
Definition: kyra_v1.h:126
Definition: path.h:52
Definition: sound.h:91
Definition: pc_base.h:34
Definition: mixer.h:59
void haltTrack() override
void playSoundEffect(uint16 track, uint8 volume=0xFF) override
Definition: detection.h:27
Definition: sound_pc_v1.h:49
void loadSoundFile(uint file) override
void selectAudioResourceSet(int set) override
void resetTrigger() override