From b739497bdffde9e6ce7c3e69e83d25ce58ef5d91 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Mon, 18 Dec 2006 16:20:45 +0000 Subject: [PATCH] Some more tweaks to keyframes Originally committed to SVN as r575. --- core/audio_display.cpp | 2 +- core/dialog_timing_processor.cpp | 4 ++-- core/frame_main_events.cpp | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/audio_display.cpp b/core/audio_display.cpp index fc6caf630..bb00f6f42 100644 --- a/core/audio_display.cpp +++ b/core/audio_display.cpp @@ -231,7 +231,7 @@ void AudioDisplay::UpdateImage(bool weak) { } // Draw keyframes - if (video->loaded && draw_boundary_lines) { + if (video->KeyFramesLoaded() && draw_boundary_lines) { wxArrayInt KeyFrames = video->GetKeyFrames(); int nKeys = (int)KeyFrames.Count(); dc.SetPen(wxPen(wxColour(255,0,255),1)); diff --git a/core/dialog_timing_processor.cpp b/core/dialog_timing_processor.cpp index 99fbebc23..aefbdf340 100644 --- a/core/dialog_timing_processor.cpp +++ b/core/dialog_timing_processor.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2005, Rodrigo Braz Monteiro +// Copyright (c) 2006, Rodrigo Braz Monteiro // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -197,7 +197,7 @@ void DialogTimingProcessor::UpdateControls() { adjascentThres->Enable(adjsEnable->IsChecked()); // Keyframes are only available if timecodes are loaded - bool keysAvailable = VFR_Output.IsLoaded(); + bool keysAvailable = grid->video->KeyFramesLoaded(); bool enableKeys = keysEnable->IsChecked() && keysAvailable; keysStartBefore->Enable(enableKeys); keysStartAfter->Enable(enableKeys); diff --git a/core/frame_main_events.cpp b/core/frame_main_events.cpp index 98dbe3c48..e9a81cde1 100644 --- a/core/frame_main_events.cpp +++ b/core/frame_main_events.cpp @@ -635,6 +635,7 @@ void FrameMain::OnCloseVFR(wxCommandEvent &event) { void FrameMain::OnOpenKeyframes (wxCommandEvent &event) { // Pick file wxString filename = wxFileSelector(_T("Select the Keyframes file to open"),_T(""),_T(""),_T(".txt"),_T("Text files (*.txt)|*.txt"),wxFILE_MUST_EXIST | wxOPEN); + if (filename.IsEmpty()) return; // Open file wxArrayInt keyFrames; @@ -664,7 +665,11 @@ void FrameMain::OnOpenKeyframes (wxCommandEvent &event) { if (!videoBox->videoDisplay->loaded) { videoBox->videoDisplay->fps = fps; VFR_Input.SetCFR(fps); + if (!VFR_Output.IsLoaded()) VFR_Output.SetCFR(fps); } + + // Refresh display + Refresh(); } @@ -680,6 +685,7 @@ void FrameMain::OnCloseKeyframes (wxCommandEvent &event) { void FrameMain::OnSaveKeyframes (wxCommandEvent &event) { // Pick file wxString filename = wxFileSelector(_T("Select the Keyframes file to open"),_T(""),_T(""),_T("*.key.txt"),_T("Text files (*.txt)|*.txt"),wxOVERWRITE_PROMPT | wxSAVE); + if (filename.IsEmpty()) return; // Get keyframes wxArrayInt keyFrames = videoBox->videoDisplay->GetKeyFrames();