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

Main class for JACK IO. More...

Inheritance diagram for MHAIOJackdb::io_jack_t:
Inheritance graph

Public Member Functions

 io_jack_t (unsigned int fragsize, float samplerate, IOProcessEvent_t proc_event, void *proc_handle, IOStartedEvent_t start_event, void *start_handle, IOStoppedEvent_t stop_event, void *stop_handle)
 
void prepare (int, int)
 Allocate buffers, activate JACK client and install internal ports. More...
 
void release ()
 
bool fail_on_async_jackerror () const
 
- Public Member Functions inherited from MHAParser::parser_t
 parser_t (const std::string &help_text="")
 Construct detached node to be used in the configuration tree. More...
 
 ~parser_t ()
 
void insert_item (const std::string &, base_t *)
 Register a parser item into this sub-parser. More...
 
void remove_item (const std::string &)
 Remove an item by name. More...
 
void force_remove_item (const std::string &)
 Remove an item by name. More...
 
void remove_item (const base_t *)
 Remove an item by address. More...
 
- Public Member Functions inherited from MHAParser::base_t
 base_t (const std::string &)
 Constructor for base class of all parser nodes. More...
 
 base_t (const base_t &)
 Copy constructor for base_t. More...
 
base_toperator= (const base_t &)=default
 
 base_t (base_t &&)=delete
 
base_toperator= (base_t &&)=delete
 
virtual ~base_t ()
 
virtual std::string parse (const std::string &)
 Causes this node to process a command in the openMHA configuration language. More...
 
virtual void parse (const char *, char *, unsigned int)
 This function parses a command and writes the parsing result into a C character array. More...
 
virtual void parse (const std::vector< std::string > &, std::vector< std::string > &)
 
virtual std::string query_perm (const std::string &)
 
virtual std::string query_range (const std::string &)
 
std::string query_version (const std::string &)
 
std::string query_id (const std::string &)
 
std::string query_subst (const std::string &)
 
std::string query_addsubst (const std::string &)
 
std::string query_help (const std::string &)
 
std::string query_cmds (const std::string &)
 
void set_node_id (const std::string &)
 Set the identification string of this parser node. More...
 
void set_help (const std::string &)
 Set the help comment of a variable or parser. More...
 
void add_parent_on_insert (parser_t *, std::string)
 
void rm_parent_on_remove (parser_t *)
 
const std::string & fullname () const
 Return the full dot-separated path name of this parser node in the openMHA configuration tree. 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

int IOProcessEvent_inner (mha_wave_t *sIn, mha_wave_t **sOut)
 
void reconnect_inports ()
 Connect the input ports when connection variable is accessed. More...
 
void reconnect_outports ()
 Connect the output ports when connection variable is accessed. More...
 
void get_physical_input_ports ()
 
void get_physical_output_ports ()
 
void get_all_input_ports ()
 
void get_all_output_ports ()
 
void read_get_cpu_load ()
 
void read_get_xruns ()
 
void read_get_scheduler ()
 
void set_use_jack_transport ()
 
void set_locate ()
 

Static Private Member Functions

static int IOProcessEvent_inner (void *handle, mha_wave_t *sIn, mha_wave_t **sOut)
 

Private Attributes

IOProcessEvent_t proc_event
 
void * proc_handle
 
unsigned int mha_fragsize
 
float mha_samplerate
 
unsigned int fragsize_ratio
 
MHAParser::string_t servername
 
MHAParser::string_t clientname
 
MHAParser::vstring_t connections_in
 
MHAParser::vstring_t connections_out
 
MHAParser::vstring_t portnames_in
 
MHAParser::vstring_t portnames_out
 
MHAParser::bool_t fail_on_async_jackerr
 
MHAParser::bool_t use_jack_transport
 
MHAParser::float_t locate
 
MHAParser::float_mon_t server_srate
 
MHAParser::int_mon_t server_fragsize
 
MHAParser::vstring_mon_t ports_in_physical
 
MHAParser::vstring_mon_t ports_out_physical
 
MHAParser::vstring_mon_t ports_in_all
 
MHAParser::vstring_mon_t ports_out_all
 
MHAParser::parser_t ports_parser
 
MHAParser::float_mon_t state_cpuload
 
MHAParser::int_mon_t state_xruns
 
MHAParser::int_mon_t state_priority
 
MHAParser::string_mon_t state_scheduler
 
MHAParser::parser_t state_parser
 
MHASignal::waveform_tpwinner_out
 
MHAEvents::patchbay_t< io_jack_tpatchbay
 

Additional Inherited Members

- Public Attributes inherited from MHAParser::base_t
MHAEvents::emitter_t writeaccess
 Event emitted on write access. More...
 
MHAEvents::emitter_t valuechanged
 Event emitted if the value has changed. More...
 
MHAEvents::emitter_t readaccess
 Event emitted on read access. More...
 
MHAEvents::emitter_t prereadaccess
 Event emitted on read access, before the data field is accessed. More...
 
- Protected Member Functions inherited from MHAParser::parser_t
std::string op_subparse (expression_t &)
 
std::string op_setval (expression_t &)
 
std::string op_query (expression_t &)
 
std::string query_type (const std::string &)
 
std::string query_dump (const std::string &)
 
std::string query_entries (const std::string &)
 
std::string query_readfile (const std::string &)
 
std::string query_savefile (const std::string &)
 
std::string query_savefile_compact (const std::string &)
 
std::string query_savemons (const std::string &)
 
std::string query_val (const std::string &)
 
std::string query_listids (const std::string &)
 
void set_id_string (const std::string &)
 
bool has_entry (const std::string &)
 
- Protected Member Functions inherited from MHAParser::base_t
void activate_query (const std::string &, query_t)
 
