Ardour  8.7-15-gadf511264b
AudioGrapher::TmpFileRt< T > Class Template Reference

#include <tmp_file_rt.h>

Inheritance diagram for AudioGrapher::TmpFileRt< T >:
[legend]

Public Member Functions

 TmpFileRt (char *filename_template, int format, ChannelCount channels, samplecnt_t samplerate)
 filename_template must match the requirements for mkstemp, i.e. end in "XXXXXX" More...
 
 ~TmpFileRt ()
 
void process (ProcessContext< T > const &c)
 Writes data to file. More...
 
void disk_thread ()
 
SndfileHandleoperator= (const SndfileHandle &rhs)
 
- Public Member Functions inherited from AudioGrapher::TmpFile< DefaultSampleType >
virtual ~TmpFile ()
 
- Public Member Functions inherited from AudioGrapher::SndfileWriter< DefaultSampleType >
 SndfileWriter (std::string const &path, int format, ChannelCount channels, samplecnt_t samplerate, std::shared_ptr< BroadcastInfo > broadcast_info)
 
virtual ~SndfileWriter ()
 
samplecnt_t get_samples_written () const
 
void reset_samples_written_count ()
 
virtual void process (ProcessContext< DefaultSampleType > const &c)
 Writes data to file. More...
 
SndfileHandleoperator= (const SndfileHandle &rhs)
 
- Public Member Functions inherited from AudioGrapher::SndfileHandle
 SndfileHandle (void)
 
 SndfileHandle (const char *path, int mode=SFM_READ, int format=0, int channels=0, int samplerate=0)
 
 SndfileHandle (std::string const &path, int mode=SFM_READ, int format=0, int channels=0, int samplerate=0)
 
 SndfileHandle (int fd, bool close_desc, int mode=SFM_READ, int format=0, int channels=0, int samplerate=0)
 
 ~SndfileHandle (void)
 
 SndfileHandle (const SndfileHandle &orig)
 
SndfileHandleoperator= (const SndfileHandle &rhs)
 
void close (void)
 
int refCount (void) const
 
 operator bool () const
 
bool operator== (const SndfileHandle &rhs) const
 
sf_count_t frames (void) const
 
int format (void) const
 
int channels (void) const
 
int samplerate (void) const
 
int error (void) const
 
const char * strError (void) const
 
int command (int cmd, void *data, int datasize)
 
sf_count_t seek (sf_count_t frames, int whence)
 
void writeSync (void)
 
int setString (int str_type, const char *str)
 
const char * getString (int str_type) const
 
sf_count_t read (short *ptr, sf_count_t items)
 
sf_count_t read (int *ptr, sf_count_t items)
 
sf_count_t read (float *ptr, sf_count_t items)
 
sf_count_t read (double *ptr, sf_count_t items)
 
sf_count_t write (const short *ptr, sf_count_t items)
 
sf_count_t write (const int *ptr, sf_count_t items)
 
sf_count_t write (const float *ptr, sf_count_t items)
 
sf_count_t write (const double *ptr, sf_count_t items)
 
sf_count_t readf (short *ptr, sf_count_t frames)
 
sf_count_t readf (int *ptr, sf_count_t frames)
 
sf_count_t readf (float *ptr, sf_count_t frames)
 
sf_count_t readf (double *ptr, sf_count_t frames)
 
sf_count_t writef (const short *ptr, sf_count_t frames)
 
sf_count_t writef (const int *ptr, sf_count_t frames)
 
sf_count_t writef (const float *ptr, sf_count_t frames)
 
sf_count_t writef (const double *ptr, sf_count_t frames)
 
sf_count_t readRaw (void *ptr, sf_count_t bytes)
 
sf_count_t writeRaw (const void *ptr, sf_count_t bytes)
 
- Public Member Functions inherited from AudioGrapher::Sink< DefaultSampleType >
virtual ~Sink ()
 
virtual void process (ProcessContext< DefaultSampleType > &context)
 
- Public Member Functions inherited from AudioGrapher::SndfileReader< DefaultSampleType >
 SndfileReader (std::string const &path)
 
 SndfileReader (SndfileReader const &other)
 
