lots of fidgety work to get track renaming to work correctly now that we have to...
[ardour.git] / libs / ardour / externalsource.cc
index de560bfce5d768cec5b74826a08b08b9ac176556..4fb102a4a0159f4099ec9c4d4c77a0aa26cec8f1 100644 (file)
@@ -84,24 +84,63 @@ ExternalSource::peak_path (string audio_path)
        return res;
 }
 
-string
-ExternalSource::old_peak_path (string audio_path)
+#ifdef HAVE_COREAUDIO
+
+ExternalSource*
+ExternalSource::create (const XMLNode& node)
 {
-       return peak_path (audio_path);
+       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)