diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 8a04c40f..b22dc3b0 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -2339,8 +2339,6 @@ void CMenu::_stopSounds(void) } m_btnMgr.stopSounds(); m_cf.stopSound(); - - m_music.Stop(); m_gameSound.Stop(); } diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index cf35c9fb..84bb0298 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -449,6 +449,7 @@ void CMenu::_game(bool launch) FILE *file = fopen(videoPath.c_str(), "rb"); if(file) { + m_music.StopAndSetPos(); m_gameSound.Stop(); m_banner->SetShowBanner(false); fclose(file); @@ -470,7 +471,6 @@ void CMenu::_game(bool launch) } movie.Stop(); _showGame(); - m_music.Play(); m_video_playing = false; m_banner->SetShowBanner(true); if(!m_gameSound.IsPlaying()) diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index 0af0966e..8d673102 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -248,34 +248,32 @@ int CMenu::main(void) if (m_cfg.getBool("GENERAL", "async_network", false) || has_enabled_providers()) _initAsyncNetwork(); - SetupInput(true); - m_music.Play(); - + GameTDB m_gametdb; m_gametdb.OpenFile(fmt("%s/wiitdb.xml", m_settingsDir.c_str())); - m_GameTDBLoaded=false; + m_GameTDBLoaded = false; if(m_gametdb.IsLoaded()) { - m_GameTDBLoaded=true; + m_GameTDBLoaded = true; m_gametdb.CloseFile(); } if(m_Emulator_boot) m_current_view = COVERFLOW_EMU; - if (m_cfg.getBool("GENERAL", "update_cache", false)) + if(m_cfg.getBool("GENERAL", "update_cache", false)) { UpdateCache(); m_gameList.Update(); } LoadView(); - if (m_cfg.getBool("GENERAL", "startup_menu", false)) + if(m_cfg.getBool("GENERAL", "startup_menu", false)) { _hideMain(); if(!_Source()) LoadView(); else - _showMain(); + _showMain(); if(BTN_B_HELD) bUsed = true; } diff --git a/source/music/musicplayer.cpp b/source/music/musicplayer.cpp index 03b53fc4..07cfadf9 100644 --- a/source/music/musicplayer.cpp +++ b/source/music/musicplayer.cpp @@ -11,7 +11,13 @@ MusicPlayer m_music; void MusicPlayer::cleanup() { + if(m_music_files.empty()) + return; + MusicFile.Pause(); + MusicFile.Stop(); MusicFile.FreeMemory(); + m_music_files.clear(); + m_stopped = true; } void MusicPlayer::Init(Config &cfg, string musicDir, string themeMusicDir) @@ -68,6 +74,8 @@ void MusicPlayer::Previous() { if(m_music_files.empty()) return; + if(PosFromPrevFile()) + return; if(m_current_music == m_music_files.begin()) m_current_music = m_music_files.end(); @@ -80,15 +88,8 @@ void MusicPlayer::Next() { if(m_music_files.empty()) return; - if(CurrentPosition) - { - LoadCurrentFile(); - MusicFile.Pause(); - SoundHandler::Instance()->Decoder(MusicFile.GetVoice())->Seek(CurrentPosition); - CurrentPosition = 0; - MusicFile.Resume(); + if(PosFromPrevFile()) return; - } m_current_music++; if (m_current_music == m_music_files.end()) m_current_music = m_music_files.begin(); @@ -98,10 +99,24 @@ void MusicPlayer::Next() void MusicPlayer::StopAndSetPos() { + if(m_music_files.empty()) + return; CurrentPosition = SoundHandler::Instance()->Decoder(MusicFile.GetVoice())->Tell(); Stop(); } +bool MusicPlayer::PosFromPrevFile() +{ + if(!CurrentPosition) + return false; + LoadCurrentFile(); + MusicFile.Pause(); + SoundHandler::Instance()->Decoder(MusicFile.GetVoice())->Seek(CurrentPosition); + CurrentPosition = 0; + MusicFile.Resume(); + return true; +} + void MusicPlayer::Play() { SetVolume(m_music_current_volume); diff --git a/source/music/musicplayer.h b/source/music/musicplayer.h index 7895dd16..2950170d 100644 --- a/source/music/musicplayer.h +++ b/source/music/musicplayer.h @@ -21,13 +21,14 @@ public: void Previous(); void Next(); - void Play(); - void Stop(); void StopAndSetPos(); bool IsStopped() { return m_stopped; }; protected: + void Play(); + void Stop(); + bool PosFromPrevFile(); void LoadCurrentFile(); void ScanDirectories(const char *directory); diff --git a/wii/wiiflow/Languages/german.ini b/wii/wiiflow/Languages/german.ini index 9170238c..0e8924b8 100644 --- a/wii/wiiflow/Languages/german.ini +++ b/wii/wiiflow/Languages/german.ini @@ -191,6 +191,9 @@ DMLprogP=PAL 480p errboot1=Kein cIOS gefunden!\ncIOS d2x 249 Basis 56 und 250 Basis 57 genügen für die meisten Spiele. errboot2=Kein Speichermedium zum Speichern der Konfiguration gefunden! errboot3=Konnte DIP Modul nicht initialisieren! +errboot4=Keine verwendbare Partition gefunden! +errboot5=data_on_usb=yes aber keine verwendbare USB Partition!\nSD wird verwendet. +errboot6=Kein Speichermedium zum Speichern der Konfiguration gefunden!\Beende. errgame1=Konnte folgendes Spiel mit dieser ID nicht finden: %s errgame2=Kein cIOS gefunden! errgame4=Konnte IOS %i nicht laden!