The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
MHAJack::client_avg_t Class Reference

Generic JACK client for averaging a system response across time. More...

Inheritance diagram for MHAJack::client_avg_t:
Inheritance graph

Public Member Functions

 client_avg_t (const std::string &name, const unsigned int &nrep_)
 Constructor for averaging client. More...
 
void io (mha_wave_t *s_out, mha_wave_t *s_in, const std::vector< std::string > &p_out, const std::vector< std::string > &p_in, float *srate=NULL, unsigned int *fragsize=NULL)
 Recording function. More...
 
- Public Member Functions inherited from MHAJack::client_t
 client_t (IOProcessEvent_t proc_event, void *proc_handle=NULL, IOStartedEvent_t start_event=NULL, void *start_handle=NULL, IOStoppedEvent_t stop_event=NULL, void *stop_handle=NULL, bool use_jack_transport=false)
 
void prepare (const std::string &client_name, const unsigned int &nchannels_in, const unsigned int &nchannels_out)
 Allocate buffers, activate JACK client and install internal ports. More...
 
void prepare (const std::string &server_name, const std::string &client_name, const unsigned int &nchannels_in, const unsigned int &nchannels_out)
 Allocate buffers, ports, and activates JACK client. More...
 
void release ()
 Remove JACK client and deallocate internal ports and buffers. More...
 
void start (bool fail_on_async_jack_error=true)
 
void stop ()
 
void connect_input (const std::vector< std::string > &)
 Connect the input ports when connection variable is accessed. More...
 
void connect_output (const std::vector< std::string > &)
 Connect the output ports when connection variable is accessed. More...
 
unsigned int get_fragsize () const
 
float get_srate () const
 
unsigned long get_xruns ()
 
unsigned long get_xruns_reset ()
 
std::string str_error (int err)
 
void get_ports (std::vector< std::string > &, unsigned long jack_flags)
 Get a list of Jack ports. More...
 
std::vector< std::string > get_my_input_ports ()
 
std::vector< std::string > get_my_output_ports ()
 
void set_input_portnames (const std::vector< std::string > &)
 
void set_output_portnames (const std::vector< std::string > &)
 
float get_cpu_load ()
 
void set_use_jack_transport (bool ut)
 
bool is_prepared () const
 

Private Member Functions

void proc (mha_wave_t *sIn, mha_wave_t **sOut)
 
void IOStoppedEvent ()
 

Static Private Member Functions

static int proc (void *handle, mha_wave_t *sIn, mha_wave_t **sOut)
 
static void IOStoppedEvent (void *handle, int proc_err, int io_err)
 

Private Attributes

bool b_stopped
 
unsigned int pos
 
mha_wave_tsn_in
 
mha_wave_tsn_out
 
std::string name
 
MHASignal::waveform_tfrag_out
 
const unsigned int nrep
 
unsigned int n
 
bool b_ready
 

Additional Inherited Members

- Protected Attributes inherited from MHAJack::client_t
jack_client_t * jc
 

Detailed Description

Generic JACK client for averaging a system response across time.

Constructor & Destructor Documentation

◆ client_avg_t()

MHAJack::client_avg_t::client_avg_t ( const std::string &  name_,
const unsigned int &  nrep_ 
)

Constructor for averaging client.

Parameters
name_Name of JACK client
nrep_Number of repetitions

Member Function Documentation

◆ io()

void MHAJack::client_avg_t::io ( mha_wave_t is_out,
mha_wave_t is_in,
const std::vector< std::string > &  p_out,
const std::vector< std::string > &  p_in,
float *  srate = NULL,
unsigned int *  fragsize = NULL 
)

Recording function.

long-description

Parameters
is_outInput (test) signal, which will be repeated
is_inSystem response (averaged, same length as input required)
p_outPorts to play back the test signal
p_inPorts to record from the system response
sratePointer to sampling rate variable, will be filled with server sampling rate
fragsizePointer to fragment size variable, will be filled with server fragment size

◆ proc() [1/2]

int MHAJack::client_avg_t::proc ( void *  handle,
mha_wave_t sIn,
mha_wave_t **  sOut 
)
staticprivate

◆ IOStoppedEvent() [1/2]

void MHAJack::client_avg_t::IOStoppedEvent ( void *  handle,
int  proc_err,
int  io_err 
)
staticprivate

◆ proc() [2/2]

void MHAJack::client_avg_t::proc ( mha_wave_t sIn,
mha_wave_t **  sOut 
)
private

◆ IOStoppedEvent() [2/2]

void MHAJack::client_avg_t::IOStoppedEvent ( )
private

Member Data Documentation

◆ b_stopped

bool MHAJack::client_avg_t::b_stopped
private

◆ pos

unsigned int MHAJack::client_avg_t::pos
private

◆ sn_in

mha_wave_t* MHAJack::client_avg_t::sn_in
private

◆ sn_out

mha_wave_t* MHAJack::client_avg_t::sn_out
private

◆ name

std::string MHAJack::client_avg_t::name
private

◆ frag_out

MHASignal::waveform_t* MHAJack::client_avg_t::frag_out
private

◆ nrep

const unsigned int MHAJack::client_avg_t::nrep
private

◆ n

unsigned int MHAJack::client_avg_t::n
private

◆ b_ready

bool MHAJack::client_avg_t::b_ready
private

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