diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-10-20 21:17:25 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-10-20 21:17:25 +0000 |
commit | fb917cff45c95f6cdc5705d411de7cd18e466d60 (patch) | |
tree | 759a28c44b3bf73f23a90a771ea81187087b4560 /libs | |
parent | 00ddd099ed5cd6e0d77448670381d13d88b96218 (diff) |
remove absurd internal Crossfade constructor that confused region start and region position; set position explicitly in the two places that we use these crossfades; revert to the assert that caught this crazy error
git-svn-id: svn://localhost/ardour2/branches/3.0@10259 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/crossfade.h | 5 | ||||
-rw-r--r-- | libs/ardour/audio_playlist.cc | 16 | ||||
-rw-r--r-- | libs/ardour/audioregion.cc | 7 | ||||
-rw-r--r-- | libs/ardour/crossfade.cc | 3 |
4 files changed, 12 insertions, 19 deletions
diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h index 11bea700de..20bbcccdf5 100644 --- a/libs/ardour/ardour/crossfade.h +++ b/libs/ardour/ardour/crossfade.h @@ -59,7 +59,6 @@ class Crossfade : public ARDOUR::AudioRegion /* constructor for "fixed" xfades at each end of an internal overlap */ Crossfade (boost::shared_ptr<ARDOUR::AudioRegion> in, boost::shared_ptr<ARDOUR::AudioRegion> out, - framepos_t position, framecnt_t initial_length, AnchorPoint); @@ -114,10 +113,6 @@ class Crossfade : public ARDOUR::AudioRegion PBD::Signal1<void,boost::shared_ptr<Region> > Invalidated; - bool covers (framepos_t frame) const { - return _position <= frame && frame < _position + _length; - } - OverlapType coverage (framepos_t start, framepos_t end) const; static void set_buffer_size (framecnt_t); diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index af075608ad..094191084d 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -311,12 +311,14 @@ AudioPlaylist::read (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, fr DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("Checking %1 xfades\n", _crossfades.size())); for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) { - DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("%1 check xfade between %2 and %3 ...\n", - name(), (*i)->out()->name(), (*i)->in()->name())); + DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("%1 check xfade between %2 and %3 ... [ %4 ... %5 | %6 ... %7]\n", + name(), (*i)->out()->name(), (*i)->in()->name(), + (*i)->first_frame(), (*i)->last_frame(), + start, end)); if ((*i)->coverage (start, end) != OverlapNone) { relevant_xfades[(*i)->upper_layer()].push_back (*i); - DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\t\txfade is relevant, place on layer %1\n", - (*i)->upper_layer())); + DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\t\txfade is relevant (coverage = %2), place on layer %1\n", + (*i)->upper_layer(), enum_2_string ((*i)->coverage (start, end)))); } } @@ -579,7 +581,8 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh) if (top_region_at (top->first_frame()) == top) { - xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, top->first_frame(), StartOfIn)); + xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, StartOfIn)); + xfade->set_position (top->first_frame()); add_crossfade (xfade); } @@ -590,7 +593,8 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh) would cover it). */ - xfade = boost::shared_ptr<Crossfade> (new Crossfade (bottom, top, xfade_length, top->last_frame() - xfade_length, EndOfOut)); + xfade = boost::shared_ptr<Crossfade> (new Crossfade (bottom, top, xfade_length, EndOfOut)); + xfade->set_position (top->last_frame() - xfade_length); add_crossfade (xfade); } break; diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 5d9935935e..e2a6694917 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -402,12 +402,7 @@ AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit, /* if this fails then the requested section is entirely before the position of this region */ - if (cnt < buf_offset) { - error << "trying to read region " << name() << " @ " << position << " which is outside region bounds " - << _position << " .. " << last_frame() << " (len = " << length() << ')' - << endmsg; - return 0; // read nothing - } + assert (cnt >= buf_offset); cnt -= buf_offset; } else { internal_offset = position - _position; diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index f06fcfb280..b2301b7167 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -85,9 +85,8 @@ Crossfade::operator== (const Crossfade& other) Crossfade::Crossfade (boost::shared_ptr<AudioRegion> in, boost::shared_ptr<AudioRegion> out, framecnt_t length, - framepos_t position, AnchorPoint ap) - : AudioRegion (in->session(), position, length, in->name() + string ("<>") + out->name()) + : AudioRegion (in->session(), 0, length, in->name() + string ("<>") + out->name()) , CROSSFADE_DEFAULT_PROPERTIES , _fade_in (Evoral::Parameter(FadeInAutomation)) // linear (gain coefficient) => -inf..+6dB , _fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB |