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;
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 */
}
}
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);
}
}
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;
+ }
+}