1 #ifndef AUDIOGRAPHER_SNDFILE_WRITER_H
2 #define AUDIOGRAPHER_SNDFILE_WRITER_H
21 template <
typename T = DefaultSampleType>
36 broadcast_info->write_to_file (
this);
42 using SndfileHandle::operator=;
54 (
"Wrong number of channels given to process(), %1 instead of %2",
62 std::stringstream reason;
63 reason <<
"Could not write data to output file ("
90 std::stringstream reason;
91 reason <<
"Could not write data to output file ("
A debugging class for nodes that support a certain set of flags.
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)
SndfileWriter()
SndfileHandle has to be constructed directly by deriving classes.
samplecnt_t samples_written
SndfileWriter(std::string const &path, int format, ChannelCount channels, samplecnt_t samplerate, std::shared_ptr< BroadcastInfo > broadcast_info)
virtual void process(ProcessContext< T > const &c)
Writes data to file.
void reset_samples_written_count()
samplecnt_t get_samples_written() const
PBD::Signal< void(std::string)> FileWritten
SndfileWriter(SndfileWriter const &other)
bool throw_level(ThrowLevel level)
std::string string_compose(const std::string &fmt, const T1 &o1)
@ ThrowProcess
Process cycle level stuff.
@ ThrowStrict
Stricter checks than ThrowProcess, less than ThrowSample.