Some more tweaks to keyframes

Originally committed to SVN as r575.
This commit is contained in:
Rodrigo Braz Monteiro 2006-12-18 16:20:45 +00:00
parent c55af72ed3
commit b739497bdf
3 changed files with 9 additions and 3 deletions

View file

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

View file

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

View file

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