summaryrefslogtreecommitdiff
path: root/libs/audiographer/audiographer/sndfile/sndfile_writer.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-07-15 17:03:07 +0200
committerRobin Gareus <robin@gareus.org>2016-07-16 02:14:13 +0200
commit77687519b69f39aaa2354f4c9945958fc1c630fe (patch)
tree36ed0f367bc81cccaba0ed01d837c56ff2fea072 /libs/audiographer/audiographer/sndfile/sndfile_writer.h
parent6626723880e6d464bf8d59178120d191a8423c93 (diff)
Refactor TmpFile into an abstract base class
This allows a TmpFile pointer to be either a Sync or Async (Threaded) writer. As result we must be able to handle both RT and non RT processing. Still, post-processing (normalization and encoding) should always happen faster than realtime (freewheeling). Since jack does not allow a client to change to freewheeling from within the process-callback, the async-writer disk-thread FileFlushed is used to initiate post-processing.
Diffstat (limited to 'libs/audiographer/audiographer/sndfile/sndfile_writer.h')
-rw-r--r--libs/audiographer/audiographer/sndfile/sndfile_writer.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/libs/audiographer/audiographer/sndfile/sndfile_writer.h b/libs/audiographer/audiographer/sndfile/sndfile_writer.h
index 57ad968dc5..81f0ddb497 100644
--- a/libs/audiographer/audiographer/sndfile/sndfile_writer.h
+++ b/libs/audiographer/audiographer/sndfile/sndfile_writer.h
@@ -40,19 +40,13 @@ class SndfileWriter
virtual ~SndfileWriter () {}
- SndfileWriter (SndfileWriter const & other)
- : SndfileHandle (other)
- {
- init();
- }
-
using SndfileHandle::operator=;
framecnt_t get_frames_written() const { return frames_written; }
void reset_frames_written_count() { frames_written = 0; }
/// Writes data to file
- void process (ProcessContext<T> const & c)
+ virtual void process (ProcessContext<T> const & c)
{
check_flags (*this, c);
@@ -88,7 +82,7 @@ class SndfileWriter
init();
}
- void init()
+ virtual void init()
{
frames_written = 0;
add_supported_flag (ProcessContext<T>::EndOfInput);
@@ -97,6 +91,9 @@ class SndfileWriter
protected:
std::string path;
framecnt_t frames_written;
+
+ private:
+ SndfileWriter (SndfileWriter const & other) {}
};
} // namespace