From 1c4410bb87710abb3d63cd0f0ba30a6155e2bf12 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 31 Aug 2011 04:17:31 +0000 Subject: [PATCH] Make middle-click on the audio display seek the video to the clicked on time Originally committed to SVN as r5577. --- aegisub/src/audio_display.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aegisub/src/audio_display.cpp b/aegisub/src/audio_display.cpp index 20fcc1bbb..bbd7be62d 100644 --- a/aegisub/src/audio_display.cpp +++ b/aegisub/src/audio_display.cpp @@ -55,10 +55,12 @@ #include "audio_timing.h" #include "block_cache.h" #include "include/aegisub/audio_provider.h" +#include "include/aegisub/context.h" #include "include/aegisub/hotkey.h" #include "main.h" #include "selection_controller.h" #include "utils.h" +#include "video_context.h" class AudioDisplayScrollbar : public AudioDisplayInteractionObject { static const int height = 10; @@ -1149,7 +1151,12 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) } } - /// @todo Handle middle click to seek video + if (event.MiddleDown()) + { + context->videoController->JumpToTime( + controller->MillisecondsFromSamples(SamplesFromRelativeX(mousepos.x)), + agi::vfr::EXACT); + } } void AudioDisplay::OnKeyDown(wxKeyEvent& event)