From 4b5bd4ca46fe00a473682bf21927a0d67ac1a3a4 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 16 May 2011 15:49:26 +0000 Subject: refactor playlist sources to allow for MIDI and upcoming work on save/restore git-svn-id: svn://localhost/ardour2/branches/3.0@9521 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/source_factory.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libs/ardour/source_factory.cc') diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc index 1bf3956694..4d3f02b1dc 100644 --- a/libs/ardour/source_factory.cc +++ b/libs/ardour/source_factory.cc @@ -332,9 +332,15 @@ SourceFactory::createFromPlaylist (DataType type, Session& s, boost::shared_ptr< try { boost::shared_ptr ap = boost::dynamic_pointer_cast(p); - + if (ap) { - Source* src = new AudioPlaylistSource (s, name, ap, chn, start, len, copy, Source::Flag (0)); + + if (copy) { + ap.reset (new AudioPlaylist (ap, start, len, name, true)); + start = 0; + } + + Source* src = new AudioPlaylistSource (s, name, ap, chn, start, len, Source::Flag (0)); boost::shared_ptr ret (src); if (setup_peakfile (ret, defer_peaks)) { -- cgit v1.2.3