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

A combination of mha parser variables to describe an overalapadd analysis window. More...

Public Member Functions

 windowselector_t (const std::string &default_type)
 constructor creates the mha parser variables that describe an overlapadd analysis window. More...
 
 ~windowselector_t ()
 destructor frees window data that were allocated More...
 
const MHAWindow::base_tget_window_data (unsigned length)
 re-computes the window if required. More...
 
void insert_items (MHAParser::parser_t *p)
 insert the window parameters "wndtype", "wndexp", and "userwnd" as mha configuration parameters into the given mha configuration parser. More...
 
void setlock (bool b_)
 Lock/Unlock variables. More...
 

Public Attributes

MHAEvents::emitter_t updated
 A collector event that fires when any of the window parameters managed here is written to. More...
 

Private Member Functions

void invalidate_window_data ()
 invalidates any allocated window samples. More...
 
void update_parser ()
 invoked when a parser parameter changes. More...
 

Private Attributes

MHAWindow::base_twnd
 Storage for the window data returned by get_window_data() More...
 
MHAParser::kw_t wndtype
 parser variable for window type More...
 
MHAParser::float_t wndexp
 parser variable for window exponent More...
 
MHAParser::vfloat_t userwnd
 parser variable for user window samples to use More...
 
MHAEvents::patchbay_t< windowselector_tpatchbay
 patchbay to watch for changes for the parser variables More...
 

Detailed Description

A combination of mha parser variables to describe an overalapadd analysis window.

Provides a method to get the window samples as an instance of MHAWindow::base_t when needed.

Constructor & Destructor Documentation

◆ windowselector_t()

windowselector_t::windowselector_t ( const std::string &  default_type)

constructor creates the mha parser variables that describe an overlapadd analysis window.

Parameters
default_typename of the default analysis window type. Must be one of: "rect", "bartlett", "hanning", "hamming", "blackman"

◆ ~windowselector_t()

windowselector_t::~windowselector_t ( )

destructor frees window data that were allocated

Member Function Documentation

◆ get_window_data()

const MHAWindow::base_t & windowselector_t::get_window_data ( unsigned  length)

re-computes the window if required.

Parameters
lengththe desired window length in samples return the window's samples as a constref to MHAWindow::base_t instance. The referenced instance lives until the window parameters are changed, or this windowselector_t instance is destroyed.

◆ insert_items()

void windowselector_t::insert_items ( MHAParser::parser_t p)

insert the window parameters "wndtype", "wndexp", and "userwnd" as mha configuration parameters into the given mha configuration parser.

Parameters
pThe configuration parser where to insert the window parameters. E.g. the plugin wave2spec's interface class.

◆ setlock()

void windowselector_t::setlock ( bool  b_)

Lock/Unlock variables.

Parameters
b_Desired lock state

◆ invalidate_window_data()

void windowselector_t::invalidate_window_data ( )
private

invalidates any allocated window samples.

◆ update_parser()

void windowselector_t::update_parser ( )
private

invoked when a parser parameter changes.

Calls invalidate_window_data() and emits the updated event.

Member Data Documentation

◆ updated

MHAEvents::emitter_t windowselector_t::updated

A collector event that fires when any of the window parameters managed here is written to.

◆ wnd

MHAWindow::base_t* windowselector_t::wnd
private

Storage for the window data returned by get_window_data()

◆ wndtype

MHAParser::kw_t windowselector_t::wndtype
private

parser variable for window type

◆ wndexp

MHAParser::float_t windowselector_t::wndexp
private

parser variable for window exponent

◆ userwnd

MHAParser::vfloat_t windowselector_t::userwnd
private

parser variable for user window samples to use

◆ patchbay

MHAEvents::patchbay_t<windowselector_t> windowselector_t::patchbay
private

patchbay to watch for changes for the parser variables


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