+char
+Session::session_name_is_legal (const string& path)
+{
+ char illegal_chars[] = { '/', '\\', ':', ';', '\0' };
+
+ for (int i = 0; illegal_chars[i]; ++i) {
+ if (path.find (illegal_chars[i]) != string::npos) {
+ return illegal_chars[i];
+ }
+ }
+
+ return 0;
+}
+
+uint32_t
+Session::next_control_id () const
+{
+ int subtract = 0;
+
+ /* the monitor bus remote ID is in a different
+ * "namespace" than regular routes. its existence doesn't
+ * affect normal (low) numbered routes.
+ */
+
+ if (_monitor_out) {
+ subtract++;
+ }
+
+ return nroutes() - subtract;
+}
+
+void
+Session::notify_remote_id_change ()
+{
+ if (deletion_in_progress()) {
+ return;
+ }
+
+ switch (Config->get_remote_model()) {
+ case MixerSort:
+ case EditorSort:
+ Route::RemoteControlIDChange (); /* EMIT SIGNAL */
+ break;
+ default:
+ break;
+ }
+}
+
+void
+Session::sync_order_keys (RouteSortOrderKey sort_key_changed)
+{
+ if (deletion_in_progress()) {
+ return;
+ }
+
+ /* tell everyone that something has happened to the sort keys
+ and let them sync up with the change(s)
+ this will give objects that manage the sort order keys the
+ opportunity to keep them in sync if they wish to.
+ */
+
+ DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("Sync Order Keys, based on %1\n", enum_2_string (sort_key_changed)));
+
+ Route::SyncOrderKeys (sort_key_changed); /* EMIT SIGNAL */
+
+ DEBUG_TRACE (DEBUG::OrderKeys, "\tsync done\n");
+}
+
+bool
+Session::operation_in_progress (GQuark op) const
+{
+ return (find (_current_trans_quarks.begin(), _current_trans_quarks.end(), op) != _current_trans_quarks.end());
+}