Sort ports in state-save.
authorRobin Gareus <robin@gareus.org>
Sun, 27 Sep 2015 14:10:10 +0000 (16:10 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 27 Sep 2015 14:10:10 +0000 (16:10 +0200)
This results in identical XML if the session did not change, allowing
to keep track of state-changes easily (e.g. session file in git).

Thanks to deva (again).

libs/ardour/io.cc

index 82d4bd03e5b45e3951e3de42b32b29106adc0240..c69006c7452e72485e8dbc8147e857ed20ba2368 100644 (file)
@@ -526,7 +526,6 @@ IO::state (bool /*full_state*/)
        XMLNode* node = new XMLNode (state_node_name);
        char buf[64];
        string str;
-       vector<string>::iterator ci;
        int n;
        LocaleGuard lg (X_("C"));
        Glib::Threads::Mutex::Lock lm (io_lock);
@@ -552,6 +551,8 @@ IO::state (bool /*full_state*/)
                pnode->add_property (X_("name"), i->name());
 
                if (i->get_connections (connections)) {
+                       vector<string>::const_iterator ci;
+                       std::sort (connections.begin(), connections.end());
 
                        for (n = 0, ci = connections.begin(); ci != connections.end(); ++ci, ++n) {