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  */
21 
22 #ifndef CRUISE_SOUND_H
23 #define CRUISE_SOUND_H
24 
25 #include "common/config-manager.h"
26 #include "common/serializer.h"
27 
28 namespace Cruise {
29 
30 class CruiseEngine;
31 class PCSoundDriver;
32 class PCSoundFxPlayer;
33 
34 class PCSound {
35 private:
36  Audio::Mixer *_mixer;
37  CruiseEngine *_vm;
38  int _genVolume;
39 protected:
40  PCSoundDriver *_soundDriver;
41  PCSoundFxPlayer *_player;
42 public:
43  PCSound(Audio::Mixer *mixer, CruiseEngine *vm);
44  virtual ~PCSound();
45 
46  virtual void loadMusic(const char *name);
47  virtual void playMusic();
48  virtual void stopMusic();
49  virtual void removeMusic();
50  virtual void fadeOutMusic();
51 
52  virtual void playSound(const uint8 *data, int size, int volume);
53  virtual void stopSound(int channel);
54 
55  void doSync(Common::Serializer &s);
56  const char *musicName();
57  void stopChannel(int channel);
58  bool isPlaying() const;
59  bool songLoaded() const;
60  bool songPlayed() const;
61  void fadeSong();
62  uint8 numOrders() const;
63  void setNumOrders(uint8 v);
64  void setPattern(int offset, uint8 value);
65  bool musicLooping() const;
66  void musicLoop(bool v);
67  void startNote(int channel, int volume, int freq);
68  void syncSounds();
69 
70  // Note: Volume variable accessed by these methods is never actually used in original game
71  void setVolume(int volume) { _genVolume = volume; }
72  uint8 getVolume() const { return _genVolume; }
73 };
74 
75 } // End of namespace Cruise
76 
77 #endif
Definition: cruise.h:55
Definition: serializer.h:79
Definition: mixer.h:59
Definition: actor.h:25
Definition: sound.h:34