Implemented an optional line indicating the current video position on the audio (request #542)

Originally committed to SVN as r1712.
This commit is contained in:
Rodrigo Braz Monteiro 2008-01-14 01:18:24 +00:00
parent f939133a36
commit 6116b0af7b
4 changed files with 22 additions and 5 deletions

View File

@ -266,6 +266,15 @@ void AudioDisplay::UpdateImage(bool weak) {
} }
} }
// Draw current frame
if (Options.AsBool(_T("Audio Draw Video Position"))) {
if (VideoContext::Get()->IsLoaded()) {
dc.SetPen(wxPen(Options.AsColour(_T("Audio Play Cursor")),2,wxLONG_DASH));
int x = GetXAtMS(VFR_Output.GetTimeAtFrame(VideoContext::Get()->GetFrameN()));
dc.DrawLine(x,0,x,h);
}
}
// Draw keyframes // Draw keyframes
if (drawKeyframes && VideoContext::Get()->KeyFramesLoaded()) { if (drawKeyframes && VideoContext::Get()->KeyFramesLoaded()) {
DrawKeyframes(dc); DrawKeyframes(dc);

View File

@ -473,11 +473,11 @@ DialogOptions::DialogOptions(wxWindow *parent)
wxFlexGridSizer *displaySizer4 = new wxFlexGridSizer(14,2,2,2); wxFlexGridSizer *displaySizer4 = new wxFlexGridSizer(14,2,2,2);
// First sizer // First sizer
wxString labels1[5] = { _("Draw secondary lines"), _("Draw selection background"), _("Draw timeline"), wxString labels1[6] = { _("Draw secondary lines"), _("Draw selection background"), _("Draw timeline"),
_("Draw cursor time"), _("Draw keyframes") }; _("Draw cursor time"), _("Draw keyframes"), _("Draw video position") };
wxString options1[5] = { _T("Draw Secondary Lines"), _T("Draw Selection Background") , _T("Draw Timeline"), wxString options1[6] = { _T("Draw Secondary Lines"), _T("Draw Selection Background") , _T("Draw Timeline"),
_T("Draw Cursor Time"), _T("Draw keyframes")}; _T("Draw Cursor Time"), _T("Draw keyframes"), _T("Draw video position")};
for (int i=0;i<5;i++) { for (int i=0;i<6;i++) {
wxCheckBox *control = new wxCheckBox(displayPage,-1,labels1[i]); wxCheckBox *control = new wxCheckBox(displayPage,-1,labels1[i]);
Bind(control,_T("Audio ") + options1[i]); Bind(control,_T("Audio ") + options1[i]);
displaySizer3->Add(control,1,wxEXPAND | wxALL,5); displaySizer3->Add(control,1,wxEXPAND | wxALL,5);

View File

@ -260,6 +260,7 @@ void OptionsManager::LoadDefaults(bool onlyDefaults) {
SetBool(_T("Audio Draw Keyframes"), true); SetBool(_T("Audio Draw Keyframes"), true);
SetBool(_T("Audio Draw Timeline"),true); SetBool(_T("Audio Draw Timeline"),true);
SetBool(_T("Audio Draw Cursor Time"),true); SetBool(_T("Audio Draw Cursor Time"),true);
SetBool(_T("Audio Draw Video Position"),true);
SetColour(_T("Audio Selection Background Modified"),wxColour(92,0,0)); SetColour(_T("Audio Selection Background Modified"),wxColour(92,0,0));
SetColour(_T("Audio Selection Background"),wxColour(64,64,64)); SetColour(_T("Audio Selection Background"),wxColour(64,64,64));
SetColour(_T("Audio Seconds Boundaries"),wxColour(0,100,255)); SetColour(_T("Audio Seconds Boundaries"),wxColour(0,100,255));

View File

@ -415,6 +415,13 @@ void VideoContext::UpdateDisplays(bool full) {
//display->Update(); //display->Update();
display->Render(); display->Render();
} }
// Update audio display
if (audio && audio->loaded) {
if (Options.AsBool(_T("Audio Draw Video Position"))) {
audio->UpdateImage(false);
}
}
} }