From 8a8a1b9fb9264d76123cd445b1371185df5e45c2 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 7 Mar 2024 17:24:12 +0100 Subject: [PATCH] Vapor: export file timecode must be < 24h --- gtk2_ardour/simple_export_dialog.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gtk2_ardour/simple_export_dialog.cc b/gtk2_ardour/simple_export_dialog.cc index d09d98f76b..50648e8831 100644 --- a/gtk2_ardour/simple_export_dialog.cc +++ b/gtk2_ardour/simple_export_dialog.cc @@ -270,6 +270,21 @@ SimpleExportDialog::start_export () range_name = SimpleExport::_session->snap_name (); } + samplepos_t rend = (*r)[_range_cols.end]; + samplepos_t t24h; + Timecode::Time tc (SimpleExport::_session->timecode_frames_per_second ()); + tc.hours = 24; + + SimpleExport::_session->timecode_to_sample (tc, t24h, false /* use_offset */, false /* use_subframes */); + + if (rend >= t24h) { + hide (); + std::string txt = _("Error: ADM/BWN files timecode cannot be past 24h."); + Gtk::MessageDialog msg (txt, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); + msg.run (); + return; + } + /* Ensure timespan exists, see also SimpleExport::run_export */ auto ts = _manager->get_timespans (); assert (ts.size () == 1);