From 48d078b97554dbc0cf8423d42c306f7b1330bff5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 21 May 2007 22:12:06 +0000 Subject: virtualize audioregion, make crossfade IS-A audioregion git-svn-id: svn://localhost/ardour2/trunk@1889 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audio_playlist.cc | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'libs/ardour/audio_playlist.cc') diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index 929101fe6d..246384689e 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -79,7 +79,7 @@ AudioPlaylist::AudioPlaylist (boost::shared_ptr other, stri if ((*xfades)->out() == ar2) { boost::shared_ptrin = boost::dynamic_pointer_cast(*in_n); boost::shared_ptrout = boost::dynamic_pointer_cast(*out_n); - boost::shared_ptr new_fade = boost::shared_ptr (new Crossfade (*(*xfades), in, out)); + boost::shared_ptr new_fade = boost::shared_ptr (new Crossfade (*xfades, in, out)); add_crossfade(new_fade); break; } @@ -125,8 +125,6 @@ AudioPlaylist::read (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, nf { nframes_t ret = cnt; nframes_t end; - nframes_t read_frames; - nframes_t skip_frames; /* optimizing this memset() away involves a lot of conditionals that may well cause more of a hit due to cache misses @@ -151,8 +149,6 @@ AudioPlaylist::read (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, nf end = start + cnt - 1; - read_frames = 0; - skip_frames = 0; _read_data_count = 0; map > > relevant_regions; @@ -191,7 +187,7 @@ AudioPlaylist::read (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, nf for (vector >::iterator i = r.begin(); i != r.end(); ++i) { boost::shared_ptr ar = boost::dynamic_pointer_cast(*i); assert(ar); - ar->read_at (buf, mixdown_buffer, gain_buffer, start, cnt, chan_n, read_frames, skip_frames); + ar->read_at (buf, mixdown_buffer, gain_buffer, start, cnt, chan_n); _read_data_count += ar->read_data_count(); } @@ -309,19 +305,19 @@ AudioPlaylist::finalize_split_region (boost::shared_ptr o, boost::shared if ((*x)->_in == orig) { if (! (*x)->covers(right->position())) { - fade = boost::shared_ptr (new Crossfade (**x, left, (*x)->_out)); + fade = boost::shared_ptr (new Crossfade (*x, left, (*x)->_out)); } else { // Overlap, the crossfade is copied on the left side of the right region instead - fade = boost::shared_ptr (new Crossfade (**x, right, (*x)->_out)); + fade = boost::shared_ptr (new Crossfade (*x, right, (*x)->_out)); } } if ((*x)->_out == orig) { if (! (*x)->covers(right->position())) { - fade = boost::shared_ptr (new Crossfade (**x, (*x)->_in, right)); + fade = boost::shared_ptr (new Crossfade (*x, (*x)->_in, right)); } else { // Overlap, the crossfade is copied on the right side of the left region instead - fade = boost::shared_ptr (new Crossfade (**x, (*x)->_in, left)); + fade = boost::shared_ptr (new Crossfade (*x, (*x)->_in, left)); } } @@ -478,9 +474,10 @@ void AudioPlaylist::notify_crossfade_added (boost::shared_ptr x) } void -AudioPlaylist::crossfade_invalidated (boost::shared_ptr xfade) +AudioPlaylist::crossfade_invalidated (boost::shared_ptr r) { Crossfades::iterator i; + boost::shared_ptr xfade = boost::dynamic_pointer_cast (r); xfade->in()->resume_fade_in (); xfade->out()->resume_fade_out (); -- cgit v1.2.3