The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t Class Reference

Wrapper class around the matlab-generated library. More...

Public Member Functions

 wrapped_plugin_t ()=delete
 
 wrapped_plugin_t (const char *name_)
 Ctor. More...
 
virtual ~wrapped_plugin_t ()
 Dtor. More...
 
mha_wave_tprocess_ww (mha_wave_t *s, emxArray_user_config_t *user_config_)
 Process callback. More...
 
mha_spec_tprocess_ss (mha_spec_t *s, emxArray_user_config_t *user_config_)
 Process callback. More...
 
mha_spec_tprocess_ws (mha_wave_t *s, emxArray_user_config_t *user_config_)
 Process callback. More...
 
mha_wave_tprocess_sw (mha_spec_t *s, emxArray_user_config_t *user_config_)
 Process callback. More...
 
void prepare (mhaconfig_t &config)
 Prepare callback. More...
 
void release ()
 Release callback. More...
 

Public Attributes

emxArray_user_config_t * user_config =nullptr
 Ptr to user config array. More...
 
emxArray_user_config_t * state =nullptr
 Ptr to state array. More...
 

Private Attributes

dynamiclib_t library_handle
 Handle to matlab generated shared library. More...
 
void(* fcn_terminate )() =nullptr
 Handle to matlab generated cleanup function. More...
 
void(* fcn_init )(emxArray_user_config_t *, emxArray_user_config_t *) =nullptr
 Handle to matlab generated init function. More...
 
void(* fcn_process_ww )(const emxArray_real_T *, const signal_dimensions_t *, const emxArray_user_config_t *, emxArray_user_config_t *, emxArray_real_T *) =nullptr
 Handle to matlab generated wave to wave process function. More...
 
void(* fcn_process_ss )(const emxArray_creal_T *, const signal_dimensions_t *, const emxArray_user_config_t *, emxArray_user_config_t *, emxArray_creal_T *) =nullptr
 Handle to matlab generated spectrum to spectrum process function. More...
 
void(* fcn_process_ws )(const emxArray_real_T *, const signal_dimensions_t *, const emxArray_user_config_t *, emxArray_user_config_t *, emxArray_creal_T *) =nullptr
 Handle to matlab generated wave to spectrum process function. More...
 
void(* fcn_process_sw )(const emxArray_creal_T *, const signal_dimensions_t *, const emxArray_user_config_t *, emxArray_user_config_t *, emxArray_real_T *) =nullptr
 Handle to matlab generated spectrum to wave process function. More...
 
void(* fcn_prepare )(signal_dimensions_t *, emxArray_user_config_t *, emxArray_user_config_t *) =nullptr
 Handle to matlab generated prepare function. More...
 
void(* fcn_release )() =nullptr
 
signal_dimensions_t signal_dimensions {0,'U',0,0,0,0}
 Signal dimensions. More...
 
emxArray_real_T * wave_in =nullptr
 Ptr to emxArray holding the input signal. More...
 
emxArray_real_T * wave_out =nullptr
 Ptr to emxArray holding the output signal. More...
 
emxArray_creal_T * spec_in =nullptr
 Ptr to emxArray holding the input signal. More...
 
emxArray_creal_T * spec_out =nullptr
 Ptr to emxArray holding the output signal. More...
 
std::unique_ptr< MHASignal::waveform_tmha_wave_out
 MHA waveform holding the output signal. More...
 
std::unique_ptr< MHASignal::spectrum_tmha_spec_out
 MHA waveform holding the output signal. More...
 

Detailed Description

Wrapper class around the matlab-generated library.

Constructor & Destructor Documentation

◆ wrapped_plugin_t() [1/2]

matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::wrapped_plugin_t ( )
delete

◆ wrapped_plugin_t() [2/2]

matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::wrapped_plugin_t ( const char *  name_)
explicit

Ctor.

Opens matlab-generated library and resolves functions

Parameters
name_file name of shared library

◆ ~wrapped_plugin_t()

matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::~wrapped_plugin_t ( )
virtual

Dtor.

Member Function Documentation

◆ process_ww()

mha_wave_t * matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::process_ww ( mha_wave_t s,
emxArray_user_config_t *  user_config_ 
)

Process callback.

Converts mha-type wave to matlab array and calls wrapped process callback, then convert output to mha type

Parameters
sinput/output signal
user_config_Ptr to user configuration array

