forked from mia/Aegisub
Add an option to play audio when stepping through video, like some other video players do. Also, add .mov as a file format to load, as it is widely used on Mac and seems to work fine for me with ffmpeg.
Originally committed to SVN as r4120.
This commit is contained in:
parent
65b09da334
commit
3082838aa1
3 changed files with 17 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue