29 #include "common/thread/worker_thread.h"
33 #include "sound/oalsound/check.h"
52 : music(std::move(other.music)),
53 fadeTime(std::move(other.fadeTime)),
54 currentTime(std::move(other.currentTime))
59 music = std::move(other.music);
60 fadeTime = std::move(other.fadeTime);
61 currentTime = std::move(other.currentTime);
65 std::unique_ptr<CChannel> music;
66 float fadeTime = 0.0f;
67 float currentTime = 0.0f;
71 return l.currentTime < r.currentTime;
76 return l.currentTime == r.currentTime;
101 int Play(
SoundType sound,
float amplitude=1.0f,
float frequency=1.0f,
bool loop =
false)
override;
102 int Play(
SoundType sound,
const Math::Vector &pos,
float amplitude=1.0f,
float frequency=1.0f,
bool loop =
false)
override;
104 bool AddEnvelope(
int channel,
float amplitude,
float frequency,
float time,
SoundNext oper)
override;
106 bool Frequency(
int channel,
float frequency)
override;
107 bool Stop(
int channel)
override;
109 bool MuteAll(
bool mute)
override;
111 void PlayMusic(
const std::string &filename,
bool repeat,
float fadeTime = 2.0f)
override;
112 void StopMusic(
float fadeTime=2.0f)
override;
114 void PlayPauseMusic(
const std::string &filename,
bool repeat)
override;
120 bool SearchFreeBuffer(
SoundType sound,
int &channel,
bool &alreadyLoaded);
121 bool CheckChannel(
int &channel);
126 unsigned int m_channelsLimit;
128 ALCcontext* m_context;
129 std::map<SoundType, std::unique_ptr<CBuffer>> m_sounds;
130 std::map<std::string, std::unique_ptr<CBuffer>> m_music;
131 std::map<int, std::unique_ptr<CChannel>> m_channels;
132 std::unique_ptr<CChannel> m_currentMusic;
133 std::list<OldMusic> m_oldMusic;
bool Stop(int channel) override
Definition: alsound.cpp:427
void PlayPauseMusic(const std::string &filename, bool repeat) override
Definition: alsound.cpp:625
void PlayMusic(const std::string &filename, bool repeat, float fadeTime=2.0f) override
Definition: alsound.cpp:578
bool Position(int channel, const Math::Vector &pos) override
Definition: alsound.cpp:404
int GetMusicVolume() override
Definition: alsound.cpp:129
bool Frequency(int channel, float frequency) override
Definition: alsound.cpp:415
bool StopAll() override
Definition: alsound.cpp:440
int Play(SoundType sound, float amplitude=1.0f, float frequency=1.0f, bool loop=false) override
Definition: alsound.cpp:315
void CacheMusic(const std::string &) override
Definition: alsound.cpp:148
int GetAudioVolume() override
Definition: alsound.cpp:112
void StopMusic(float fadeTime=2.0f) override
Definition: alsound.cpp:669
void SetListener(const Math::Vector &eye, const Math::Vector &lookat) override
Definition: alsound.cpp:566
SoundNext
Enum representing operation that will be performend on a sound at given time.
Definition: sound.h:46
void StopPauseMusic() override
Definition: alsound.cpp:650
bool IsCachedMusic(const std::string &) override
Definition: alsound.cpp:168
bool IsCached(SoundType) override
Definition: alsound.cpp:163
bool IsPlayingMusic() override
Definition: alsound.cpp:683
bool AddEnvelope(int channel, float amplitude, float frequency, float time, SoundNext oper) override
Definition: alsound.cpp:386
SoundType
Enum representing sound file.
Definition: sound_type.h:34
bool Create() override
Definition: alsound.cpp:72
3D (3x1) vector
Definition: vector.h:53
bool MuteAll(bool mute) override
Definition: alsound.cpp:456
bool GetEnable() override
Definition: alsound.cpp:102
void FrameMove(float rTime) override
Definition: alsound.cpp:474
bool FlushEnvelope(int channel) override
Definition: alsound.cpp:375
bool Cache(SoundType, const std::string &) override
Definition: alsound.cpp:137
void SetMusicVolume(int volume) override
Definition: alsound.cpp:120
Sound plugin interface.
Definition: sound.h:60
void SetAudioVolume(int volume) override
Definition: alsound.cpp:107
Thread that runs functions, one at a time.
Definition: worker_thread.h:36