Otclient  14/8/2020
combinedsoundsource.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2020 OTClient <https://github.com/edubart/otclient>
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 
23 #ifndef COMBINEDSOUNDSOURCE_H
24 #define COMBINEDSOUNDSOURCE_H
25 
26 #include "soundsource.h"
27 
29 {
30 public:
32 
33  void addSource(const SoundSourcePtr& source);
34  std::vector<SoundSourcePtr> getSources() { return m_sources; }
35 
36  void play();
37  void stop();
38 
39  bool isBuffering();
40  bool isPlaying();
41 
42  void setLooping(bool looping);
43  void setRelative(bool relative);
44  void setReferenceDistance(float distance);
45  void setGain(float gain);
46  void setPitch(float pitch);
47  void setPosition(const Point& pos);
48  void setVelocity(const Point& velocity);
49  void setFading(FadeState state, float fadetime);
50 
51 protected:
52  virtual void update();
53 
54 private:
55  std::vector<SoundSourcePtr> m_sources;
56 };
57 
58 #endif
SoundSource
Definition: soundsource.h:30
SoundSource::FadeState
FadeState
Definition: soundsource.h:36
CombinedSoundSource::addSource
void addSource(const SoundSourcePtr &source)
Definition: combinedsoundsource.cpp:29
CombinedSoundSource::getSources
std::vector< SoundSourcePtr > getSources()
Definition: combinedsoundsource.h:34
CombinedSoundSource::setPosition
void setPosition(const Point &pos)
Definition: combinedsoundsource.cpp:94
CombinedSoundSource::setLooping
void setLooping(bool looping)
Definition: combinedsoundsource.cpp:64
CombinedSoundSource::setFading
void setFading(FadeState state, float fadetime)
Definition: combinedsoundsource.cpp:106
CombinedSoundSource::isBuffering
bool isBuffering()
Definition: combinedsoundsource.cpp:46
CombinedSoundSource::update
virtual void update()
Definition: combinedsoundsource.cpp:112
CombinedSoundSource::setVelocity
void setVelocity(const Point &velocity)
Definition: combinedsoundsource.cpp:100
CombinedSoundSource::setPitch
void setPitch(float pitch)
Definition: combinedsoundsource.cpp:88
CombinedSoundSource::stop
void stop()
Definition: combinedsoundsource.cpp:40
stdext::shared_object_ptr< SoundSource >
CombinedSoundSource::setReferenceDistance
void setReferenceDistance(float distance)
Definition: combinedsoundsource.cpp:76
CombinedSoundSource::CombinedSoundSource
CombinedSoundSource()
Definition: combinedsoundsource.cpp:25
CombinedSoundSource::setGain
void setGain(float gain)
Definition: combinedsoundsource.cpp:82
soundsource.h
CombinedSoundSource::play
void play()
Definition: combinedsoundsource.cpp:34
CombinedSoundSource::isPlaying
bool isPlaying()
Definition: combinedsoundsource.cpp:55
CombinedSoundSource::setRelative
void setRelative(bool relative)
Definition: combinedsoundsource.cpp:70
TPoint< int >
CombinedSoundSource
Definition: combinedsoundsource.h:28