2 * Copyright (C) 2008-2013 Sakari Bergen <sakari.bergen@beatwaves.net>
3 * Copyright (C) 2008-2016 Paul Davis <paul@linuxaudiosystems.com>
4 * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
5 * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
6 * Copyright (C) 2013-2015 Colin Fletcher <colin.m.fletcher@googlemail.com>
7 * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
8 * Copyright (C) 2015 Ben Loftis <ben@harrisonconsoles.com>
9 * Copyright (C) 2015 Nick Mainsbridge <mainsbridge@gmail.com>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #include <gtkmm/menu.h>
31 #include "pbd/convert.h"
33 #include "ardour/audio_track.h"
34 #include "ardour/audioregion.h"
35 #include "ardour/export_channel_configuration.h"
36 #include "ardour/io.h"
37 #include "ardour/route.h"
38 #include "ardour/session.h"
39 #include "ardour/selection.h"
41 #include "export_channel_selector.h"
42 #include "route_sorter.h"
48 using namespace ARDOUR;
51 PortExportChannelSelector::PortExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager) :
52 ExportChannelSelector (session, manager),
53 channels_label (_("Channels:"), Gtk::ALIGN_LEFT),
54 split_checkbox (_("Split to mono files")),
56 channel_view (max_channels)
58 channels_hbox.pack_start (channels_label, false, false, 0);
59 channels_hbox.pack_end (channels_spinbutton, false, false, 0);
61 channels_vbox.pack_start (channels_hbox, false, false, 0);
62 channels_vbox.pack_start (split_checkbox, false, false, 6);
64 channel_alignment.add (channel_scroller);
65 channel_alignment.set_padding (0, 0, 12, 0);
66 channel_scroller.add (channel_view);
67 channel_scroller.set_size_request (-1, 130);
68 channel_scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
70 pack_start (channels_vbox, false, false, 0);
71 pack_start (channel_alignment, true, true, 0);
73 /* Channels spinbutton */
75 channels_spinbutton.set_digits (0);
76 channels_spinbutton.set_increments (1, 2);
77 channels_spinbutton.set_range (1, max_channels);
78 channels_spinbutton.set_value (2);
80 channels_spinbutton.signal_value_changed().connect (sigc::mem_fun (*this, &PortExportChannelSelector::update_channel_count));
84 split_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &PortExportChannelSelector::update_split_state));
85 channel_view.CriticalSelectionChanged.connect (CriticalSelectionChanged.make_slot());
94 PortExportChannelSelector::~PortExportChannelSelector ()
99 PortExportChannelSelector::sync_with_manager ()
101 state = manager->get_channel_configs().front();
103 split_checkbox.set_active (state->config->get_split());
104 channels_spinbutton.set_value (state->config->get_n_chans());
106 /* when loading presets, config is ready set here (shared ptr)
107 * fill_route_list () -> update_channel_count () -> set_channel_count () -> update_config()
108 * will call config->clear_channels(); and clear the config
110 channel_view.set_config (ChannelConfigPtr ());
112 channel_view.set_config (state->config);
116 PortExportChannelSelector::fill_route_list ()
118 channel_view.clear_routes ();
119 RouteList routes = _session->get_routelist();
121 /* Add master bus and then everything else */
123 if (_session->master_out()) {
124 ARDOUR::IO* master = _session->master_out()->output().get();
125 channel_view.add_route (master);
128 routes.sort (Stripable::Sorter ());
130 for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
131 if ((*it)->is_master () || (*it)->is_monitor ()) {
134 channel_view.add_route ((*it)->output().get());
137 update_channel_count ();
141 PortExportChannelSelector::update_channel_count ()
143 uint32_t chans = static_cast<uint32_t> (channels_spinbutton.get_value());
144 channel_view.set_channel_count (chans);
145 CriticalSelectionChanged();
149 PortExportChannelSelector::update_split_state ()
151 state->config->set_split (split_checkbox.get_active());
152 CriticalSelectionChanged();
156 PortExportChannelSelector::RouteCols::add_channels (uint32_t chans)
159 channels.push_back (Channel (*this));
165 PortExportChannelSelector::RouteCols::Channel &
166 PortExportChannelSelector::RouteCols::get_channel (uint32_t channel)
168 if (channel > n_channels) {
169 std::cout << "Invalid channel count for get_channel!" << std::endl;
172 std::list<Channel>::iterator it = channels.begin();
174 while (channel > 1) { // Channel count starts from one!
182 PortExportChannelSelector::ChannelTreeView::ChannelTreeView (uint32_t max_channels) :
187 route_cols.add_channels (max_channels);
189 route_list = Gtk::ListStore::create(route_cols);
190 set_model (route_list);
192 /* Add column with toggle and text */
194 append_column_editable (_("Export"), route_cols.selected);
196 Gtk::CellRendererText* text_renderer = Gtk::manage (new Gtk::CellRendererText);
197 text_renderer->property_editable() = false;
198 text_renderer->set_alignment (0.0, 0.5);
200 Gtk::TreeView::Column* column = Gtk::manage (new Gtk::TreeView::Column);
201 column->set_title (_("Bus or Track"));
202 column->pack_start (*text_renderer);
203 column->set_expand (true);
204 column->add_attribute (text_renderer->property_text(), route_cols.name);
205 append_column (*column);
207 Gtk::CellRendererToggle *toggle = dynamic_cast<Gtk::CellRendererToggle *>(get_column_cell_renderer (0));
208 toggle->set_alignment (0.0, 0.5);
209 toggle->signal_toggled().connect (sigc::mem_fun (*this, &PortExportChannelSelector::ChannelTreeView::update_toggle_selection));
211 static_columns = get_columns().size();
215 PortExportChannelSelector::ChannelTreeView::set_config (ChannelConfigPtr c)
217 /* TODO Without the following line, the state might get reset.
218 * Pointing to the same address does not mean the state of the configuration hasn't changed.
219 * In the current code this is safe, but the actual cause of the problem would be good to fix
222 if (config == c) { return; }
224 if (!config) { return; }
227 ExportChannelConfiguration::ChannelList chan_list = config->get_channels();
228 for (ExportChannelConfiguration::ChannelList::iterator c_it = chan_list.begin(); c_it != chan_list.end(); ++c_it) {
230 for (Gtk::ListStore::Children::iterator r_it = route_list->children().begin(); r_it != route_list->children().end(); ++r_it) {
232 ARDOUR::PortExportChannel * pec;
233 if (!(pec = dynamic_cast<ARDOUR::PortExportChannel *> (c_it->get()))) {
237 Glib::RefPtr<Gtk::ListStore> port_list = r_it->get_value (route_cols.port_list_col);
238 std::set<boost::weak_ptr<AudioPort> > route_ports;
239 std::set<boost::weak_ptr<AudioPort> > intersection;
240 std::map<boost::weak_ptr<AudioPort>, string> port_labels;
242 for (Gtk::ListStore::Children::const_iterator p_it = port_list->children().begin(); p_it != port_list->children().end(); ++p_it) {
243 route_ports.insert ((*p_it)->get_value (route_cols.port_cols.port));
244 port_labels.insert (make_pair ((*p_it)->get_value (route_cols.port_cols.port),
245 (*p_it)->get_value (route_cols.port_cols.label)));
248 std::set_intersection (pec->get_ports().begin(), pec->get_ports().end(),
249 route_ports.begin(), route_ports.end(),
250 std::insert_iterator<std::set<boost::weak_ptr<AudioPort> > > (intersection, intersection.begin()));
252 intersection.erase (boost::weak_ptr<AudioPort> ()); // Remove "none" selection
254 if (intersection.empty()) {
258 if (!r_it->get_value (route_cols.selected)) {
259 r_it->set_value (route_cols.selected, true);
261 /* Set previous channels (if any) to none */
263 for (uint32_t chn = 1; chn < i; ++chn) {
264 r_it->set_value (route_cols.get_channel (chn).port, boost::weak_ptr<AudioPort> ());
265 r_it->set_value (route_cols.get_channel (chn).label, string ("(none)"));
269 boost::weak_ptr<AudioPort> port = *intersection.begin();
270 std::map<boost::weak_ptr<AudioPort>, string>::iterator label_it = port_labels.find (port);
271 string label = label_it != port_labels.end() ? label_it->second : "error";
273 r_it->set_value (route_cols.get_channel (i).port, port);
274 r_it->set_value (route_cols.get_channel (i).label, label);
282 PortExportChannelSelector::ChannelTreeView::add_route (ARDOUR::IO * io)
284 Gtk::TreeModel::iterator iter = route_list->append();
285 Gtk::TreeModel::Row row = *iter;
287 row[route_cols.selected] = false;
288 row[route_cols.name] = io->name();
289 row[route_cols.io] = io;
291 /* Initialize port list */
293 Glib::RefPtr<Gtk::ListStore> port_list = Gtk::ListStore::create (route_cols.port_cols);
294 row[route_cols.port_list_col] = port_list;
296 uint32_t outs = io->n_ports().n_audio();
297 for (uint32_t i = 0; i < outs; ++i) {
298 iter = port_list->append();
301 row[route_cols.port_cols.selected] = false;
302 row[route_cols.port_cols.port] = io->audio (i);
304 std::ostringstream oss;
305 oss << "Out-" << (i + 1);
307 row[route_cols.port_cols.label] = oss.str();
310 iter = port_list->append();
313 row[route_cols.port_cols.selected] = false;
314 row[route_cols.port_cols.port] = boost::weak_ptr<AudioPort> ();
315 row[route_cols.port_cols.label] = "(none)";
320 PortExportChannelSelector::ChannelTreeView::set_channel_count (uint32_t channels)
322 int offset = channels - n_channels;
327 std::ostringstream oss;
332 Gtk::TreeView::Column* column = Gtk::manage (new Gtk::TreeView::Column (oss.str()));
334 Gtk::CellRendererCombo* combo_renderer = Gtk::manage (new Gtk::CellRendererCombo);
335 combo_renderer->property_text_column() = 2;
336 combo_renderer->property_has_entry() = false;
337 column->pack_start (*combo_renderer);
339 append_column (*column);
341 column->add_attribute (combo_renderer->property_text(), route_cols.get_channel(n_channels).label);
342 column->add_attribute (combo_renderer->property_model(), route_cols.port_list_col);
343 column->add_attribute (combo_renderer->property_editable(), route_cols.selected);
345 combo_renderer->signal_edited().connect (sigc::bind (sigc::mem_fun (*this, &PortExportChannelSelector::ChannelTreeView::update_selection_text), n_channels));
347 /* put data into view */
349 for (Gtk::ListStore::Children::iterator it = route_list->children().begin(); it != route_list->children().end(); ++it) {
350 std::string label = it->get_value(route_cols.selected) ? "(none)" : "";
351 it->set_value (route_cols.get_channel (n_channels).label, label);
352 it->set_value (route_cols.get_channel (n_channels).port, boost::weak_ptr<AudioPort> ());
355 /* set column width */
357 get_column (static_columns + n_channels - 1)->set_min_width (80);
365 remove_column (*get_column (n_channels + static_columns));
374 PortExportChannelSelector::ChannelTreeView::update_config ()
376 if (!config) { return; }
378 config->clear_channels();
380 for (uint32_t i = 1; i <= n_channels; ++i) {
382 ExportChannelPtr channel (new PortExportChannel ());
383 PortExportChannel * pec = static_cast<PortExportChannel *> (channel.get());
385 for (Gtk::ListStore::Children::iterator it = route_list->children().begin(); it != route_list->children().end(); ++it) {
386 Gtk::TreeModel::Row row = *it;
388 if (!row[route_cols.selected]) {
392 boost::weak_ptr<AudioPort> weak_port = row[route_cols.get_channel (i).port];
393 boost::shared_ptr<AudioPort> port = weak_port.lock ();
395 pec->add_port (port);
399 config->register_channel (channel);
402 CriticalSelectionChanged ();
406 PortExportChannelSelector::ChannelTreeView::update_toggle_selection (std::string const & path)
408 Gtk::TreeModel::iterator iter = get_model ()->get_iter (path);
409 bool selected = iter->get_value (route_cols.selected);
411 for (uint32_t i = 1; i <= n_channels; ++i) {
414 iter->set_value (route_cols.get_channel (i).label, std::string (""));
418 iter->set_value (route_cols.get_channel (i).label, std::string("(none)"));
419 iter->set_value (route_cols.get_channel (i).port, boost::weak_ptr<AudioPort> ());
421 Glib::RefPtr<Gtk::ListStore> port_list = iter->get_value (route_cols.port_list_col);
422 Gtk::ListStore::Children::iterator port_it;
423 uint32_t port_number = 1;
425 for (port_it = port_list->children().begin(); port_it != port_list->children().end(); ++port_it) {
426 if (port_number == i) {
427 iter->set_value (route_cols.get_channel (i).label, (std::string) (*port_it)->get_value (route_cols.port_cols.label));
428 iter->set_value (route_cols.get_channel (i).port, (*port_it)->get_value (route_cols.port_cols.port));
439 PortExportChannelSelector::ChannelTreeView::update_selection_text (std::string const & path, std::string const & new_text, uint32_t channel)
441 Gtk::TreeModel::iterator iter = get_model ()->get_iter (path);
442 iter->set_value (route_cols.get_channel (channel).label, new_text);
444 Glib::RefPtr<Gtk::ListStore> port_list = iter->get_value (route_cols.port_list_col);
445 Gtk::ListStore::Children::iterator port_it;
447 for (port_it = port_list->children().begin(); port_it != port_list->children().end(); ++port_it) {
448 std::string label = port_it->get_value (route_cols.port_cols.label);
449 if (label == new_text) {
450 boost::weak_ptr<AudioPort> w = (*port_it)[route_cols.port_cols.port];
451 iter->set_value (route_cols.get_channel (channel).port, w);
458 RegionExportChannelSelector::RegionExportChannelSelector (ARDOUR::Session * _session,
459 ProfileManagerPtr manager,
460 ARDOUR::AudioRegion const & region,
461 ARDOUR::AudioTrack & track) :
462 ExportChannelSelector (_session, manager),
465 region_chans (region.n_channels()),
466 track_chans (track.n_outputs().n_audio()),
468 raw_button (type_group),
469 fades_button (type_group),
470 processed_button (type_group)
474 /* make fades+region gain be the default */
476 fades_button.set_active ();
478 raw_button.set_label (string_compose (_("Region contents without fades nor region gain (channels: %1)"), region_chans));
479 raw_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
480 vbox.pack_start (raw_button, false, false);
482 fades_button.set_label (string_compose (_("Region contents with fades and region gain (channels: %1)"), region_chans));
483 fades_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
484 vbox.pack_start (fades_button, false, false);
486 processed_button.set_label (string_compose (_("Track output (channels: %1)"), track_chans));
487 processed_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
488 vbox.pack_start (processed_button, false, false);
491 vbox.show_all_children ();
492 show_all_children ();
496 RegionExportChannelSelector::sync_with_manager ()
498 state = manager->get_channel_configs().front();
500 if (!state) { return; }
502 switch (state->config->region_processing_type()) {
503 case RegionExportChannelFactory::None:
506 case RegionExportChannelFactory::Raw:
507 raw_button.set_active (true);
509 case RegionExportChannelFactory::Fades:
510 fades_button.set_active (true);
512 case RegionExportChannelFactory::Processed:
513 processed_button.set_active (true);
521 RegionExportChannelSelector::handle_selection ()
527 state->config->clear_channels ();
529 RegionExportChannelFactory::Type type = RegionExportChannelFactory::None;
530 if (raw_button.get_active ()) {
531 type = RegionExportChannelFactory::Raw;
532 } else if (fades_button.get_active ()) {
533 type = RegionExportChannelFactory::Fades;
534 } else if (processed_button.get_active ()) {
535 type = RegionExportChannelFactory::Processed;
537 CriticalSelectionChanged ();
541 factory.reset (new RegionExportChannelFactory (_session, region, track, type));
542 state->config->set_region_processing_type (type);
544 const size_t cc = type == RegionExportChannelFactory::Processed ? track_chans : region_chans;
545 for (size_t chan = 0; chan < cc; ++chan) {
546 state->config->register_channel (factory->create (chan));
549 CriticalSelectionChanged ();
552 /* Track export channel selector */
554 TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager)
555 : ExportChannelSelector(session, manager)
556 , track_output_button(_("Apply track/bus processing"))
558 pack_start(main_layout);
560 // Populate Selection Menu
562 using namespace Gtk::Menu_Helpers;
564 select_menu.set_text (_("Selection Actions"));
565 select_menu.disable_scrolling ();
567 select_menu.AddMenuElem (MenuElem (_("Select tracks"), sigc::mem_fun (*this, &TrackExportChannelSelector::select_tracks)));
568 select_menu.AddMenuElem (MenuElem (_("Select busses"), sigc::mem_fun (*this, &TrackExportChannelSelector::select_busses)));
569 select_menu.AddMenuElem (MenuElem (_("Deselect all"), sigc::mem_fun (*this, &TrackExportChannelSelector::select_none)));
570 select_menu.AddMenuElem (SeparatorElem ());
572 exclude_hidden = new Gtk::CheckMenuItem (_("Exclude Hidden"));
573 exclude_hidden->set_active (false);
574 exclude_hidden->show();
575 select_menu.AddMenuElem (*exclude_hidden);
577 exclude_muted = new Gtk::CheckMenuItem (_("Exclude Muted"));
578 exclude_muted->set_active (true);
579 exclude_muted->show();
580 select_menu.AddMenuElem (*exclude_muted);
584 options_box.set_spacing (8);
585 options_box.pack_start (track_output_button, false, false);
586 options_box.pack_start (select_menu, false, false);
587 main_layout.pack_start (options_box, false, false);
590 track_scroller.add (track_view);
591 track_scroller.set_size_request (-1, 130);
592 track_scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
593 main_layout.pack_start(track_scroller);
596 track_list = Gtk::ListStore::create (track_cols);
597 track_list->set_sort_column (track_cols.order_key, Gtk::SORT_ASCENDING);
598 track_view.set_model (track_list);
599 track_view.set_headers_visible (true);
601 track_view.append_column_editable (_("Export"), track_cols.selected);
602 Gtk::CellRendererToggle *toggle = dynamic_cast<Gtk::CellRendererToggle *>(track_view.get_column_cell_renderer (0));
603 toggle->set_alignment (0.0, 0.5);
605 toggle->signal_toggled().connect (sigc::hide (sigc::mem_fun (*this, &TrackExportChannelSelector::update_config)));
607 Gtk::CellRendererText* text_renderer = Gtk::manage (new Gtk::CellRendererText);
608 text_renderer->property_editable() = false;
609 text_renderer->set_alignment (0.0, 0.5);
611 Gtk::TreeView::Column* column = Gtk::manage (new Gtk::TreeView::Column);
612 column->set_title (_("Track name"));
614 track_view.append_column (*column);
615 column->pack_start (*text_renderer, false);
616 column->add_attribute (text_renderer->property_text(), track_cols.label);
618 track_output_button.signal_clicked().connect (sigc::mem_fun (*this, &TrackExportChannelSelector::track_outputs_selected));
622 show_all_children ();
625 TrackExportChannelSelector::~TrackExportChannelSelector ()
627 delete exclude_hidden;
628 delete exclude_muted;
632 TrackExportChannelSelector::sync_with_manager ()
634 // TODO implement properly
639 TrackExportChannelSelector::select_tracks ()
641 bool excl_hidden = exclude_hidden->get_active ();
642 bool excl_muted = exclude_muted->get_active ();
644 for (Gtk::ListStore::Children::iterator it = track_list->children().begin(); it != track_list->children().end(); ++it) {
645 Gtk::TreeModel::Row row = *it;
646 boost::shared_ptr<Route> route = row[track_cols.route];
647 if (boost::dynamic_pointer_cast<Track> (route)) {
648 if (excl_muted && route->muted ()) {
651 if (excl_hidden && route->is_hidden ()) {
654 row[track_cols.selected] = true;
661 TrackExportChannelSelector::select_busses ()
663 bool excl_hidden = exclude_hidden->get_active ();
664 bool excl_muted = exclude_muted->get_active ();
666 for (Gtk::ListStore::Children::iterator it = track_list->children().begin(); it != track_list->children().end(); ++it) {
667 Gtk::TreeModel::Row row = *it;
668 boost::shared_ptr<Route> route = row[track_cols.route];
669 if (!boost::dynamic_pointer_cast<Track> (route)) {
670 if (excl_muted && route->muted ()) {
673 if (excl_hidden && route->is_hidden ()) {
676 row[track_cols.selected] = true;
683 TrackExportChannelSelector::select_none ()
685 for (Gtk::ListStore::Children::iterator it = track_list->children().begin(); it != track_list->children().end(); ++it) {
686 Gtk::TreeModel::Row row = *it;
687 row[track_cols.selected] = false;
693 TrackExportChannelSelector::track_outputs_selected ()
699 TrackExportChannelSelector::fill_list()
702 RouteList routes = _session->get_routelist();
704 CoreSelection const& cs (_session->selection());
706 for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
707 if (!boost::dynamic_pointer_cast<Track>(*it)) {
708 // not a track, must be a bus
709 if ((*it)->is_master () || (*it)->is_monitor ()) {
712 if (!(*it)->active ()) {
713 // don't include inactive busses
717 // not monitor or master bus
718 add_track (*it, cs.selected (*it));
721 for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
722 if (boost::dynamic_pointer_cast<AudioTrack>(*it)) {
723 if (!(*it)->active ()) {
724 // don't include inactive tracks
727 add_track (*it, cs.selected (*it));
733 TrackExportChannelSelector::add_track (boost::shared_ptr<Route> route, bool selected)
735 Gtk::TreeModel::iterator iter = track_list->append();
736 Gtk::TreeModel::Row row = *iter;
738 row[track_cols.selected] = selected;
739 row[track_cols.label] = route->name();
740 row[track_cols.route] = route;
741 row[track_cols.order_key] = route->presentation_info().order();
745 TrackExportChannelSelector::update_config()
747 manager->clear_channel_configs();
749 for (Gtk::ListStore::Children::iterator it = track_list->children().begin(); it != track_list->children().end(); ++it) {
750 Gtk::TreeModel::Row row = *it;
752 if (!row[track_cols.selected]) {
756 ExportProfileManager::ChannelConfigStatePtr state;
758 boost::shared_ptr<Route> route = row[track_cols.route];
760 if (track_output_button.get_active()) {
761 uint32_t outs = route->n_outputs().n_audio();
762 for (uint32_t i = 0; i < outs; ++i) {
763 boost::shared_ptr<AudioPort> port = route->output()->audio (i);
765 ExportChannelPtr channel (new PortExportChannel ());
766 PortExportChannel * pec = static_cast<PortExportChannel *> (channel.get());
769 state = manager->add_channel_config();
771 state->config->register_channel(channel);
775 std::list<ExportChannelPtr> list;
776 RouteExportChannel::create_from_route (list, route);
777 if (list.size () == 0) {
780 state = manager->add_channel_config();
781 state->config->register_channels (list);
785 if (_session->config.get_track_name_number() && route->track_number() > 0) {
786 state->config->set_name (string_compose ("%1-%2", route->track_number(), route->name()));
788 state->config->set_name (route->name());
794 CriticalSelectionChanged ();