summaryrefslogtreecommitdiff
path: root/gtk2_ardour/export_channel_selector.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-07-19 02:10:27 +0200
committerRobin Gareus <robin@gareus.org>2019-07-19 02:14:09 +0200
commit35066002709e1877e9b4401f6ad8cb0b49577241 (patch)
treea897695e447531cf7b1ff174400048712914c34e /gtk2_ardour/export_channel_selector.cc
parent0d1d6d69758c034363a96df2a2d66f4a2bd90cad (diff)
Refine Stem-Export selection options
Allow to exclude muted, or hidden tracks from stem-export selection actions.
Diffstat (limited to 'gtk2_ardour/export_channel_selector.cc')
-rw-r--r--gtk2_ardour/export_channel_selector.cc70
1 files changed, 54 insertions, 16 deletions
diff --git a/gtk2_ardour/export_channel_selector.cc b/gtk2_ardour/export_channel_selector.cc
index a17cfbaf3a..14053f9eb0 100644
--- a/gtk2_ardour/export_channel_selector.cc
+++ b/gtk2_ardour/export_channel_selector.cc
@@ -19,6 +19,9 @@
*/
#include <algorithm>
+#include <sstream>
+
+#include <gtkmm/menu.h>
#include "pbd/convert.h"
@@ -29,8 +32,6 @@
#include "ardour/route.h"
#include "ardour/session.h"
-#include <sstream>
-
#include "export_channel_selector.h"
#include "route_sorter.h"
@@ -547,18 +548,37 @@ RegionExportChannelSelector::handle_selection ()
TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager)
: ExportChannelSelector(session, manager)
, track_output_button(_("Apply track/bus processing"))
- , select_tracks_button (_("Select all tracks"))
- , select_busses_button (_("Select all busses"))
- , select_none_button (_("Deselect all"))
{
pack_start(main_layout);
+ // Populate Selection Menu
+ {
+ using namespace Gtk::Menu_Helpers;
+
+ select_menu.set_text (_("Selection Actions"));
+ select_menu.disable_scrolling ();
+
+ select_menu.AddMenuElem (MenuElem (_("Select tracks"), sigc::mem_fun (*this, &TrackExportChannelSelector::select_tracks)));
+ select_menu.AddMenuElem (MenuElem (_("Select busses"), sigc::mem_fun (*this, &TrackExportChannelSelector::select_busses)));
+ select_menu.AddMenuElem (MenuElem (_("Deselect all"), sigc::mem_fun (*this, &TrackExportChannelSelector::select_none)));
+ select_menu.AddMenuElem (SeparatorElem ());
+
+ exclude_hidden = new Gtk::CheckMenuItem (_("Exclude Hidden"));
+ exclude_hidden->set_active (false);
+ exclude_hidden->show();
+ select_menu.AddMenuElem (*exclude_hidden);
+
+ exclude_muted = new Gtk::CheckMenuItem (_("Exclude Muted"));
+ exclude_muted->set_active (true);
+ exclude_muted->show();
+ select_menu.AddMenuElem (*exclude_muted);
+ }
+
// Options
- options_box.pack_start(track_output_button);
- options_box.pack_start (select_tracks_button);
- options_box.pack_start (select_busses_button);
- options_box.pack_start (select_none_button);
- main_layout.pack_start(options_box, false, false);
+ options_box.set_spacing (8);
+ options_box.pack_start (track_output_button, false, false);
+ options_box.pack_start (select_menu, false, false);
+ main_layout.pack_start (options_box, false, false);
// Track scroller
track_scroller.add (track_view);
@@ -589,10 +609,6 @@ TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * sessio
column->pack_start (*text_renderer, false);
column->add_attribute (text_renderer->property_text(), track_cols.label);
- select_tracks_button.signal_clicked().connect (sigc::mem_fun (*this, &TrackExportChannelSelector::select_tracks));
- select_busses_button.signal_clicked().connect (sigc::mem_fun (*this, &TrackExportChannelSelector::select_busses));
- select_none_button.signal_clicked().connect (sigc::mem_fun (*this, &TrackExportChannelSelector::select_none));
-
track_output_button.signal_clicked().connect (sigc::mem_fun (*this, &TrackExportChannelSelector::track_outputs_selected));
fill_list();
@@ -600,6 +616,12 @@ TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * sessio
show_all_children ();
}
+TrackExportChannelSelector::~TrackExportChannelSelector ()
+{
+ delete exclude_hidden;
+ delete exclude_muted;
+}
+
void
TrackExportChannelSelector::sync_with_manager ()
{
@@ -610,11 +632,19 @@ TrackExportChannelSelector::sync_with_manager ()
void
TrackExportChannelSelector::select_tracks ()
{
+ bool excl_hidden = exclude_hidden->get_active ();
+ bool excl_muted = exclude_muted->get_active ();
+
for (Gtk::ListStore::Children::iterator it = track_list->children().begin(); it != track_list->children().end(); ++it) {
Gtk::TreeModel::Row row = *it;
boost::shared_ptr<Route> route = row[track_cols.route];
if (boost::dynamic_pointer_cast<Track> (route)) {
- // it's a track
+ if (excl_muted && route->muted ()) {
+ continue;
+ }
+ if (excl_hidden && route->is_hidden ()) {
+ continue;
+ }
row[track_cols.selected] = true;
}
}
@@ -624,11 +654,19 @@ TrackExportChannelSelector::select_tracks ()
void
TrackExportChannelSelector::select_busses ()
{
+ bool excl_hidden = exclude_hidden->get_active ();
+ bool excl_muted = exclude_muted->get_active ();
+
for (Gtk::ListStore::Children::iterator it = track_list->children().begin(); it != track_list->children().end(); ++it) {
Gtk::TreeModel::Row row = *it;
boost::shared_ptr<Route> route = row[track_cols.route];
if (!boost::dynamic_pointer_cast<Track> (route)) {
- // it's not a track, must be a bus
+ if (excl_muted && route->muted ()) {
+ continue;
+ }
+ if (excl_hidden && route->is_hidden ()) {
+ continue;
+ }
row[track_cols.selected] = true;
}
}