The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
MHASignal::doublebuffer_t Class Referenceabstract

Double-buffering class. More...

Inheritance diagram for MHASignal::doublebuffer_t:
Inheritance graph

Public Member Functions

 doublebuffer_t (unsigned int nchannels_in, unsigned int nchannels_out, unsigned int outer_fragsize, unsigned int inner_fragsize)
 Constructor of double buffer. More...
 
virtual ~doublebuffer_t ()
 
mha_wave_touter_process (mha_wave_t *s)
 Method to pass audio fragments into the inner layer. More...
 

Protected Member Functions

virtual mha_wave_tinner_process (mha_wave_t *s)=0
 Method to realize inner processing callback. More...
 

Private Member Functions

unsigned int min (unsigned int a, unsigned int b)
 

Private Attributes

waveform_t outer_out
 
mha_wave_t this_outer_out
 
waveform_t inner_in
 
waveform_t inner_out
 
unsigned int k_inner
 
unsigned int k_outer
 
unsigned int ch
 

Detailed Description

Double-buffering class.

This class has two layers: The outer layer, with an outer fragment size, and an inner layer, with its own fragment size. Data is passed into the inner layer through the doublebuffer_t::outr_process() callback. The pure virtual method doublebuffer_t::inner_process() is called whenever enough data is available.

Constructor & Destructor Documentation

◆ doublebuffer_t()

MHASignal::doublebuffer_t::doublebuffer_t ( unsigned int  nchannels_in,
unsigned int  nchannels_out,
unsigned int  outer_fragsize,
unsigned int  inner_fragsize 
)

Constructor of double buffer.

Parameters
nchannels_inNumber of channels at the input (both layers).
nchannels_outNumber of channels at the output (both layers).
outer_fragsizeFragment size of the outer layer (e.g., hardware fragment size)
inner_fragsizeFragment size of the inner layer (e.g., software fragment size)

◆ ~doublebuffer_t()

MHASignal::doublebuffer_t::~doublebuffer_t ( )
virtual

Member Function Documentation

◆ outer_process()

mha_wave_t * MHASignal::doublebuffer_t::outer_process ( mha_wave_t s)

Method to pass audio fragments into the inner layer.

Parameters
sPointer to input waveform fragment.
Returns
Pointer to output waveform fragment.

◆ inner_process()

virtual mha_wave_t* MHASignal::doublebuffer_t::inner_process ( mha_wave_t s)
protectedpure virtual

Method to realize inner processing callback.

To be overwritten by derived classes.

Parameters
sPointer to input waveform fragment.
Returns
Pointer to output waveform fragment.

Implemented in db_t.

◆ min()

unsigned int MHASignal::doublebuffer_t::min ( unsigned int  a,
unsigned int  b 
)
inlineprivate

Member Data Documentation

◆ outer_out

waveform_t MHASignal::doublebuffer_t::outer_out
private

◆ this_outer_out

mha_wave_t MHASignal::doublebuffer_t::this_outer_out
private

◆ inner_in

waveform_t MHASignal::doublebuffer_t::inner_in
private

◆ inner_out

waveform_t MHASignal::doublebuffer_t::inner_out
private

◆ k_inner

unsigned int MHASignal::doublebuffer_t::k_inner
private

◆ k_outer

unsigned int MHASignal::doublebuffer_t::k_outer
private

◆ ch

unsigned int MHASignal::doublebuffer_t::ch
private

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