La música la tiene ahora la clase Director

This commit is contained in:
2024-07-05 07:20:20 +02:00
parent 8051cbbc39
commit 2b628d2d61
12 changed files with 169 additions and 45 deletions

View File

@@ -183,4 +183,32 @@ std::string toLower(std::string str)
std::string nova(lower);
free(lower);
return nova;
}
// Obtiene el fichero de sonido a partir de un nombre
JA_Sound_t *getSound(std::vector<sound_file_t> sounds, std::string name)
{
for (auto s : sounds)
{
if (s.name == name)
{
return s.file;
}
}
return nullptr;
}
// Obtiene el fichero de música a partir de un nombre
JA_Music_t *getMusic(std::vector<music_file_t> music, std::string name)
{
for (auto m : music)
{
if (m.name == name)
{
return m.file;
}
}
return nullptr;
}