mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
fixes #123 by displaying the Audio test in the GUI
* added methods to get results in context * added signal to indicate audio test completed * updated GUI to display results * changed test run methods to non-const to be consistent with voice lib * Logic in GUI to avoid parallel / interfering tests * Fixed wrong Q_ASSERT message and QTimer::singleShot in voice_vatlib.cpp
This commit is contained in:
@@ -22,7 +22,7 @@ MainWindow::MainWindow(GuiModes::WindowMode windowMode, QWidget *parent) :
|
|||||||
QMainWindow(parent, windowMode == GuiModes::WindowFrameless ? (Qt::Window | Qt::FramelessWindowHint) : Qt::Tool),
|
QMainWindow(parent, windowMode == GuiModes::WindowFrameless ? (Qt::Window | Qt::FramelessWindowHint) : Qt::Tool),
|
||||||
ui(new Ui::MainWindow),
|
ui(new Ui::MainWindow),
|
||||||
m_infoWindow(nullptr),
|
m_infoWindow(nullptr),
|
||||||
m_init(false), m_windowMode(windowMode),
|
m_init(false), m_windowMode(windowMode), m_audioTestRunning(NoAudioTest),
|
||||||
// misc
|
// misc
|
||||||
m_dBusConnection("dummy"),
|
m_dBusConnection("dummy"),
|
||||||
// table view models
|
// table view models
|
||||||
|
|||||||
@@ -95,11 +95,19 @@ protected:
|
|||||||
MainPageSettings = 7
|
MainPageSettings = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum AudioTest
|
||||||
|
{
|
||||||
|
NoAudioTest,
|
||||||
|
SquelchTest,
|
||||||
|
MicrophoneTest
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::MainWindow> ui;
|
QScopedPointer<Ui::MainWindow> ui;
|
||||||
CInfoWindow *m_infoWindow;
|
CInfoWindow *m_infoWindow;
|
||||||
bool m_init;
|
bool m_init;
|
||||||
GuiModes::WindowMode m_windowMode;
|
GuiModes::WindowMode m_windowMode;
|
||||||
|
AudioTest m_audioTestRunning;
|
||||||
QDBusConnection m_dBusConnection;
|
QDBusConnection m_dBusConnection;
|
||||||
|
|
||||||
// the table view models
|
// the table view models
|
||||||
|
|||||||
@@ -1799,7 +1799,7 @@ QStatusBar QLabel {
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tb_Settings">
|
<widget class="QTabWidget" name="tb_Settings">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tb_SettingsTrafficNetwork">
|
<widget class="QWidget" name="tb_SettingsTrafficNetwork">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -2230,13 +2230,6 @@ QStatusBar QLabel {
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsAudioTestActionAndResult">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QProgressBar" name="prb_SettingsAudioTestProgress">
|
<widget class="QProgressBar" name="prb_SettingsAudioTestProgress">
|
||||||
<property name="value">
|
<property name="value">
|
||||||
@@ -2244,6 +2237,19 @@ QStatusBar QLabel {
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QPlainTextEdit" name="pte_SettingsAudioTestActionAndResult">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -200,6 +200,7 @@ void MainWindow::init(GuiModes::CoreMode coreMode)
|
|||||||
this->connect(this->m_timerContextWatchdog, &QTimer::timeout, this, &MainWindow::timerBasedUpdates);
|
this->connect(this->m_timerContextWatchdog, &QTimer::timeout, this, &MainWindow::timerBasedUpdates);
|
||||||
this->connect(this->m_timerCollectedCockpitUpdates, &QTimer::timeout, this, &MainWindow::sendCockpitUpdates);
|
this->connect(this->m_timerCollectedCockpitUpdates, &QTimer::timeout, this, &MainWindow::sendCockpitUpdates);
|
||||||
this->connect(this->m_timerAudioTests, &QTimer::timeout, this, &MainWindow::audioTestUpdate);
|
this->connect(this->m_timerAudioTests, &QTimer::timeout, this, &MainWindow::audioTestUpdate);
|
||||||
|
connect = this->connect(this->m_contextVoice, &IContextVoice::audioTestCompleted, this, &MainWindow::audioTestUpdate);
|
||||||
|
|
||||||
// start timers, update timers will be started when network is connected
|
// start timers, update timers will be started when network is connected
|
||||||
this->m_timerContextWatchdog->start(2 * 1000);
|
this->m_timerContextWatchdog->start(2 * 1000);
|
||||||
|
|||||||
@@ -165,19 +165,24 @@ void MainWindow::startAudioTest()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QObject *sender = QObject::sender();
|
QObject *sender = QObject::sender();
|
||||||
this->m_timerAudioTests->start(625); // I let this run for 10*625ms, so there is enough overhead to really complete it
|
this->m_timerAudioTests->start(600); // I let this run for <x>ms, so there is enough overhead to really complete it
|
||||||
this->ui->prb_SettingsAudioTestProgress->setValue(0);
|
this->ui->prb_SettingsAudioTestProgress->setValue(0);
|
||||||
|
this->ui->pte_SettingsAudioTestActionAndResult->clear();
|
||||||
if (sender == this->ui->pb_SettingsAudioMicrophoneTest)
|
if (sender == this->ui->pb_SettingsAudioMicrophoneTest)
|
||||||
{
|
{
|
||||||
|
this->m_audioTestRunning = MicrophoneTest;
|
||||||
this->m_contextVoice->runMicrophoneTest();
|
this->m_contextVoice->runMicrophoneTest();
|
||||||
this->ui->le_SettingsAudioTestActionAndResult->setText("Speak normally for 5 seconds");
|
this->ui->pte_SettingsAudioTestActionAndResult->appendPlainText("Speak normally for 5 seconds");
|
||||||
}
|
}
|
||||||
else if (sender == this->ui->pb_SettingsAudioSquelchTest)
|
else if (sender == this->ui->pb_SettingsAudioSquelchTest)
|
||||||
{
|
{
|
||||||
|
this->m_audioTestRunning = SquelchTest;
|
||||||
this->m_contextVoice->runSquelchTest();
|
this->m_contextVoice->runSquelchTest();
|
||||||
this->ui->le_SettingsAudioTestActionAndResult->setText("Silence for 5 seconds");
|
this->ui->pte_SettingsAudioTestActionAndResult->appendPlainText("Silence for 5 seconds");
|
||||||
}
|
}
|
||||||
this->ui->prb_SettingsAudioTestProgress->setVisible(true);
|
this->ui->prb_SettingsAudioTestProgress->setVisible(true);
|
||||||
|
this->ui->pb_SettingsAudioMicrophoneTest->setEnabled(false);
|
||||||
|
this->ui->pb_SettingsAudioSquelchTest->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -186,15 +191,39 @@ void MainWindow::startAudioTest()
|
|||||||
void MainWindow::audioTestUpdate()
|
void MainWindow::audioTestUpdate()
|
||||||
{
|
{
|
||||||
int v = this->ui->prb_SettingsAudioTestProgress->value();
|
int v = this->ui->prb_SettingsAudioTestProgress->value();
|
||||||
if (v < 100)
|
QObject *sender = this->sender();
|
||||||
|
|
||||||
|
if (v < 100 && (sender == m_timerAudioTests))
|
||||||
{
|
{
|
||||||
|
// timer update, increasing progress
|
||||||
this->ui->prb_SettingsAudioTestProgress->setValue(v + 10);
|
this->ui->prb_SettingsAudioTestProgress->setValue(v + 10);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// fetch results
|
|
||||||
// TODO
|
|
||||||
this->m_timerAudioTests->stop();
|
this->m_timerAudioTests->stop();
|
||||||
|
this->ui->prb_SettingsAudioTestProgress->setValue(100);
|
||||||
|
if (sender == m_timerAudioTests) return; // just timer update
|
||||||
|
|
||||||
|
// getting here we assume the audio test finished signal
|
||||||
|
// fetch results
|
||||||
|
this->ui->pte_SettingsAudioTestActionAndResult->clear();
|
||||||
|
if (this->m_contextVoiceAvailable)
|
||||||
|
{
|
||||||
|
if (this->m_audioTestRunning == SquelchTest)
|
||||||
|
{
|
||||||
|
double s = this->m_contextVoice->getSquelchValue();
|
||||||
|
this->ui->pte_SettingsAudioTestActionAndResult->appendPlainText(QString::number(s));
|
||||||
|
}
|
||||||
|
else if (this->m_audioTestRunning == MicrophoneTest)
|
||||||
|
{
|
||||||
|
QString m = this->m_contextVoice->getMicrophoneTestResult();
|
||||||
|
this->ui->pte_SettingsAudioTestActionAndResult->appendPlainText(m);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this->m_audioTestRunning = NoAudioTest;
|
||||||
|
this->m_timerAudioTests->stop();
|
||||||
|
this->ui->pb_SettingsAudioMicrophoneTest->setEnabled(true);
|
||||||
|
this->ui->pb_SettingsAudioSquelchTest->setEnabled(true);
|
||||||
this->ui->prb_SettingsAudioTestProgress->setVisible(false);
|
this->ui->prb_SettingsAudioTestProgress->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,12 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
Q_ASSERT(runtime);
|
Q_ASSERT(runtime);
|
||||||
|
|
||||||
// 1. Init by "network driver"
|
// 1. Init by "voice driver"
|
||||||
this->m_voice = new CVoiceVatlib(this);
|
this->m_voice = new CVoiceVatlib(this);
|
||||||
|
|
||||||
|
// 2. Signal / slots
|
||||||
|
connect(this->m_voice, &CVoiceVatlib::micTestFinished, this, &CContextVoice::audioTestCompleted);
|
||||||
|
connect(this->m_voice, &CVoiceVatlib::squelchTestFinished, this, &CContextVoice::audioTestCompleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -229,7 +233,7 @@ namespace BlackCore
|
|||||||
/*
|
/*
|
||||||
* Mic test.
|
* Mic test.
|
||||||
*/
|
*/
|
||||||
void CContextVoice::runMicrophoneTest() const
|
void CContextVoice::runMicrophoneTest()
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->m_voice);
|
Q_ASSERT(this->m_voice);
|
||||||
this->m_voice->runMicrophoneTest();
|
this->m_voice->runMicrophoneTest();
|
||||||
@@ -238,11 +242,29 @@ namespace BlackCore
|
|||||||
/*
|
/*
|
||||||
* Squelch test.
|
* Squelch test.
|
||||||
*/
|
*/
|
||||||
void CContextVoice::runSquelchTest() const
|
void CContextVoice::runSquelchTest()
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->m_voice);
|
Q_ASSERT(this->m_voice);
|
||||||
this->m_voice->runSquelchTest();
|
this->m_voice->runSquelchTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Microphone test
|
||||||
|
*/
|
||||||
|
QString CContextVoice::getMicrophoneTestResult() const
|
||||||
|
{
|
||||||
|
Q_ASSERT(this->m_voice);
|
||||||
|
return this->m_voice->micTestResultAsString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Squelch value
|
||||||
|
*/
|
||||||
|
double CContextVoice::getSquelchValue() const
|
||||||
|
{
|
||||||
|
Q_ASSERT(this->m_voice);
|
||||||
|
return static_cast<double>(this->m_voice->inputSquelch());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -159,12 +159,22 @@ namespace BlackCore
|
|||||||
/*!
|
/*!
|
||||||
* \copydoc IContextVoice::runMicrophoneTest()
|
* \copydoc IContextVoice::runMicrophoneTest()
|
||||||
*/
|
*/
|
||||||
virtual void runMicrophoneTest() const;
|
virtual void runMicrophoneTest();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \copydoc IContextVoice::runSquelchTest()
|
* \copydoc IContextVoice::runSquelchTest()
|
||||||
*/
|
*/
|
||||||
virtual void runSquelchTest() const;
|
virtual void runSquelchTest();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \copydoc IContextVoice::getMicrophoneTestResult()
|
||||||
|
*/
|
||||||
|
virtual QString getMicrophoneTestResult() const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \copydoc IContextVoice::getSquelchValue()
|
||||||
|
*/
|
||||||
|
virtual double getSquelchValue() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CVoiceVatlib *m_voice; //!< underlying voice lib
|
CVoiceVatlib *m_voice; //!< underlying voice lib
|
||||||
|
|||||||
@@ -26,9 +26,10 @@ namespace BlackCore
|
|||||||
/*
|
/*
|
||||||
* Workaround for signals, not working without, but why?
|
* Workaround for signals, not working without, but why?
|
||||||
*/
|
*/
|
||||||
void IContextVoice::relaySignals(const QString & /** serviceName **/, QDBusConnection & /** connection **/)
|
void IContextVoice::relaySignals(const QString &serviceName, QDBusConnection &connection)
|
||||||
{
|
{
|
||||||
// void
|
connection.connect(serviceName, IContextVoice::ServicePath(), IContextVoice::InterfaceName(),
|
||||||
|
"audioTestCompleted", this, SIGNAL(audioTestCompleted()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -154,19 +155,35 @@ namespace BlackCore
|
|||||||
/*
|
/*
|
||||||
* MIC test
|
* MIC test
|
||||||
*/
|
*/
|
||||||
void IContextVoice::runMicrophoneTest() const
|
void IContextVoice::runMicrophoneTest()
|
||||||
{
|
{
|
||||||
this->m_dBusInterface->callDBus(QLatin1Literal("runMicrophoneTest"));
|
this->m_dBusInterface->callDBus(QLatin1Literal("runMicrophoneTest"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MIC test
|
* Mic test
|
||||||
*/
|
*/
|
||||||
void IContextVoice::runSquelchTest() const
|
void IContextVoice::runSquelchTest()
|
||||||
{
|
{
|
||||||
this->m_dBusInterface->callDBus(QLatin1Literal("runSquelchTest"));
|
this->m_dBusInterface->callDBus(QLatin1Literal("runSquelchTest"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Test result
|
||||||
|
*/
|
||||||
|
QString IContextVoice::getMicrophoneTestResult() const
|
||||||
|
{
|
||||||
|
return this->m_dBusInterface->callDBusRet<QString>(QLatin1Literal("getMicrophoneTestResult"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Squelch value
|
||||||
|
*/
|
||||||
|
double IContextVoice::getSquelchValue() const
|
||||||
|
{
|
||||||
|
return this->m_dBusInterface->callDBusRet<double>(QLatin1Literal("getSquelchValue"));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Volumes, by COM systems
|
* Volumes, by COM systems
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -201,13 +201,28 @@ namespace BlackCore
|
|||||||
/*!
|
/*!
|
||||||
* \brief Microphone test
|
* \brief Microphone test
|
||||||
*/
|
*/
|
||||||
virtual void runMicrophoneTest() const;
|
virtual void runMicrophoneTest();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Microphone test
|
* \brief Microphone test
|
||||||
*/
|
*/
|
||||||
virtual void runSquelchTest() const;
|
virtual void runSquelchTest();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Get the microphone test result
|
||||||
|
*/
|
||||||
|
virtual QString getMicrophoneTestResult() const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Get the squelch value
|
||||||
|
*/
|
||||||
|
virtual double getSquelchValue() const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
/*!
|
||||||
|
* \brief Audio test has been completed
|
||||||
|
*/
|
||||||
|
void audioTestCompleted();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::setInputDevice(const BlackMisc::Voice::CAudioDevice &device)
|
void CVoiceVatlib::setInputDevice(const BlackMisc::Voice::CAudioDevice &device)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
if (!device.isValid())
|
if (!device.isValid())
|
||||||
{
|
{
|
||||||
qWarning() << "Cannot set invalid input device!";
|
qWarning() << "Cannot set invalid input device!";
|
||||||
@@ -142,7 +142,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::setOutputDevice(const BlackMisc::Voice::CAudioDevice &device)
|
void CVoiceVatlib::setOutputDevice(const BlackMisc::Voice::CAudioDevice &device)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
if (!device.isValid())
|
if (!device.isValid())
|
||||||
{
|
{
|
||||||
qWarning() << "Cannot set invalid output device!";
|
qWarning() << "Cannot set invalid output device!";
|
||||||
@@ -170,7 +170,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
BlackMisc::Voice::CVoiceRoomList CVoiceVatlib::getComVoiceRoomsWithAudioStatus() const
|
BlackMisc::Voice::CVoiceRoomList CVoiceVatlib::getComVoiceRoomsWithAudioStatus() const
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voiceRooms.size() == 2, "CVoiceClientVatlib", "Wrong numer of COM voice rooms");
|
Q_ASSERT_X(m_voiceRooms.size() == 2, "CVoiceVatlib", "Wrong numer of COM voice rooms");
|
||||||
CVoiceRoomList voiceRooms;
|
CVoiceRoomList voiceRooms;
|
||||||
if (m_voice->IsValid() && m_voice->IsSetup())
|
if (m_voice->IsValid() && m_voice->IsSetup())
|
||||||
{
|
{
|
||||||
@@ -208,8 +208,8 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::switchAudioOutput(const ComUnit comUnit, bool enable)
|
void CVoiceVatlib::switchAudioOutput(const ComUnit comUnit, bool enable)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceClientVatlib", "Room index out of bounds!");
|
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceVatlib", "Room index out of bounds!");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_voice->SetOutoutState(static_cast<qint32>(comUnit), 0, enable);
|
m_voice->SetOutoutState(static_cast<qint32>(comUnit), 0, enable);
|
||||||
@@ -226,7 +226,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::runSquelchTest()
|
void CVoiceVatlib::runSquelchTest()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -246,19 +246,18 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::runMicrophoneTest()
|
void CVoiceVatlib::runMicrophoneTest()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_voice->BeginMicTest();
|
m_voice->BeginMicTest();
|
||||||
|
// Start the timer only if no exception was thrown before
|
||||||
|
QTimer::singleShot(5000, this, SLOT(onEndMicTest()));
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
this->exceptionDispatcher(Q_FUNC_INFO);
|
this->exceptionDispatcher(Q_FUNC_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the timer only if no exception was thrown before
|
|
||||||
QTimer::singleShot(5000, this, SLOT(onEndMicTest()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -321,8 +320,8 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::joinVoiceRoom(const ComUnit comUnit, const BlackMisc::Voice::CVoiceRoom &voiceRoom)
|
void CVoiceVatlib::joinVoiceRoom(const ComUnit comUnit, const BlackMisc::Voice::CVoiceRoom &voiceRoom)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceClientVatlib", "Room index out of bounds!");
|
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceVatlib", "Room index out of bounds!");
|
||||||
|
|
||||||
if (!voiceRoom.isValid())
|
if (!voiceRoom.isValid())
|
||||||
{
|
{
|
||||||
@@ -354,8 +353,8 @@ namespace BlackCore
|
|||||||
CVoiceRoom vr = this->voiceRoomForUnit(comUnit);
|
CVoiceRoom vr = this->voiceRoomForUnit(comUnit);
|
||||||
if (!vr.isConnected()) return;
|
if (!vr.isConnected()) return;
|
||||||
|
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceClientVatlib", "Room index out of bounds!");
|
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceVatlib", "Room index out of bounds!");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -383,8 +382,8 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::setRoomOutputVolume(const ComUnit comUnit, const qint32 volume)
|
void CVoiceVatlib::setRoomOutputVolume(const ComUnit comUnit, const qint32 volume)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceClientVatlib", "Room index out of bounds!");
|
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceVatlib", "Room index out of bounds!");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -401,8 +400,8 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::startTransmitting(const ComUnit comUnit)
|
void CVoiceVatlib::startTransmitting(const ComUnit comUnit)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceClientVatlib", "Room index out of bounds!");
|
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceVatlib", "Room index out of bounds!");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -419,8 +418,8 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::stopTransmitting(const ComUnit comUnit)
|
void CVoiceVatlib::stopTransmitting(const ComUnit comUnit)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceClientVatlib", "Room index out of bounds!");
|
Q_ASSERT_X(m_voice->IsRoomValid(static_cast<qint32>(comUnit)), "CVoiceVatlib", "Room index out of bounds!");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_voice->SetMicState(static_cast<qint32>(comUnit), false);
|
m_voice->SetMicState(static_cast<qint32>(comUnit), false);
|
||||||
@@ -486,7 +485,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::timerEvent(QTimerEvent *)
|
void CVoiceVatlib::timerEvent(QTimerEvent *)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -504,7 +503,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::onEndFindSquelch()
|
void CVoiceVatlib::onEndFindSquelch()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -520,7 +519,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
void CVoiceVatlib::onEndMicTest()
|
void CVoiceVatlib::onEndMicTest()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -538,7 +537,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void CVoiceVatlib::onUserJoinedLeft(const ComUnit comUnit)
|
void CVoiceVatlib::onUserJoinedLeft(const ComUnit comUnit)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceClientVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
Q_ASSERT_X(m_voice->IsValid() && m_voice->IsSetup(), "CVoiceVatlib", "Cvatlib_Voice_Simple invalid or not setup!");
|
||||||
Q_ASSERT_X(m_temporaryUserRoomIndex == CVoiceVatlib::InvalidRoomIndex, "CVoiceClientVatlib::onUserJoinedLeft", "Cannot list users for two rooms in parallel!");
|
Q_ASSERT_X(m_temporaryUserRoomIndex == CVoiceVatlib::InvalidRoomIndex, "CVoiceClientVatlib::onUserJoinedLeft", "Cannot list users for two rooms in parallel!");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user