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