virtual ~SndfileReader ()
 
samplecnt_t read (ProcessContext< DefaultSampleType > &context)
 
SndfileHandleoperator= (const SndfileHandle &rhs)
 
- Public Member Functions inherited from AudioGrapher::ListedSource< DefaultSampleType >
void add_output (typename Source< DefaultSampleType >::SinkPtr output)
 
void clear_outputs ()
 Removes all outputs added. More...
 
void remove_output (typename Source< DefaultSampleType >::SinkPtr output)
 
- Public Member Functions inherited from AudioGrapher::Source< DefaultSampleType >
virtual ~Source ()
 
virtual void add_output (SinkPtr output)=0
 Adds an output to this source. All data generated is forwarded to output. More...
 
virtual void remove_output (SinkPtr output)=0
 Removes a specific output from this source. More...
 

Protected Member Functions

void end_write ()
 
void init ()
 
- Protected Member Functions inherited from AudioGrapher::SndfileWriter< DefaultSampleType >
 SndfileWriter ()
 SndfileHandle has to be constructed directly by deriving classes. More...
 
- Protected Member Functions inherited from AudioGrapher::SndfileBase
 SndfileBase ()
 
- Protected Member Functions inherited from AudioGrapher::Throwing< L >
 Throwing ()
 
bool throw_level (ThrowLevel level)
 
- Protected Member Functions inherited from AudioGrapher::FlagDebuggable< L >
void add_supported_flag (Flag flag)
 Adds a flag to the set of flags supported. More...
 
template<typename SelfType , typename ContextType >
void check_flags (SelfType &self, ProcessContext< ContextType > context)
 Prints debug output if context contains flags that are not supported by this class. More...
 
- Protected Member Functions inherited from AudioGrapher::Debuggable< DebugNone >
 Debuggable (std::ostream &debug_stream=std::cerr)
 
bool debug_level (DebugLevel level)
 
std::ostream & debug_stream ()
 
- Protected Member Functions inherited from AudioGrapher::SndfileReader< DefaultSampleType >
 SndfileReader ()
 SndfileHandle has to be constructed directly by deriving classes. More...
 
- Protected Member Functions inherited from AudioGrapher::ListedSource< DefaultSampleType >
void output (ProcessContext< DefaultSampleType > const &c)
 Helper for derived classes. More...
 
void output (ProcessContext< DefaultSampleType > &c)
 
bool output_size_is_one ()
 

Static Protected Member Functions

static void * _disk_thread (void *arg)
 

Protected Attributes

std::string filename
 
bool _capture
 
samplecnt_t _chunksize
 
PBD::RingBuffer< T > _rb
 
pthread_mutex_t _disk_thread_lock
 
pthread_cond_t _data_ready
 
pthread_t _thread_id
 
- Protected Attributes inherited from AudioGrapher::SndfileWriter< DefaultSampleType >
std::string path
 
samplecnt_t samples_written
 
- Protected Attributes inherited from AudioGrapher::ListedSource< DefaultSampleType >
SinkList outputs
 

Private Member Functions

 TmpFileRt (TmpFileRt const &other)
 

Additional Inherited Members

- Public Types inherited from AudioGrapher::SndfileBase
enum  Mode { Read = SFM_READ , Write = SFM_WRITE , ReadWrite = SFM_RDWR }
 
- Public Types inherited from AudioGrapher::FlagDebuggable< L >
typedef FlagField::Flag Flag
 
- Public Types inherited from AudioGrapher::Source< DefaultSampleType >
typedef std::shared_ptr< Sink< DefaultSampleType > > SinkPtr
 
- Static Public Member Functions inherited from AudioGrapher::SndfileHandle
static int formatCheck (int format, int channels, int samplerate)
 
- Public Attributes inherited from AudioGrapher::TmpFile< DefaultSampleType >
PBD::Signal0< void > FileFlushed
 
- Public Attributes inherited from AudioGrapher::SndfileWriter< DefaultSampleType >
PBD::Signal1< void, std::string > FileWritten
 
