remove all lines to avoid recompiles after commits
[ardour.git] / libs / ardour / playlist_factory.cc
1 /*
2     Copyright (C) 2000-2006 Paul Davis 
3
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.
8
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.
13
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.
17
18 */
19
20 #include <pbd/error.h>
21
22 #include <ardour/playlist.h>
23 #include <ardour/audioplaylist.h>
24 #include <ardour/playlist_factory.h>
25
26 #include "i18n.h"
27
28 using namespace ARDOUR;
29 using namespace PBD;
30
31 sigc::signal<void,boost::shared_ptr<Playlist> > PlaylistFactory::PlaylistCreated;
32
33 boost::shared_ptr<Playlist> 
34 PlaylistFactory::create (Session& s, const XMLNode& node, bool hidden) 
35 {
36         boost::shared_ptr<Playlist> pl;
37
38         pl = boost::shared_ptr<Playlist> (new AudioPlaylist (s, node, hidden));
39
40         pl->set_region_ownership ();
41
42         if (!hidden) {
43                 PlaylistCreated (pl);
44         }
45         return pl;
46 }
47
48 boost::shared_ptr<Playlist> 
49 PlaylistFactory::create (Session& s, string name, bool hidden) 
50 {
51         boost::shared_ptr<Playlist> pl;
52
53         pl = boost::shared_ptr<Playlist> (new AudioPlaylist (s, name, hidden));
54
55         if (!hidden) {
56                 PlaylistCreated (pl);
57         }
58
59         return pl;
60 }
61
62 boost::shared_ptr<Playlist> 
63 PlaylistFactory::create (boost::shared_ptr<const Playlist> old, string name, bool hidden) 
64 {
65         boost::shared_ptr<Playlist> pl;
66         boost::shared_ptr<const AudioPlaylist> apl;
67
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 ();
71         }
72
73         if (!hidden) {
74                 PlaylistCreated (pl);
75         }
76
77         return pl;
78 }
79
80 boost::shared_ptr<Playlist> 
81 PlaylistFactory::create (boost::shared_ptr<const Playlist> old, nframes_t start, nframes_t cnt, string name, bool hidden) 
82 {
83         boost::shared_ptr<Playlist> pl;
84         boost::shared_ptr<const AudioPlaylist> apl;
85         
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 ();
89         }
90
91         /* this factory method does NOT notify others */
92
93         return pl;
94 }