mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
[AFV] Ref T730, allow to set AFV notifcation sounds in AFV settings
This commit is contained in:
@@ -70,6 +70,10 @@ namespace BlackGui
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAudioNoTransmission, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAfvBlocked, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->cb_SetupAfvClicked, &QCheckBox::toggled, this, &CAudioNotificationComponent::onNotificationsToggled, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->pb_SoundReset, &QPushButton::released, this, &CAudioNotificationComponent::resetNotificationSoundsDir, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
c = connect(ui->pb_SoundDir, &QPushButton::released, this, &CAudioNotificationComponent::selectNotificationSoundsDir, Qt::QueuedConnection);
|
||||
@@ -88,7 +92,8 @@ namespace BlackGui
|
||||
return ui->cb_SetupAudioPTTClickDown->isChecked() || ui->cb_SetupAudioPTTClickUp->isChecked() ||
|
||||
ui->cb_SetupAudioPTTBlocked->isChecked() ||
|
||||
ui->cb_SetupAudioNotificationTextMessagePrivate->isChecked() || ui->cb_SetupAudioNotificationTextMessageSupervisor->isChecked() ||
|
||||
ui->cb_SetupAudioNotificationTextCallsignMentioned->isChecked() || ui->cb_SetupAudioNoTransmission->isChecked();
|
||||
ui->cb_SetupAudioNotificationTextCallsignMentioned->isChecked() || ui->cb_SetupAudioNoTransmission->isChecked() ||
|
||||
ui->cb_SetupAfvBlocked->isChecked() || ui->cb_SetupAfvClicked->isChecked();
|
||||
}
|
||||
|
||||
void CAudioNotificationComponent::reloadSettings()
|
||||
@@ -104,6 +109,9 @@ namespace BlackGui
|
||||
ui->cb_SetupAudioNotificationTextCallsignMentioned->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationTextCallsignMentioned));
|
||||
ui->cb_SetupAudioNoTransmission->setChecked(as.isNotificationFlagSet(CNotificationSounds::NotificationNoAudioTransmission));
|
||||
|
||||
ui->cb_SetupAfvBlocked->setChecked(as.isNotificationFlagSet(CNotificationSounds::AFVBlocked));
|
||||
ui->cb_SetupAfvClicked->setChecked(as.isNotificationFlagSet(CNotificationSounds::AFVClicked));
|
||||
|
||||
ui->le_SoundDir->setText(as.getNotificationSoundDirectory());
|
||||
ui->sb_NotificationValueVolume->setValue(as.getNotificationVolume());
|
||||
}
|
||||
@@ -123,12 +131,16 @@ namespace BlackGui
|
||||
|
||||
if (cb == ui->cb_SetupAudioPTTClickDown) { return CNotificationSounds::PTTClickKeyDown; }
|
||||
if (cb == ui->cb_SetupAudioPTTClickUp) { return CNotificationSounds::PTTClickKeyUp; }
|
||||
if (cb == ui->cb_SetupAudioPTTBlocked) { return CNotificationSounds::PTTBlocked; }
|
||||
if (cb == ui->cb_SetupAudioPTTBlocked) { return CNotificationSounds::PTTBlocked; }
|
||||
|
||||
if (cb == ui->cb_SetupAudioNotificationTextCallsignMentioned) { return CNotificationSounds::NotificationTextCallsignMentioned; }
|
||||
if (cb == ui->cb_SetupAudioNotificationTextMessagePrivate) { return CNotificationSounds::NotificationTextMessagePrivate; }
|
||||
if (cb == ui->cb_SetupAudioNotificationTextMessageSupervisor) { return CNotificationSounds::NotificationTextMessageSupervisor; }
|
||||
if (cb == ui->cb_SetupAudioNoTransmission) { return CNotificationSounds::NotificationNoAudioTransmission; }
|
||||
|
||||
if (cb == ui->cb_SetupAfvBlocked) { return CNotificationSounds::AFVBlocked; }
|
||||
if (cb == ui->cb_SetupAfvClicked) { return CNotificationSounds::AFVClicked; }
|
||||
|
||||
return CNotificationSounds::NoNotifications;
|
||||
}
|
||||
|
||||
@@ -146,6 +158,9 @@ namespace BlackGui
|
||||
as.setNotificationFlag(CNotificationSounds::NotificationTextCallsignMentioned, ui->cb_SetupAudioNotificationTextCallsignMentioned->isChecked());
|
||||
as.setNotificationFlag(CNotificationSounds::NotificationNoAudioTransmission, ui->cb_SetupAudioNoTransmission->isChecked());
|
||||
|
||||
as.setNotificationFlag(CNotificationSounds::AFVBlocked, ui->cb_SetupAfvBlocked->isChecked());
|
||||
as.setNotificationFlag(CNotificationSounds::AFVClicked, ui->cb_SetupAfvClicked->isChecked());
|
||||
|
||||
const CStatusMessage msg = m_audioSettings.set(as);
|
||||
CLogMessage(this).preformatted(msg);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>298</width>
|
||||
<height>240</height>
|
||||
<height>297</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
@@ -46,45 +46,14 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>296</width>
|
||||
<height>238</height>
|
||||
<height>295</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioPTTClickUp">
|
||||
<item row="11" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioPTTBlocked">
|
||||
<property name="text">
|
||||
<string>PTT click (key up)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextMessageSupervisor">
|
||||
<property name="text">
|
||||
<string>supervisor messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNoTransmission">
|
||||
<property name="text">
|
||||
<string>No audio transmission warning</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioPTTClickDown">
|
||||
<property name="text">
|
||||
<string>PTT click (key down)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbl_Notifications">
|
||||
<property name="toolTip">
|
||||
<string>Notifications</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Volume:</string>
|
||||
<string>PTT blocking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -127,10 +96,24 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioPTTBlocked">
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextMessagePrivate">
|
||||
<property name="text">
|
||||
<string>PTT blocking</string>
|
||||
<string>notification for private text messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAfvClicked">
|
||||
<property name="text">
|
||||
<string>AFV click</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioPTTClickDown">
|
||||
<property name="text">
|
||||
<string>PTT click (key down)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -150,6 +133,44 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_SoundDirectory">
|
||||
<property name="text">
|
||||
<string>Dir.:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextMessageSupervisor">
|
||||
<property name="text">
|
||||
<string>supervisor messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioPTTClickUp">
|
||||
<property name="text">
|
||||
<string>PTT click (key up)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNoTransmission">
|
||||
<property name="text">
|
||||
<string>No audio transmission warning</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbl_Notifications">
|
||||
<property name="toolTip">
|
||||
<string>Notifications</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Volume:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextCallsignMentioned">
|
||||
<property name="text">
|
||||
@@ -157,17 +178,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAudioNotificationTextMessagePrivate">
|
||||
<item row="13" column="1">
|
||||
<widget class="QCheckBox" name="cb_SetupAfvBlocked">
|
||||
<property name="text">
|
||||
<string>notification for private text messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_SoundDirectory">
|
||||
<property name="text">
|
||||
<string>Dir.:</string>
|
||||
<string>AFV blocking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Audio;
|
||||
using namespace BlackSound::SampleProvider;
|
||||
|
||||
namespace BlackSound
|
||||
{
|
||||
@@ -44,7 +45,7 @@ namespace BlackSound
|
||||
|
||||
// used for too long or hanging sounds
|
||||
QPointer<CNotificationPlayer> myself(this);
|
||||
QTimer::singleShot(2000, effect, [ = ]
|
||||
QTimer::singleShot(3000, effect, [ = ]
|
||||
{
|
||||
if (!myself || !m_playingEffect) { return; }
|
||||
m_playingEffect->stop();
|
||||
@@ -71,6 +72,9 @@ namespace BlackSound
|
||||
this->updateEffect(CNotificationSounds::PTTBlocked, directory, "pttblocked.wav");
|
||||
this->updateEffect(CNotificationSounds::PTTClickKeyDown, directory, "pttclick.wav");
|
||||
this->updateEffect(CNotificationSounds::PTTClickKeyUp, directory, "pttclick.wav");
|
||||
|
||||
// CNotificationSounds::AFVBlocked is generated
|
||||
this->updateEffect(CNotificationSounds::AFVClicked, directory, Samples::fnClick());
|
||||
}
|
||||
|
||||
void CNotificationPlayer::onPlayingChanged()
|
||||
|
||||
Reference in New Issue
Block a user