diff options
author | Carl Hetherington <carl@carlh.net> | 2009-12-28 02:54:04 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-12-28 02:54:04 +0000 |
commit | bd231ac9bf860fbfec074d0d2b737bdbe1dea733 (patch) | |
tree | f5a87ee6de9dd46ae058d61b0056446b6b0f3ecd /libs | |
parent | 8e65788ef0cb56747f4e1e08c9c64a137f922026 (diff) |
Remove unnecessary _fade_{in,out}_shape members from AudioRegion.
Copy fade in / out to new regions created by filters, which should fix 2972.
git-svn-id: svn://localhost/ardour2/branches/3.0@6406 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/audioregion.h | 4 | ||||
-rw-r--r-- | libs/ardour/audioregion.cc | 26 | ||||
-rw-r--r-- | libs/ardour/filter.cc | 4 |
3 files changed, 28 insertions, 6 deletions
diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index a8055575f9..c2d13667dd 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -125,11 +125,13 @@ class AudioRegion : public Region void set_fade_in_shape (FadeShape); void set_fade_in_length (nframes_t); void set_fade_in (FadeShape, nframes_t); + void set_fade_in (boost::shared_ptr<AutomationList>); void set_fade_out_active (bool yn); void set_fade_out_shape (FadeShape); void set_fade_out_length (nframes_t); void set_fade_out (FadeShape, nframes_t); + void set_fade_out (boost::shared_ptr<AutomationList>); void set_envelope_active (bool yn); void set_default_envelope (); @@ -206,9 +208,7 @@ class AudioRegion : public Region AutomatableControls _automatable; boost::shared_ptr<AutomationList> _fade_in; - FadeShape _fade_in_shape; boost::shared_ptr<AutomationList> _fade_out; - FadeShape _fade_out_shape; boost::shared_ptr<AutomationList> _envelope; gain_t _scale_amplitude; uint32_t _fade_in_disabled; diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 24febdd86a..5a99c164d9 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -772,6 +772,16 @@ AudioRegion::set_fade_out_shape (FadeShape shape) } void +AudioRegion::set_fade_in (boost::shared_ptr<AutomationList> f) +{ + _fade_in->freeze (); + *_fade_in = *f; + _fade_in->thaw (); + + send_change (FadeInChanged); +} + +void AudioRegion::set_fade_in (FadeShape shape, nframes_t len) { _fade_in->freeze (); @@ -826,7 +836,16 @@ AudioRegion::set_fade_in (FadeShape shape, nframes_t len) } _fade_in->thaw (); - _fade_in_shape = shape; + + send_change (FadeInChanged); +} + +void +AudioRegion::set_fade_out (boost::shared_ptr<AutomationList> f) +{ + _fade_out->freeze (); + *_fade_out = *f; + _fade_out->thaw (); send_change (FadeInChanged); } @@ -884,7 +903,6 @@ AudioRegion::set_fade_out (FadeShape shape, nframes_t len) } _fade_out->thaw (); - _fade_out_shape = shape; send_change (FadeOutChanged); } @@ -952,13 +970,13 @@ AudioRegion::set_fade_out_active (bool yn) bool AudioRegion::fade_in_is_default () const { - return _fade_in_shape == Linear && _fade_in->back()->when == 64; + return _fade_in->size() == 2 && _fade_in->front()->when == 0 && _fade_in->back()->when == 64; } bool AudioRegion::fade_out_is_default () const { - return _fade_out_shape == Linear && _fade_out->back()->when == 64; + return _fade_out->size() == 2 && _fade_out->front()->when == 0 && _fade_out->back()->when == 64; } void diff --git a/libs/ardour/filter.cc b/libs/ardour/filter.cc index fc659b3ab8..eab27b4ce0 100644 --- a/libs/ardour/filter.cc +++ b/libs/ardour/filter.cc @@ -128,6 +128,10 @@ Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs, string regi boost::shared_ptr<AudioRegion> audio_r = boost::dynamic_pointer_cast<AudioRegion> (r); if (audio_region && audio_r) { audio_r->set_scale_amplitude (audio_region->scale_amplitude()); + audio_r->set_fade_in_active (audio_region->fade_in_active ()); + audio_r->set_fade_in (audio_region->fade_in ()); + audio_r->set_fade_out_active (audio_region->fade_out_active ()); + audio_r->set_fade_out (audio_region->fade_out ()); } results.push_back (r); |