diff options
Diffstat (limited to 'libs/audiographer/audiographer/sndfile')
5 files changed, 30 insertions, 30 deletions
diff --git a/libs/audiographer/audiographer/sndfile/sndfile.h b/libs/audiographer/audiographer/sndfile/sndfile.h index c48a0331ab..2fccfc458e 100644 --- a/libs/audiographer/audiographer/sndfile/sndfile.h +++ b/libs/audiographer/audiographer/sndfile/sndfile.h @@ -16,7 +16,7 @@ class Sndfile : public SndfileWriter<T>, public SndfileReader<T> public: Sndfile (std::string const & filename, SndfileBase::Mode mode = SndfileBase::ReadWrite, int format = 0, - ChannelCount channels = 0, framecnt_t samplerate = 0) + ChannelCount channels = 0, samplecnt_t samplerate = 0) : SndfileHandle (filename, mode, format, channels, samplerate) {} diff --git a/libs/audiographer/audiographer/sndfile/sndfile_reader.h b/libs/audiographer/audiographer/sndfile/sndfile_reader.h index ea27470d77..b3e84ac40a 100644 --- a/libs/audiographer/audiographer/sndfile/sndfile_reader.h +++ b/libs/audiographer/audiographer/sndfile/sndfile_reader.h @@ -25,11 +25,11 @@ class SndfileReader SndfileReader (SndfileReader const & other) : SndfileHandle (other) {} using SndfileHandle::operator=; - /** Read data into buffer in \a context, only the data is modified (not frame count) + /** Read data into buffer in \a context, only the data is modified (not sample count) * Note that the data read is output to the outputs, as well as read into the context - * \return number of frames read + * \return number of samples read */ - framecnt_t read (ProcessContext<T> & context) + samplecnt_t read (ProcessContext<T> & context) { if (throw_level (ThrowStrict) && context.channels() != channels() ) { throw Exception (*this, boost::str (boost::format @@ -37,14 +37,14 @@ class SndfileReader % context.channels() % channels())); } - framecnt_t const frames_read = SndfileHandle::read (context.data(), context.frames()); - ProcessContext<T> c_out = context.beginning (frames_read); + samplecnt_t const samples_read = SndfileHandle::read (context.data(), context.samples()); + ProcessContext<T> c_out = context.beginning (samples_read); - if (frames_read < context.frames()) { + if (samples_read < context.samples()) { c_out.set_flag (ProcessContext<T>::EndOfInput); } this->output (c_out); - return frames_read; + return samples_read; } protected: diff --git a/libs/audiographer/audiographer/sndfile/sndfile_writer.h b/libs/audiographer/audiographer/sndfile/sndfile_writer.h index 81f0ddb497..d0049360d2 100644 --- a/libs/audiographer/audiographer/sndfile/sndfile_writer.h +++ b/libs/audiographer/audiographer/sndfile/sndfile_writer.h @@ -27,7 +27,7 @@ class SndfileWriter , public FlagDebuggable<> { public: - SndfileWriter (std::string const & path, int format, ChannelCount channels, framecnt_t samplerate, boost::shared_ptr<BroadcastInfo> broadcast_info) + SndfileWriter (std::string const & path, int format, ChannelCount channels, samplecnt_t samplerate, boost::shared_ptr<BroadcastInfo> broadcast_info) : SndfileHandle (path, Write, format, channels, samplerate) , path (path) { @@ -42,8 +42,8 @@ class SndfileWriter using SndfileHandle::operator=; - framecnt_t get_frames_written() const { return frames_written; } - void reset_frames_written_count() { frames_written = 0; } + samplecnt_t get_samples_written() const { return samples_written; } + void reset_samples_written_count() { samples_written = 0; } /// Writes data to file virtual void process (ProcessContext<T> const & c) @@ -56,10 +56,10 @@ class SndfileWriter % c.channels() % channels())); } - framecnt_t const written = write (c.data(), c.frames()); - frames_written += written; + samplecnt_t const written = write (c.data(), c.samples()); + samples_written += written; - if (throw_level (ThrowProcess) && written != c.frames()) { + if (throw_level (ThrowProcess) && written != c.samples()) { throw Exception (*this, boost::str (boost::format ("Could not write data to output file (%1%)") % strError())); @@ -84,13 +84,13 @@ class SndfileWriter virtual void init() { - frames_written = 0; + samples_written = 0; add_supported_flag (ProcessContext<T>::EndOfInput); } protected: std::string path; - framecnt_t frames_written; + samplecnt_t samples_written; private: SndfileWriter (SndfileWriter const & other) {} diff --git a/libs/audiographer/audiographer/sndfile/tmp_file_rt.h b/libs/audiographer/audiographer/sndfile/tmp_file_rt.h index 4207d3da75..1e2786252b 100644 --- a/libs/audiographer/audiographer/sndfile/tmp_file_rt.h +++ b/libs/audiographer/audiographer/sndfile/tmp_file_rt.h @@ -17,7 +17,7 @@ namespace AudioGrapher { - static const framecnt_t rb_chunksize = 8192; // samples + static const samplecnt_t rb_chunksize = 8192; // samples /** A temporary file deleted after this class is destructed * with realtime safe background thread writer. @@ -29,7 +29,7 @@ class TmpFileRt public: /// \a filename_template must match the requirements for mkstemp, i.e. end in "XXXXXX" - TmpFileRt (char * filename_template, int format, ChannelCount channels, framecnt_t samplerate) + TmpFileRt (char * filename_template, int format, ChannelCount channels, samplecnt_t samplerate) : SndfileHandle (g_mkstemp(filename_template), true, SndfileBase::ReadWrite, format, channels, samplerate) , filename (filename_template) , _chunksize (rb_chunksize * channels) @@ -65,13 +65,13 @@ class TmpFileRt % c.channels() % SndfileHandle::channels())); } - if (SndfileWriter<T>::throw_level (ThrowProcess) && _rb.write_space() < c.frames()) { + if (SndfileWriter<T>::throw_level (ThrowProcess) && _rb.write_space() < c.samples()) { throw Exception (*this, boost::str (boost::format ("Could not write data to ringbuffer/output file (%1%)") % SndfileHandle::strError())); } - _rb.write (c.data(), c.frames()); + _rb.write (c.data(), c.samples()); if (c.has_flag(ProcessContext<T>::EndOfInput)) { _capture = false; @@ -93,11 +93,11 @@ class TmpFileRt pthread_mutex_lock (&_disk_thread_lock); while (_capture) { - if ((framecnt_t)_rb.read_space () >= _chunksize) { + if ((samplecnt_t)_rb.read_space () >= _chunksize) { _rb.read (framebuf, _chunksize); - framecnt_t const written = SndfileBase::write (framebuf, _chunksize); + samplecnt_t const written = SndfileBase::write (framebuf, _chunksize); assert (written == _chunksize); - SndfileWriter<T>::frames_written += written; + SndfileWriter<T>::samples_written += written; } if (!_capture) { break; @@ -107,10 +107,10 @@ class TmpFileRt // flush ringbuffer while (_rb.read_space () > 0) { - size_t remain = std::min ((framecnt_t)_rb.read_space (), _chunksize); + size_t remain = std::min ((samplecnt_t)_rb.read_space (), _chunksize); _rb.read (framebuf, remain); - framecnt_t const written = SndfileBase::write (framebuf, remain); - SndfileWriter<T>::frames_written += written; + samplecnt_t const written = SndfileBase::write (framebuf, remain); + SndfileWriter<T>::samples_written += written; } SndfileWriter<T>::writeSync(); @@ -123,7 +123,7 @@ class TmpFileRt std::string filename; bool _capture; - framecnt_t _chunksize; + samplecnt_t _chunksize; PBD::RingBuffer<T> _rb; pthread_mutex_t _disk_thread_lock; @@ -148,7 +148,7 @@ class TmpFileRt void init() { - SndfileWriter<T>::frames_written = 0; + SndfileWriter<T>::samples_written = 0; _capture = true; SndfileWriter<T>::add_supported_flag (ProcessContext<T>::EndOfInput); pthread_mutex_init (&_disk_thread_lock, 0); diff --git a/libs/audiographer/audiographer/sndfile/tmp_file_sync.h b/libs/audiographer/audiographer/sndfile/tmp_file_sync.h index 7807346935..8eab56a3a6 100644 --- a/libs/audiographer/audiographer/sndfile/tmp_file_sync.h +++ b/libs/audiographer/audiographer/sndfile/tmp_file_sync.h @@ -22,12 +22,12 @@ class TmpFileSync public: /// \a filename_template must match the requirements for mkstemp, i.e. end in "XXXXXX" - TmpFileSync (char * filename_template, int format, ChannelCount channels, framecnt_t samplerate) + TmpFileSync (char * filename_template, int format, ChannelCount channels, samplecnt_t samplerate) : SndfileHandle (g_mkstemp(filename_template), true, SndfileBase::ReadWrite, format, channels, samplerate) , filename (filename_template) {} - TmpFileSync (int format, ChannelCount channels, framecnt_t samplerate) + TmpFileSync (int format, ChannelCount channels, samplecnt_t samplerate) : SndfileHandle (fileno (tmpfile()), true, SndfileBase::ReadWrite, format, channels, samplerate) {} |