use shared_ptr<> for all region handling
[ardour.git] / libs / ardour / ardour / region_factory.h
1 #ifndef __ardour_region_factory_h__
2 #define __ardour_region_factory_h__
3
4 #include <ardour/types.h>
5 #include <ardour/region.h>
6
7 class XMLNode;
8
9 namespace ARDOUR {
10
11 class Session;
12
13 class RegionFactory {
14
15   public:
16         /* This is emitted only when a new id is assigned. Therefore,
17            in a pure Region copy, it will not be emitted.
18
19            It must be emitted by derived classes, not Region
20            itself, to permit dynamic_cast<> to be used to 
21            infer the type of Region.
22         */
23
24         static sigc::signal<void,boost::shared_ptr<Region> > CheckNewRegion;
25
26         static boost::shared_ptr<Region> create (boost::shared_ptr<Region>, jack_nframes_t start, 
27                                                  jack_nframes_t length, std::string name, 
28                                                  layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
29         static boost::shared_ptr<Region> create (Source&, jack_nframes_t start, jack_nframes_t length, const string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
30         static boost::shared_ptr<Region> create (SourceList &, jack_nframes_t start, jack_nframes_t length, const string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
31         static boost::shared_ptr<Region> create (boost::shared_ptr<Region>);
32         static boost::shared_ptr<Region> create (Session&, XMLNode&, bool);
33         static boost::shared_ptr<Region> create (SourceList &, const XMLNode&);
34 };
35
36 }
37
38 #endif /* __ardour_region_factory_h__  */