void notify ()
 
- Protected Attributes inherited from MHAParser::base_t
query_map_t queries
 
bool data_is_initialized
 
- Protected Attributes inherited from MHAJack::client_t
jack_client_t * jc
 

Detailed Description

Main class for JACK IO.

This class registers a JACK client. JACK and framework states are managed by this class.

Constructor & Destructor Documentation

◆ io_jack_t()

io_jack_t::io_jack_t ( unsigned int  fragsize,
float  samplerate,
IOProcessEvent_t  proc_event,
void *  proc_handle,
IOStartedEvent_t  start_event,
void *  start_handle,
IOStoppedEvent_t  stop_event,
void *  stop_handle 
)

Member Function Documentation

◆ prepare()

void io_jack_t::prepare ( int  nch_in,
int  nch_out 
)

Allocate buffers, activate JACK client and install internal ports.

◆ release()

void io_jack_t::release ( void  )

◆ fail_on_async_jackerror()

bool MHAIOJackdb::io_jack_t::fail_on_async_jackerror ( ) const
inline

◆ IOProcessEvent_inner() [1/2]

int io_jack_t::IOProcessEvent_inner ( void *  handle,
mha_wave_t sIn,
mha_wave_t **  sOut 
)
staticprivate

◆ IOProcessEvent_inner() [2/2]

int io_jack_t::IOProcessEvent_inner ( mha_wave_t sIn,
mha_wave_t **  sOut 
)
private

◆ reconnect_inports()

void io_jack_t::reconnect_inports ( )
private

Connect the input ports when connection variable is accessed.

◆ reconnect_outports()

void io_jack_t::reconnect_outports ( )
private

Connect the output ports when connection variable is accessed.

◆ get_physical_input_ports()

void io_jack_t::get_physical_input_ports ( )
private

◆ get_physical_output_ports()

void io_jack_t::get_physical_output_ports ( )
private

◆ get_all_input_ports()

void io_jack_t::get_all_input_ports ( )
private

◆ get_all_output_ports()

void io_jack_t::get_all_output_ports ( )
private

◆ read_get_cpu_load()

void io_jack_t::read_get_cpu_load ( )
private

◆ read_get_xruns()

void io_jack_t::read_get_xruns ( )
private

◆ read_get_scheduler()

void io_jack_t::read_get_scheduler ( )
private

◆ set_use_jack_transport()

void io_jack_t::set_use_jack_transport ( )
private

◆ set_locate()

void io_jack_t::set_locate ( )
private

Member Data Documentation

◆ proc_event

IOProcessEvent_t MHAIOJackdb::io_jack_t::proc_event
private

◆ proc_handle

void* MHAIOJackdb::io_jack_t::proc_handle
private

◆ mha_fragsize

unsigned int MHAIOJackdb::io_jack_t::mha_fragsize
private

◆ mha_samplerate

float MHAIOJackdb::io_jack_t::mha_samplerate
private

◆ fragsize_ratio

unsigned int MHAIOJackdb::io_jack_t::fragsize_ratio
private

◆ servername

MHAParser::string_t MHAIOJackdb::io_jack_t::servername
private

◆ clientname

MHAParser::string_t MHAIOJackdb::io_jack_t::clientname
private

◆ connections_in

MHAParser::vstring_t MHAIOJackdb::io_jack_t::connections_in
private

◆ connections_out

MHAParser::vstring_t MHAIOJackdb::io_jack_t::connections_out
private

◆ portnames_in

MHAParser::vstring_t MHAIOJackdb::io_jack_t::portnames_in
private

◆ portnames_out

MHAParser::vstring_t MHAIOJackdb::io_jack_t::portnames_out
private

◆ fail_on_async_jackerr

MHAParser::bool_t MHAIOJackdb::io_jack_t::fail_on_async_jackerr
private

◆ use_jack_transport

MHAParser::bool_t MHAIOJackdb::io_jack_t::use_jack_transport
private

◆ locate

MHAParser::float_t MHAIOJackdb::io_jack_t::locate
private

◆ server_srate

MHAParser::float_mon_t MHAIOJackdb::io_jack_t::server_srate
private

◆ server_fragsize

MHAParser::int_mon_t MHAIOJackdb::io_jack_t::server_fragsize
private

◆ ports_in_physical

MHAParser::vstring_mon_t MHAIOJackdb::io_jack_t::ports_in_physical
private

◆ ports_out_physical

MHAParser::vstring_mon_t MHAIOJackdb::io_jack_t::ports_out_physical
private

◆ ports_in_all

MHAParser::vstring_mon_t MHAIOJackdb::io_jack_t::ports_in_all
private

◆ ports_out_all

MHAParser::vstring_mon_t MHAIOJackdb::io_jack_t::ports_out_all
private

◆ ports_parser

MHAParser::parser_t MHAIOJackdb::io_jack_t::ports_parser
private

◆ state_cpuload

MHAParser::float_mon_t MHAIOJackdb::io_jack_t::state_cpuload
private

◆ state_xruns

MHAParser::int_mon_t MHAIOJackdb::io_jack_t::state_xruns
private

◆ state_priority

MHAParser::int_mon_t MHAIOJackdb::io_jack_t::state_priority
private

◆ state_scheduler

MHAParser::string_mon_t MHAIOJackdb::io_jack_t::state_scheduler
private

◆ state_parser

MHAParser::parser_t MHAIOJackdb::io_jack_t::state_parser
private

◆ pwinner_out

MHASignal::waveform_t* MHAIOJackdb::io_jack_t::pwinner_out
private

◆ patchbay

MHAEvents::patchbay_t<io_jack_t> MHAIOJackdb::io_jack_t::patchbay
private

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