mirror of https://github.com/odrling/Aegisub
Audio display now follows the play cursor
Originally committed to SVN as r211.
This commit is contained in:
parent
6f0073536e
commit
a00a45125e
|
@ -1479,19 +1479,42 @@ void AudioDisplay::OnUpdateTimer(wxTimerEvent &event) {
|
||||||
if (curPos > player->GetStartPosition() && curPos < player->GetEndPosition()) {
|
if (curPos > player->GetStartPosition() && curPos < player->GetEndPosition()) {
|
||||||
// Scroll if needed
|
// Scroll if needed
|
||||||
int posX = GetXAtSample(curPos);
|
int posX = GetXAtSample(curPos);
|
||||||
if (posX > w-80) {
|
bool fullDraw = false;
|
||||||
UpdatePosition(curPos - samples/2 - 80,true);
|
bool centerLock = Options.AsBool(_T("Audio lock scroll on cursor"));
|
||||||
|
if (centerLock) {
|
||||||
|
int goTo = MAX(0,curPos - w*samples/2);
|
||||||
|
if (goTo >= 0) {
|
||||||
|
UpdatePosition(goTo,true);
|
||||||
UpdateImage();
|
UpdateImage();
|
||||||
Refresh(true);
|
fullDraw = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (posX < 80 || posX > w-80) {
|
||||||
|
int goTo = MAX(0,curPos - 80*samples);
|
||||||
|
if (goTo >= 0) {
|
||||||
|
UpdatePosition(goTo,true);
|
||||||
|
UpdateImage();
|
||||||
|
fullDraw = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw cursor
|
// Draw cursor
|
||||||
wxMemoryDC src;
|
wxMemoryDC src;
|
||||||
src.SelectObject(*origImage);
|
|
||||||
dc.Blit(oldCurPos,0,1,h,&src,oldCurPos,0);
|
|
||||||
dc.SetPen(wxPen(Options.AsColour(_T("Audio Play cursor"))));
|
|
||||||
curpos = GetXAtSample(curPos);
|
curpos = GetXAtSample(curPos);
|
||||||
|
dc.SetPen(wxPen(Options.AsColour(_T("Audio Play cursor"))));
|
||||||
|
src.SelectObject(*origImage);
|
||||||
|
if (fullDraw) {
|
||||||
|
//dc.Blit(0,0,w,h,&src,0,0);
|
||||||
dc.DrawLine(curpos,0,curpos,h);
|
dc.DrawLine(curpos,0,curpos,h);
|
||||||
|
//dc.Blit(0,0,curpos-10,h,&src,0,0);
|
||||||
|
//dc.Blit(curpos+10,0,w-curpos-10,h,&src,curpos+10,0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dc.Blit(oldCurPos,0,1,h,&src,oldCurPos,0);
|
||||||
|
dc.DrawLine(curpos,0,curpos,h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (curPos > player->GetEndPosition() + 8192) {
|
if (curPos > player->GetEndPosition() + 8192) {
|
||||||
|
|
|
@ -63,7 +63,7 @@ Please visit http://aegisub.net to download latest version
|
||||||
- Select lines dialog now has an option on how to deal with comment lines. (Pomyk)
|
- Select lines dialog now has an option on how to deal with comment lines. (Pomyk)
|
||||||
- Last folder for all the file selection dialogs are now remembered in config.dat. (Pomyk)
|
- Last folder for all the file selection dialogs are now remembered in config.dat. (Pomyk)
|
||||||
- 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.
|
- Removed video frame/subtitles time sync controls from the grid context menu. (AMZ)
|
||||||
|
|
||||||
|
|
||||||
= 1.09 beta - 2006.01.16 ===========================
|
= 1.09 beta - 2006.01.16 ===========================
|
||||||
|
|
|
@ -174,6 +174,7 @@ void OptionsManager::LoadDefaults() {
|
||||||
SetInt(_T("Audio Display Height"),100);
|
SetInt(_T("Audio Display Height"),100);
|
||||||
SetInt(_T("Timing Default Duration"), 2000);
|
SetInt(_T("Timing Default Duration"), 2000);
|
||||||
SetBool(_T("Audio Wheel Default To Zoom"),false);
|
SetBool(_T("Audio Wheel Default To Zoom"),false);
|
||||||
|
SetBool(_T("Audio lock scroll on cursor"),false);
|
||||||
|
|
||||||
SetBool(_T("Audio Spectrum"),false);
|
SetBool(_T("Audio Spectrum"),false);
|
||||||
SetInt(_T("Audio Spectrum Cutoff"),32);
|
SetInt(_T("Audio Spectrum Cutoff"),32);
|
||||||
|
|
Loading…
Reference in New Issue