ScummVM API documentation
halestorm.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_HALESTORM_H
23 #define KYRA_SOUND_HALESTORM_H
24 
25 #include "common/scummsys.h"
26 
27 namespace Audio {
28  class Mixer;
29 }
30 
31 namespace Common {
32  class SeekableReadStream;
33 }
34 
35 namespace Kyra {
36 
37 class HSSoundSystem;
38 
40 public:
41  virtual ~HalestormLoader() {}
42 
43  virtual Common::SeekableReadStream *getResource(uint16 id, uint32 type) = 0;
44 };
45 
47 public:
49  ~HalestormDriver();
50 
51  enum InterpolationMode {
52  kNone = 0,
53  kSimple = 1,
54  kTable = 2
55  };
56 
57  // The original driver would generate 8-bit sound, which makes
58  // sense, since most of the hardware had support for only that.
59  // However, the internal quality of the intermediate pcm stream
60  // (before the downsampling to 8-bit in the final pass) is a bit
61  // higher (up to 12 bits, depending on the channel use). I have
62  // added an "output16bit" option which will output the unmodified
63  // intermediate data (but converting it from unsigned to signed).
64  bool init(bool hiQuality, InterpolationMode imode, int numChanSfx, bool output16bit);
65 
66  void registerSamples(const uint16 *resList, bool registerOnly);
67  void releaseSamples();
68  int changeSystemVoices(int numChanMusicTotal, int numChanMusicPoly, int numChanSfx);
69 
70  void startSoundEffect(int id, int rate = 0);
71  void enqueueSoundEffect(int id, int rate, int note);
72  void stopSoundEffect(int id);
73  void stopAllSoundEffects();
74 
75  enum HSCommands {
76  kSongPlayOnce = 0,
77  kSongPlayLoop = 1,
78  kSongAbort = 2,
79  kSongIsPlaying = 3,
80  kSongFadeOut = 10,
81  kSongFadeIn = 11,
82  kSongFadeGetState = 12,
83  kSongFadeReset = 13,
84  kSetRateAndIntrplMode = 14
85  };
86 
87  int doCommand(int cmd, ...);
88 
89  void setMusicVolume(int volume);
90  void setSoundEffectVolume(int volume);
91 
92 private:
93  HSSoundSystem *_hs;
94 };
95 
96 } // End of namespace Kyra
97 
98 #endif
Definition: stream.h:745
Definition: mixer.h:59
Definition: halestorm.h:46
Definition: algorithm.h:29
Definition: detection.h:27
Definition: halestorm.h:39
Definition: system.h:38