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

The splitted_part_t instance manages the plugin that performs processing on the reduced set of channels. More...

Inheritance diagram for MHAPlugin_Split::splitted_part_t:
Inheritance graph

Public Member Functions

 splitted_part_t (const std::string &plugname, MHAParser::parser_t *parent)
 Load the plugin for this partial signal path. More...
 
 splitted_part_t (PluginLoader::fourway_processor_t *plugin)
 Create the handler for the partial signal. More...
 
 ~splitted_part_t () throw ()
 Destructor. Deletes the plugin plug. More...
 
void prepare (mhaconfig_t &signal_parameters, const std::string &thread_platform, const std::string &thread_scheduler, int thread_priority)
 Delegates the prepare method to the plugin and allocates a suitable MHAPlugin_Split::domain_handler_t instance. More...
 
void release ()
 Delegates the release method to the plugin and deletes the MHAPlugin_Split::domain_handler_t instance. More...
 
std::string parse (const std::string &str)
 Delegates parser incovation to plugin. More...
 
template<class SigType >
unsigned trigger_processing (SigType *s_in, unsigned start_channel)
 The domain handler copies the input signal channels. More...
 
template<class SigType >
unsigned collect_result (SigType *s_out, unsigned start_channel)
 Wait until processing is finished, then copy the output data. More...
 
- Public Member Functions inherited from MHA_AC::algo_comm_class_t
void insert_var (const std::string &name, comm_var_t cv) override
 
void insert_var_int (const std::string &name, int *ptr) override
 
void insert_var_vfloat (const std::string &name, std::vector< float > &vec) override
 
void insert_var_float (const std::string &name, float *ptr) override
 
void insert_var_double (const std::string &name, double *ptr) override
 
void remove_var (const std::string &name) override
 
void remove_ref (void *addr) override
 
bool is_var (const std::string &name) const override
 
comm_var_t get_var (const std::string &name) const override
 
int get_var_int (const std::string &name) const override
 
float get_var_float (const std::string &name) const override
 
double get_var_double (const std::string &name) const override
 
const std::vector< std::string > & get_entries () const override
 
size_t size () const override
 
virtual void set_prepared (bool prepared)
 The provider of this AC space must set the AC space to prepared at the end of its own prepare() operation and to not prepared at the beginning of its own release() operation. More...
 
- Public Member Functions inherited from MHA_AC::algo_comm_t
virtual ~algo_comm_t ()=default
 

Private Member Functions

 splitted_part_t (const splitted_part_t &)
 Disallow copy constructor. More...
 
splitted_part_toperator= (const splitted_part_t &)
 Disallow assignment operator. More...
 

Private Attributes

PluginLoader::fourway_processor_tplug
 The plugin that performs the signal processing on the prepared channels. More...
 
domain_handler_tdomain
 The domain specific signal handler, allocated from prepare when input and output domains and signal parameters are known. More...
 
thread_platform_tthread
 The platform-dependent thread synchronization implementation. More...
 

Detailed Description

The splitted_part_t instance manages the plugin that performs processing on the reduced set of channels.

The signal is split by channels by this instance, but the signal is combined again by the calling class.

Constructor & Destructor Documentation

◆ splitted_part_t() [1/3]

MHAPlugin_Split::splitted_part_t::splitted_part_t ( const splitted_part_t )
private

Disallow copy constructor.

◆ splitted_part_t() [2/3]

MHAPlugin_Split::splitted_part_t::splitted_part_t ( const std::string &  plugname,
MHAParser::parser_t parent 
)

Load the plugin for this partial signal path.

Loads the MHA plugin for a signal path of these audio channels.

Parameters
plugnameThe name of the MHA plugin, optionally followed by a colon and the algorithm name.
parentThe parser node where the configuration of the new plugin is inserted. The plugin's parser name is the configured name (colon syntax).

◆ splitted_part_t() [3/3]

MHAPlugin_Split::splitted_part_t::splitted_part_t ( PluginLoader::fourway_processor_t plugin)

Create the handler for the partial signal.

The plugin is loaded by the caller, but it will be deleted by the destructor of this class. This constructor exists solely for testing purposes.

Parameters
pluginThe plugin used for processing the signal. The new splitted_part_t instance will take ownership of this instance and release it in the destructor.

◆ ~splitted_part_t()

MHAPlugin_Split::splitted_part_t::~splitted_part_t ( )
throw (
)

Destructor. Deletes the plugin plug.

Member Function Documentation

◆ operator=()

splitted_part_t& MHAPlugin_Split::splitted_part_t::operator= ( const splitted_part_t )
private

Disallow assignment operator.

◆ prepare()

void MHAPlugin_Split::splitted_part_t::prepare ( mhaconfig_t signal_parameters,
const std::string &  thread_platform,
const std::string &  thread_scheduler,
int  thread_priority 
)

Delegates the prepare method to the plugin and allocates a suitable MHAPlugin_Split::domain_handler_t instance.

Prepare the loaded plugin.

Plugin preparation.

Parameters
signal_parametersThe signal description parameters for this path.
thread_platformThe name of the thread platform to use. Possible values: "posix", "win32", "dummy".
thread_schedulerThe name of the scheduler to use. Posix threads support "SCHED_OTHER", "SCHED_RR", "SCHED_FIFO". The other thread platforms do not support different thread schedulers. This value is not used for platforms other than "posix".
thread_priorityThe new thread priority. Interpretation and permitted range depend on the thread platform and possibly on the scheduler.

◆ release()

void MHAPlugin_Split::splitted_part_t::release ( void  )

Delegates the release method to the plugin and deletes the MHAPlugin_Split::domain_handler_t instance.

Release the loaded plugin.

Plugin release.

◆ parse()

std::string MHAPlugin_Split::splitted_part_t::parse ( const std::string &  str)
inline

Delegates parser incovation to plugin.

◆ trigger_processing()

template<class SigType >
unsigned MHAPlugin_Split::splitted_part_t::trigger_processing ( SigType *  s_in,
unsigned  start_channel 
)
inline

The domain handler copies the input signal channels.

Then, processing is initiated.

Parameters
s_inThe combined input signal.
start_channelThe index (0-based) of the first channel in s_in to be copied to the partial input signal.
Returns
The number of channels that were copied from the input signal

◆ collect_result()

template<class SigType >
unsigned MHAPlugin_Split::splitted_part_t::collect_result ( SigType *  s_out,
unsigned  start_channel 
)
inline

Wait until processing is finished, then copy the output data.

Parameters
s_outThe combined waveform output signal.
start_channelThe channel offset (0-based) in s_out.
Returns
The number of channels that were copied to the output signal

Member Data Documentation

◆ plug

PluginLoader::fourway_processor_t* MHAPlugin_Split::splitted_part_t::plug
private

The plugin that performs the signal processing on the prepared channels.

◆ domain

domain_handler_t* MHAPlugin_Split::splitted_part_t::domain
private

The domain specific signal handler, allocated from prepare when input and output domains and signal parameters are known.

◆ thread

thread_platform_t* MHAPlugin_Split::splitted_part_t::thread
private

The platform-dependent thread synchronization implementation.


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