bd5089f512d59ef28e512e0cb3c470d8a293206d
[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         static sigc::signal<void,boost::shared_ptr<Region> > CheckNewRegion;
24
25         static boost::shared_ptr<Region> create (boost::shared_ptr<Region>, jack_nframes_t start, 
26                                                  jack_nframes_t length, std::string name, 
27                                                  layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
28         static boost::shared_ptr<Region> create (boost::shared_ptr<AudioRegion>, jack_nframes_t start, 
29                                                  jack_nframes_t length, std::string name, 
30                                                  layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
31         static boost::shared_ptr<Region> create (boost::shared_ptr<Source>, jack_nframes_t start, jack_nframes_t length, const string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
32         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);
33         static boost::shared_ptr<Region> create (boost::shared_ptr<Region>);
34         static boost::shared_ptr<Region> create (Session&, XMLNode&, bool);
35         static boost::shared_ptr<Region> create (SourceList &, const XMLNode&);
36 };
37
38 }
39
40 #endif /* __ardour_region_factory_h__  */