From 1e05b4389dab5912fb4178d489aa9eef639d823c Mon Sep 17 00:00:00 2001 From: Taybin Rutkin Date: Fri, 10 Mar 2006 18:43:08 +0000 Subject: [PATCH] Link error fixed. Stub functions filled in. git-svn-id: svn://localhost/trunk/ardour2@374 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/coreaudio_source.h | 1 - libs/ardour/ardour/externalsource.h | 3 +- libs/ardour/ardour/sndfilesource.h | 1 - libs/ardour/externalsource.cc | 45 +++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/libs/ardour/ardour/coreaudio_source.h b/libs/ardour/ardour/coreaudio_source.h index c8634cb9e2..6ae74b7304 100644 --- a/libs/ardour/ardour/coreaudio_source.h +++ b/libs/ardour/ardour/coreaudio_source.h @@ -42,7 +42,6 @@ class CoreAudioSource : public ExternalSource { mutable PBD::Lock _tmpbuf_lock; void init (const string &str, bool build_peak); - jack_nframes_t read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const; }; }; /* namespace ARDOUR */ diff --git a/libs/ardour/ardour/externalsource.h b/libs/ardour/ardour/externalsource.h index 3ba19dc1d5..17504d0afc 100644 --- a/libs/ardour/ardour/externalsource.h +++ b/libs/ardour/ardour/externalsource.h @@ -58,8 +58,7 @@ class ExternalSource : public Source { uint16_t channel; string _path; - virtual void init (const string &str, bool build_peak) = 0; - virtual jack_nframes_t read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const; + jack_nframes_t read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const; }; }; /* namespace ARDOUR */ diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h index 53e5b9df67..37167e6a9a 100644 --- a/libs/ardour/ardour/sndfilesource.h +++ b/libs/ardour/ardour/sndfilesource.h @@ -46,7 +46,6 @@ class SndFileSource : public ExternalSource { mutable PBD::Lock _tmpbuf_lock; void init (const string &str, bool build_peak); - jack_nframes_t read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const; }; }; /* namespace ARDOUR */ diff --git a/libs/ardour/externalsource.cc b/libs/ardour/externalsource.cc index de560bfce5..568100ca44 100644 --- a/libs/ardour/externalsource.cc +++ b/libs/ardour/externalsource.cc @@ -90,18 +90,63 @@ ExternalSource::old_peak_path (string audio_path) return peak_path (audio_path); } +#ifdef HAVE_COREAUDIO + +ExternalSource* +ExternalSource::create (const XMLNode& node) +{ + ExternalSource* es = 0; + + try { + es = new CoreAudioSource (node); + } + + catch (failed_constructor& err) { + es = new SndFileSource (node); + } + + es = new SndFileSource (node); + + return es; +} + +#else + ExternalSource* ExternalSource::create (const XMLNode& node) { return new SndFileSource (node); } +#endif // HAVE_COREAUDIO + +#ifdef HAVE_COREAUDIO +ExternalSource* +ExternalSource::create (const string& idstr, bool build_peak) +{ + ExternalSource* es = 0; + + try { + es = new CoreAudioSource (idstr, build_peak); + } + + catch (failed_constructor& err) { + es = new SndFileSource (idstr, build_peak); + } + + return es; +} + +#else + ExternalSource* ExternalSource::create (const string& idstr, bool build_peak) { return new SndFileSource (idstr, build_peak); } +#endif // HAVE_COREAUDIO + #ifdef HAVE_COREAUDIO std::string CFStringRefToStdString(CFStringRef stringRef)