summaryrefslogtreecommitdiff
path: root/libs/ardour/audioregion.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-21 17:03:16 +0000
committerDavid Robillard <d@drobilla.net>2010-12-21 17:03:16 +0000
commitda89cd0c9b545c418fe2d6692844ff05779bb258 (patch)
tree6471696f49b6fedb07159bbf6e1389c0e48d0011 /libs/ardour/audioregion.cc
parent71986da212b641b53c4583d0dca02cc87c758291 (diff)
Remove confuzzling offset_relative stuff from region construction (pre-properties "hangover").
This commit (in theory) only reorganizes code, not change actual functionality. RegionFactory now uses a distinct Region constructor for each case, which is a bit easier to wrap around. Note comment at region.cc:276, this case seems pretty weird to me (more hangover?). git-svn-id: svn://localhost/ardour2/branches/3.0@8320 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audioregion.cc')
-rw-r--r--libs/ardour/audioregion.cc28
1 files changed, 26 insertions, 2 deletions
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index f3a5be9da6..cb3e00cea9 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -158,8 +158,32 @@ AudioRegion::AudioRegion (const SourceList& srcs)
assert (_sources.size() == _master_sources.size());
}
-AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, framecnt_t offset, bool offset_relative)
- : Region (other, offset, offset_relative)
+AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other)
+ : Region (other)
+ , AUDIOREGION_COPY_STATE (other)
+ , _automatable (other->session())
+ , _fade_in (new AutomationList (*other->_fade_in))
+ , _fade_out (new AutomationList (*other->_fade_out))
+ /* As far as I can see, the _envelope's times are relative to region position, and have nothing
+ to do with sources (and hence _start). So when we copy the envelope, we just use the supplied offset.
+ */
+ , _envelope (new AutomationList (*other->_envelope, 0, other->_length))
+ , _fade_in_suspended (0)
+ , _fade_out_suspended (0)
+{
+ /* don't use init here, because we got fade in/out from the other region
+ */
+ register_properties ();
+ listen_to_my_curves ();
+ connect_to_analysis_changed ();
+ connect_to_header_position_offset_changed ();
+
+ assert(_type == DataType::AUDIO);
+ assert (_sources.size() == _master_sources.size());
+}
+
+AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, framecnt_t offset)
+ : Region (other, offset)
, AUDIOREGION_COPY_STATE (other)
, _automatable (other->session())
, _fade_in (new AutomationList (*other->_fade_in))