allow to load/save default session-properties
[ardour.git] / libs / ardour / session.cc
index 4a3ce009ebfa9449ad5eb7804689160e4f3c9a8f..121df3130cb60f2cf08755d6318ad28e9013b61e 100644 (file)
@@ -194,6 +194,8 @@ Session::Session (AudioEngine &eng,
        , state_tree (0)
        , state_was_pending (false)
        , _state_of_the_state (StateOfTheState(CannotSave|InitialConnecting|Loading))
+       , _suspend_save (0)
+       , _save_queued (false)
        , _last_roll_location (0)
        , _last_roll_or_reversal_location (0)
        , _last_record_location (0)
@@ -298,6 +300,9 @@ Session::Session (AudioEngine &eng,
                        throw failed_constructor ();
                }
 
+               /* load default session properties - if any */
+               config.load_state();
+
        } else {
 
                if (load_state (_current_snapshot_name)) {
@@ -1880,6 +1885,7 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, boost:
 
   failed:
        if (!new_routes.empty()) {
+               StateProtector sp (this);
                add_routes (new_routes, true, true, true);
 
                if (instrument) {
@@ -2121,6 +2127,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
 
   failed:
        if (!new_routes.empty()) {
+               StateProtector sp (this);
                add_routes (new_routes, true, true, true);
        }
 
@@ -2206,6 +2213,7 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r
 
   failure:
        if (!ret.empty()) {
+               StateProtector sp (this);
                add_routes (ret, false, true, true); // autoconnect outputs only
        }
 
@@ -2322,6 +2330,7 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
 
   out:
        if (!ret.empty()) {
+               StateProtector sp (this);
                add_routes (ret, true, true, true);
                IO::enable_connecting ();
        }
@@ -3057,6 +3066,8 @@ Session::reassign_track_numbers ()
        SignalOrderRouteSorter sorter;
        r.sort (sorter);
 
+       StateProtector sp (this);
+
        for (RouteList::iterator i = r.begin(); i != r.end(); ++i) {
                if (boost::dynamic_pointer_cast<Track> (*i)) {
                        (*i)->set_track_number(++tn);