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  int getVolume();
43  int getVolumePercent();
44  bool setVolumePercent(int percent);
45  bool setVolume(int volume);
46  bool setPrivateVolume(int volume);
47  bool setLoopStart(uint32 pos);
48  uint32 getPositionTime();
49  bool setPositionTime(uint32 time);
50  bool isPlaying();
51  bool isPaused();
52  DECLARE_PERSISTENT(BaseSound, BaseClass)
53  bool resume();
54  bool pause(bool freezePaused = false);
55  bool stop();
56  bool play(bool looping = false);
57  uint32 getLength();
58  const char *getFilename() { return _soundFilename.c_str(); }
59  bool setSoundSimple();
60  bool setSound(const Common::String &filename, Audio::Mixer::SoundType type = Audio::Mixer::kSFXSoundType, bool streamed = false);
61  BaseSound(BaseGame *inGame);
62  ~BaseSound() override;
63 
64  bool applyFX(TSFXType type = SFX_NONE, float param1 = 0, float param2 = 0, float param3 = 0, float param4 = 0);
65 private:
66  Common::String _soundFilename;
67  bool _soundStreamed;
68  Audio::Mixer::SoundType _soundType;
69  int32 _soundPrivateVolume;
70  uint32 _soundLoopStart;
71  uint32 _soundPosition;
72  bool _soundPlaying;
73  bool _soundLooping;
74  bool _soundPaused;
75  bool _soundFreezePaused;
76  TSFXType _sFXType;
77  float _sFXParam1;
78  float _sFXParam2;
79  float _sFXParam3;
80  float _sFXParam4;
81  BaseSoundBuffer *_sound;
82 };
83 
84 } // End of namespace Wintermute
85 
86 #endif
Definition: base_game.h:76
Definition: str.h:59
Definition: mixer.h:66
SoundType
Definition: mixer.h:62
Definition: base_sound_buffer.h:44
Definition: base_sound.h:39
Definition: base.h:43
Definition: achievements_tables.h:27