diff --git a/src/blackgui/components/audiocomponent.cpp b/src/blackgui/components/audiocomponent.cpp new file mode 100644 index 000000000..8313f2ff9 --- /dev/null +++ b/src/blackgui/components/audiocomponent.cpp @@ -0,0 +1,29 @@ +/* Copyright (C) 2013 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +#include "audiocomponent.h" +#include "ui_audiocomponent.h" + +namespace BlackGui +{ + namespace Components + { + + CAudioComponent::CAudioComponent(QWidget *parent) : + QFrame(parent), + ui(new Ui::CAudioComponent) + { + ui->setupUi(this); + } + + CAudioComponent::~CAudioComponent() + { } + + } // namespace +} // namespace diff --git a/src/blackgui/components/audiocomponent.h b/src/blackgui/components/audiocomponent.h new file mode 100644 index 000000000..b39a01b30 --- /dev/null +++ b/src/blackgui/components/audiocomponent.h @@ -0,0 +1,44 @@ +/* Copyright (C) 2013 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKGUI_AUDIOCOMPONENT_H +#define BLACKGUI_AUDIOCOMPONENT_H + +#include +#include + +namespace Ui { class CAudioComponent; } + +namespace BlackGui +{ + namespace Components + { + //! Audio component, volume, ... + class CAudioComponent : public QFrame + { + Q_OBJECT + + public: + //! Constructor + explicit CAudioComponent(QWidget *parent = nullptr); + + //! Destructor + ~CAudioComponent(); + + private: + QScopedPointer ui; + }; + + } // namespace +} // namespace + + +#endif // guard diff --git a/src/blackgui/components/audiosetup.cpp b/src/blackgui/components/audiosetup.cpp new file mode 100644 index 000000000..9f602bb7b --- /dev/null +++ b/src/blackgui/components/audiosetup.cpp @@ -0,0 +1,239 @@ +/* Copyright (C) 2013 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +#include "audiosetup.h" +#include "ui_audiosetup.h" +#include "blackmisc/setaudio.h" +#include "blackmisc/logmessage.h" + +using namespace BlackCore; +using namespace BlackMisc; +using namespace BlackGui; +using namespace BlackMisc::Aviation; +using namespace BlackMisc::Audio; +using namespace BlackMisc::PhysicalQuantities; +using namespace BlackMisc::Settings; + +namespace BlackGui +{ + namespace Components + { + CAudioSetup::CAudioSetup(QWidget *parent) : + QFrame(parent), + CEnableForRuntime(nullptr, false), + ui(new Ui::CAudioSetup) + { + ui->setupUi(this); + this->ui->prb_SetupAudioTestProgress->hide(); + this->m_timerAudioTests = new QTimer(this); + } + + CAudioSetup::~CAudioSetup() + { } + + /* + * Runtime set + */ + void CAudioSetup::runtimeHasBeenSet() + { + if (!this->getIContextSettings()) qFatal("Settings missing"); + this->connect(this->getIContextSettings(), &IContextSettings::changedSettings, this, &CAudioSetup::ps_changedSettings); + this->connect(this->m_timerAudioTests, &QTimer::timeout, this, &CAudioSetup::ps_audioTestUpdate); + + // based on audio context + Q_ASSERT(this->getIContextAudio()); + bool connected = false; + if (this->getIContextAudio()) + { + this->initAudioDeviceLists(); + connected = this->connect(this->getIContextAudio(), &IContextAudio::audioTestCompleted, this, &CAudioSetup::ps_audioTestUpdate); + Q_ASSERT(connected); + connected = this->connect(this->ui->cb_SetupAudioInputDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_audioDeviceSelected(int))); + Q_ASSERT(connected); + connected = this->connect(this->ui->cb_SetupAudioOutputDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_audioDeviceSelected(int))); + Q_ASSERT(connected); + this->connect(this->ui->pb_SetupAudioMicrophoneTest, &QPushButton::clicked, this, &CAudioSetup::ps_startAudioTest); + this->connect(this->ui->pb_SetupAudioSquelchTest, &QPushButton::clicked, this, &CAudioSetup::ps_startAudioTest); + } + this->reloadSettings(); + } + + void CAudioSetup::ps_changedSettings(uint typeValue) + { + IContextSettings::SettingsType type = static_cast(typeValue); + this->reloadSettings(); + Q_UNUSED(type); + } + + /* + * Reload settings + */ + void CAudioSetup::reloadSettings() + { + // local copy + CSettingsAudio as = this->getIContextSettings()->getAudioSettings(); + + // fake setting for sound notifications + this->ui->cb_SetupAudioPlayNotificationSounds->setChecked(true); + this->ui->cb_SetupAudioNotificationTextMessage->setChecked(as.getNotificationFlag(BlackSound::CNotificationSounds::NotificationTextMessagePrivate)); + this->ui->cb_SetupAudioNotificationVoiceRoom->setChecked(as.getNotificationFlag(BlackSound::CNotificationSounds::NotificationVoiceRoomJoined)); + } + + /* + * Set audio device lists + */ + void CAudioSetup::initAudioDeviceLists() + { + if (!this->getIContextAudio()) return; + this->ui->cb_SetupAudioOutputDevice->clear(); + this->ui->cb_SetupAudioInputDevice->clear(); + + foreach(CAudioDevice device, this->getIContextAudio()->getAudioDevices()) + { + if (device.getType() == CAudioDevice::InputDevice) + { + this->ui->cb_SetupAudioInputDevice->addItem(device.toQString(true)); + } + else if (device.getType() == CAudioDevice::OutputDevice) + { + this->ui->cb_SetupAudioOutputDevice->addItem(device.toQString(true)); + } + } + + foreach(CAudioDevice device, this->getIContextAudio()->getCurrentAudioDevices()) + { + if (device.getType() == CAudioDevice::InputDevice) + { + this->ui->cb_SetupAudioInputDevice->setCurrentText(device.toQString(true)); + } + else if (device.getType() == CAudioDevice::OutputDevice) + { + this->ui->cb_SetupAudioOutputDevice->setCurrentText(device.toQString(true)); + } + } + } + + /* + * Notification sounds + */ + bool CAudioSetup::playNotificationSounds() const + { + return this->ui->cb_SetupAudioPlayNotificationSounds->isChecked(); + } + + /* + * Start the voice tests + */ + void CAudioSetup::ps_startAudioTest() + { + if (!this->getIContextAudio()) + { + CLogMessage(this).error("voice context not available"); + return; + } + if (this->m_timerAudioTests->isActive()) + { + CLogMessage(this).error("test running, wait until completed"); + return; + } + + QObject *sender = QObject::sender(); + this->m_timerAudioTests->start(600); // I let this run for ms, so there is enough overhead to really complete it + this->ui->prb_SetupAudioTestProgress->setValue(0); + this->ui->pte_SetupAudioTestActionAndResult->clear(); + if (sender == this->ui->pb_SetupAudioMicrophoneTest) + { + this->m_audioTestRunning = MicrophoneTest; + this->getIContextAudio()->runMicrophoneTest(); + this->ui->pte_SetupAudioTestActionAndResult->appendPlainText("Speak normally for 5 seconds"); + } + else if (sender == this->ui->pb_SetupAudioSquelchTest) + { + this->m_audioTestRunning = SquelchTest; + this->getIContextAudio()->runSquelchTest(); + this->ui->pte_SetupAudioTestActionAndResult->appendPlainText("Silence for 5 seconds"); + } + this->ui->prb_SetupAudioTestProgress->setVisible(true); + this->ui->pb_SetupAudioMicrophoneTest->setEnabled(false); + this->ui->pb_SetupAudioSquelchTest->setEnabled(false); + } + + /* + * Start the voice tests + */ + void CAudioSetup::ps_audioTestUpdate() + { + Q_ASSERT(this->getIContextAudio()); + if (!this->getIContextAudio()) return; + int v = this->ui->prb_SetupAudioTestProgress->value(); + QObject *sender = this->sender(); + + if (v < 100 && (sender == m_timerAudioTests)) + { + // timer update, increasing progress + this->ui->prb_SetupAudioTestProgress->setValue(v + 10); + } + else + { + this->m_timerAudioTests->stop(); + this->ui->prb_SetupAudioTestProgress->setValue(100); + if (sender == m_timerAudioTests) return; // just timer update + + // getting here we assume the audio test finished signal + // fetch results + this->ui->pte_SetupAudioTestActionAndResult->clear(); + if (this->m_audioTestRunning == SquelchTest) + { + double s = this->getIContextAudio()->getSquelchValue(); + this->ui->pte_SetupAudioTestActionAndResult->appendPlainText(QString::number(s)); + } + else if (this->m_audioTestRunning == MicrophoneTest) + { + QString m = this->getIContextAudio()->getMicrophoneTestResult(); + this->ui->pte_SetupAudioTestActionAndResult->appendPlainText(m); + } + this->m_audioTestRunning = NoAudioTest; + this->m_timerAudioTests->stop(); + this->ui->pb_SetupAudioMicrophoneTest->setEnabled(true); + this->ui->pb_SetupAudioSquelchTest->setEnabled(true); + this->ui->prb_SetupAudioTestProgress->setVisible(false); + } + } + + /* + * Select audio device + */ + void CAudioSetup::ps_audioDeviceSelected(int index) + { + if (!this->getIContextAudio()) return; + if (index < 0)return; + + CAudioDeviceList devices = this->getIContextAudio()->getAudioDevices(); + if (devices.isEmpty()) return; + CAudioDevice selectedDevice; + QObject *sender = QObject::sender(); + if (sender == this->ui->cb_SetupAudioInputDevice) + { + CAudioDeviceList inputDevices = devices.getInputDevices(); + if (index >= inputDevices.size()) return; + selectedDevice = inputDevices[index]; + this->getIContextAudio()->setCurrentAudioDevice(selectedDevice); + } + else if (sender == this->ui->cb_SetupAudioOutputDevice) + { + CAudioDeviceList outputDevices = devices.getOutputDevices(); + if (index >= outputDevices.size()) return; + selectedDevice = outputDevices[index]; + this->getIContextAudio()->setCurrentAudioDevice(selectedDevice); + } + } + + } // namespace +} // namespace + diff --git a/src/blackgui/components/audiosetup.h b/src/blackgui/components/audiosetup.h new file mode 100644 index 000000000..f34388e00 --- /dev/null +++ b/src/blackgui/components/audiosetup.h @@ -0,0 +1,86 @@ +/* Copyright (C) 2013 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKGUI_AUDIOSETUP_H +#define BLACKGUI_AUDIOSETUP_H + +#include "enableforruntime.h" +#include +#include + +namespace Ui { class CAudioSetup; } + +namespace BlackGui +{ + namespace Components + { + //! Audio setup such as input / output devices + class CAudioSetup : + public QFrame, + public CEnableForRuntime + { + Q_OBJECT + + public: + //! Constructor + explicit CAudioSetup(QWidget *parent = nullptr); + + //! Destructor + ~CAudioSetup(); + + //! Play notification sounds (at all) + bool playNotificationSounds() const; + + public slots: + //! Reload settings + void reloadSettings(); + + protected: + //! \copydoc CRuntimeBasedComponent::runtimeHasBeenSet + virtual void runtimeHasBeenSet() override; + + private slots: + + //! Settings have been changed + void ps_changedSettings(uint typeValue); + + //! start the MIC tests (Squelch) + void ps_startAudioTest(); + + //! Audio test updates (timer) for progressbar and fetching results + void ps_audioTestUpdate(); + + /*! + * \brief Audio device selected + * \param index audio device index (COM1, COM2) + */ + void ps_audioDeviceSelected(int index); + + private: + //! Audio test modes + enum AudioTest + { + NoAudioTest, + SquelchTest, + MicrophoneTest + }; + + //! Audio device lists from settings + void initAudioDeviceLists(); + + QScopedPointer ui; + QTimer *m_timerAudioTests; //!< audio tests: progress bar, disable/enable buttons + AudioTest m_audioTestRunning = NoAudioTest; + }; + } // namespace +} // namespace + +#endif // guard diff --git a/src/blackgui/components/settingscomponent.cpp b/src/blackgui/components/settingscomponent.cpp index 76184acb9..85ab25e53 100644 --- a/src/blackgui/components/settingscomponent.cpp +++ b/src/blackgui/components/settingscomponent.cpp @@ -16,7 +16,6 @@ #include "blackcore/context_settings.h" #include "blackcore/context_audio.h" #include "blackmisc/hwkeyboardkeylist.h" -#include "blackmisc/setaudio.h" #include "blackmisc/logmessage.h" #include "blackmisc/settingsblackmiscclasses.h" #include @@ -36,28 +35,23 @@ namespace BlackGui { namespace Components { - - /* - * Constructor - */ CSettingsComponent::CSettingsComponent(QWidget *parent) : QTabWidget(parent), CEnableForRuntime(nullptr, false), - ui(new Ui::CSettingsComponent), - m_audioTestRunning(NoAudioTest) + ui(new Ui::CSettingsComponent) { ui->setupUi(this); this->tabBar()->setExpanding(false); - this->ui->prb_SettingsAudioTestProgress->setVisible(false); - this->m_timerAudioTests = new QTimer(this); } - /* - * Destructor - */ CSettingsComponent::~CSettingsComponent() { } + bool CSettingsComponent::playNotificationSounds() const + { + return ui->comp_AudioSetup->playNotificationSounds(); + } + /* * Update own ICAO data from GUI */ @@ -68,65 +62,36 @@ namespace BlackGui icao.setAircraftCombinedType(this->ui->le_SettingsIcaoCombinedType->text()); } - /* - * Opacity - */ void CSettingsComponent::setGuiOpacity(double value) { this->ui->hs_SettingsGuiOpacity->setValue(value); } - /* - * Login as observer - */ bool CSettingsComponent::loginAsObserver() const { return this->ui->rb_SettingsLoginStealthMode->isChecked(); } - /* - * Stealth - */ bool CSettingsComponent::loginStealth() const { return this->ui->rb_SettingsLoginStealthMode->isChecked(); } - /* - * Notification sounds - */ - bool CSettingsComponent::playNotificationSounds() const - { - return this->ui->cb_SettingsAudioPlayNotificationSounds->isChecked(); - } - - /* - * Update interval - */ int CSettingsComponent::getAtcUpdateIntervalSeconds() const { return this->ui->hs_SettingsGuiAtcRefreshTime->value(); } - /* - * Update interval - */ int CSettingsComponent::getAircraftUpdateIntervalSeconds() const { return this->ui->hs_SettingsGuiAircraftRefreshTime->value(); } - /* - * Update interval - */ int CSettingsComponent::getUsersUpdateIntervalSeconds() const { return this->ui->hs_SettingsGuiUserRefreshTime->value(); } - /* - * Own callsign - */ QString CSettingsComponent::getOwnCallsignFromGui() const { return this->ui->le_SettingsAircraftCallsign->text(); @@ -139,7 +104,6 @@ namespace BlackGui { // local copy CSettingsNetwork nws = this->getIContextSettings()->getNetworkSettings(); - CSettingsAudio as = this->getIContextSettings()->getAudioSettings(); // update servers this->ui->tvp_SettingsTnServers->setSelectedServer(nws.getCurrentTrafficNetworkServer()); @@ -147,11 +111,6 @@ namespace BlackGui // update hot keys this->ui->tvp_SettingsMiscHotkeys->updateContainer(this->getIContextSettings()->getHotkeys()); - - // fake setting for sound notifications - this->ui->cb_SettingsAudioPlayNotificationSounds->setChecked(true); - this->ui->cb_SettingsAudioNotificationTextMessage->setChecked(as.getNotificationFlag(BlackSound::CNotificationSounds::NotificationTextMessagePrivate)); - this->ui->cb_SettingsAudioNotificationVoiceRoom->setChecked(as.getNotificationFlag(BlackSound::CNotificationSounds::NotificationVoiceRoomJoined)); } /* @@ -168,27 +127,10 @@ namespace BlackGui void CSettingsComponent::runtimeHasBeenSet() { if (!this->getIContextSettings()) qFatal("Settings missing"); - this->connect(this->getIContextSettings(), &IContextSettings::changedSettings, this, &CSettingsComponent::ps_changedSettings); - this->connect(this->m_timerAudioTests, &QTimer::timeout, this, &CSettingsComponent::ps_audioTestUpdate); - - // based on audio context - Q_ASSERT(this->getIContextAudio()); - bool connected = false; - if (this->getIContextAudio()) - { - this->initAudioDeviceLists(); - connected = this->connect(this->getIContextAudio(), &IContextAudio::audioTestCompleted, this, &CSettingsComponent::ps_audioTestUpdate); - Q_ASSERT(connected); - connected = this->connect(this->ui->cb_SettingsAudioInputDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_audioDeviceSelected(int))); - Q_ASSERT(connected); - connected = this->connect(this->ui->cb_SettingsAudioOutputDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(ps_audioDeviceSelected(int))); - Q_ASSERT(connected); - this->connect(this->ui->pb_SettingsAudioMicrophoneTest, &QPushButton::clicked, this, &CSettingsComponent::ps_startAudioTest); - this->connect(this->ui->pb_SettingsAudioSquelchTest, &QPushButton::clicked, this, &CSettingsComponent::ps_startAudioTest); - } // Opacity, intervals + bool connected = false; this->connect(this->ui->hs_SettingsGuiOpacity, &QSlider::valueChanged, this, &CSettingsComponent::changedWindowsOpacity); this->connect(this->ui->hs_SettingsGuiAircraftRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedAircraftsUpdateInterval); this->connect(this->ui->hs_SettingsGuiAtcRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedAtcStationsUpdateInterval); @@ -259,7 +201,7 @@ namespace BlackGui } /* - * Settings did changed + * Settings did change */ void CSettingsComponent::ps_changedSettings(uint typeValue) { @@ -326,40 +268,6 @@ namespace BlackGui this->ui->tvp_SettingsMiscHotkeys->derivedModel()->update(i, defaultHotkey); } - /* - * Set audio device lists - */ - void CSettingsComponent::initAudioDeviceLists() - { - if (!this->getIContextAudio()) return; - this->ui->cb_SettingsAudioOutputDevice->clear(); - this->ui->cb_SettingsAudioInputDevice->clear(); - - foreach(CAudioDevice device, this->getIContextAudio()->getAudioDevices()) - { - if (device.getType() == CAudioDevice::InputDevice) - { - this->ui->cb_SettingsAudioInputDevice->addItem(device.toQString(true)); - } - else if (device.getType() == CAudioDevice::OutputDevice) - { - this->ui->cb_SettingsAudioOutputDevice->addItem(device.toQString(true)); - } - } - - foreach(CAudioDevice device, this->getIContextAudio()->getCurrentAudioDevices()) - { - if (device.getType() == CAudioDevice::InputDevice) - { - this->ui->cb_SettingsAudioInputDevice->setCurrentText(device.toQString(true)); - } - else if (device.getType() == CAudioDevice::OutputDevice) - { - this->ui->cb_SettingsAudioOutputDevice->setCurrentText(device.toQString(true)); - } - } - } - /* * Font has been changed */ @@ -396,112 +304,5 @@ namespace BlackGui this->ui->le_SettingsGuiFontColor->setText(this->m_fontColor.name()); this->ps_fontChanged(); } - - /* - * Start the voice tests - */ - void CSettingsComponent::ps_startAudioTest() - { - if (!this->getIContextAudio()) - { - CLogMessage(this).error("voice context not available"); - return; - } - if (this->m_timerAudioTests->isActive()) - { - CLogMessage(this).error("test running, wait until completed"); - return; - } - - QObject *sender = QObject::sender(); - this->m_timerAudioTests->start(600); // I let this run for ms, so there is enough overhead to really complete it - this->ui->prb_SettingsAudioTestProgress->setValue(0); - this->ui->pte_SettingsAudioTestActionAndResult->clear(); - if (sender == this->ui->pb_SettingsAudioMicrophoneTest) - { - this->m_audioTestRunning = MicrophoneTest; - this->getIContextAudio()->runMicrophoneTest(); - this->ui->pte_SettingsAudioTestActionAndResult->appendPlainText("Speak normally for 5 seconds"); - } - else if (sender == this->ui->pb_SettingsAudioSquelchTest) - { - this->m_audioTestRunning = SquelchTest; - this->getIContextAudio()->runSquelchTest(); - this->ui->pte_SettingsAudioTestActionAndResult->appendPlainText("Silence for 5 seconds"); - } - this->ui->prb_SettingsAudioTestProgress->setVisible(true); - this->ui->pb_SettingsAudioMicrophoneTest->setEnabled(false); - this->ui->pb_SettingsAudioSquelchTest->setEnabled(false); - } - - /* - * Start the voice tests - */ - void CSettingsComponent::ps_audioTestUpdate() - { - Q_ASSERT(this->getIContextAudio()); - if (!this->getIContextAudio()) return; - int v = this->ui->prb_SettingsAudioTestProgress->value(); - QObject *sender = this->sender(); - - if (v < 100 && (sender == m_timerAudioTests)) - { - // timer update, increasing progress - this->ui->prb_SettingsAudioTestProgress->setValue(v + 10); - } - else - { - 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_audioTestRunning == SquelchTest) - { - double s = this->getIContextAudio()->getSquelchValue(); - this->ui->pte_SettingsAudioTestActionAndResult->appendPlainText(QString::number(s)); - } - else if (this->m_audioTestRunning == MicrophoneTest) - { - QString m = this->getIContextAudio()->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); - } - } - - /* - * Select audio device - */ - void CSettingsComponent::ps_audioDeviceSelected(int index) - { - if (!this->getIContextAudio()) return; - if (index < 0)return; - - CAudioDeviceList devices = this->getIContextAudio()->getAudioDevices(); - if (devices.isEmpty()) return; - CAudioDevice selectedDevice; - QObject *sender = QObject::sender(); - if (sender == this->ui->cb_SettingsAudioInputDevice) - { - CAudioDeviceList inputDevices = devices.getInputDevices(); - if (index >= inputDevices.size()) return; - selectedDevice = inputDevices[index]; - this->getIContextAudio()->setCurrentAudioDevice(selectedDevice); - } - else if (sender == this->ui->cb_SettingsAudioOutputDevice) - { - CAudioDeviceList outputDevices = devices.getOutputDevices(); - if (index >= outputDevices.size()) return; - selectedDevice = outputDevices[index]; - this->getIContextAudio()->setCurrentAudioDevice(selectedDevice); - } - } } } // namespace diff --git a/src/blackgui/components/settingscomponent.h b/src/blackgui/components/settingscomponent.h index 83fbb00e7..6d22e7ec7 100644 --- a/src/blackgui/components/settingscomponent.h +++ b/src/blackgui/components/settingscomponent.h @@ -53,6 +53,9 @@ namespace BlackGui //! Destructor ~CSettingsComponent(); + //! \copydoc CAudioSetupComponent::playNotificationSounds + bool playNotificationSounds() const; + //! ICAO data from GUI void setOwnAircraftIcaoDataFromGui(BlackMisc::Aviation::CAircraftIcao &icao) const; @@ -65,9 +68,6 @@ namespace BlackGui //! Login as observer bool loginStealth() const; - //! Play notification sounds (at all) - bool playNotificationSounds() const; - //! ATC refresh time int getAtcUpdateIntervalSeconds() const; @@ -130,18 +130,6 @@ namespace BlackGui //! Clear single hotkey void ps_clearHotkey(); - //! start the MIC tests (Squelch) - void ps_startAudioTest(); - - //! Audio test updates (timer) for progressbar and fetching results - void ps_audioTestUpdate(); - - /*! - * \brief Audio device selected - * \param index audio device index (COM1, COM2) - */ - void ps_audioDeviceSelected(int index); - //! Font has been changed void ps_fontChanged(); @@ -149,22 +137,8 @@ namespace BlackGui void ps_fontColorDialog(); private: - //! Audio test modes - enum AudioTest - { - NoAudioTest, - SquelchTest, - MicrophoneTest - }; - QScopedPointer ui; - QTimer *m_timerAudioTests; //!< audio tests: progress bar, disable/enable buttons - AudioTest m_audioTestRunning; - QColor m_fontColor; - - //! Audio device lists from settings - void initAudioDeviceLists(); - + QColor m_fontColor; }; } } // namespace diff --git a/src/blackgui/components/settingscomponent.ui b/src/blackgui/components/settingscomponent.ui index d84351187..971923c04 100644 --- a/src/blackgui/components/settingscomponent.ui +++ b/src/blackgui/components/settingscomponent.ui @@ -372,7 +372,7 @@ 0 - + QFrame::StyledPanel @@ -468,9 +468,12 @@ - + Aircraft refresh time (5-30s) + + Aircraft rt (5-30s) + @@ -506,9 +509,12 @@ - + ATC refresh time (5-30s) + + ATC rt (5-30s) + @@ -541,9 +547,12 @@ - + User refresh time (5-30s) + + User rt (5-30s) + @@ -589,6 +598,9 @@ 0 + + QComboBox::AdjustToMinimumContentsLength + @@ -792,6 +804,12 @@ + + BlackGui::Components::CAudioSetupComponent + QFrame +
blackgui/components/audiosetupcomponent.h
+ 1 +
BlackGui::Views::CKeyboardKeyView QTableView @@ -808,12 +826,6 @@
blackgui/components/settingssimulatorcomponent.h
1
- - BlackGui::Components::CAudioSetup - QFrame -
blackgui/components/audiosetup.h
- 1 -