summaryrefslogtreecommitdiff
path: root/libs/ardour/source_factory.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-01-28 17:44:13 +0000
committerDavid Robillard <d@drobilla.net>2007-01-28 17:44:13 +0000
commitf9f5ec85fbfd15d0008f70d4185a84eeadfd3891 (patch)
treeadb7e13707b1361604c1ec57c0ea405125a4e98e /libs/ardour/source_factory.cc
parentcd37c36326a165ddf6eb83c176213b0732a6db0d (diff)
Merged with trunk R1393.
git-svn-id: svn://localhost/ardour2/branches/midi@1395 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/source_factory.cc')
-rw-r--r--libs/ardour/source_factory.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc
index ad01bf6171..560bf03e7f 100644
--- a/libs/ardour/source_factory.cc
+++ b/libs/ardour/source_factory.cc
@@ -131,14 +131,13 @@ SourceFactory::create (Session& s, const XMLNode& node)
#ifdef HAVE_COREAUDIO
boost::shared_ptr<Source>
-SourceFactory::createReadable (DataType type, Session& s, string idstr, AudioFileSource::Flag flags, bool announce)
+SourceFactory::createReadable (DataType type, Session& s, string path, int chn, AudioFileSource::Flag flags, bool announce)
{
if (type == DataType::AUDIO) {
-
if (!(flags & Destructive)) {
try {
- boost::shared_ptr<Source> ret (new CoreAudioSource (s, idstr, flags));
+ boost::shared_ptr<Source> ret (new CoreAudioSource (s, path, chn, flags));
if (setup_peakfile (ret)) {
return boost::shared_ptr<Source>();
}
@@ -149,7 +148,7 @@ SourceFactory::createReadable (DataType type, Session& s, string idstr, AudioFil
}
catch (failed_constructor& err) {
- boost::shared_ptr<Source> ret (new SndFileSource (s, idstr, flags));
+ boost::shared_ptr<Source> ret (new SndFileSource (s, path, chn, flags));
if (setup_peakfile (ret)) {
return boost::shared_ptr<Source>();
}
@@ -161,7 +160,7 @@ SourceFactory::createReadable (DataType type, Session& s, string idstr, AudioFil
} else {
- boost::shared_ptr<Source> ret (new SndFileSource (s, idstr, flags));
+ boost::shared_ptr<Source> ret (new SndFileSource (s, path, chn, flags));
if (setup_peakfile (ret)) {
return boost::shared_ptr<Source>();
}
@@ -171,6 +170,7 @@ SourceFactory::createReadable (DataType type, Session& s, string idstr, AudioFil
return ret;
}
+ return boost::shared_ptr<Source>();
} else if (type == DataType::MIDI) {
boost::shared_ptr<Source> ret (new SMFSource (s, node));
@@ -187,11 +187,11 @@ SourceFactory::createReadable (DataType type, Session& s, string idstr, AudioFil
#else
boost::shared_ptr<Source>
-SourceFactory::createReadable (DataType type, Session& s, string idstr, AudioFileSource::Flag flags, bool announce)
+SourceFactory::createReadable (DataType type, Session& s, string path, int chn, AudioFileSource::Flag flags, bool announce)
{
if (type == DataType::AUDIO) {
-
- boost::shared_ptr<Source> ret (new SndFileSource (s, idstr, flags));
+
+ boost::shared_ptr<Source> ret (new SndFileSource (s, path, chn, flags));
if (setup_peakfile (ret)) {
return boost::shared_ptr<Source>();
@@ -203,10 +203,11 @@ SourceFactory::createReadable (DataType type, Session& s, string idstr, AudioFil
return ret;
+
} else if (type == DataType::MIDI) {
// FIXME: flags?
- boost::shared_ptr<Source> ret (new SMFSource (s, idstr, SMFSource::Flag(0)));
+ boost::shared_ptr<Source> ret (new SMFSource (s, path, SMFSource::Flag(0)));
if (announce) {
SourceCreated (ret);