Rename internal sends when their send-to bus changes.
[ardour.git] / libs / ardour / ardour / coreaudiosource.h
index ba9f122fc9870536ef21721e804110dac07a7396..7720ca739583c042673f64ba2af750e4dd61040f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2000 Paul Davis 
+    Copyright (C) 2000 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
-#ifndef __coreaudio_source_h__ 
+#ifndef __coreaudio_source_h__
 #define __coreaudio_source_h__
 
-#include <ardour/audiofilesource.h>
-#include <AudioToolbox/ExtendedAudioFile.h>
+#include <appleutility/CAAudioFile.h>
+#include "ardour/audiofilesource.h"
+#include <string>
+
+using namespace std;
 
 namespace ARDOUR {
 
 class CoreAudioSource : public AudioFileSource {
   public:
-       CoreAudioSource (const XMLNode&);
-       CoreAudioSource (const string& path_plus_channel, Flag);
+       CoreAudioSource (ARDOUR::Session&, const XMLNode&);
+       CoreAudioSource (ARDOUR::Session&, const string& path, bool, int chn, Flag);
        ~CoreAudioSource ();
 
        float sample_rate() const;
-       int update_header (jack_nframes_t when, struct tm&, time_t);
+       int update_header (sframes_t when, struct tm&, time_t);
 
        int flush_header () {return 0;};
        void set_header_timeline_position () {};
 
+       static int get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg);
+
   protected:
-       jack_nframes_t read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const;
-       
-       jack_nframes_t write_unlocked (Sample *dst, jack_nframes_t cnt, char * workbuf) 
-       { return 0; }
-       
+       nframes_t read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const;
+       nframes_t write_unlocked (Sample *dst, nframes_t cnt) { return 0; }
 
   private:
-       ExtAudioFileRef af;
+       mutable CAAudioFile af;
        uint16_t n_channels;
 
-       mutable float *tmpbuf;
-       mutable jack_nframes_t tmpbufsize;
-       mutable Glib::Mutex _tmpbuf_lock;
-
-       void init (const string &str);
+       void init ();
+       int safe_read (Sample*, nframes_t start, nframes_t cnt, AudioBufferList&) const;
 };
 
 }; /* namespace ARDOUR */