1 #ifndef AUDIOGRAPHER_TMP_FILE_RT_H
2 #define AUDIOGRAPHER_TMP_FILE_RT_H
29 template<
typename T = DefaultSampleType>
45 using SndfileHandle::operator=;
68 (
"Wrong number of channels given to process(), %1 instead of %2",
74 (
"Could not write data to ringbuffer/output file (%1)",
96 T *framebuf = (T*) malloc (
_chunksize *
sizeof (T));
114 while (
_rb.read_space () > 0) {
116 _rb.read (framebuf, remain);
164 throw Exception (*
this,
"Cannot create export disk writer");
void check_flags(SelfType &self, ProcessContext< ContextType > context)
Prints debug output if context contains flags that are not supported by this class.
void add_supported_flag(Flag flag)
Adds a flag to the set of flags supported.
ChannelCount const & channels() const
bool has_flag(Flag flag) const
T const * data() const
data points to the array of data to process
samplecnt_t const & samples() const
samples tells how many samples the array pointed by data contains
Base class for all classes using libsndfile.
int samplerate(void) const
const char * strError(void) const
sf_count_t write(const short *ptr, sf_count_t items)
PBD::Signal< void(std::string)> FileWritten
void process(ProcessContext< T > const &c)
Writes data to file.
TmpFileRt(char *filename_template, int format, ChannelCount channels, samplecnt_t samplerate)
filename_template must match the requirements for mkstemp, i.e. end in "XXXXXX"
TmpFileRt(TmpFileRt const &other)
static void * _disk_thread(void *arg)
pthread_cond_t _data_ready
pthread_mutex_t _disk_thread_lock
A temporary file deleted after this class is destructed.
PBD::Signal< void()> FileFlushed
std::string string_compose(const std::string &fmt, const T1 &o1)
@ ThrowProcess
Process cycle level stuff.
@ ThrowStrict
Stricter checks than ThrowProcess, less than ThrowSample.
static const samplecnt_t rb_chunksize
int pthread_create_and_store(std::string name, pthread_t *thread, void *(*start_routine)(void *), void *arg, uint32_t stacklimit=0x80000)