make LADSPA and LV2 plugins pay attention to "offset" in connect_and_run, again ...
[ardour2.git] / libs / ardour / playlist_factory.cc
blob9cbdba0c792b8f101a06f11c649339b8b1e868ac
1 /*
2 Copyright (C) 2000-2006 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <pbd/error.h>
22 #include <ardour/playlist.h>
23 #include <ardour/audioplaylist.h>
24 #include <ardour/playlist_factory.h>
26 #include "i18n.h"
28 using namespace ARDOUR;
29 using namespace PBD;
31 sigc::signal<void,boost::shared_ptr<Playlist> > PlaylistFactory::PlaylistCreated;
33 boost::shared_ptr<Playlist>
34 PlaylistFactory::create (Session& s, const XMLNode& node, bool hidden)
36 boost::shared_ptr<Playlist> pl;
38 pl = boost::shared_ptr<Playlist> (new AudioPlaylist (s, node, hidden));
40 pl->set_region_ownership ();
42 if (!hidden) {
43 PlaylistCreated (pl);
45 return pl;
48 boost::shared_ptr<Playlist>
49 PlaylistFactory::create (Session& s, string name, bool hidden)
51 boost::shared_ptr<Playlist> pl;
53 pl = boost::shared_ptr<Playlist> (new AudioPlaylist (s, name, hidden));
55 if (!hidden) {
56 PlaylistCreated (pl);
59 return pl;
62 boost::shared_ptr<Playlist>
63 PlaylistFactory::create (boost::shared_ptr<const Playlist> old, string name, bool hidden)
65 boost::shared_ptr<Playlist> pl;
66 boost::shared_ptr<const AudioPlaylist> apl;
68 if ((apl = boost::dynamic_pointer_cast<const AudioPlaylist> (old)) != 0) {
69 pl = boost::shared_ptr<Playlist> (new AudioPlaylist (apl, name, hidden));
70 pl->set_region_ownership ();
73 if (!hidden) {
74 PlaylistCreated (pl);
77 return pl;
80 boost::shared_ptr<Playlist>
81 PlaylistFactory::create (boost::shared_ptr<const Playlist> old, nframes_t start, nframes_t cnt, string name, bool hidden)
83 boost::shared_ptr<Playlist> pl;
84 boost::shared_ptr<const AudioPlaylist> apl;
86 if ((apl = boost::dynamic_pointer_cast<const AudioPlaylist> (old)) != 0) {
87 pl = boost::shared_ptr<Playlist> (new AudioPlaylist (apl, start, cnt, name, hidden));
88 pl->set_region_ownership ();
91 /* this factory method does NOT notify others */
93 return pl;