diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index b157d68545..0054b6a177 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -669,46 +669,46 @@ AudioPlaylist::set_state (const XMLNode& node, int version) XMLProperty* p = (*i)->property (X_("active")); assert (p); + if (!string_is_affirmative (p->value())) { continue; } + + if ((p = (*i)->property (X_("in"))) == 0) { + continue; + } - p = (*i)->property (X_("in")); - assert (p); boost::shared_ptr in = region_by_id (PBD::ID (p->value ())); + if (!in) { warning << string_compose (_("Legacy crossfade involved an incoming region not present in playlist \"%1\" - crossfade discarded"), name()) << endmsg; continue; } + boost::shared_ptr in_a = boost::dynamic_pointer_cast (in); assert (in_a); + + const XMLNodeList c = (*i)->children (); - p = (*i)->property (X_("out")); - assert (p); - boost::shared_ptr out = region_by_id (PBD::ID (p->value ())); - if (!in) { - warning << string_compose (_("Legacy crossfade involved an outgoing region not present in playlist \"%1\" - crossfade discarded"), - name()) - << endmsg; - continue; - } - boost::shared_ptr out_a = boost::dynamic_pointer_cast (out); - assert (out_a); - - XMLNodeList c = (*i)->children (); for (XMLNodeConstIterator j = c.begin(); j != c.end(); ++j) { if ((*j)->name() == X_("FadeIn")) { in_a->fade_in()->set_state (**j, version); - in_a->set_fade_in_active (true); - in_a->set_fade_in_is_xfade (true); } else if ((*j)->name() == X_("FadeOut")) { - out_a->fade_out()->set_state (**j, version); - out_a->set_fade_out_active (true); - out_a->set_fade_out_is_xfade (true); + in_a->inverse_fade_in()->set_state (**j, version); } } + + if ((p = (*i)->property ("follow-overlap")) != 0) { + in_a->set_fade_in_is_short (!string_is_affirmative (p->value())); + } else { + in_a->set_fade_in_is_short (false); + } + + in_a->set_fade_in_is_xfade (true); + in_a->set_fade_in_active (true); + cerr << in_a->name() << " from playlist fade in = xfade false\n"; } } diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 66b978131d..248da95936 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -78,14 +78,14 @@ reverse_curve (boost::shared_ptr dst, boost::shared_ptrback()->when; for (Evoral::ControlList::const_iterator it = src->begin(); it!=src->end(); it++) { - dst->add ( len - (*it)->when, (*it)->value ); + dst->add (len - (*it)->when, (*it)->value); } } static void generate_inverse_power_curve (boost::shared_ptr dst, boost::shared_ptr src) { - //calc inverse curve using sum of squares + // calc inverse curve using sum of squares for (Evoral::ControlList::const_iterator it = src->begin(); it!=src->end(); ++it ) { float value = (*it)->value; value = 1 - powf(value,2); @@ -94,18 +94,6 @@ generate_inverse_power_curve (boost::shared_ptr dst, boost: } } -/* -static void -generate_inverse_coefficient_curve (boost::shared_ptr dst, boost::shared_ptr src) -{ - //calc inverse gain coefficient curve - for (Evoral::ControlList::const_iterator it = src->begin(); it!=src->end(); ++it ) { - float value = 1.0 - (*it)->value; - dst->fast_simple_add ( (*it)->when, value ); - } -} -*/ - static void generate_db_fade (boost::shared_ptr dst, double len, int num_steps, float dB_drop) { @@ -921,8 +909,6 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ if ((prop = child->property ("is-xfade")) != 0) { _fade_in_is_xfade = string_is_affirmative (prop->value()); - } else { - _fade_in_is_xfade = false; } } else if (child->name() == "FadeOut") { @@ -950,8 +936,6 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ if ((prop = child->property ("is-xfade")) != 0) { _fade_out_is_xfade = string_is_affirmative (prop->value()); - } else { - _fade_out_is_xfade = false; } } else if (child->name() == "InvFadeIn") { diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index 2bc84f8988..fa948844ab 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -284,9 +284,7 @@ RegionFactory::create (SourceList& srcs, const XMLNode& node) if (ret) { if (ret->set_state (node, Stateful::loading_state_version)) { ret.reset (); - cerr << "set state on region failed\n"; } else { - cerr << "add region " << ret->id() << " to region map\n"; map_add (ret); /* Don't fiddle with position_lock_style here as the region