Remove no-longer used file.
[ardour.git] / libs / ardour / audiosource.cc
index d8640306463708c61bedeb64c23d08c546478686..083cf3bea903273d1f203bf2d2f2ccdeed794861 100644 (file)
@@ -126,14 +126,20 @@ AudioSource::set_state (const XMLNode& node, int /*version*/)
        return 0;
 }
 
-sframes_t
-AudioSource::length (sframes_t /*pos*/) const
+bool
+AudioSource::empty () const
+{
+        return _length == 0;
+}
+
+framecnt_t
+AudioSource::length (framepos_t /*pos*/) const
 {
        return _length;
 }
 
 void
-AudioSource::update_length (sframes_t pos, sframes_t cnt)
+AudioSource::update_length (framepos_t pos, framecnt_t cnt)
 {
        if (pos + cnt > _length) {
                _length = pos + cnt;
@@ -874,7 +880,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, framepos_t first_frame, frame
                off_t target_length = blocksize * ((first_peak_byte + blocksize + 1) / blocksize);
 
                if (endpos < target_length) {
-                       ftruncate (_peakfile_fd, target_length);
+                       (void) ftruncate (_peakfile_fd, target_length);
                        /* error doesn't actually matter though, so continue on without testing */
                }
        }
@@ -917,7 +923,7 @@ AudioSource::truncate_peakfile ()
        off_t end = lseek (_peakfile_fd, 0, SEEK_END);
 
        if (end > _peak_byte_max) {
-               ftruncate (_peakfile_fd, _peak_byte_max);
+               (void) ftruncate (_peakfile_fd, _peak_byte_max);
        }
 }
 
@@ -939,3 +945,14 @@ AudioSource::available_peaks (double zoom_factor) const
        return (end/sizeof(PeakData)) * _FPP;
 }
 
+void
+AudioSource::dec_read_data_count (nframes_t cnt)
+{
+        uint32_t val = cnt * sizeof (Sample);
+
+        if (val < _read_data_count) {
+                _read_data_count -= val;
+        } else { 
+                _read_data_count = 0;
+        }
+}