diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-10 08:16:55 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-10 08:16:55 -0400 |
commit | 0622a0cc3068a06d328119e90b7d9c5f5a84df32 (patch) | |
tree | 7f1a03a03df6e47cad3c358ceb1de60a1033c96e /libs/ardour/audioregion.cc | |
parent | 94c8b672c4e294384348f405d179f13e33e72ee5 (diff) |
add libardour infrastructure for "fade range" edit operation
Diffstat (limited to 'libs/ardour/audioregion.cc')
-rw-r--r-- | libs/ardour/audioregion.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 2eb09ae192..630819d7c1 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -958,6 +958,34 @@ AudioRegion::set_state (const XMLNode& node, int version) } void +AudioRegion::fade_range (framepos_t start, framepos_t end) +{ + framepos_t s, e; + + switch (coverage (start, end)) { + case Evoral::OverlapStart: + s = _position; + e = end; + set_fade_in (FadeConstantPower, e - s); + break; + case Evoral::OverlapEnd: + s = start; + e = _position + _length; + set_fade_out (FadeConstantPower, e - s); + break; + case Evoral::OverlapInternal: + /* needs addressing, perhaps. Difficult to do if we can't + * control one edge of the fade relative to the relevant edge + * of the region, which we cannot - fades are currently assumed + * to start/end at the start/end of the region + */ + break; + default: + return; + } +} + +void AudioRegion::set_fade_in_shape (FadeShape shape) { set_fade_in (shape, (framecnt_t) _fade_in->back()->when); |