summaryrefslogtreecommitdiff
path: root/libs/ardour/source_factory.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-05-16 15:49:26 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-05-16 15:49:26 +0000
commit4b5bd4ca46fe00a473682bf21927a0d67ac1a3a4 (patch)
tree290d12cefb2ec876d922b88deb2800b73d67a38a /libs/ardour/source_factory.cc
parentad5a326694fb29303bd23dc7a36e500211c621d3 (diff)
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
Diffstat (limited to 'libs/ardour/source_factory.cc')
-rw-r--r--libs/ardour/source_factory.cc10
1 files changed, 8 insertions, 2 deletions
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<AudioPlaylist> ap = boost::dynamic_pointer_cast<AudioPlaylist>(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<Source> ret (src);
if (setup_peakfile (ret, defer_peaks)) {