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