video-range export tweaks:

* quantize range to video-frame boundaries
* warn if range is empty or does not include video
This commit is contained in:
Robin Gareus 2013-10-12 21:25:05 +02:00
parent a90858897e
commit f7c54f1435
1 changed files with 11 additions and 3 deletions

View File

@ -510,9 +510,8 @@ ExportVideoDialog::launch_export ()
end += av_offset;
}
else if (insnd_combo.get_active_row_number() == 2) {
// TODO quantize to video-frame ?!
start = export_range.start();
end = export_range.end_frame();
start = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(export_range.start());
end = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(export_range.end_frame());
}
if (end <= 0) {
start = _session->current_start_frame();
@ -522,6 +521,15 @@ ExportVideoDialog::launch_export ()
printf("audio export-range %lld -> %lld\n", start, end);
#endif
const frameoffset_t vstart = ARDOUR_UI::instance()->video_timeline->get_offset();
const frameoffset_t vend = vstart + ARDOUR_UI::instance()->video_timeline->get_duration();
if ( (start >= end) || (end < vstart) || (start > vend)) {
warning << _("Export Video: export-range does not include video.") << endmsg;
Gtk::Dialog::response(RESPONSE_CANCEL);
return;
}
tsp->set_range (start, end);
tsp->set_name ("mysession");
tsp->set_range_id ("session");