From 6f0073536e8960dc158dab4e7cbb39c213a8349b Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Sun, 5 Mar 2006 23:01:02 +0000 Subject: [PATCH] Audio current play position cursor will now always be visible. Removed video frame/subtitles time sync controls from the grid context menu. Originally committed to SVN as r210. --- core/audio_display.cpp | 38 +++++++++++++++++++++++++++++--------- core/changelog.txt | 2 ++ core/subs_grid.cpp | 12 ++++++------ 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/core/audio_display.cpp b/core/audio_display.cpp index 7b44ca0e2..425294a46 100644 --- a/core/audio_display.cpp +++ b/core/audio_display.cpp @@ -1470,25 +1470,45 @@ void AudioDisplay::OnUpdateTimer(wxTimerEvent &event) { // Get DCs //wxMutexGuiEnter(); wxClientDC dc(this); - wxMemoryDC src; - src.SelectObject(*origImage); dc.BeginDrawing(); - // Restore background - dc.Blit(oldCurPos,0,1,h,&src,oldCurPos,0); - // Draw cursor int curpos = -1; if (player->IsPlaying()) { - if (player->GetCurrentPosition() > player->GetStartPosition() && player->GetCurrentPosition() < player->GetEndPosition()) { + __int64 curPos = player->GetCurrentPosition(); + if (curPos > player->GetStartPosition() && curPos < player->GetEndPosition()) { + // Scroll if needed + int posX = GetXAtSample(curPos); + if (posX > w-80) { + UpdatePosition(curPos - samples/2 - 80,true); + UpdateImage(); + Refresh(true); + } + + // Draw cursor + 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(player->GetCurrentPosition()); + curpos = GetXAtSample(curPos); dc.DrawLine(curpos,0,curpos,h); } - else if (player->GetCurrentPosition() > player->GetEndPosition() + 8192) { - player->Stop(); + else { + if (curPos > player->GetEndPosition() + 8192) { + player->Stop(); + } + wxMemoryDC src; + src.SelectObject(*origImage); + dc.Blit(oldCurPos,0,1,h,&src,oldCurPos,0); } } + + // Restore background + else { + wxMemoryDC src; + src.SelectObject(*origImage); + dc.Blit(oldCurPos,0,1,h,&src,oldCurPos,0); + } oldCurPos = curpos; // Done diff --git a/core/changelog.txt b/core/changelog.txt index a7ba62713..f769d2287 100644 --- a/core/changelog.txt +++ b/core/changelog.txt @@ -62,6 +62,8 @@ Please visit http://aegisub.net to download latest version - Scrollbar and sliders in audio box can no longer receive focus. (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) +- Audio current play position cursor will now always be visible. (AMZ) +- Removed video frame/subtitles time sync controls from the grid context menu. = 1.09 beta - 2006.01.16 =========================== diff --git a/core/subs_grid.cpp b/core/subs_grid.cpp index 6afa3452e..d437e5d18 100644 --- a/core/subs_grid.cpp +++ b/core/subs_grid.cpp @@ -126,12 +126,12 @@ void SubtitlesGrid::OnPopupMenu() { menu.AppendSeparator(); // Video/time sync - state = (video && video->loaded); - menu.Append(MENU_SET_VIDEO_TO_START,_("Jump video to start"),_T("Sets current video time to start time"))->Enable(state); - menu.Append(MENU_SET_VIDEO_TO_END,_("Jump video to end"),_T("Sets current video time to end time"))->Enable(state); - menu.Append(MENU_SET_START_TO_VIDEO,_("Set start to video"),_T("Sets start times to current video time"))->Enable(state); - menu.Append(MENU_SET_END_TO_VIDEO,_("Set end to video"),_T("Sets end times to current video time"))->Enable(state); - menu.AppendSeparator(); + //state = (video && video->loaded); + //menu.Append(MENU_SET_VIDEO_TO_START,_("Jump video to start"),_T("Sets current video time to start time"))->Enable(state); + //menu.Append(MENU_SET_VIDEO_TO_END,_("Jump video to end"),_T("Sets current video time to end time"))->Enable(state); + //menu.Append(MENU_SET_START_TO_VIDEO,_("Set start to video"),_T("Sets start times to current video time"))->Enable(state); + //menu.Append(MENU_SET_END_TO_VIDEO,_("Set end to video"),_T("Sets end times to current video time"))->Enable(state); + //menu.AppendSeparator(); // Duplicate selection menu.Append(MENU_DUPLICATE,_("&Duplicate"),_T("Duplicate the selected lines"))->Enable(continuous);