+ time_label = manage (new Label (remove ? _("Time to remove:") : _("Time to insert:")));
+ time_label->set_alignment (1, 0.5);
+ table->attach (*time_label, 0, 1, 1, 2, FILL | EXPAND);
+ duration_clock.set_session (_session);
+ duration_clock.set_mode (ARDOUR_UI::instance()->secondary_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 ) {
+ position_clock.set ( _editor.get_selection().time.start(), true );
+ duration_clock.set ( _editor.get_selection().time.end_frame(), true, _editor.get_selection().time.start() );
+ duration_clock.set_bbt_reference (_editor.get_selection().time.start());
+ } else {
+ framepos_t const pos = _editor.get_preferred_edit_position (EDIT_IGNORE_MOUSE);
+ position_clock.set ( pos, true );
+ duration_clock.set_bbt_reference (pos);
+ duration_clock.set (0);
+ }
+