Remove C++11'ism
[ardour.git] / libs / ardour / ardour / coreaudiosource.h
index f12a67ded7fae8ad8c05a8e1e38cf16a38add86a..f61c6bb9845127d38e619dbdd71d593e8ecd7289 100644 (file)
 #ifndef __coreaudio_source_h__
 #define __coreaudio_source_h__
 
-#include <appleutility/CAAudioFile.h>
+#ifdef COREAUDIO105
+#include "CAAudioFile.h"
+#else
+#include "CAExtAudioFile.h"
+#endif
 #include "ardour/audiofilesource.h"
 #include <string>
 
@@ -37,7 +41,9 @@ class LIBARDOUR_API CoreAudioSource : public AudioFileSource {
        void set_path (const std::string& p);
 
        float sample_rate() const;
-       int update_header (framepos_t when, struct tm&, time_t);
+       int update_header (samplepos_t when, struct tm&, time_t);
+
+    uint32_t channel_count () const { return n_channels; }
 
        int flush_header () {return 0;};
        void set_header_timeline_position () {};
@@ -48,15 +54,20 @@ class LIBARDOUR_API CoreAudioSource : public AudioFileSource {
        static int get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg);
 
   protected:
-       framecnt_t read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const;
-       framecnt_t write_unlocked (Sample *, framecnt_t) { return 0; }
+       void close ();
+       samplecnt_t read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) const;
+       samplecnt_t write_unlocked (Sample *, samplecnt_t) { return 0; }
 
   private:
+#ifdef COREAUDIO105
        mutable CAAudioFile af;
+#else
+       mutable CAExtAudioFile af;
+#endif
        uint16_t n_channels;
 
        void init_cafile ();
-       int safe_read (Sample*, framepos_t start, framecnt_t cnt, AudioBufferList&) const;
+       int safe_read (Sample*, samplepos_t start, samplecnt_t cnt, AudioBufferList&) const;
 };
 
 }; /* namespace ARDOUR */