ScummVM API documentation
base_sound_buffer.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_SOUNDBUFFER_H
29 #define WINTERMUTE_BASE_SOUNDBUFFER_H
30 
31 
32 #include "engines/wintermute/base/base.h"
33 #include "audio/mixer.h"
34 #include "common/stream.h"
35 
36 namespace Audio {
37 class SeekableAudioStream;
38 class SoundHandle;
39 }
40 
41 namespace Wintermute {
42 
43 class BaseSoundBuffer : public BaseClass {
44 public:
45 
46  BaseSoundBuffer(BaseGame *inGame);
47  ~BaseSoundBuffer() override;
48 
49  bool pause();
50  bool play(bool looping = false, uint32 startSample = 0);
51  bool resume();
52  bool stop();
53  bool isPlaying();
54 
55  void setLooping(bool looping);
56 
57  uint32 getPosition();
58  bool setPosition(uint32 pos);
59  uint32 getLength();
60 
61  bool setLoopStart(uint32 pos);
62  uint32 getLoopStart() const {
63  return _loopStart;
64  }
65 
66  bool setPan(float pan);
67  bool setPrivateVolume(int colume);
68  bool setVolume(int colume);
69 
70  void setType(TSoundType type);
71 
72  bool loadFromFile(const char *filename, bool forceReload = false);
73  void setStreaming(bool streamed, uint32 numBlocks = 0, uint32 blockSize = 0);
74  bool applyFX(TSFXType type, float param1, float param2, float param3, float param4);
75 
76  bool _freezePaused;
77  uint32 _loopStart;
78  TSoundType _type;
79  bool _looping;
80  char *_filename;
81  bool _streamed;
82  int32 _privateVolume;
83 
85  Audio::SoundHandle *_handle;
86 
87  int32 _volume;
88  uint32 _startPos;
89  int8 _pan;
90 };
91 
92 } // End of namespace Wintermute
93 
94 #endif
Definition: base_game.h:79
Definition: audiostream.h:212
Definition: mixer.h:49
Definition: base_sound_buffer.h:43
Definition: base.h:43
Definition: system.h:38
Definition: achievements_tables.h:27