use SilentFileSource when sources cannot be found
[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         static boost::shared_ptr<Source> createSilent (Session&, const XMLNode& node, nframes_t nframes, float sample_rate);
24
25         // MIDI sources will have to be hacked in here somehow
26         static boost::shared_ptr<Source> createReadable (Session&, std::string path, int chn, AudioFileSource::Flag flags, bool announce = true);
27         static boost::shared_ptr<Source> createWritable (Session&, std::string name, bool destructive, nframes_t rate, bool announce = true);
28
29   private:
30         static int setup_peakfile (boost::shared_ptr<Source>);
31 };
32
33 }
34
35 #endif /* __ardour_source_factory_h__ */