summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/source_factory.h
blob: be1551f518f8eb6488a1ff9cc919f9f3aec4767f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __ardour_source_factory_h__
#define __ardour_source_factory_h__

#include <string>
#include <stdint.h>
#include <sigc++/sigc++.h>
#include <boost/shared_ptr.hpp>

#include <ardour/source.h>
#include <ardour/audiofilesource.h>

class XMLNode;

namespace ARDOUR {

class Session;

class SourceFactory {
  public:
	static sigc::signal<void,boost::shared_ptr<Source> > SourceCreated;

	static boost::shared_ptr<Source> create (Session&, const XMLNode& node);

	// MIDI sources will have to be hacked in here somehow
	static boost::shared_ptr<Source> createReadable (DataType type, Session&, std::string idstr, AudioFileSource::Flag flags, bool announce = true);
	static boost::shared_ptr<Source> createWritable (DataType type, Session&, std::string name, bool destructive, nframes_t rate, bool announce = true);

  private:
	static int setup_peakfile (boost::shared_ptr<Source>);
};

}

#endif /* __ardour_source_factory_h__ */