1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-30 14:04:18 -04:00

Update threading model in Simple PTT feature. Part of #1346

This commit is contained in:
f4exb
2022-09-22 10:54:15 +02:00
parent 4bae584a9d
commit 9f65a6e636
4 changed files with 68 additions and 32 deletions
@@ -35,7 +35,6 @@ MESSAGE_CLASS_DEFINITION(SimplePTTWorker::MsgPTT, Message)
SimplePTTWorker::SimplePTTWorker(WebAPIAdapterInterface *webAPIAdapterInterface) :
m_webAPIAdapterInterface(webAPIAdapterInterface),
m_msgQueueToGUI(nullptr),
m_running(false),
m_tx(false),
m_audioFifo(12000),
m_audioSampleRate(48000),
@@ -63,19 +62,16 @@ void SimplePTTWorker::reset()
m_inputMessageQueue.clear();
}
bool SimplePTTWorker::startWork()
void SimplePTTWorker::startWork()
{
QMutexLocker mutexLocker(&m_mutex);
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
m_running = true;
return m_running;
}
void SimplePTTWorker::stopWork()
{
QMutexLocker mutexLocker(&m_mutex);
disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
m_running = false;
}
void SimplePTTWorker::handleInputMessages()