Don't disable or hide the visual tools while video is playing. Updates #1336.

Originally committed to SVN as r6168.
This commit is contained in:
Thomas Goyne 2011-12-27 01:38:00 +00:00
parent ae3895fb8e
commit cfc7e009f2
4 changed files with 8 additions and 18 deletions

View File

@ -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() {

View File

@ -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()));
}
}

View File

@ -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();
}

View File

@ -112,7 +112,7 @@ void VisualToolDrag::OnFileChanged() {
for (entryIter it = c->ass->Line.begin(); it != c->ass->Line.end(); ++it) {
AssDialogue *diag = dynamic_cast<AssDialogue*>(*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) {