22#include <kiwano-audio/Sound.h>
28KGE_DECLARE_SMART_PTR(SoundPlayer);
42 using SoundList = List<SoundPtr>;
51 AudioDataPtr Preload(
const String& file_path);
55 AudioDataPtr Preload(
const Resource& res,
const String& ext =
"");
61 void Play(SoundPtr sound,
int loop_count = 0);
67 SoundPtr Play(
const String& file_path,
int loop_count = 0);
73 SoundPtr Play(
const Resource& res,
int loop_count = 0);
89 const SoundList& GetPlayingList()
const;
93 float GetVolume()
const;
98 void SetVolume(
float volume);
105 void OnEnd(
Sound* sound);
107 float OnVolumeChanged(
Sound* sound,
float volume);
109 void SetCallback(
Sound* sound);
111 void RemoveCallback(
Sound* sound);
117 SoundList sound_list_;
119 SoundCallbackPtr callback_;
121 UnorderedMap<size_t, AudioDataPtr> cache_;
基础对象
Definition: ObjectBase.h:137
资源
Definition: Resource.h:41
音频播放器
Definition: SoundPlayer.h:40
const SoundList & GetPlayingList() const
获取正在播放的音频列表
Definition: SoundPlayer.h:126