Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow playing movies from command line. Also remove some unneeded code.
  • Loading branch information
RachelBryk committed Mar 13, 2013
1 parent 78d0ff1 commit e73cc85
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
33 changes: 21 additions & 12 deletions Source/Core/DolphinWX/Src/Main.cpp
Expand Up @@ -162,6 +162,11 @@ bool DolphinApp::OnInit()
"Low level (LLE) or high level (HLE) audio",
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{
wxCMD_LINE_OPTION, "m", "movie",
"Play a movie file",
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{
wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0
}
Expand All @@ -182,6 +187,7 @@ bool DolphinApp::OnInit()
&videoBackendName);
selectAudioEmulation = parser.Found(wxT("audio_emulation"),
&audioEmulationName);
playMovie = parser.Found(wxT("movie"), &movieFile);
#endif // wxUSE_CMDLINE_PARSER

#if defined _DEBUG && defined _WIN32
Expand Down Expand Up @@ -331,8 +337,21 @@ void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event))
if (!BatchMode)
main_frame->UpdateGameList();

if (playMovie && movieFile != wxEmptyString)
{
if (Movie::PlayInput(movieFile.char_str()))
{
if (LoadFile && FileToLoad != wxEmptyString)
{
main_frame->BootGame(WxStrToStr(FileToLoad));
}
else
main_frame->BootGame(std::string(""));
}
}

// First check if we have an exec command line.
if (LoadFile && FileToLoad != wxEmptyString)
else if (LoadFile && FileToLoad != wxEmptyString)
{
main_frame->BootGame(WxStrToStr(FileToLoad));
}
Expand All @@ -342,17 +361,7 @@ void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event))
{
if (main_frame->g_pCodeWindow->AutomaticStart())
{
if(!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty()
&& File::Exists(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM))
{
main_frame->BootGame(SConfig::GetInstance().m_LocalCoreStartupParameter.
m_strDefaultGCM);
}
else if(!SConfig::GetInstance().m_LastFilename.empty()
&& File::Exists(SConfig::GetInstance().m_LastFilename))
{
main_frame->BootGame(SConfig::GetInstance().m_LastFilename);
}
main_frame->BootGame("");
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinWX/Src/Main.h
Expand Up @@ -40,7 +40,9 @@ class DolphinApp : public wxApp
wxTimer *m_afterinit;
bool BatchMode;
bool LoadFile;
bool playMovie;
wxString FileToLoad;
wxString movieFile;
wxLocale *m_locale;

void AfterInit(wxTimerEvent& WXUNUSED(event));
Expand Down

0 comments on commit e73cc85

Please sign in to comment.