KisaragiLibrary
 
読み取り中…
検索中…
一致する文字列を見つけられません
Kisaragi_Lib::SoundResourceFacade::SoundResourceFacade_Impl クラス

SoundFacadeの本体 [詳解]

公開メンバ関数

void Load (std::string _key, std::string _pass)
 
void UnLoad (std::string _key)
 
int GetSoundHandle (std::string _key)
 

非公開変数類

std::unordered_map< std::string, std::unique_ptr< SoundHandle > > sounds
 
std::unordered_set< std::string > loadedFils
 
std::unordered_map< std::string, std::string > keyToPath
 

詳解

SoundFacadeの本体

関数詳解

◆ Load()

void Kisaragi_Lib::SoundResourceFacade::SoundResourceFacade_Impl::Load ( std::string _key,
std::string _pass )
inline
76 {
77 if (sounds.count(_key) || loadedFils.count(_pass))
78 {
79 Debug::PrintAssertStatic("SoundFacade : 既に読み込み済みのファイルを読み込もうとしました");
80 return;
81 }
82
83 int tmp = LoadSoundMem(_pass.c_str());
84
85 if (tmp == -1)
86 {
87 Debug::PrintAssertStatic("SoundFacade : 読み込みに失敗しました");
88 return;
89 }
90
91 sounds.emplace(_key, std::make_unique<SoundHandle>(tmp));
92 loadedFils.emplace(_pass);
93 keyToPath.emplace(_key, _pass);
94 }
static void PrintAssertStatic(const std::string _in)
エラー出力用コンソール出力(文字色しか変わらない)
Definition Debug.cpp:152
std::unordered_map< std::string, std::string > keyToPath
Definition Sound.cpp:71
std::unordered_map< std::string, std::unique_ptr< SoundHandle > > sounds
Definition Sound.cpp:69
std::unordered_set< std::string > loadedFils
Definition Sound.cpp:70

◆ UnLoad()

void Kisaragi_Lib::SoundResourceFacade::SoundResourceFacade_Impl::UnLoad ( std::string _key)
inline
97 {
98 if (!keyToPath.count(_key))
99 {
100 Debug::PrintAssertStatic("SoundFacade : 存在しないSoundを削除しようとしました");
101 return;
102 }
103
104 loadedFils.erase(keyToPath[_key]);
105 sounds.erase(_key);
106 }

◆ GetSoundHandle()

int Kisaragi_Lib::SoundResourceFacade::SoundResourceFacade_Impl::GetSoundHandle ( std::string _key)
inline
109 {
110 if (!sounds.count(_key))
111 {
112 Debug::PrintAssertStatic("SoundFacade : 存在しないSoundを読み込もうとしています");
113 return -1;
114 }
115
116 int copyHandle = DuplicateSoundMem(sounds[_key]->operator const int& ());
117
118 if (copyHandle == -1)
119 {
120 Debug::PrintAssertStatic("SoundFacade : Handlの複製に失敗しました");
121 return -1;
122 }
123
124 return copyHandle;
125 }

メンバ詳解

◆ sounds

std::unordered_map<std::string, std::unique_ptr<SoundHandle> > Kisaragi_Lib::SoundResourceFacade::SoundResourceFacade_Impl::sounds
private

◆ loadedFils

std::unordered_set<std::string> Kisaragi_Lib::SoundResourceFacade::SoundResourceFacade_Impl::loadedFils
private

参照元 Load(), UnLoad().

◆ keyToPath

std::unordered_map<std::string, std::string> Kisaragi_Lib::SoundResourceFacade::SoundResourceFacade_Impl::keyToPath
private

参照元 Load(), UnLoad().


このクラス詳解は次のファイルから抽出されました: