clean up debug output for OrderKeys
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 17 May 2016 13:36:28 +0000 (09:36 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:42 +0000 (15:30 -0400)
gtk2_ardour/editor_routes.cc
gtk2_ardour/mixer_ui.cc
libs/ardour/session.cc

index c909c5a1c5d5ebc1a90084281228fe38e2f47f82..40ead04f7a93f139947dc7478bd0ec6842409176 100644 (file)
@@ -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> 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) {
index 3c8605642b17cf18ec346a8b2de24f0dec3fbfde..437bdf515ab10efad285a484c79fa03d404ad677 100644 (file)
@@ -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) {
index e4fc664b7eec5bb9490622ee5868e0f9638ac948..39b8e6c50df0f0c9bcb5ccfff8867c6430c13be1 100644 (file)
@@ -2425,7 +2425,7 @@ Session::default_track_name_pattern (DataType t)
 list<boost::shared_ptr<MidiTrack> >
 Session::new_midi_track (const ChanCount& input, const ChanCount& output,
                          boost::shared_ptr<PluginInfo> 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<Route> 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<RouteList> 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