The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
The tcp sound io library. More...
Public Member Functions | |
io_tcp_t (int fragsize, float samplerate, IOProcessEvent_t proc_event, void *proc_handle, IOStartedEvent_t start_event, void *start_handle, IOStoppedEvent_t stop_event, void *stop_handle) | |
void | prepare (int num_inchannels, int num_outchannels) |
Allocate server socket and start thread waiting for sound data exchange. More... | |
void | start () |
Call frameworks start callback if there is a sound data connection at the moment. More... | |
void | stop () |
Close the current connection if there is one. More... | |
void | release () |
Close the current connection and close the server socket. More... | |
virtual void | accept_loop () |
IO thread executes this method. More... | |
virtual void | connection_loop (MHA_TCP::Connection *c) |
IO thread executes this method for each connection. More... | |
virtual void | parse (const char *cmd, char *retval, unsigned int len) |
Parser interface. More... | |
virtual | ~io_tcp_t () |
The tcp sound io library.
io_tcp_t::io_tcp_t | ( | int | fragsize, |
float | samplerate, | ||
IOProcessEvent_t | proc_event, | ||
void * | proc_handle, | ||
IOStartedEvent_t | start_event, | ||
void * | start_handle, | ||
IOStoppedEvent_t | stop_event, | ||
void * | stop_handle | ||
) |
|
inlinevirtual |
void io_tcp_t::prepare | ( | int | num_inchannels, |
int | num_outchannels | ||
) |
Allocate server socket and start thread waiting for sound data exchange.
prepare opens the tcp server socket and starts the io thread that listens for audio data on the tcp socket after doing some sanity checks
void io_tcp_t::start | ( | ) |
Call frameworks start callback if there is a sound data connection at the moment.
void io_tcp_t::stop | ( | ) |
Close the current connection if there is one.
stop IO thread
void io_tcp_t::release | ( | void | ) |
Close the current connection and close the server socket.
Stop IO thread and close server socket.
|
virtual |
IO thread executes this method.
|
virtual |
IO thread executes this method for each connection.
c | pointer to connection. connection_loop deletes connection before exiting. |
|
inlinevirtual |
Parser interface.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |