try to make NewSessionDialog only show up when really needed, and only have necessary...
[ardour.git] / libs / ardour / session_state.cc
index e1afae1443e372c4d3da74dcbda36da434130158..fd2c9fa98285b747f537e5174537f3c0f75f8b5f 100644 (file)
@@ -138,6 +138,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
        transport_sub_state = 0;
        _transport_frame = 0;
        last_stop_frame = 0;
+       requested_return_frame = -1;
        end_location = new Location (0, 0, _("end"), Location::Flags ((Location::IsMark|Location::IsEnd)));
        start_location = new Location (0, 0, _("start"), Location::Flags ((Location::IsMark|Location::IsStart)));
        _end_location_is_free = true;
@@ -164,6 +165,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
        _worst_track_latency = 0;
        _state_of_the_state = StateOfTheState(CannotSave|InitialConnecting|Loading|Deletion);
        _slave = 0;
+       _silent = false;
        butler_mixdown_buffer = 0;
        butler_gain_buffer = 0;
        mmc = 0;
@@ -455,7 +457,7 @@ Session::setup_raid_path (string path)
 }
 
 int
-Session::create (bool& new_session, string* mix_template, nframes_t initial_length)
+Session::create (bool& new_session, const string& mix_template, nframes_t initial_length)
 {
        string dir;
 
@@ -500,8 +502,8 @@ Session::create (bool& new_session, string* mix_template, nframes_t initial_leng
 
        /* check new_session so we don't overwrite an existing one */
 
-       if (mix_template) {
-               std::string in_path = *mix_template;
+       if (!mix_template.empty()) {
+               std::string in_path = mix_template;
 
                ifstream in(in_path.c_str());
 
@@ -1460,10 +1462,10 @@ Session::XMLRegionFactory (const XMLNode& node, bool full)
                }
        }
 
-       for (uint32_t n=1; n < nchans; ++n) {
+       for (uint32_t n=0; n < nchans; ++n) {
                snprintf (buf, sizeof(buf), X_("master-source-%d"), n);
                if ((prop = node.property (buf)) != 0) {
-                       
+               
                        PBD::ID id2 (prop->value());
                        
                        if ((source = source_by_id (id2)) == 0) {
@@ -1477,7 +1479,7 @@ Session::XMLRegionFactory (const XMLNode& node, bool full)
                                return boost::shared_ptr<AudioRegion>();
                        }
                        master_sources.push_back (as);
-               }
+               } 
        }
 
        try {
@@ -1495,7 +1497,7 @@ Session::XMLRegionFactory (const XMLNode& node, bool full)
                }
 
                if (!master_sources.empty()) {
-                       if (master_sources.size() == nchans) {
+                       if (master_sources.size() != nchans) {
                                error << _("Session: XMLNode describing an AudioRegion is missing some master sources; ignored") << endmsg;
                        } else {
                                region->set_master_sources (master_sources);