#include "vca_time_axis.h"
#include "utils.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace ARDOUR;
TreeModel::Children::iterator ri;
bool change = false;
PresentationInfo::order_t order = 0;
+ bool master_is_first = false;
+ uint32_t count = 0;
+
+ // special case master if it's got PI order 0 lets keep it there
+ if (_session->master_out() && (_session->master_out()->presentation_info().order() == 0)) {
+ order++;
+ master_is_first = true;
+ }
for (ri = rows.begin(); ri != rows.end(); ++ri) {
stripable->presentation_info().set_hidden (!visible);
+ /* special case master if it's got PI order 0 lets keep it there
+ * but still allow master to move if first non-master route has
+ * presentation order 1
+ */
+ if ((count == 0) && master_is_first && (stripable->presentation_info().order() == 1)) {
+ master_is_first = false; // someone has moved master
+ order = 0;
+ }
+
+ if (stripable->is_master() && master_is_first) {
+ if (count) {
+ continue;
+ } else {
+ count++;
+ continue;
+ }
+ }
+
if (order != stripable->presentation_info().order()) {
stripable->set_presentation_order (order, false);
change = true;
}
++order;
+ ++count;
}
if (change) {
DEBUG_TRACE (DEBUG::OrderKeys, "... notify PI change from editor GUI\n");
_session->notify_presentation_info_change ();
+ _session->set_dirty();
}
}