35#include "../common/CircularBuffer.hxx"
87 unsigned int _sample_count_hint = 1024,
88 std::string audio_sock_basename = std::string(
"soda_"));
92 unsigned int _sample_count_hint = 1024,
93 std::string audio_sock_basename = std::string(
"soda_")) {
94 auto ret = std::shared_ptr<AudioQt>(
new AudioQt(_sample_rate,
96 audio_sock_basename));
97 ret->registerThread(ret);
112 int send(
void * buf,
unsigned int len,
bool when_ready =
false);
130 virtual int recv(std::vector<float> & buf,
bool when_ready =
false);
164 return std::string(
"Fabulous");
168 return std::string(
"NOT IMPLEMENTED");
The Baseclass for all SoDa objects, and useful commonly used classes.
The Baseclass for all SoDa thread objects.
AudioIfc(unsigned int _sample_rate, unsigned int _sample_count_hint, const std::string &name="AudioIfc")
Qt audio interface class.
virtual std::string currentCaptureState()
void sleepOut()
stop the output stream so that we don't encounter a buffer underflow while the reciever is muted.
void subscribeToMailBoxes(const std::vector< MailBoxBasePtr > &mailboxes)
the creator of this thread may offer one or more mailboxes to this object.
std::shared_ptr< SoDa::UD::ServerSocket > audio_tx_socket
std::shared_ptr< SoDa::UD::ServerSocket > audio_rx_socket
bool recvBufferReady(unsigned int len)
recvBufferReady – are there samples waiting in the audio device?
static AudioQtPtr make(unsigned int _sample_rate, unsigned int _sample_count_hint=1024, std::string audio_sock_basename=std::string("soda_"))
std::string currentPlaybackState()
void run()
the run method – maintains incoming audio sample buffers
SoDa::CircularBuffer< char > * audio_cbuffer_p
int send(void *buf, unsigned int len, bool when_ready=false)
send – send a buffer to the audio output
bool sendBufferReady(unsigned int len)
sendBufferReady – is there enough space in the audio device send buffer for a call from send?
AudioQt(unsigned int _sample_rate, unsigned int _sample_count_hint=1024, std::string audio_sock_basename=std::string("soda_"))
constructor
void wakeOut()
start the output stream
virtual void sleepIn()
stop the input stream so that we don't encounter a buffer overflow while the transmitter is inactive.
CmdMBoxPtr cmd_stream
command stream from UI and other units
virtual void wakeIn()
start the input stream
CmdMBox::Subscription cmd_subs
subscription ID for command stream
virtual int recv(std::vector< float > &buf, bool when_ready=false)
recv – get a buffer of data from the audio input
void setupNetwork(std::string audio_sock_basename)
setup the network sockets for the audio link to the user interface.
Thread(const std::string &oname, const std::string &version=std::string("12.2.0"))
make the thread object.
std::shared_ptr< AudioQt > AudioQtPtr
std::shared_ptr< CmdMBox > CmdMBoxPtr