fix abort-capture path, including many subtle issues with shared_ptr<>; remove old...
[ardour.git] / libs / ardour / ardour / source_factory.h
1 #ifndef __ardour_source_factory_h__
2 #define __ardour_source_factory_h__
3
4 #include <string>
5 #include <stdint.h>
6 #include <sigc++/sigc++.h>
7 #include <boost/shared_ptr.hpp>
8
9 #include <ardour/source.h>
10 #include <ardour/audiofilesource.h>
11
12 class XMLNode;
13
14 namespace ARDOUR {
15
16 class Session;
17
18 class SourceFactory {
19   public:
20         static sigc::signal<void,boost::shared_ptr<Source> > SourceCreated;
21
22         static boost::shared_ptr<Source> create (Session&, const XMLNode& node);
23
24         // MIDI sources will have to be hacked in here somehow
25         static boost::shared_ptr<Source> createReadable (Session&, std::string idstr, AudioFileSource::Flag flags, bool announce = true);
26         static boost::shared_ptr<Source> createWritable (Session&, std::string name, bool destructive, nframes_t rate, bool announce = true);
27
28   private:
29         static int setup_peakfile (boost::shared_ptr<Source>);
30 };
31
32 }
33
34 #endif /* __ardour_source_factory_h__ */