From b11f76d748a724ed2a8edc7dc9ec0115b675d300 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 16 May 2022 01:03:37 +0200 Subject: [PATCH] Do not select re-imported tracks Stem-export defaults to use selected tracks. This retains the selection, so focus remains. Repeat stem export will use previously exported tracks if the selection is empty, or the current selection (again). --- gtk2_ardour/editor.cc | 3 ++- gtk2_ardour/editor.h | 2 ++ gtk2_ardour/editor_export_audio.cc | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index a820cd0414..e2178153b6 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -438,6 +438,7 @@ Editor::Editor () , autoscroll_cnt (0) , autoscroll_widget (0) , show_gain_after_trim (false) + , _no_not_select_reimported_tracks (false) , selection_op_cmd_depth (0) , selection_op_history_it (0) , no_save_instant (false) @@ -5742,7 +5743,7 @@ Editor::add_stripables (StripableList& sl) * than just VCAs */ - if (!from_scratch && !new_selection.empty()) { + if (!from_scratch && !_no_not_select_reimported_tracks && !new_selection.empty()) { selection->set (new_selection); begin_selection_op_history(); } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 2ca735db58..1724aaf86d 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -2133,6 +2133,8 @@ private: /* audio export */ + bool _no_not_select_reimported_tracks; + enum BounceTarget { NewSource, NewTrigger, diff --git a/gtk2_ardour/editor_export_audio.cc b/gtk2_ardour/editor_export_audio.cc index 27a07f8751..f92bf120ef 100644 --- a/gtk2_ardour/editor_export_audio.cc +++ b/gtk2_ardour/editor_export_audio.cc @@ -34,6 +34,7 @@ #include "pbd/gstdio_compat.h" #include "pbd/pthread_utils.h" +#include "pbd/unwind.h" #include "ardour/audio_track.h" #include "ardour/audiofilesource.h" @@ -83,6 +84,7 @@ void Editor::stem_export () { StemExportDialog dialog (*this); + PBD::Unwinder uw (_no_not_select_reimported_tracks, true); dialog.set_session (_session); dialog.run(); }