1 #ifndef AUDIOGRAPHER_CMDPIPE_WRITER_H
2 #define AUDIOGRAPHER_CMDPIPE_WRITER_H
7 #include <boost/format.hpp>
25 template <
typename T = DefaultSampleType>
73 throw Exception (*
this, boost::str (boost::format
74 (
"Target encoder process is not running")));
77 const size_t bytes_per_sample =
sizeof (T);
80 written = write (
_tmp_fd, (
const void*) c.
data(), c.
samples() * bytes_per_sample) / bytes_per_sample;
88 throw Exception (*
this, boost::str (boost::format
89 (
"Could not write data to output file")));
int start(StdErrMode stderr_mode=IgnoreAndClose)
samplecnt_t get_samples_written() const
CmdPipeWriter(CmdPipeWriter const &other)
virtual void process(ProcessContext< T > const &c)
CmdPipeWriter(ARDOUR::SystemExec *proc, std::string const &path, int tmp_fd=-1, gchar *tmp_file=0)
samplecnt_t samples_written
void reset_samples_written_count()
PBD::Signal1< void, std::string > FileWritten
PBD::ScopedConnectionList exec_connections
ARDOUR::SystemExec * _proc
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.
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
bool throw_level(ThrowLevel level)
size_t write_to_stdin(std::string const &d, size_t len=0)
PBD::Signal0< void > Terminated
@ ThrowProcess
Process cycle level stuff.