Ardour  9.0-pre0-582-g084a23a80d
AudioGrapher::SampleRateConverter Class Reference

Samplerate converter. More...

#include <sr_converter.h>

Inheritance diagram for AudioGrapher::SampleRateConverter:
[legend]

Public Member Functions

 SampleRateConverter (uint32_t channels)
 Constructor.
RT safe. More...
 
 ~SampleRateConverter ()
 
void init (samplecnt_t in_rate, samplecnt_t out_rate, int quality=0)
 Init converter
Not RT safe. More...
 
samplecnt_t allocate_buffers (samplecnt_t max_samples)
 Returns max amount of samples that will be output
RT safe. More...
 
void process (ProcessContext< float > const &c)
 
- Public Member Functions inherited from AudioGrapher::ListedSource< float >
void add_output (typename Source< float >::SinkPtr output)
 
void clear_outputs ()
 Removes all outputs added. More...
 
void remove_output (typename Source< float >::SinkPtr output)
 
- Public Member Functions inherited from AudioGrapher::Source< T >
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...
 
- Public Member Functions inherited from AudioGrapher::Sink< float >
virtual ~Sink ()
 
virtual void process (ProcessContext< float > &context)
 

Private Member Functions

void set_end_of_input (ProcessContext< float > const &c)
 
void reset ()
 

Private Attributes

bool active
 
uint32_t channels
 
samplecnt_t max_samples_in
 
float * leftover_data
 
samplecnt_t leftover_samples
 
samplecnt_t max_leftover_samples
 
float * data_out
 
samplecnt_t data_out_size
 
SRC_DATA src_data
 
SRC_STATE * src_state
 

Additional Inherited Members

- Public Types inherited from AudioGrapher::Source< T >
typedef std::shared_ptr< Sink< T > > SinkPtr
 
- Public Types inherited from AudioGrapher::FlagDebuggable< L >
typedef FlagField::Flag Flag
 
- Protected Types inherited from AudioGrapher::ListedSource< float >
typedef std::list< typename Source< float >::SinkPtrSinkList
 
- Protected Member Functions inherited from AudioGrapher::ListedSource< float >
void output (ProcessContext< float > const &c)
 Helper for derived classes. More...
 
void output (ProcessContext< float > &c)
 
bool output_size_is_one ()
 
- 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::Throwing< L >
 Throwing ()
 
bool throw_level (ThrowLevel level)
 
- Protected Attributes inherited from AudioGrapher::ListedSource< float >
SinkList outputs
 

Detailed Description

Samplerate converter.

Definition at line 17 of file sr_converter.h.

Constructor & Destructor Documentation

◆ SampleRateConverter()

AudioGrapher::SampleRateConverter::SampleRateConverter ( uint32_t  channels)

Constructor.
RT safe.

◆ ~SampleRateConverter()

AudioGrapher::SampleRateConverter::~SampleRateConverter ( )

Member Function Documentation

◆ allocate_buffers()

samplecnt_t AudioGrapher::SampleRateConverter::allocate_buffers ( samplecnt_t  max_samples)

Returns max amount of samples that will be output
RT safe.

◆ init()

void AudioGrapher::SampleRateConverter::init ( samplecnt_t  in_rate,
samplecnt_t  out_rate,
int  quality = 0 
)

Init converter
Not RT safe.

◆ process()

void AudioGrapher::SampleRateConverter::process ( ProcessContext< float > const &  c)
virtual

Does sample rate conversion. Note that outpt size may vary a lot. May or may not output several contexts of data.
Should be RT safe.

Implements AudioGrapher::Sink< float >.

◆ reset()

void AudioGrapher::SampleRateConverter::reset ( )
private

◆ set_end_of_input()

void AudioGrapher::SampleRateConverter::set_end_of_input ( ProcessContext< float > const &  c)
private

Member Data Documentation

◆ active

bool AudioGrapher::SampleRateConverter::active
private

Definition at line 47 of file sr_converter.h.

◆ channels

uint32_t AudioGrapher::SampleRateConverter::channels
private

Definition at line 48 of file sr_converter.h.

◆ data_out

float* AudioGrapher::SampleRateConverter::data_out
private

Definition at line 55 of file sr_converter.h.

◆ data_out_size

samplecnt_t AudioGrapher::SampleRateConverter::data_out_size
private

Definition at line 56 of file sr_converter.h.

◆ leftover_data

float* AudioGrapher::SampleRateConverter::leftover_data
private

Definition at line 51 of file sr_converter.h.

◆ leftover_samples

samplecnt_t AudioGrapher::SampleRateConverter::leftover_samples
private

Definition at line 52 of file sr_converter.h.

◆ max_leftover_samples

samplecnt_t AudioGrapher::SampleRateConverter::max_leftover_samples
private

Definition at line 53 of file sr_converter.h.

◆ max_samples_in

samplecnt_t AudioGrapher::SampleRateConverter::max_samples_in
private

Definition at line 49 of file sr_converter.h.

◆ src_data

SRC_DATA AudioGrapher::SampleRateConverter::src_data
private

Definition at line 58 of file sr_converter.h.

◆ src_state

SRC_STATE* AudioGrapher::SampleRateConverter::src_state
private

Definition at line 59 of file sr_converter.h.


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