diff --git a/core/audio_display.cpp b/core/audio_display.cpp index de0c699c3..ae4cf3007 100644 --- a/core/audio_display.cpp +++ b/core/audio_display.cpp @@ -74,6 +74,7 @@ AudioDisplay::AudioDisplay(wxWindow *parent,VideoDisplay *display) blockUpdate = false; dontReadTimes = false; holding = false; + draggingScale = false; Position = 0; PositionSample = 0; oldCurPos = 0; @@ -1154,11 +1155,15 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) { // Is inside? bool inside = false; - if (x >= 0 && y >= 0 && x < w && y < h) { - inside = true; + bool onScale = false; + if (x >= 0 && y >= 0 && x < w) { + if (y < h) { + inside = true; - // Get focus - if (wxWindow::FindFocus() != this && Options.AsBool(_T("Audio Autofocus"))) SetFocus(); + // Get focus + if (wxWindow::FindFocus() != this && Options.AsBool(_T("Audio Autofocus"))) SetFocus(); + } + else if (y < h+20) onScale = true; } // Click type @@ -1242,6 +1247,23 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) { dc.EndDrawing(); } + // Scale dragging + if (onScale || draggingScale) { + if (event.ButtonDown(wxMOUSE_BTN_LEFT)) { + lastDragX = x; + draggingScale = true; + } + else if (holding) { + int delta = lastDragX - x; + lastDragX = x; + UpdatePosition(Position + delta); + UpdateImage(); + Refresh(false); + } + else draggingScale = false; + } + + // Outside if (!inside) return; // Left/middle click diff --git a/core/audio_display.h b/core/audio_display.h index 11961627b..51832c8e9 100644 --- a/core/audio_display.h +++ b/core/audio_display.h @@ -79,6 +79,7 @@ private: bool hasKaraoke; bool diagUpdated; bool holding; + bool draggingScale; __int64 selStart; __int64 selEnd; __int64 lineStart; @@ -87,6 +88,7 @@ private: __int64 selEndCap; int hold; int lastX; + int lastDragX; int curStartMS; int curEndMS; int holdSyl; diff --git a/core/changelog.txt b/core/changelog.txt index 646670333..93d287525 100644 --- a/core/changelog.txt +++ b/core/changelog.txt @@ -65,6 +65,7 @@ Please visit http://aegisub.net to download latest version - Audio current play position cursor will now always be visible. (AMZ) - Removed video frame/subtitles time sync controls from the grid context menu. (AMZ) - Timeline is now drawn below audio display. (AMZ) +- Dragging the timeline will now scroll audio display. (AMZ) = 1.09 beta - 2006.01.16 ===========================