From 3447869f21c152bef487863f4047a8e8a510f5ea Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 20 Oct 2022 14:04:43 -0600 Subject: [PATCH] fix for initial value of insert/remove time duration clock --- gtk2_ardour/insert_remove_time_dialog.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/insert_remove_time_dialog.cc b/gtk2_ardour/insert_remove_time_dialog.cc index 89136865d5..342e7d3cb7 100644 --- a/gtk2_ardour/insert_remove_time_dialog.cc +++ b/gtk2_ardour/insert_remove_time_dialog.cc @@ -72,9 +72,15 @@ InsertRemoveTimeDialog::InsertRemoveTimeDialog (PublicEditor& e, bool remove) duration_clock.set_mode (ARDOUR_UI::instance()->primary_clock->mode()); table->attach (duration_clock, 1, 2, 1, 2); - //if a Range is selected, assume the user wants to insert/remove the length of the range - if ( _editor.get_selection().time.length() != 0 ) { - duration_clock.set_duration (_editor.get_selection().time.start_time().distance (_editor.get_selection().time.start_time()), true); + std::cerr << "dist " + << _editor.get_selection().time.start_time().distance (_editor.get_selection().time.start_time()).str() + << " length " + << _editor.get_selection().time.length().str() + << std::endl; + + //if a Range is selected, assume the user wants to insert/remove the length of the range //if a Range is selected, assume the user wants to insert/remove the length of the range + if (!_editor.get_selection().time.length().is_zero ()) { + duration_clock.set_duration (_editor.get_selection().time.length(), true); } else { timepos_t const pos = _editor.get_preferred_edit_position (EDIT_IGNORE_MOUSE); duration_clock.set_duration (timecnt_t (pos));