diff --git a/aegisub/src/dialog_options.cpp b/aegisub/src/dialog_options.cpp index 281ab858f..06559dca9 100644 --- a/aegisub/src/dialog_options.cpp +++ b/aegisub/src/dialog_options.cpp @@ -449,6 +449,7 @@ DialogOptions::DialogOptions(wxWindow *parent) AddCheckBox(audioPage,audioSizer3,_("Snap to keyframes"),_T("Audio snap to keyframes")); AddCheckBox(audioPage,audioSizer3,_("Snap to adjacent lines"),_T("Audio snap to other lines")); AddCheckBox(audioPage,audioSizer3,_("Auto-focus on mouse over"),_T("Audio Autofocus")); + AddCheckBox(audioPage,audioSizer3,_("Play audio when stepping in video"),_T("Audio Plays When Stepping Video")); audioSizer3->AddGrowableCol(1,1); // Second sizer diff --git a/aegisub/src/frame_main_events.cpp b/aegisub/src/frame_main_events.cpp index a5818e0c9..910f8bf7b 100644 --- a/aegisub/src/frame_main_events.cpp +++ b/aegisub/src/frame_main_events.cpp @@ -692,7 +692,7 @@ void FrameMain::OnVideoPlay(wxCommandEvent &event) { /// void FrameMain::OnOpenVideo(wxCommandEvent& WXUNUSED(event)) { wxString path = Options.AsText(_T("Last open video path")); - wxString str = wxString(_("Video Formats")) + _T(" (*.avi,*.mkv,*.mp4,*.avs,*.d2v,*.ogm,*.mpeg,*.mpg,*.vob)|*.avi;*.avs;*.d2v;*.mkv;*.ogm;*.mp4;*.mpeg;*.mpg;*.vob|") + wxString str = wxString(_("Video Formats")) + _T(" (*.avi,*.mkv,*.mp4,*.avs,*.d2v,*.ogm,*.mpeg,*.mpg,*.vob,*.mov)|*.avi;*.avs;*.d2v;*.mkv;*.ogm;*.mp4;*.mpeg;*.mpg;*.vob;*.mov|") + _("All Files") + _T(" (*.*)|*.*"); wxString filename = wxFileSelector(_("Open video file"),path,_T(""),_T(""),str,wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (!filename.empty()) { @@ -1779,6 +1779,13 @@ void FrameMain::OnStatusClear(wxTimerEvent &event) { /// void FrameMain::OnNextFrame(wxCommandEvent &event) { videoBox->videoSlider->NextFrame(); + // FIXME: This is probably not the best place to put this, but I was told + // this code is all undergoing a rewrite, so I consider this a temporary solution. + if (audioBox && Options.AsBool(_T("Audio Plays When Stepping Video"))) { + int start = VFR_Output.GetTimeAtFrame(videoBox->videoDisplay->GetFrame()); + int end = VFR_Output.GetTimeAtFrame(videoBox->videoDisplay->GetFrame() + 1); + audioBox->audioDisplay->Play(start,end); + } } @@ -1788,6 +1795,13 @@ void FrameMain::OnNextFrame(wxCommandEvent &event) { /// void FrameMain::OnPrevFrame(wxCommandEvent &event) { videoBox->videoSlider->PrevFrame(); + // FIXME: This is probably not the best place to put this, but I was told + // this code is all undergoing a rewrite, so I consider this a temporary solution. + if (audioBox && Options.AsBool(_T("Audio Plays When Stepping Video"))) { + int start = VFR_Output.GetTimeAtFrame(videoBox->videoDisplay->GetFrame() - 1); + int end = VFR_Output.GetTimeAtFrame(videoBox->videoDisplay->GetFrame()); + audioBox->audioDisplay->Play(start,end); + } } diff --git a/aegisub/src/options.cpp b/aegisub/src/options.cpp index f13e6e51f..7dac15c35 100644 --- a/aegisub/src/options.cpp +++ b/aegisub/src/options.cpp @@ -199,6 +199,7 @@ void OptionsManager::LoadDefaults(bool onlyDefaults,bool doOverride) { SetModificationType(MOD_AUTOMATIC); SetBool(_T("Audio grab times on select"),true); SetBool(_T("Audio Autofocus"),false); + SetBool(_T("Audio Plays When Stepping Video"),false); SetBool(_T("Audio Wheel Default To Zoom"),false); SetBool(_T("Audio lock scroll on cursor"),false); SetBool(_T("Audio snap to keyframes"),false);