31 #include "sound/oalsound/check.h"
50 : music(std::move(other.music)),
51 fadeTime(std::move(other.fadeTime)),
52 currentTime(std::move(other.currentTime))
57 music = std::move(other.music);
58 fadeTime = std::move(other.fadeTime);
59 currentTime = std::move(other.currentTime);
63 std::unique_ptr<Channel> music;
64 float fadeTime = 0.0f;
65 float currentTime = 0.0f;
69 return l.currentTime < r.currentTime;
74 return l.currentTime == r.currentTime;
85 bool Cache(SoundType,
const std::string &)
override;
99 int Play(SoundType sound,
float amplitude=1.0f,
float frequency=1.0f,
bool loop =
false)
override;
100 int Play(SoundType sound,
const Math::Vector &pos,
float amplitude=1.0f,
float frequency=1.0f,
bool loop =
false)
override;
102 bool AddEnvelope(
int channel,
float amplitude,
float frequency,
float time,
SoundNext oper)
override;
104 bool Frequency(
int channel,
float frequency)
override;
105 bool Stop(
int channel)
override;
107 bool MuteAll(
bool mute)
override;
109 bool PlayMusic(
const std::string &filename,
bool repeat,
float fadeTime=2.0f)
override;
112 void StopMusic(
float fadeTime=2.0f)
override;
114 bool PlayPauseMusic(
const std::string &filename,
bool repeat)
override;
119 int GetPriority(SoundType);
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<Buffer>> m_sounds;
130 std::map<std::string, std::unique_ptr<Buffer>> m_music;
131 std::map<int, std::unique_ptr<Channel>> m_channels;
132 std::unique_ptr<Channel> m_currentMusic;
133 std::list<OldMusic> m_oldMusic;
bool GetEnable() override
Definition: alsound.cpp:106
bool Cache(SoundType, const std::string &) override
Definition: alsound.cpp:146
void StopPauseMusic() override
Definition: alsound.cpp:675
int GetAudioVolume() override
Definition: alsound.cpp:118
void StopMusic(float fadeTime=2.0f) override
Definition: alsound.cpp:708
bool StopAll() override
Definition: alsound.cpp:455
bool Position(int channel, const Math::Vector &pos) override
Definition: alsound.cpp:417
void SetMusicVolume(int volume) override
Definition: alsound.cpp:127
bool CacheMusic(const std::string &) override
Definition: alsound.cpp:157
bool AddEnvelope(int channel, float amplitude, float frequency, float time, SoundNext oper) override
Definition: alsound.cpp:398
bool IsCached(SoundType) override
Definition: alsound.cpp:171
void SetAudioVolume(int volume) override
Definition: alsound.cpp:112
SoundNext
Enum representing operation that will be performend on a sound at given time.
Definition: sound.h:43
void FrameMove(float rTime) override
Definition: alsound.cpp:491
bool PlayMusic(const std::string &filename, bool repeat, float fadeTime=2.0f) override
Definition: alsound.cpp:597
bool IsPlayingMusic() override
Definition: alsound.cpp:723
bool MuteAll(bool mute) override
Definition: alsound.cpp:472
void SuspendMusic() override
Definition: alsound.cpp:734
bool FlushEnvelope(int channel) override
Definition: alsound.cpp:386
bool IsCachedMusic(const std::string &) override
Definition: alsound.cpp:176
int Play(SoundType sound, float amplitude=1.0f, float frequency=1.0f, bool loop=false) override
Definition: alsound.cpp:325
bool Create() override
Definition: alsound.cpp:75
bool RestartMusic() override
Definition: alsound.cpp:695
bool PlayPauseMusic(const std::string &filename, bool repeat) override
Definition: alsound.cpp:649
3D (3x1) vector
Definition: vector.h:53
bool Stop(int channel) override
Definition: alsound.cpp:441
void SetListener(const Math::Vector &eye, const Math::Vector &lookat) override
Definition: alsound.cpp:584
bool Frequency(int channel, float frequency) override
Definition: alsound.cpp:429
int GetMusicVolume() override
Definition: alsound.cpp:137
Sound plugin interface.
Definition: sound.h:57