summaryrefslogtreecommitdiff
path: root/gtk2_ardour/mixer_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-06-06 12:52:48 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-06-06 12:58:48 -0400
commita0f0bdc063e81fd6f98fbcb1268538106cca753a (patch)
tree09f95a08247d17e37cf3c19e54fde12919d7ea7d /gtk2_ardour/mixer_ui.cc
parent6a622d86dca2c8af8993d85be8bd8a44debc5b8c (diff)
try to keep editor+mixer treemodels in sync
Diffstat (limited to 'gtk2_ardour/mixer_ui.cc')
-rw-r--r--gtk2_ardour/mixer_ui.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc
index ef3228375a..196a53647a 100644
--- a/gtk2_ardour/mixer_ui.cc
+++ b/gtk2_ardour/mixer_ui.cc
@@ -64,6 +64,7 @@
#include "actions.h"
#include "gui_thread.h"
#include "mixer_group_tabs.h"
+#include "route_sorter.h"
#include "timers.h"
#include "ui_config.h"
#include "vca_master_strip.h"
@@ -479,8 +480,11 @@ void
Mixer_UI::add_stripables (StripableList& slist)
{
Gtk::TreeModel::Children::iterator insert_iter = track_model->children().end();
+ bool from_scratch = (track_model->children().size() == 0);
uint32_t nroutes = 0;
+ slist.sort (StripablePresentationInfoSorter());
+
for (Gtk::TreeModel::Children::iterator it = track_model->children().begin(); it != track_model->children().end(); ++it) {
boost::shared_ptr<Stripable> s = (*it)[stripable_columns.stripable];
@@ -589,8 +593,9 @@ Mixer_UI::add_stripables (StripableList& slist)
no_track_list_redisplay = false;
track_display.set_model (track_model);
- sync_presentation_info_from_treeview ();
- redisplay_track_list ();
+ if (!from_scratch) {
+ sync_presentation_info_from_treeview ();
+ }
}
void
@@ -687,6 +692,10 @@ Mixer_UI::sync_presentation_info_from_treeview ()
continue;
}
+ /* Master also doesn't get set here but since the editor allows
+ * it to be reordered, we need to preserve its ordering.
+ */
+
stripable->presentation_info().set_hidden (!visible);
if (order != stripable->presentation_info().order()) {