Remove unused variables.
[ardour.git] / libs / ardour / coreaudiosource.cc
index a4da378aa43d43f6bf89479701753cea7af239f6..ef99b9afcfb7c5adcb15009837f19c21ed93f95e 100644 (file)
@@ -19,7 +19,6 @@
 */
 
 #include <algorithm>
-#define __STDC_FORMAT_MACROS
 #include <inttypes.h>
 
 #include "pbd/error.h"
@@ -44,7 +43,7 @@ CoreAudioSource::CoreAudioSource (Session& s, const XMLNode& node)
        init_cafile ();
 }
 
-CoreAudioSource::CoreAudioSource (Session& s, const string& path, bool, int chn, Flag flags)
+CoreAudioSource::CoreAudioSource (Session& s, const string& path, int chn, Flag flags)
        /* files created this way are never writable or removable */
        : Source (s, DataType::AUDIO, path, Source::Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy))),
                AudioFileSource (s, path,
@@ -90,20 +89,19 @@ CoreAudioSource::init_cafile ()
 
 CoreAudioSource::~CoreAudioSource ()
 {
-       GoingAway (); /* EMIT SIGNAL */
 }
 
 int
-CoreAudioSource::safe_read (Sample* dst, nframes_t start, nframes_t cnt, AudioBufferList& abl) const
+CoreAudioSource::safe_read (Sample* dst, framepos_t start, framecnt_t cnt, AudioBufferList& abl) const
 {
-       nframes_t nread = 0;
+       framecnt_t nread = 0;
 
        while (nread < cnt) {
 
                try {
                        af.Seek (start+nread);
                } catch (CAXException& cax) {
-                       error << string_compose("CoreAudioSource: %1 to %2 (%3)", cax.mOperation, start+nread, _name.substr (1)) << endmsg;
+                       error << string_compose("CoreAudioSource: %1 to %2 (%3)", cax.mOperation, start+nread, _name.val().substr (1)) << endmsg;
                        return -1;
                }
 
@@ -139,10 +137,10 @@ CoreAudioSource::safe_read (Sample* dst, nframes_t start, nframes_t cnt, AudioBu
 }
 
 
-nframes_t
-CoreAudioSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const
+framecnt_t
+CoreAudioSource::read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const
 {
-       nframes_t file_cnt;
+       framecnt_t file_cnt;
        AudioBufferList abl;
 
        abl.mNumberBuffers = 1;
@@ -168,7 +166,7 @@ CoreAudioSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) con
        }
 
        if (file_cnt != cnt) {
-               nframes_t delta = cnt - file_cnt;
+               frameoffset_t delta = cnt - file_cnt;
                memset (dst+file_cnt, 0, sizeof (Sample) * delta);
        }
 
@@ -176,7 +174,6 @@ CoreAudioSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) con
 
                if (n_channels == 1) {
                        if (safe_read (dst, start, file_cnt, abl) == 0) {
-                               _read_data_count = cnt * sizeof (Sample);
                                return cnt;
                        }
                        return 0;
@@ -189,13 +186,11 @@ CoreAudioSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) con
                return 0;
        }
 
-       _read_data_count = cnt * sizeof(float);
-
        Sample *ptr = interleave_buf + _channel;
 
        /* stride through the interleaved data */
 
-       for (uint32_t n = 0; n < file_cnt; ++n) {
+       for (framecnt_t n = 0; n < file_cnt; ++n) {
                dst[n] = *ptr;
                ptr += n_channels;
        }
@@ -219,13 +214,13 @@ CoreAudioSource::sample_rate() const
 }
 
 int
-CoreAudioSource::update_header (sframes_t when, struct tm&, time_t)
+CoreAudioSource::update_header (framepos_t, struct tm&, time_t)
 {
        return 0;
 }
 
 int
-CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg)
+CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&)
 {
        FSRef ref;
        ExtAudioFileRef af = 0;
@@ -369,3 +364,9 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&
        return ret;
 
 }
+
+void
+CoreAudioSource::set_path (const string& p)
+{
+        FileSource::set_path (p);
+}