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;
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

View file

@ -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;

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)
- 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 ===========================