![]() |
The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
LSL to AC bridge variable. More...

Public Member Functions | |
| save_var_t (const save_var_t &)=delete | |
| save_var_t (save_var_t &&)=delete | |
| virtual | ~save_var_t ()=default |
| save_var_t & | operator= (const save_var_t &)=delete |
| save_var_t & | operator= (save_var_t &&)=delete |
| save_var_t (const lsl::stream_info &info_, MHA_AC::algo_comm_t &ac_, overrun_behavior ob_, int type_, int buflen_, int chunksize_, int nchannels_, int nsamples_) | |
| C'tor of lsl to ac bridge. More... | |
| lsl::stream_info | info () override |
| Get stream info object from stream inlet. More... | |
| void | receive_frame () override |
| Receive a samples from lsl and copy to AC space. More... | |
Public Member Functions inherited from lsl2ac::save_var_base_t | |
| virtual | ~save_var_base_t ()=default |
Private Member Functions | |
| void | pull_samples_ignore () |
| Pull new samples, ignore overrun. More... | |
| void | pull_samples_discard () |
| Pull new samples as long as there are samples ready for pickup in the LSL buffers. More... | |
| void | get_time_correction () |
| Refresh time correction value every 5s. More... | |
| void | insert_vars () |
| Insert stream value, time stamp and time offset into ac space. More... | |
Private Attributes | |
| lsl::stream_inlet | stream |
| LSL stream outlet. More... | |
| std::vector< T > | buf |
| Data buffer of the ac variable. More... | |
| std::vector< double > | ts_buf |
| Timestamp buffer. More... | |
| std::vector< double > | tc_buf |
| Clock correction buffer. More... | |
| MHA_AC::algo_comm_t & | ac |
| Handle to AC space. More... | |
| MHA_AC::comm_var_t | cv |
| Timeseries AC variable. More... | |
| MHA_AC::comm_var_t | ts |
| Timestamp AC variable. More... | |
| MHA_AC::comm_var_t | tc |
| Time correction AC variable. More... | |
| std::string | ts_name |
| Timestamp AC variable name. More... | |
| std::string | tc_name |
| Time correction AC variable name. More... | |
| std::string | new_name |
| Number of new samples AC variable name. More... | |
| std::chrono::time_point< std::chrono::steady_clock > | tic |
| time point of last time correction pull More... | |
| bool | skip =false |
| Should the variable be skipped in future process calls? Only true when error occured. More... | |
| overrun_behavior | ob |
| Behavior on stream overrun. More... | |
| const std::string | name |
| Name of stream. More... | |
| int32_t | nchannels |
| Number of channels. More... | |
| std::size_t | nsamples |
| Number of samples per channel in the AC variable. More... | |
| std::size_t | chunksize |
| Maximal chunk size of lsl stream. More... | |
| std::size_t | bufsize |
| Total buffer size of the ac variable buffer. More... | |
| int | n_new_samples |
| Number of most recently pulled samples per channel. More... | |
LSL to AC bridge variable.
|
delete |
|
delete |
|
virtualdefault |
|
inline |
C'tor of lsl to ac bridge.
| name_ | Name of LSL stream to be received |
| info_ | LSL stream info object containing metadata |
| ac_ | Handle to ac space |
| ob_ | Overrun behavior. 0=Discard oldest, 1=Ignore |
| type_ | Type tag of the AC variable |
| buflen_ | LSL buffer size |
| chunksize_ | LSL chunk size |
| nchannels_ | Number of channels in the AC variable must be zero or equal to number of channels in LSL stream |
| nsamples_ | Number of samples per channel in the AC variable. Zero means resize as needed |
|
delete |
|
delete |
|
inlineoverridevirtual |
Get stream info object from stream inlet.
Implements lsl2ac::save_var_base_t.
|
inlineoverridevirtual |
Receive a samples from lsl and copy to AC space.
Handling of underrun is configuration-dependent
Implements lsl2ac::save_var_base_t.
|
inlineprivate |
Pull new samples, ignore overrun.
If nsamples=0, leaves the buffers in a state where the newest samples are at the beginning of the buffers, the state of the older samples is undefined and n_new_samples contains the number of new samples per channel. If nsamples is non-zero, the buffers are rotated so the oldest samples are the first in the buffer and n_new_samples contains the number of new samples per channel.
|
inlineprivate |
Pull new samples as long as there are samples ready for pickup in the LSL buffers.
If nsamples=0, leaves the buffers in a state where the newest samples are at the beginning of the buffers, the state of the older samples is undefined and n_new_samples contains total number of new samples per channel. If nsamples is non-zero, the buffers are rotated so the oldest samples come first. n_samples_new then contains the total number of new samples per channel. If n_new_samples is larger than the number of samples in the AC variable that means samples had be discarded.
|
inlineprivate |
Refresh time correction value every 5s.
|
inlineprivate |
Insert stream value, time stamp and time offset into ac space.
|
private |
LSL stream outlet.
Interface to lsl
|
private |
Data buffer of the ac variable.
|
private |
Timestamp buffer.
|
private |
Clock correction buffer.
|
private |
Handle to AC space.
|
private |
Timeseries AC variable.
|
private |
Timestamp AC variable.
|
private |
Time correction AC variable.
|
private |
Timestamp AC variable name.
|
private |
Time correction AC variable name.
|
private |
Number of new samples AC variable name.
|
private |
time point of last time correction pull
|
private |
Should the variable be skipped in future process calls? Only true when error occured.
|
private |
Behavior on stream overrun.
|
private |
Name of stream.
Must be saved separately because the stream info might be unrecoverable in error cases
|
private |
Number of channels.
|
private |
Number of samples per channel in the AC variable.
Zero means resize as needed.
|
private |
Maximal chunk size of lsl stream.
|
private |
Total buffer size of the ac variable buffer.
nsamples*nchannels if nsamples is set, chunksize*nchannels otherwise if chunksize is set, nchannels if neither nsamples and chunksize are set.
|
private |
Number of most recently pulled samples per channel.