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;
_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;
}
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;
/* 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());
// store libardour version, just in case
char buf[16];
snprintf(buf, sizeof(buf)-1, "%d.%d.%d",
- libardour_major_version, libardour_minor_version, libardour_micro_version);
+ libardour2_major_version, libardour2_minor_version, libardour2_micro_version);
node->add_property("version", string(buf));
/* store configuration settings */
boost::shared_ptr<Source> source;
boost::shared_ptr<AudioSource> as;
SourceList sources;
+ SourceList master_sources;
uint32_t nchans = 1;
char buf[128];
sources.push_back (as);
}
}
-
+
+ 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) {
+ error << string_compose(_("Session: XMLNode describing a AudioRegion references an unknown source id =%1"), id2) << endmsg;
+ return boost::shared_ptr<AudioRegion>();
+ }
+
+ as = boost::dynamic_pointer_cast<AudioSource>(source);
+ if (!as) {
+ error << string_compose(_("Session: XMLNode describing a AudioRegion references a non-audio source id =%1"), id2) << endmsg;
+ return boost::shared_ptr<AudioRegion>();
+ }
+ master_sources.push_back (as);
+ }
+ }
+
try {
boost::shared_ptr<AudioRegion> region (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (sources, node)));
}
}
+ if (!master_sources.empty()) {
+ 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);
+ }
+ }
return region;