- Protected Types inherited from AudioGrapher::ListedSource< DefaultSampleType >
typedef std::list< typename Source< DefaultSampleType >::SinkPtrSinkList
 

Detailed Description

template<typename T = DefaultSampleType>
class AudioGrapher::TmpFileRt< T >

A temporary file deleted after this class is destructed with realtime safe background thread writer.

Definition at line 29 of file tmp_file_rt.h.

Constructor & Destructor Documentation

◆ TmpFileRt() [1/2]

template<typename T = DefaultSampleType>
AudioGrapher::TmpFileRt< T >::TmpFileRt ( char *  filename_template,
int  format,
ChannelCount  channels,
samplecnt_t  samplerate 
)
inline

filename_template must match the requirements for mkstemp, i.e. end in "XXXXXX"

Definition at line 35 of file tmp_file_rt.h.

◆ ~TmpFileRt()

template<typename T = DefaultSampleType>
AudioGrapher::TmpFileRt< T >::~TmpFileRt ( )
inline

Definition at line 46 of file tmp_file_rt.h.

◆ TmpFileRt() [2/2]

template<typename T = DefaultSampleType>
AudioGrapher::TmpFileRt< T >::TmpFileRt ( TmpFileRt< T > const &  other)
inlineprivate

Definition at line 170 of file tmp_file_rt.h.

Member Function Documentation

◆ _disk_thread()

template<typename T = DefaultSampleType>
static void* AudioGrapher::TmpFileRt< T >::_disk_thread ( void *  arg)
inlinestaticprotected

Definition at line 136 of file tmp_file_rt.h.

◆ disk_thread()

template<typename T = DefaultSampleType>
void AudioGrapher::TmpFileRt< T >::disk_thread ( )
inline

Definition at line 92 of file tmp_file_rt.h.

◆ end_write()

template<typename T = DefaultSampleType>
void AudioGrapher::TmpFileRt< T >::end_write ( )
inlineprotected

Definition at line 145 of file tmp_file_rt.h.

◆ init()

template<typename T = DefaultSampleType>
void AudioGrapher::TmpFileRt< T >::init ( )
inlineprotectedvirtual

Reimplemented from AudioGrapher::SndfileWriter< DefaultSampleType >.

Definition at line 153 of file tmp_file_rt.h.

◆ operator=()

template<typename T = DefaultSampleType>
SndfileHandle& AudioGrapher::SndfileHandle::operator=

◆ process()

template<typename T = DefaultSampleType>
void AudioGrapher::TmpFileRt< T >::process ( ProcessContext< T > const &  c)
inline

Writes data to file.

Definition at line 61 of file tmp_file_rt.h.

Member Data Documentation

◆ _capture

template<typename T = DefaultSampleType>
bool AudioGrapher::TmpFileRt< T >::_capture
protected

Definition at line 128 of file tmp_file_rt.h.

◆ _chunksize

template<typename T = DefaultSampleType>
samplecnt_t AudioGrapher::TmpFileRt< T >::_chunksize
protected

Definition at line 129 of file tmp_file_rt.h.

◆ _data_ready

template<typename T = DefaultSampleType>
pthread_cond_t AudioGrapher::TmpFileRt< T >::_data_ready
protected

Definition at line 133 of file tmp_file_rt.h.

◆ _disk_thread_lock

template<typename T = DefaultSampleType>
pthread_mutex_t AudioGrapher::TmpFileRt< T >::_disk_thread_lock
protected

Definition at line 132 of file tmp_file_rt.h.

◆ _rb

template<typename T = DefaultSampleType>
PBD::RingBuffer<T> AudioGrapher::TmpFileRt< T >::_rb
protected

Definition at line 130 of file tmp_file_rt.h.

◆ _thread_id

template<typename T = DefaultSampleType>
pthread_t AudioGrapher::TmpFileRt< T >::_thread_id
protected

Definition at line 134 of file tmp_file_rt.h.

◆ filename

template<typename T = DefaultSampleType>
std::string AudioGrapher::TmpFileRt< T >::filename
protected

Definition at line 126 of file tmp_file_rt.h.


The documentation for this class was generated from the following file: