Compare commits
2 Commits
97f6a459ea
...
3a401b492f
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a401b492f | |||
| 5212674093 |
11
source/external/jail_audio.cpp
vendored
11
source/external/jail_audio.cpp
vendored
@@ -230,15 +230,14 @@ void JA_PlayMusic(JA_Music_t *music, const int loop)
|
|||||||
current_music->times = loop;
|
current_music->times = loop;
|
||||||
|
|
||||||
current_music->stream = SDL_CreateAudioStream(¤t_music->spec, &JA_audioSpec);
|
current_music->stream = SDL_CreateAudioStream(¤t_music->spec, &JA_audioSpec);
|
||||||
|
if (!current_music->stream)
|
||||||
|
printf("[ERROR] SDL_CreateAudioStream failed: %s\n", SDL_GetError());
|
||||||
if (!SDL_PutAudioStreamData(current_music->stream, current_music->buffer, current_music->length))
|
if (!SDL_PutAudioStreamData(current_music->stream, current_music->buffer, current_music->length))
|
||||||
printf("[ERROR] SDL_PutAudioStreamData failed!\n");
|
printf("[ERROR] SDL_SetAudioStreamGain failed: %s\n", SDL_GetError());
|
||||||
SDL_SetAudioStreamGain(current_music->stream, JA_musicVolume);
|
if (!SDL_SetAudioStreamGain(current_music->stream, JA_musicVolume))
|
||||||
|
printf("[ERROR] SDL_SetAudioStreamGain failed: %s\n", SDL_GetError());
|
||||||
if (!SDL_BindAudioStream(sdlAudioDevice, current_music->stream))
|
if (!SDL_BindAudioStream(sdlAudioDevice, current_music->stream))
|
||||||
{
|
|
||||||
printf("[ERROR] SDL_BindAudioStream failed: %s\n", SDL_GetError());
|
printf("[ERROR] SDL_BindAudioStream failed: %s\n", SDL_GetError());
|
||||||
}
|
|
||||||
|
|
||||||
// SDL_ResumeAudioStreamDevice(current_music->stream);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void JA_PauseMusic()
|
void JA_PauseMusic()
|
||||||
|
|||||||
@@ -193,10 +193,7 @@ void ServiceMenu::applySettings()
|
|||||||
void ServiceMenu::applyVideoSettings()
|
void ServiceMenu::applyVideoSettings()
|
||||||
{
|
{
|
||||||
Screen::get()->applySettings();
|
Screen::get()->applySettings();
|
||||||
auto option = getOptionByCaption(Lang::getText("[SERVICE_MENU] WINDOW_SIZE"));
|
setHiddenOptions();
|
||||||
if (option)
|
|
||||||
option->setHidden(Options::video.fullscreen);
|
|
||||||
updateMenu(); // El menú debe refrescarse si algo se oculta
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServiceMenu::applyAudioSettings()
|
void ServiceMenu::applyAudioSettings()
|
||||||
@@ -206,10 +203,7 @@ void ServiceMenu::applyAudioSettings()
|
|||||||
|
|
||||||
void ServiceMenu::applySettingsSettings()
|
void ServiceMenu::applySettingsSettings()
|
||||||
{
|
{
|
||||||
auto option = getOptionByCaption(Lang::getText("[SERVICE_MENU] SHUTDOWN"));
|
setHiddenOptions();
|
||||||
if (option)
|
|
||||||
option->setHidden(!Options::settings.shutdown_enabled);
|
|
||||||
updateMenu(); // El menú debe refrescarse si algo se oculta
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuOption *ServiceMenu::getOptionByCaption(const std::string &caption) const
|
MenuOption *ServiceMenu::getOptionByCaption(const std::string &caption) const
|
||||||
@@ -294,7 +288,7 @@ void ServiceMenu::initializeOptions()
|
|||||||
options_.push_back(std::make_unique<FolderOption>(Lang::getText("[SERVICE_MENU] SETTINGS"), SettingsGroup::MAIN, SettingsGroup::SETTINGS));
|
options_.push_back(std::make_unique<FolderOption>(Lang::getText("[SERVICE_MENU] SETTINGS"), SettingsGroup::MAIN, SettingsGroup::SETTINGS));
|
||||||
options_.push_back(std::make_unique<FolderOption>(Lang::getText("[SERVICE_MENU] SYSTEM"), SettingsGroup::MAIN, SettingsGroup::SYSTEM));
|
options_.push_back(std::make_unique<FolderOption>(Lang::getText("[SERVICE_MENU] SYSTEM"), SettingsGroup::MAIN, SettingsGroup::SYSTEM));
|
||||||
|
|
||||||
// precalculateMenuWidths();
|
setHiddenOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sincroniza los valores de las opciones tipo lista
|
// Sincroniza los valores de las opciones tipo lista
|
||||||
@@ -331,3 +325,21 @@ std::string ServiceMenu::settingsGroupToString(SettingsGroup group) const
|
|||||||
return Lang::getText("[SERVICE_MENU] TITLE");
|
return Lang::getText("[SERVICE_MENU] TITLE");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Establece el estado de oculto de ciertas opciones
|
||||||
|
void ServiceMenu::setHiddenOptions()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
auto option = getOptionByCaption(Lang::getText("[SERVICE_MENU] WINDOW_SIZE"));
|
||||||
|
if (option)
|
||||||
|
option->setHidden(Options::video.fullscreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto option = getOptionByCaption(Lang::getText("[SERVICE_MENU] SHUTDOWN"));
|
||||||
|
if (option)
|
||||||
|
option->setHidden(!Options::settings.shutdown_enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateMenu(); // El menú debe refrescarse si algo se oculta
|
||||||
|
}
|
||||||
@@ -95,6 +95,7 @@ private:
|
|||||||
void AdjustListValues();
|
void AdjustListValues();
|
||||||
void playMenuSound();
|
void playMenuSound();
|
||||||
std::string settingsGroupToString(SettingsGroup group) const;
|
std::string settingsGroupToString(SettingsGroup group) const;
|
||||||
|
void setHiddenOptions();
|
||||||
|
|
||||||
// --- Singleton ---
|
// --- Singleton ---
|
||||||
ServiceMenu();
|
ServiceMenu();
|
||||||
|
|||||||
Reference in New Issue
Block a user