From cfc7e009f291dd7817fb6d37e0fca929e07da87e Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 27 Dec 2011 01:38:00 +0000 Subject: [PATCH] Don't disable or hide the visual tools while video is playing. Updates #1336. Originally committed to SVN as r6168. --- aegisub/src/video_context.cpp | 8 ++------ aegisub/src/video_display.cpp | 11 +++-------- aegisub/src/visual_tool.cpp | 2 +- aegisub/src/visual_tool_drag.cpp | 5 ++--- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/aegisub/src/video_context.cpp b/aegisub/src/video_context.cpp index 2e31eac8d..9318f6d58 100644 --- a/aegisub/src/video_context.cpp +++ b/aegisub/src/video_context.cpp @@ -229,13 +229,9 @@ void VideoContext::Reload() { void VideoContext::OnSubtitlesCommit() { if (!IsLoaded()) return; - bool wasPlaying = IsPlaying(); - Stop(); - provider->LoadSubtitles(context->ass); - GetFrameAsync(frame_n); - - if (wasPlaying) Play(); + if (!IsPlaying()) + GetFrameAsync(frame_n); } void VideoContext::OnSubtitlesSave() { diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index 04b4ad9d3..a64437340 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -211,10 +211,8 @@ void VideoDisplay::Render() try { } } - if (mouse_pos || alwaysShowTools->GetBool()) { - if (!con->videoController->IsPlaying()) - tool->Draw(); - } + if (mouse_pos || alwaysShowTools->GetBool()) + tool->Draw(); SwapBuffers(); } @@ -355,9 +353,6 @@ void VideoDisplay::OnSizeEvent(wxSizeEvent &event) { void VideoDisplay::OnMouseEvent(wxMouseEvent& event) { assert(w > 0); - // Disable when playing - if (con->videoController->IsPlaying()) return; - if (event.ButtonDown()) SetFocus(); @@ -374,7 +369,7 @@ void VideoDisplay::OnMouseLeave(wxMouseEvent& event) { void VideoDisplay::OnMouseWheel(wxMouseEvent& event) { if (int wheel = event.GetWheelRotation()) { if (ForwardMouseWheelEvent(this, event)) - SetZoom (zoomValue + .125 * (wheel / event.GetWheelDelta())); + SetZoom(zoomValue + .125 * (wheel / event.GetWheelDelta())); } } diff --git a/aegisub/src/visual_tool.cpp b/aegisub/src/visual_tool.cpp index c46bb4eb2..ea6bbf0ac 100644 --- a/aegisub/src/visual_tool.cpp +++ b/aegisub/src/visual_tool.cpp @@ -102,11 +102,11 @@ void VisualToolBase::OnSeek(int new_frame) { if (frame_number == new_frame) return; frame_number = new_frame; - dragging = false; OnFrameChanged(); AssDialogue *new_line = GetActiveDialogueLine(); if (new_line != active_line) { + dragging = false; active_line = new_line; OnLineChanged(); } diff --git a/aegisub/src/visual_tool_drag.cpp b/aegisub/src/visual_tool_drag.cpp index e766c737b..c6df9e429 100644 --- a/aegisub/src/visual_tool_drag.cpp +++ b/aegisub/src/visual_tool_drag.cpp @@ -112,7 +112,7 @@ void VisualToolDrag::OnFileChanged() { for (entryIter it = c->ass->Line.begin(); it != c->ass->Line.end(); ++it) { AssDialogue *diag = dynamic_cast(*it); if (diag && IsDisplayed(diag)) - MakeFeatures(diag); + MakeFeatures(diag); } UpdateToggleButtons(); @@ -140,14 +140,13 @@ void VisualToolDrag::OnFrameChanged() { else { // Remove all features for this line (if any) while (feat != end && feat->line == diag) { + if (feat == active_feature) active_feature = features.end(); feat->line = 0; RemoveSelection(feat); feat = features.erase(feat); } } } - - active_feature = features.end(); } void VisualToolDrag::OnSelectedSetChanged(const Selection &added, const Selection &removed) {