The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
Specialication for marker streams. 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 buflen_, int chunksize_, int strlen_) | |
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 | |
std::size_t | copy_string_safe () |
Copy string to AC buffer, stop at the latest at buffer end, make sure that the string is always zero-terminated. More... | |
void | pull_samples_ignore () |
Pull new samples, ignore overrun, i.e. 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::string | str |
Temporary storage for marker string. More... | |
std::vector< char > | buf |
Data buffer of the ac variable. More... | |
double | ts |
Timestamp. More... | |
MHA_AC::algo_comm_t & | ac |
Handle to AC space. More... | |
MHA_AC::comm_var_t | cv |
Timeseries AC variable. More... | |
double | tc =0.0 |
Current time correction. 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... | |
Specialication for marker streams.
|
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 |
buflen_ | LSL buffer size |
chunksize_ | LSL chunk size |
strlen_ | Length string buffer. |
|
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 |
Copy string to AC buffer, stop at the latest at buffer end, make sure that the string is always zero-terminated.
|
inlineprivate |
Pull new samples, ignore overrun, i.e.
only pull one sample from the buffer, do not check if there are newer ones waiting
|
inlineprivate |
Pull new samples as long as there are samples ready for pickup in the LSL buffers.
Overwrite old markers
|
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 |
Temporary storage for marker string.
|
private |
Data buffer of the ac variable.
|
private |
Timestamp.
|
private |
Handle to AC space.
|
private |
Timeseries AC variable.
|
private |
Current time correction.
|
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