X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fexport_channel_selector.cc;h=347882501c5959892859ba18593bd07bb26114e0;hb=1d28665f86de13de27cfdde2e16e015a73bbb698;hp=baef41e1ae30fc6f1d587355d6aedb81efaf83ad;hpb=925501c851661d612bbc1b0f0b545c9fc8897213;p=ardour.git diff --git a/gtk2_ardour/export_channel_selector.cc b/gtk2_ardour/export_channel_selector.cc index baef41e1ae..347882501c 100644 --- a/gtk2_ardour/export_channel_selector.cc +++ b/gtk2_ardour/export_channel_selector.cc @@ -18,8 +18,6 @@ */ -#include "export_channel_selector.h" - #include #include "pbd/convert.h" @@ -33,19 +31,16 @@ #include -#include "i18n.h" +#include "export_channel_selector.h" +#include "route_sorter.h" + +#include "pbd/i18n.h" using namespace std; using namespace Glib; using namespace ARDOUR; using namespace PBD; -struct EditorOrderRouteSorter { - bool operator() (boost::shared_ptr a, boost::shared_ptr b) { - return a->order_key () < b->order_key (); - } -}; - PortExportChannelSelector::PortExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager) : ExportChannelSelector (session, manager), channels_label (_("Channels:"), Gtk::ALIGN_LEFT), @@ -108,7 +103,7 @@ PortExportChannelSelector::sync_with_manager () * fill_route_list () -> update_channel_count () -> set_channel_count () -> update_config() * will call config->clear_channels(); and clear the config */ - channel_view.set_config (0); + channel_view.set_config (ChannelConfigPtr ()); fill_route_list (); channel_view.set_config (state->config); } @@ -126,7 +121,7 @@ PortExportChannelSelector::fill_route_list () channel_view.add_route (master); } - routes.sort (EditorOrderRouteSorter ()); + routes.sort (Stripable::Sorter ()); for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) { if ((*it)->is_master () || (*it)->is_monitor ()) { @@ -700,7 +695,7 @@ TrackExportChannelSelector::add_track (boost::shared_ptr route) row[track_cols.selected] = false; row[track_cols.label] = route->name(); row[track_cols.route] = route; - row[track_cols.order_key] = route->order_key(); + row[track_cols.order_key] = route->presentation_info().order(); } void @@ -715,7 +710,7 @@ TrackExportChannelSelector::update_config() continue; } - ExportProfileManager::ChannelConfigStatePtr state = manager->add_channel_config(); + ExportProfileManager::ChannelConfigStatePtr state; boost::shared_ptr route = row[track_cols.route]; @@ -727,16 +722,25 @@ TrackExportChannelSelector::update_config() ExportChannelPtr channel (new PortExportChannel ()); PortExportChannel * pec = static_cast (channel.get()); pec->add_port(port); + if (!state) { + state = manager->add_channel_config(); + } state->config->register_channel(channel); } } } else { std::list list; RouteExportChannel::create_from_route (list, route); + if (list.size () == 0) { + continue; + } + state = manager->add_channel_config(); state->config->register_channels (list); } - state->config->set_name (route->name()); + if (state) { + state->config->set_name (route->name()); + } }