diff --git a/UI/BackgroundAudio.cpp b/UI/BackgroundAudio.cpp index d7c8d692e..09cc0e289 100644 --- a/UI/BackgroundAudio.cpp +++ b/UI/BackgroundAudio.cpp @@ -39,7 +39,9 @@ public: codec = PSP_CODEC_AT3PLUS; break; case 0x270: - // Dunno? 3rd Birthday has this. + // Dunno? 3rd Birthday has this. Doesn't seem to work though. + codec = PSP_CODEC_AT3; + break; default: return; } @@ -86,7 +88,7 @@ public: return; } sample_rate = samplesPerSec; - decoder_ = new SimpleAudio(codec); + decoder_ = new SimpleAudio(codec, sample_rate, num_channels); ILOG("read ATRAC, frames: %i, rate %i", numFrames, sample_rate); } diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 3cc1c1c3d..aac12c62e 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -704,7 +704,7 @@ UI::EventReturn GameBrowser::NavigateClick(UI::EventParams &e) { return UI::EVENT_DONE; } -MainScreen::MainScreen() : highlightProgress_(0.0f), prevHighlightProgress_(0.0f), backFromStore_(false) { +MainScreen::MainScreen() : highlightProgress_(0.0f), prevHighlightProgress_(0.0f), backFromStore_(false), lockBackgroundAudio_(false) { System_SendMessage("event", "mainscreen"); SetBackgroundAudioGame(""); } @@ -978,6 +978,7 @@ UI::EventReturn MainScreen::OnGameSelected(UI::EventParams &e) { std::string path = e.s; #endif SetBackgroundAudioGame(path); + lockBackgroundAudio_ = true; screenManager()->push(new GameScreen(path)); return UI::EVENT_DONE; } @@ -1001,8 +1002,9 @@ UI::EventReturn MainScreen::OnGameHighlight(UI::EventParams &e) { highlightProgress_ = 0.0f; } - if (!highlightedGamePath_.empty()) + if ((!highlightedGamePath_.empty() || e.a == FF_LOSTFOCUS) && !lockBackgroundAudio_) SetBackgroundAudioGame(highlightedGamePath_); + lockBackgroundAudio_ = false; return UI::EVENT_DONE; } diff --git a/UI/MainScreen.h b/UI/MainScreen.h index c73539b7b..c3142ca68 100644 --- a/UI/MainScreen.h +++ b/UI/MainScreen.h @@ -69,6 +69,7 @@ private: std::string prevHighlightedGamePath_; float highlightProgress_; float prevHighlightProgress_; + bool lockBackgroundAudio_; bool backFromStore_; };