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<CChannel> music;
64 float fadeTime = 0.0f;
65 float currentTime = 0.0f;
69 return l.currentTime < r.currentTime;
74 return l.currentTime == r.currentTime;
84 bool Create()
override;
85 bool Cache(
SoundType,
const std::string &)
override;
86 bool CacheMusic(
const std::string &)
override;
88 bool IsCachedMusic(
const std::string &)
override;
90 bool GetEnable()
override;
91 void SetAudioVolume(
int volume)
override;
92 int GetAudioVolume()
override;
93 void SetMusicVolume(
int volume)
override;
94 int GetMusicVolume()
override;
97 void FrameMove(
float rTime)
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;
101 bool FlushEnvelope(
int channel)
override;
102 bool AddEnvelope(
int channel,
float amplitude,
float frequency,
float time,
SoundNext oper)
override;
103 bool Position(
int channel,
const Math::Vector &pos)
override;
104 bool Frequency(
int channel,
float frequency)
override;
105 bool Stop(
int channel)
override;
106 bool StopAll()
override;
107 bool MuteAll(
bool mute)
override;
109 bool PlayMusic(
const std::string &filename,
bool repeat,
float fadeTime=2.0f)
override;
110 bool RestartMusic()
override;
111 void SuspendMusic()
override;
112 void StopMusic(
float fadeTime=2.0f)
override;
113 bool IsPlayingMusic()
override;
114 bool PlayPauseMusic(
const std::string &filename,
bool repeat)
override;
115 void StopPauseMusic()
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;
SoundNext
Enum representing operation that will be performend on a sound at given time.
Definition: sound.h:46
SoundType
Enum representing sound file.
Definition: sound_type.h:34
3D (3x1) vector
Definition: vector.h:53
Sound plugin interface.
Definition: sound.h:60