From 25b80074076e6799dfca9a566731e2a24610a08f Mon Sep 17 00:00:00 2001 From: raven02 Date: Sat, 1 Jun 2013 22:58:22 +0800 Subject: [PATCH] Toggle Atrac3+ in [Sound] section --- Core/Config.cpp | 6 ++++-- Core/Config.h | 3 ++- Core/HW/atrac3plus.cpp | 4 ++-- UI/MenuScreens.cpp | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 5baaf2c92a..79da056b2e 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -128,7 +128,8 @@ void Config::Load(const char *iniFileName) IniFile::Section *sound = iniFile.GetOrCreateSection("Sound"); sound->Get("Enable", &bEnableSound, true); - + sound->Get("EnableAtrac3plus", &bEnableAtrac3plus, true); + IniFile::Section *control = iniFile.GetOrCreateSection("Control"); control->Get("ShowStick", &bShowAnalogStick, false); #ifdef BLACKBERRY10 @@ -218,7 +219,8 @@ void Config::Save() IniFile::Section *sound = iniFile.GetOrCreateSection("Sound"); sound->Set("Enable", bEnableSound); - + sound->Set("EnableAtrac3plus", bEnableAtrac3plus); + IniFile::Section *control = iniFile.GetOrCreateSection("Control"); control->Set("ShowStick", bShowAnalogStick); control->Set("ShowTouchControls", bShowTouchControls); diff --git a/Core/Config.h b/Core/Config.h index dc64518eba..f756b391a9 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -85,7 +85,8 @@ public: // Sound bool bEnableSound; - + bool bEnableAtrac3plus; + // UI bool bShowTouchControls; bool bShowDebuggerOnLoad; diff --git a/Core/HW/atrac3plus.cpp b/Core/HW/atrac3plus.cpp index 8ee436a595..591f4f15f2 100644 --- a/Core/HW/atrac3plus.cpp +++ b/Core/HW/atrac3plus.cpp @@ -42,7 +42,7 @@ namespace Atrac3plus_Decoder { #else hlib = LoadLibraryA("at3plusdecoder.dll"); #endif - if (hlib) { + if (hlib && g_Config.bEnableAtrac3plus) { frame_decoder = (ATRAC3PLUS_DECODEFRAME)GetProcAddress(hlib, "Atrac3plusDecoder_decodeFrame"); open_context = (ATRAC3PLUS_OPENCONTEXT)GetProcAddress(hlib, "Atrac3plusDecoder_openContext"); close_context = (ATRAC3PLUS_CLOSECONTEXT)GetProcAddress(hlib, "Atrac3plusDecoder_closeContext"); @@ -148,4 +148,4 @@ namespace Atrac3plus_Decoder { return true; } -} // Atrac3plus_Decoder \ No newline at end of file +} // Atrac3plus_Decoder diff --git a/UI/MenuScreens.cpp b/UI/MenuScreens.cpp index 8e1b4664a7..3f95fece2a 100644 --- a/UI/MenuScreens.cpp +++ b/UI/MenuScreens.cpp @@ -664,7 +664,8 @@ void AudioScreen::render() { int stride = 40; int columnw = 400; UICheckBox(GEN_ID, x, y += stride, a->T("Enable Sound"), ALIGN_TOPLEFT, &g_Config.bEnableSound); - + UICheckBox(GEN_ID, x, y += stride, a->T("Enable Atrac3+"), ALIGN_TOPLEFT, &g_Config.bEnableAtrac3plus); + UIEnd(); }