From 35e5a1e5921e48a40d6cf46510def68ee8eccfcf Mon Sep 17 00:00:00 2001 From: rog Date: Sat, 10 Nov 2012 21:57:31 -0500 Subject: [PATCH] Add an option to pause on the last frame of a movie. --- Source/Core/Core/Src/ConfigManager.cpp | 2 ++ Source/Core/Core/Src/ConfigManager.h | 1 + Source/Core/Core/Src/Movie.cpp | 4 ++++ Source/Core/DolphinWX/Src/Frame.cpp | 1 + Source/Core/DolphinWX/Src/Frame.h | 1 + Source/Core/DolphinWX/Src/FrameTools.cpp | 7 +++++++ Source/Core/DolphinWX/Src/Globals.h | 1 + 7 files changed, 17 insertions(+) diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index 0c4fa04566..714ca4cb75 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -131,6 +131,7 @@ void SConfig::SaveSettings() // General ini.Set("General", "LastFilename", m_LastFilename); + ini.Set("General", "PauseMovie", m_pauseMovie); // ISO folders // clear removed folders @@ -260,6 +261,7 @@ void SConfig::LoadSettings() // General { ini.Get("General", "LastFilename", &m_LastFilename); + ini.Get("General", "PauseMovie", &m_pauseMovie, false); m_ISOFolder.clear(); int numGCMPaths; diff --git a/Source/Core/Core/Src/ConfigManager.h b/Source/Core/Core/Src/ConfigManager.h index 0c8f3f1af1..8b9a11881c 100644 --- a/Source/Core/Core/Src/ConfigManager.h +++ b/Source/Core/Core/Src/ConfigManager.h @@ -75,6 +75,7 @@ struct SConfig : NonCopyable bool m_ListKorea; bool m_ListTaiwan; bool m_ListUnknown; + bool m_pauseMovie; SysConf* m_SYSCONF; diff --git a/Source/Core/Core/Src/Movie.cpp b/Source/Core/Core/Src/Movie.cpp index f98254e9a8..aa6fa0bd81 100644 --- a/Source/Core/Core/Src/Movie.cpp +++ b/Source/Core/Core/Src/Movie.cpp @@ -92,6 +92,10 @@ std::string GetInputDisplay() void FrameUpdate() { + if (SConfig::GetInstance().m_pauseMovie && IsPlayingInput() && g_currentInputCount == g_totalInputCount -1) + { + Core::SetState(Core::CORE_PAUSE); + } g_currentFrame++; if(!g_bPolled) g_currentLagCount++; diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 6b0e7b7678..bf09915db4 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -244,6 +244,7 @@ EVT_MENU(IDM_PLAYRECORD, CFrame::OnPlayRecording) EVT_MENU(IDM_RECORDEXPORT, CFrame::OnRecordExport) EVT_MENU(IDM_RECORDREADONLY, CFrame::OnRecordReadOnly) EVT_MENU(IDM_TASINPUT, CFrame::OnTASInput) +EVT_MENU(IDM_TOGGLE_PAUSEMOVIE, CFrame::OnTogglePauseMovie) EVT_MENU(IDM_FRAMESTEP, CFrame::OnFrameStep) EVT_MENU(IDM_SCREENSHOT, CFrame::OnScreenshot) EVT_MENU(wxID_PREFERENCES, CFrame::OnConfigMain) diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index 770d459220..9aa434f6da 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -297,6 +297,7 @@ private: void OnRecordExport(wxCommandEvent& event); void OnRecordReadOnly(wxCommandEvent& event); void OnTASInput(wxCommandEvent& event); + void OnTogglePauseMovie(wxCommandEvent& event); void OnChangeDisc(wxCommandEvent& event); void OnScreenshot(wxCommandEvent& event); void OnActive(wxActivateEvent& event); diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 8215b68efc..6691641292 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -142,6 +142,8 @@ void CFrame::CreateMenu() emulationMenu->Append(IDM_RECORDEXPORT, GetMenuLabel(HK_EXPORT_RECORDING)); emulationMenu->Append(IDM_RECORDREADONLY, GetMenuLabel(HK_READ_ONLY_MODE), wxEmptyString, wxITEM_CHECK); emulationMenu->Append(IDM_TASINPUT, _("TAS Input")); + emulationMenu->AppendCheckItem(IDM_TOGGLE_PAUSEMOVIE, _("Pause at end of movie")); + emulationMenu->Check(IDM_TOGGLE_PAUSEMOVIE, SConfig::GetInstance().m_pauseMovie); emulationMenu->Check(IDM_RECORDREADONLY, true); emulationMenu->AppendSeparator(); @@ -702,6 +704,11 @@ void CFrame::OnTASInput(wxCommandEvent& event) g_TASInputDlg->Show(true); } +void CFrame::OnTogglePauseMovie(wxCommandEvent& WXUNUSED (event)) +{ + SConfig::GetInstance().m_pauseMovie = !SConfig::GetInstance().m_pauseMovie; + SConfig::GetInstance().SaveSettings(); +} void CFrame::OnFrameStep(wxCommandEvent& event) { bool wasPaused = (Core::GetState() == Core::CORE_PAUSE); diff --git a/Source/Core/DolphinWX/Src/Globals.h b/Source/Core/DolphinWX/Src/Globals.h index 8089a2622c..854efb6235 100644 --- a/Source/Core/DolphinWX/Src/Globals.h +++ b/Source/Core/DolphinWX/Src/Globals.h @@ -80,6 +80,7 @@ enum IDM_RECORDEXPORT, IDM_RECORDREADONLY, IDM_TASINPUT, + IDM_TOGGLE_PAUSEMOVIE, IDM_FRAMESTEP, IDM_SCREENSHOT, IDM_BROWSE,