Dragging the timeline will now scroll audio display.

Originally committed to SVN as r214.
This commit is contained in:
Rodrigo Braz Monteiro 2006-03-07 00:12:50 +00:00
parent 7fe7d5cddb
commit b3618d42df
3 changed files with 29 additions and 4 deletions

View File

@ -74,6 +74,7 @@ AudioDisplay::AudioDisplay(wxWindow *parent,VideoDisplay *display)
blockUpdate = false; blockUpdate = false;
dontReadTimes = false; dontReadTimes = false;
holding = false; holding = false;
draggingScale = false;
Position = 0; Position = 0;
PositionSample = 0; PositionSample = 0;
oldCurPos = 0; oldCurPos = 0;
@ -1154,11 +1155,15 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
// Is inside? // Is inside?
bool inside = false; bool inside = false;
if (x >= 0 && y >= 0 && x < w && y < h) { bool onScale = false;
inside = true; if (x >= 0 && y >= 0 && x < w) {
if (y < h) {
inside = true;
// Get focus // Get focus
if (wxWindow::FindFocus() != this && Options.AsBool(_T("Audio Autofocus"))) SetFocus(); if (wxWindow::FindFocus() != this && Options.AsBool(_T("Audio Autofocus"))) SetFocus();
}
else if (y < h+20) onScale = true;
} }
// Click type // Click type
@ -1242,6 +1247,23 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
dc.EndDrawing(); 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; if (!inside) return;
// Left/middle click // Left/middle click

View File

@ -79,6 +79,7 @@ private:
bool hasKaraoke; bool hasKaraoke;
bool diagUpdated; bool diagUpdated;
bool holding; bool holding;
bool draggingScale;
__int64 selStart; __int64 selStart;
__int64 selEnd; __int64 selEnd;
__int64 lineStart; __int64 lineStart;
@ -87,6 +88,7 @@ private:
__int64 selEndCap; __int64 selEndCap;
int hold; int hold;
int lastX; int lastX;
int lastDragX;
int curStartMS; int curStartMS;
int curEndMS; int curEndMS;
int holdSyl; int holdSyl;

View File

@ -65,6 +65,7 @@ Please visit http://aegisub.net to download latest version
- Audio current play position cursor will now always be visible. (AMZ) - Audio current play position cursor will now always be visible. (AMZ)
- Removed video frame/subtitles time sync controls from the grid context menu. (AMZ) - Removed video frame/subtitles time sync controls from the grid context menu. (AMZ)
- Timeline is now drawn below audio display. (AMZ) - Timeline is now drawn below audio display. (AMZ)
- Dragging the timeline will now scroll audio display. (AMZ)
= 1.09 beta - 2006.01.16 =========================== = 1.09 beta - 2006.01.16 ===========================