Stem-export: pre-select selected tracks/busses

This commit is contained in:
Robin Gareus 2019-10-07 15:19:36 +02:00
parent ce7d128c8a
commit e6ab652e74
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 8 additions and 5 deletions

View file

@ -36,6 +36,7 @@
#include "ardour/io.h" #include "ardour/io.h"
#include "ardour/route.h" #include "ardour/route.h"
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/selection.h"
#include "export_channel_selector.h" #include "export_channel_selector.h"
#include "route_sorter.h" #include "route_sorter.h"
@ -700,6 +701,8 @@ TrackExportChannelSelector::fill_list()
track_list->clear(); track_list->clear();
RouteList routes = _session->get_routelist(); RouteList routes = _session->get_routelist();
CoreSelection const& cs (_session->selection());
for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) { for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
if (!boost::dynamic_pointer_cast<Track>(*it)) { if (!boost::dynamic_pointer_cast<Track>(*it)) {
// not a track, must be a bus // not a track, must be a bus
@ -712,7 +715,7 @@ TrackExportChannelSelector::fill_list()
} }
// not monitor or master bus // not monitor or master bus
add_track (*it); add_track (*it, cs.selected (*it));
} }
} }
for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) { for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
@ -721,18 +724,18 @@ TrackExportChannelSelector::fill_list()
// don't include inactive tracks // don't include inactive tracks
continue; continue;
} }
add_track (*it); add_track (*it, cs.selected (*it));
} }
} }
} }
void void
TrackExportChannelSelector::add_track (boost::shared_ptr<Route> route) TrackExportChannelSelector::add_track (boost::shared_ptr<Route> route, bool selected)
{ {
Gtk::TreeModel::iterator iter = track_list->append(); Gtk::TreeModel::iterator iter = track_list->append();
Gtk::TreeModel::Row row = *iter; Gtk::TreeModel::Row row = *iter;
row[track_cols.selected] = false; row[track_cols.selected] = selected;
row[track_cols.label] = route->name(); row[track_cols.label] = route->name();
row[track_cols.route] = route; row[track_cols.route] = route;
row[track_cols.order_key] = route->presentation_info().order(); row[track_cols.order_key] = route->presentation_info().order();

View file

@ -256,7 +256,7 @@ class TrackExportChannelSelector : public ExportChannelSelector
private: private:
void fill_list(); void fill_list();
void add_track (boost::shared_ptr<ARDOUR::Route> route); void add_track (boost::shared_ptr<ARDOUR::Route> route, bool selected);
void update_config(); void update_config();
ChannelConfigList configs; ChannelConfigList configs;