-EditorRoutes::reset_remote_control_ids ()
-{
- if (Config->get_remote_model() == UserOrdered || !_session || _session->deletion_in_progress()) {
- return;
- }
-
- TreeModel::Children rows = _model->children();
-
- if (rows.empty()) {
- return;
- }
-
-
- DEBUG_TRACE (DEBUG::OrderKeys, "editor reset remote control ids\n");
-
- TreeModel::Children::iterator ri;
- bool rid_change = false;
- uint32_t rid = 1;
- uint32_t invisible_key = UINT32_MAX;
-
- for (ri = rows.begin(); ri != rows.end(); ++ri) {
-
- /* skip two special values */
-
- if (rid == Route::MasterBusRemoteControlID) {
- rid++;
- }
-
- if (rid == Route::MonitorBusRemoteControlID) {
- rid++;
- }
-
- boost::shared_ptr<Route> route = (*ri)[_columns.route];
- bool visible = (*ri)[_columns.visible];
-
- if (!route->is_master() && !route->is_monitor()) {
-
- uint32_t new_rid = (visible ? rid : invisible_key--);
-
- if (new_rid != route->remote_control_id()) {
- route->set_remote_control_id_explicit (new_rid);
- rid_change = true;
- }
-
- if (visible) {
- rid++;
- }
-
- }
- }
-
- if (rid_change) {
- /* tell the world that we changed the remote control IDs */
- _session->notify_remote_id_change ();
- }
-}
-
-
-void
-EditorRoutes::sync_order_keys_from_treeview ()