mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-24 09:54:16 +08:00
[AFV] Ref T739, audio can now be disabled from UI
This commit is contained in:
committed by
Mat Sutcliffe
parent
c8097cc899
commit
9447db00bc
@@ -186,13 +186,13 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
void CAfvClient::disconnectFrom()
|
||||
void CAfvClient::disconnectFrom(bool stop)
|
||||
{
|
||||
if (QThread::currentThread() != thread())
|
||||
{
|
||||
// Method needs to be executed in the object thread since it will create new QObject children
|
||||
QPointer<CAfvClient> myself(this);
|
||||
QMetaObject::invokeMethod(this, [ = ]() { if (myself) disconnectFrom(); });
|
||||
QMetaObject::invokeMethod(this, [ = ]() { if (myself) disconnectFrom(stop); });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -203,6 +203,8 @@ namespace BlackCore
|
||||
m_connection->disconnectFrom();
|
||||
}
|
||||
emit connectionStatusChanged(Disconnected);
|
||||
|
||||
if (stop) { this->stopAudio(); }
|
||||
}
|
||||
|
||||
QStringList CAfvClient::availableInputDevices() const
|
||||
|
||||
@@ -94,7 +94,11 @@ namespace BlackCore
|
||||
//! Disconnect from network
|
||||
//! \threadsafe
|
||||
//! \remark runs in thread of CAfvClient object and is ASYNC when called from another thread
|
||||
Q_INVOKABLE void disconnectFrom();
|
||||
//! @{
|
||||
void disconnectFrom(bool stop);
|
||||
Q_INVOKABLE void disconnectFrom() { this->disconnectFrom(false); }
|
||||
void disconnectFromAndStop() { this->disconnectFrom(true); }
|
||||
//! @}
|
||||
|
||||
//! Audio devices @{
|
||||
Q_INVOKABLE QStringList availableInputDevices() const;
|
||||
|
||||
Reference in New Issue
Block a user