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

Class for one channel/port. More...

Public Types

enum  dir_t { input , output }
 

Public Member Functions

 port_t (jack_client_t *jc, dir_t dir, int id)
 
 port_t (jack_client_t *jc, dir_t dir, const std::string &id)
 Constructor to create port with specific name. More...
 
 ~port_t ()
 
void read (mha_wave_t *s, unsigned int ch)
 
void write (mha_wave_t *s, unsigned int ch)
 
void mute (unsigned int n)
 
void connect_to (const char *pn)
 
const char * get_short_name ()
 Return the port name. More...
 

Private Attributes

dir_t dir_type
 
jack_port_t * port
 
jack_default_audio_sample_t * iob
 
jack_client_t * jc
 

Detailed Description

Class for one channel/port.

This class represents one JACK port. Double buffering for asynchronous process callbacks is managed by this class.

Member Enumeration Documentation

◆ dir_t

Enumerator
input 
output 

Constructor & Destructor Documentation

◆ port_t() [1/2]

MHAJack::port_t::port_t ( jack_client_t *  jc,
dir_t  dir,
int  id 
)
Parameters
jcJACK client.
dirDirection (input/output).
idNumber in port name (starting with 1).

◆ port_t() [2/2]

MHAJack::port_t::port_t ( jack_client_t *  jc,
dir_t  dir,
const std::string &  id 
)

Constructor to create port with specific name.

Parameters
jcJACK client.
dirDirection (input/output).
idPort name.

◆ ~port_t()

MHAJack::port_t::~port_t ( )

Member Function Documentation

◆ read()

void MHAJack::port_t::read ( mha_wave_t s,
unsigned int  ch 
)
Parameters
sSignal structure to store the audio data.
chChannel number in audio data structure to be used.

◆ write()

void MHAJack::port_t::write ( mha_wave_t s,
unsigned int  ch 
)
Parameters
sSignal structure from which the audio data is read.
chChannel number in audio data structure to be used.

◆ mute()

void MHAJack::port_t::mute ( unsigned int  n)
Parameters
nNumber of samples to be muted (must be the same as reported by Jack processing callback).

◆ connect_to()

void MHAJack::port_t::connect_to ( const char *  pn)
Parameters
pnPort name to connect to

◆ get_short_name()

const char * MHAJack::port_t::get_short_name ( )

Return the port name.

Member Data Documentation

◆ dir_type

dir_t MHAJack::port_t::dir_type
private

◆ port

jack_port_t* MHAJack::port_t::port
private

◆ iob

jack_default_audio_sample_t* MHAJack::port_t::iob
private

◆ jc

jack_client_t* MHAJack::port_t::jc
private

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