ScummVM API documentation
base_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 /*
23  * This file is based on WME Lite.
24  * http://dead-code.org/redir.php?target=wmelite
25  * Copyright (c) 2011 Jan Nedoma
26  */
27 
28 #ifndef WINTERMUTE_BASE_SOUND_H
29 #define WINTERMUTE_BASE_SOUND_H
30 
31 #include "engines/wintermute/base/base.h"
32 #include "engines/wintermute/dctypes.h" // Added by ClassView
33 #include "engines/wintermute/persistent.h"
34 #include "audio/mixer.h"
35 
36 namespace Wintermute {
37 
38 class BaseSoundBuffer;
39 class BaseSound : public BaseClass {
40 public:
41  bool setPan(float pan);
42  int32 _soundPrivateVolume;
43  int getVolume();
44  int getVolumePercent();
45  bool setVolumePercent(int percent);
46  bool setVolume(int volume);
47  bool setPrivateVolume(int volume);
48  bool setLoopStart(uint32 pos);
49  uint32 getPositionTime();
50  bool setPositionTime(uint32 time);
51  bool _soundPaused;
52  bool _soundFreezePaused;
53  bool isPlaying();
54  bool isPaused();
55  bool _soundPlaying;
56  bool _soundLooping;
57  uint32 _soundLoopStart;
58  uint32 _soundPosition;
59  DECLARE_PERSISTENT(BaseSound, BaseClass)
60  bool resume();
61  bool pause(bool freezePaused = false);
62  bool stop();
63  bool play(bool looping = false);
64  uint32 getLength();
65  bool _soundStreamed;
66  Audio::Mixer::SoundType _soundType;
67  Common::String _soundFilename;
68  bool setSoundSimple();
69  bool setSound(const Common::String &filename, Audio::Mixer::SoundType type = Audio::Mixer::kSFXSoundType, bool streamed = false);
70  BaseSound(BaseGame *inGame);
71  ~BaseSound() override;
72 
73  bool applyFX(TSFXType type = SFX_NONE, float param1 = 0, float param2 = 0, float param3 = 0, float param4 = 0);
74 
75  TSFXType _sFXType;
76  float _sFXParam1;
77  float _sFXParam2;
78  float _sFXParam3;
79  float _sFXParam4;
80 
81 private:
82  BaseSoundBuffer *_sound;
83 };
84 
85 } // End of namespace Wintermute
86 
87 #endif
Definition: base_game.h:75
Definition: str.h:59
Definition: mixer.h:77
SoundType
Definition: mixer.h:73
Definition: base_sound_buffer.h:43
Definition: base_sound.h:39
Definition: base.h:43
Definition: achievements_tables.h:27