1 #ifndef AUDIOGRAPHER_SNDFILE_WRITER_H
2 #define AUDIOGRAPHER_SNDFILE_WRITER_H
6 #include <boost/format.hpp>
22 template <
typename T = DefaultSampleType>
37 broadcast_info->write_to_file (
this);
43 using SndfileHandle::operator=;
54 throw Exception (*
this, boost::str (boost::format
55 (
"Wrong number of channels given to process(), %1% instead of %2%")
63 throw Exception (*
this, boost::str (boost::format
64 (
"Could not write data to output file (%1%)")
88 throw Exception (*
this, boost::str (boost::format
89 (
"Could not create output file (%1%)") %
path));
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::Signal1< void, std::string > FileWritten
SndfileWriter(SndfileWriter const &other)
bool throw_level(ThrowLevel level)
@ ThrowProcess
Process cycle level stuff.
@ ThrowStrict
Stricter checks than ThrowProcess, less than ThrowSample.