From 83052ad18cc8e73c353c6bba2a63f5231a686fe9 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 17 May 2016 09:36:28 -0400 Subject: [PATCH] clean up debug output for OrderKeys --- gtk2_ardour/editor_routes.cc | 9 +-------- gtk2_ardour/mixer_ui.cc | 9 ++------- libs/ardour/session.cc | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index c909c5a1c5..40ead04f7a 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -921,7 +921,7 @@ EditorRoutes::sync_presentation_info_from_treeview () return; } - DEBUG_TRACE (DEBUG::OrderKeys, "editor sync order keys from treeview\n"); + DEBUG_TRACE (DEBUG::OrderKeys, "editor sync presentation info from treeview\n"); TreeModel::Children::iterator ri; bool change = false; @@ -992,10 +992,6 @@ EditorRoutes::sync_treeview_from_presentation_info () for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) { boost::shared_ptr route = (*ri)[_columns.route]; sorted.push_back (OrderKeys (old_order, route->presentation_info().group_order())); - DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("build new order: route %3 old = %1 new = %1\n", - old_order, - route->presentation_info().group_order(), - route->name())); } SortByNewDisplayOrder cmp; @@ -1012,9 +1008,6 @@ EditorRoutes::sync_treeview_from_presentation_info () if (sr->old_display_order != n) { changed = true; } - - DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("EDITOR change order from %1 to %2\n", - sr->old_display_order, n)); } if (changed) { diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 3c8605642b..437bdf515a 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -588,7 +588,7 @@ Mixer_UI::sync_presentation_info_from_treeview () return; } - DEBUG_TRACE (DEBUG::OrderKeys, "mixer sync order keys from model\n"); + DEBUG_TRACE (DEBUG::OrderKeys, "mixer sync presentation info from treeview\n"); TreeModel::Children::iterator ri; bool change = false; @@ -613,8 +613,6 @@ Mixer_UI::sync_presentation_info_from_treeview () route->presentation_info().unset_flag (PresentationInfo::Hidden); } - DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("route %1 old order %2 new order %3\n", route->name(), route->presentation_info().group_order(), order)); - if (order != route->presentation_info().group_order()) { route->set_presentation_group_order_explicit (order); change = true; @@ -636,7 +634,7 @@ Mixer_UI::sync_treeview_from_presentation_info () return; } - DEBUG_TRACE (DEBUG::OrderKeys, "mixer sync model from order keys.\n"); + DEBUG_TRACE (DEBUG::OrderKeys, "mixer sync model from presentation info.\n"); /* we could get here after either a change in the Mixer or Editor sort * order, but either way, the mixer order keys reflect the intended @@ -695,9 +693,6 @@ Mixer_UI::sync_treeview_from_presentation_info () if (sr->old_display_order != n) { changed = true; } - - DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("MIXER change order from %1 to %2\n", - sr->old_display_order, n)); } if (changed) { diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index e4fc664b7e..39b8e6c50d 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2425,7 +2425,7 @@ Session::default_track_name_pattern (DataType t) list > Session::new_midi_track (const ChanCount& input, const ChanCount& output, boost::shared_ptr instrument, Plugin::PresetRecord* pset, - RouteGroup* route_group, uint32_t how_many, string name_template, PresentationInfo::order_t order, + RouteGroup* route_group, uint32_t how_many, string name_template, PresentationInfo::order_t order, TrackMode mode) { string track_name; @@ -2540,7 +2540,7 @@ Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name error << "cannot find name for new midi bus" << endmsg; goto failure; } - + try { boost::shared_ptr bus (new Route (*this, bus_name, flag, DataType::AUDIO)); // XXX Editor::add_routes is not ready for ARDOUR::DataType::MIDI @@ -3477,6 +3477,8 @@ Session::add_routes_inner (RouteList& new_routes, bool input_auto_connect, bool } } } + + reassign_track_numbers (); } void @@ -4291,6 +4293,16 @@ Session::reassign_track_numbers () // trigger GUI re-layout config.ParameterChanged("track-name-number"); } + +#ifndef NDEBUG + if (DEBUG_ENABLED(DEBUG::OrderKeys)) { + boost::shared_ptr rl = routes.reader (); + for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { + DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1 numbered %2\n", (*i)->name(), (*i)->track_number())); + } + } +#endif /* NDEBUG */ + } void -- 2.30.2