MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_audio.h
[詳解]
1// SPDX-License-Identifier: Zlib
2/* ------------------------------------------------------------------------- */
9/* ------------------------------------------------------------------------- */
10
11#ifndef INCGUARD_MGL_AUDIO_H_1612343820
12#define INCGUARD_MGL_AUDIO_H_1612343820
13
16
17namespace MGL::Audio
18{
19/* ------------------------------------------------------------------------- */
27/* ------------------------------------------------------------------------- */
28template <class VoiceClass, class... Args>
29std::weak_ptr<VoiceClass> LoadVoice(Args... args) noexcept
30{
31 auto voice = STL::make_shared<VoiceClass>(args...);
32 if (!Player::GetInstance().Load(voice))
33 {
34 return std::weak_ptr<VoiceClass>();
35 }
36
37 return voice;
38}
39
40bool UnloadVoice(VoiceKey key) noexcept;
41void SetMasterVolume(float volume) noexcept;
42[[nodiscard]] float GetMasterVolume() noexcept;
43void SetVoiceVolume(VoiceKey voiceKey, float volume) noexcept;
44[[nodiscard]] float GetVoiceVolume(VoiceKey voiceKey) noexcept;
45
46} // namespace MGL::Audio
47
48#endif // INCGUARD_MGL_AUDIO_H_1612343820
49
50// vim: et ts=4 sw=4 sts=4
static Player & GetInstance() noexcept
Definition mgl_singleton.h:74
std::weak_ptr< VoiceClass > LoadVoice(Args... args) noexcept
ボイスの読み込み
Definition mgl_audio.h:29
MGL オーディオプレイヤー
MGL オーディオソース