-#ifdef HAVE_COREAUDIO
-
-AudioFileSource*
-AudioFileSource::create (const XMLNode& node)
-{
- AudioFileSource* es = 0;
-
- if (node.property (X_("destructive")) != 0) {
-
- es = new DestructiveFileSource (node);
-
- } else {
-
- try {
- es = new CoreAudioSource (node);
- }
-
-
- catch (failed_constructor& err) {
- es = new SndFileSource (node);
- }
- }
-
- return es;
-}
-
-#else
-
-AudioFileSource*
-AudioFileSource::create (const XMLNode& node)
-{
- if (node.property (X_("destructive")) != 0) {
-
- return new DestructiveFileSource (node);
-
- } else {
-
- return new SndFileSource (node);
- }
-}
-
-#endif // HAVE_COREAUDIO
-
-#ifdef HAVE_COREAUDIO
-AudioFileSource*
-AudioFileSource::create (const string& idstr, Flag flags)
-{
- AudioFileSource* es = 0;
-
- try {
- es = new CoreAudioSource (idstr, flags);
- }
-
- catch (failed_constructor& err) {
- es = new SndFileSource (idstr, flags);
- }
-
- return es;
-}
-
-#else
-
-AudioFileSource*
-AudioFileSource::create (const string& idstr, Flag flags)
-{
- return new SndFileSource (idstr, flags);
-}
-
-#endif // HAVE_COREAUDIO
-
-#ifdef HAVE_COREAUDIO
-std::string
-CFStringRefToStdString(CFStringRef stringRef)
-{
- CFIndex size =
- CFStringGetMaximumSizeForEncoding(CFStringGetLength(stringRef) ,
- kCFStringEncodingASCII);
- char *buf = new char[size];
-
- std::string result;
-
- if(CFStringGetCString(stringRef, buf, size, kCFStringEncodingASCII)) {
- result = buf;
- }
- delete [] buf;
- return result;
-}
-#endif // HAVE_COREAUDIO
-