use RAII for class-wide PresentationInfo::Change signal, along with properties to describe what changed
This commit is contained in:
parent
8cb3c42548
commit
e5aa0d774e
|
@ -1019,6 +1019,8 @@ EditorRoutes::sync_presentation_info_from_treeview ()
|
|||
OrderingKeys sorted;
|
||||
const size_t cmp_max = rows.size ();
|
||||
|
||||
PresentationInfo::ChangeSuspender cs;
|
||||
|
||||
// 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++;
|
||||
|
@ -1059,7 +1061,7 @@ EditorRoutes::sync_presentation_info_from_treeview ()
|
|||
}
|
||||
|
||||
if (order != stripable->presentation_info().order()) {
|
||||
stripable->set_presentation_order (order, false);
|
||||
stripable->set_presentation_order (order);
|
||||
change = true;
|
||||
}
|
||||
|
||||
|
@ -1083,17 +1085,11 @@ EditorRoutes::sync_presentation_info_from_treeview ()
|
|||
n = 0;
|
||||
for (OrderingKeys::iterator sr = sorted.begin(); sr != sorted.end(); ++sr, ++n) {
|
||||
if (sr->stripable->presentation_info().order() != n) {
|
||||
sr->stripable->set_presentation_order (n, false);
|
||||
sr->stripable->set_presentation_order (n);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (change) {
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "... notify PI change from editor GUI\n");
|
||||
_session->notify_presentation_info_change ();
|
||||
_session->set_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -666,6 +666,9 @@ GroupTabs::collect (RouteGroup* g)
|
|||
|
||||
int diff = 0;
|
||||
int coll = -1;
|
||||
|
||||
PresentationInfo::ChangeSuspender cs;
|
||||
|
||||
while (i != group_routes->end() && j != routes->end()) {
|
||||
|
||||
PresentationInfo::order_t const k = (*j)->presentation_info ().order();
|
||||
|
@ -679,21 +682,19 @@ GroupTabs::collect (RouteGroup* g)
|
|||
--diff;
|
||||
}
|
||||
|
||||
(*j)->set_presentation_order (coll, false);
|
||||
(*j)->set_presentation_order (coll);
|
||||
|
||||
++coll;
|
||||
++i;
|
||||
|
||||
} else {
|
||||
|
||||
(*j)->set_presentation_order (k + diff, false);
|
||||
(*j)->set_presentation_order (k + diff);
|
||||
|
||||
}
|
||||
|
||||
++j;
|
||||
}
|
||||
|
||||
_session->notify_presentation_info_change ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -724,10 +725,11 @@ GroupTabs::remove_group (RouteGroup* g)
|
|||
RouteList rl (*(g->route_list().get()));
|
||||
_session->remove_route_group (*g);
|
||||
|
||||
PresentationInfo::ChangeSuspender cs;
|
||||
|
||||
for (RouteList::iterator i = rl.begin(); i != rl.end(); ++i) {
|
||||
(*i)->presentation_info().PropertyChanged (Properties::color);
|
||||
}
|
||||
PresentationInfo::Change (); // notify summary & port-matrix
|
||||
}
|
||||
|
||||
/** Set the color of the tab of a route group */
|
||||
|
@ -841,7 +843,6 @@ GroupTabs::route_added_to_route_group (RouteGroup*, boost::weak_ptr<Route> w)
|
|||
}
|
||||
|
||||
r->presentation_info().PropertyChanged (Properties::color);
|
||||
PresentationInfo::Change (); // notify summary & port-matrix
|
||||
|
||||
set_dirty ();
|
||||
}
|
||||
|
@ -857,7 +858,6 @@ GroupTabs::route_removed_from_route_group (RouteGroup*, boost::weak_ptr<Route> w
|
|||
}
|
||||
|
||||
r->presentation_info().PropertyChanged (Properties::color);
|
||||
PresentationInfo::Change (); // notify summary & port-matrix
|
||||
|
||||
set_dirty ();
|
||||
}
|
||||
|
@ -865,8 +865,9 @@ GroupTabs::route_removed_from_route_group (RouteGroup*, boost::weak_ptr<Route> w
|
|||
void
|
||||
GroupTabs::emit_gui_changed_for_members (RouteGroup* rg)
|
||||
{
|
||||
PresentationInfo::ChangeSuspender cs;
|
||||
|
||||
for (RouteList::iterator i = rg->route_list()->begin(); i != rg->route_list()->end(); ++i) {
|
||||
(*i)->presentation_info().PropertyChanged (Properties::color);
|
||||
}
|
||||
PresentationInfo::Change (); // notify summary & port-matrix
|
||||
}
|
||||
|
|
|
@ -714,6 +714,8 @@ Mixer_UI::sync_presentation_info_from_treeview ()
|
|||
order++;
|
||||
}
|
||||
|
||||
PresentationInfo::ChangeSuspender cs;
|
||||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
||||
bool visible = (*ri)[stripable_columns.visible];
|
||||
boost::shared_ptr<Stripable> stripable = (*ri)[stripable_columns.stripable];
|
||||
|
@ -742,7 +744,7 @@ Mixer_UI::sync_presentation_info_from_treeview ()
|
|||
}
|
||||
|
||||
if (order != stripable->presentation_info().order()) {
|
||||
stripable->set_presentation_order (order, false);
|
||||
stripable->set_presentation_order (order);
|
||||
change = true;
|
||||
}
|
||||
|
||||
|
@ -765,7 +767,7 @@ Mixer_UI::sync_presentation_info_from_treeview ()
|
|||
n = 0;
|
||||
for (OrderingKeys::iterator sr = sorted.begin(); sr != sorted.end(); ++sr, ++n) {
|
||||
if (sr->stripable->presentation_info().order() != n) {
|
||||
sr->stripable->set_presentation_order (n, false);
|
||||
sr->stripable->set_presentation_order (n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -773,7 +775,6 @@ Mixer_UI::sync_presentation_info_from_treeview ()
|
|||
|
||||
if (change) {
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, "... notify PI change from mixer GUI\n");
|
||||
_session->notify_presentation_info_change ();
|
||||
_session->set_dirty();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue