treballant en la classe Audio

This commit is contained in:
2025-03-28 23:27:33 +01:00
parent 31a0ad6fd5
commit d2417f48d9
29 changed files with 321 additions and 253 deletions

View File

@@ -4,7 +4,7 @@
#include <vector> // Para vector
#include "asset.h" // Para Asset
#include "input.h" // Para Input, InputAction, InputDeviceToUse
#include "jail_audio.h" // Para JA_SetMusicVolume, JA_SetSoundVolume
#include "audio.h" // Para JA_SetMusicVolume, JA_SetSoundVolume
#include "lang.h" // Para getText, Code, getNextLangCode, loadFro...
#include "notifier.h" // Para Notifier
#include "on_screen_help.h" // Para OnScreenHelp
@@ -61,16 +61,7 @@ namespace globalInputs
void toggleAudio()
{
options.audio.enabled = !options.audio.enabled;
if (options.audio.enabled)
{
JA_SetMusicVolume(to_JA_volume(options.audio.music.volume));
JA_SetSoundVolume(to_JA_volume(options.audio.sound.volume));
}
else
{
JA_SetMusicVolume(0);
JA_SetSoundVolume(0);
}
Audio::get()->enable(options.audio.enabled);
Notifier::get()->show({"Audio " + boolToOnOff(options.audio.enabled)});
}
@@ -161,7 +152,7 @@ namespace globalInputs
switch (section::name)
{
case section::Name::INTRO:
JA_StopMusic();
Audio::get()->stopMusic();
/* Continua en el case de abajo */
case section::Name::LOGO:
case section::Name::HI_SCORE_TABLE: