The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
The splitted_part_t instance manages the plugin that performs processing on the reduced set of channels. More...
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_t & | operator= (const splitted_part_t &) |
Disallow assignment operator. More... | |
Private Attributes | |
PluginLoader::fourway_processor_t * | plug |
The plugin that performs the signal processing on the prepared channels. More... | |
domain_handler_t * | domain |
The domain specific signal handler, allocated from prepare when input and output domains and signal parameters are known. More... | |
thread_platform_t * | thread |
The platform-dependent thread synchronization implementation. More... | |
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.
|
private |
Disallow copy constructor.
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.
plugname | The name of the MHA plugin, optionally followed by a colon and the algorithm name. |
parent | The parser node where the configuration of the new plugin is inserted. The plugin's parser name is the configured name (colon syntax). |
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.
plugin | The plugin used for processing the signal. The new splitted_part_t instance will take ownership of this instance and release it in the destructor. |
MHAPlugin_Split::splitted_part_t::~splitted_part_t | ( | ) | ||
throw | ( | |||
) |
Destructor. Deletes the plugin plug.
|
private |
Disallow assignment operator.
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.
signal_parameters | The signal description parameters for this path. |
thread_platform | The name of the thread platform to use. Possible values: "posix", "win32", "dummy". |
thread_scheduler | The 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_priority | The new thread priority. Interpretation and permitted range depend on the thread platform and possibly on the scheduler. |
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.
|
inline |
Delegates parser incovation to plugin.
|
inline |
The domain handler copies the input signal channels.
Then, processing is initiated.
s_in | The combined input signal. |
start_channel | The index (0-based) of the first channel in s_in to be copied to the partial input signal. |
|
inline |
Wait until processing is finished, then copy the output data.
s_out | The combined waveform output signal. |
start_channel | The channel offset (0-based) in s_out. |
|
private |
The plugin that performs the signal processing on the prepared channels.
|
private |
The domain specific signal handler, allocated from prepare when input and output domains and signal parameters are known.
|
private |
The platform-dependent thread synchronization implementation.