Put ARDOUR::SystemExec implementation inside ARDOUR namespace in source file
[ardour.git] / libs / ardour / session_state.cc
index 752c8d03c956a171f3dfebc8461a707afa5cd11f..ed664f0dc87a5592bb15c4a6a3098ac5707db1ca 100644 (file)
 
 #include "LuaBridge/LuaBridge.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 #include <locale.h>
 
 using namespace std;
@@ -1000,6 +1000,20 @@ Session::load_state (string snapshot_name)
                                return -1;
                        }
                }
+       } else {
+               XMLNode* child;
+               if ((child = find_named_node (root, "ProgramVersion")) != 0) {
+                       if ((prop = child->property ("modified-with")) != 0) {
+                               std::string modified_with = prop->value ();
+
+                               const double modified_with_version = atof (modified_with.substr ( modified_with.find(" ", 0) + 1, string::npos).c_str());
+                               const int modified_with_revision = atoi (modified_with.substr (modified_with.find("-", 0) + 1, string::npos).c_str());
+
+                               if (modified_with_version <= 5.3 && !(modified_with_version == 5.3 && modified_with_revision > 42)) {
+                                       _midi_regions_use_bbt_beats = true;
+                               }
+                       }
+               }
        }
 
        save_snapshot_name (snapshot_name);
@@ -1095,6 +1109,8 @@ Session::state (bool full_state)
                }
        }
 
+       node->add_property ("end-is-free", _session_range_end_is_free ? X_("yes") : X_("no"));
+
        /* save the ID counter */
 
        snprintf (buf, sizeof (buf), "%" PRIu64, ID::counter());
@@ -1358,6 +1374,10 @@ Session::set_state (const XMLNode& node, int version)
 
        setup_raid_path(_session_dir->root_path());
 
+       if ((prop = node.property (X_("end-is-free"))) != 0) {
+               _session_range_end_is_free = string_is_affirmative (prop->value());
+       }
+
        if ((prop = node.property (X_("id-counter"))) != 0) {
                uint64_t x;
                sscanf (prop->value().c_str(), "%" PRIu64, &x);
@@ -4910,3 +4930,23 @@ Session::save_as (SaveAs& saveas)
 
        return 0;
 }
+
+void
+Session::undo (uint32_t n)
+{
+       if (actively_recording()) {
+               return;
+       }
+
+       _history.undo (n);
+}
+
+void
+Session::redo (uint32_t n)
+{
+       if (actively_recording()) {
+               return;
+       }
+
+       _history.redo (n);
+}