◆ process_ss()

mha_spec_t * matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::process_ss ( mha_spec_t s,
emxArray_user_config_t *  user_config_ 
)

Process callback.

Converts mha-type spectrum to matlab array and calls wrapped process callback, then convert output to mha type

Parameters
sinput/output signal
user_config_Ptr to user configuration array

◆ process_ws()

mha_spec_t * matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::process_ws ( mha_wave_t s,
emxArray_user_config_t *  user_config_ 
)

Process callback.

Converts mha-type wave to matlab array and calls wrapped process callback, then convert output to mha type

Parameters
sinput/output signal
user_config_Ptr to user configuration array

◆ process_sw()

mha_wave_t * matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::process_sw ( mha_spec_t s,
emxArray_user_config_t *  user_config_ 
)

Process callback.

Converts mha-type spectrum to matlab array and calls wrapped process callback, then convert output to mha type

Parameters
sinput/output signal
user_config_Ptr to user configuration array

◆ prepare()

void matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::prepare ( mhaconfig_t config)

Prepare callback.

Calls wrapped prepare function if necessary and determines output signal dimensions

◆ release()

void matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::release ( void  )

Release callback.

Cleans up io arrays and calls wrapped release if necessary.

Member Data Documentation

◆ user_config

emxArray_user_config_t* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::user_config =nullptr

Ptr to user config array.

◆ state

emxArray_user_config_t* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::state =nullptr

Ptr to state array.

◆ library_handle

dynamiclib_t matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::library_handle
private

Handle to matlab generated shared library.

◆ fcn_terminate

void(* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::fcn_terminate) () =nullptr
private

Handle to matlab generated cleanup function.

◆ fcn_init

void(* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::fcn_init) (emxArray_user_config_t *, emxArray_user_config_t *) =nullptr
private

Handle to matlab generated init function.

◆ fcn_process_ww

void(* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::fcn_process_ww) (const emxArray_real_T *, const signal_dimensions_t *, const emxArray_user_config_t *, emxArray_user_config_t *, emxArray_real_T *) =nullptr
private

Handle to matlab generated wave to wave process function.

◆ fcn_process_ss

void(* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::fcn_process_ss) (const emxArray_creal_T *, const signal_dimensions_t *, const emxArray_user_config_t *, emxArray_user_config_t *, emxArray_creal_T *) =nullptr
private

Handle to matlab generated spectrum to spectrum process function.

◆ fcn_process_ws

void(* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::fcn_process_ws) (const emxArray_real_T *, const signal_dimensions_t *, const emxArray_user_config_t *, emxArray_user_config_t *, emxArray_creal_T *) =nullptr
private

Handle to matlab generated wave to spectrum process function.

◆ fcn_process_sw

void(* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::fcn_process_sw) (const emxArray_creal_T *, const signal_dimensions_t *, const emxArray_user_config_t *, emxArray_user_config_t *, emxArray_real_T *) =nullptr
private

Handle to matlab generated spectrum to wave process function.

◆ fcn_prepare

void(* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::fcn_prepare) (signal_dimensions_t *, emxArray_user_config_t *, emxArray_user_config_t *) =nullptr
private

Handle to matlab generated prepare function.

◆ fcn_release

void(* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::fcn_release) () =nullptr
private

◆ signal_dimensions

signal_dimensions_t matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::signal_dimensions {0,'U',0,0,0,0}
private

Signal dimensions.

Matlab-equivalent to mha_config_t

◆ wave_in

emxArray_real_T* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::wave_in =nullptr
private

Ptr to emxArray holding the input signal.

◆ wave_out

emxArray_real_T* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::wave_out =nullptr
private

Ptr to emxArray holding the output signal.

◆ spec_in

emxArray_creal_T* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::spec_in =nullptr
private

Ptr to emxArray holding the input signal.

◆ spec_out

emxArray_creal_T* matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::spec_out =nullptr
private

Ptr to emxArray holding the output signal.

◆ mha_wave_out

std::unique_ptr<MHASignal::waveform_t> matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::mha_wave_out
private

MHA waveform holding the output signal.

◆ mha_spec_out

std::unique_ptr<MHASignal::spectrum_t> matlab_wrapper::matlab_wrapper_t::wrapped_plugin_t::mha_spec_out
private

MHA waveform holding the output signal.


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