Skip to content

Commit

Permalink
Merge PR mumble-voip#6155: FEAT(client): Add popup when mute cue is a…
Browse files Browse the repository at this point in the history
…ctivated for the first time
  • Loading branch information
Krzmbrzl authored Jan 1, 2024
2 parents be3773f + 5f6feef commit bc03c56
Show file tree
Hide file tree
Showing 55 changed files with 578 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/mumble/AudioConfigDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ void AudioInputDialog::load(const Settings &r) {
qlePushClickPathOn->setText(r.qsTxAudioCueOn);
qlePushClickPathOff->setText(r.qsTxAudioCueOff);
qleMuteCuePath->setText(r.qsTxMuteCue);
s.muteCueShown = r.muteCueShown;


loadComboBox(qcbTransmit, r.atTransmit);
loadSlider(qsTransmitHold, r.iVoiceHold);
Expand Down Expand Up @@ -439,6 +441,7 @@ void AudioInputDialog::on_qcbMuteCue_clicked(bool b) {
qleMuteCuePath->setEnabled(b);
qpbMuteCueBrowse->setEnabled(b);
qpbMuteCuePreview->setEnabled(b);
s.muteCueShown = true;
}

void AudioInputDialog::on_qpbMuteCueBrowse_clicked() {
Expand Down
2 changes: 2 additions & 0 deletions src/mumble/AudioInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ AudioInput::AudioInput() : opusBuffer(Global::get().s.iFramesPerPacket * (SAMPLE

connect(this, SIGNAL(doDeaf()), Global::get().mw->qaAudioDeaf, SLOT(trigger()), Qt::QueuedConnection);
connect(this, SIGNAL(doMute()), Global::get().mw->qaAudioMute, SLOT(trigger()), Qt::QueuedConnection);
connect(this, SIGNAL(doMuteCue()), Global::get().mw, SLOT(on_muteCuePopup_triggered()));
}

AudioInput::~AudioInput() {
Expand Down Expand Up @@ -1048,6 +1049,7 @@ void AudioInput::encodeAudioFrame(AudioChunk chunk) {
if (!qetLastMuteCue.isValid() || qetLastMuteCue.elapsed() > MUTE_CUE_DELAY) {
qetLastMuteCue.start();
ao->playSample(Global::get().s.qsTxMuteCue, Global::get().s.cueVolume);
emit doMuteCue();
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/mumble/AudioInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ class AudioInput : public QThread {
signals:
void doDeaf();
void doMute();
void doMuteCue();
/// A signal emitted if audio input is being encountered
///
/// @param inputPCM The encountered input PCM
Expand Down
1 change: 1 addition & 0 deletions src/mumble/Global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Global::Global(const QString &qsConfigPath) {
bCenterPosition = false;
bPosTest = false;
bInAudioWizard = false;
inConfigUI = false;
iAudioPathTime = 0;
iAudioBandwidth = -1;
iMaxBandwidth = -1;
Expand Down
1 change: 1 addition & 0 deletions src/mumble/Global.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ struct Global Q_DECL_FINAL {
bool bCenterPosition;
bool bPosTest;
bool bInAudioWizard;
bool inConfigUI;
#ifdef USE_OVERLAY
OverlayClient *ocIntercept;
#endif
Expand Down
27 changes: 26 additions & 1 deletion src/mumble/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4093,6 +4093,8 @@ void MainWindow::openAudioStatsDialog() {
void MainWindow::openConfigDialog() {
ConfigDialog *dlg = new ConfigDialog(this);

Global::get().inConfigUI = true;

QObject::connect(dlg, &ConfigDialog::settingsAccepted, Global::get().talkingUI, &TalkingUI::on_settingsChanged);

if (dlg->exec() == QDialog::Accepted) {
Expand All @@ -4116,6 +4118,8 @@ void MainWindow::openConfigDialog() {
}
}

Global::get().inConfigUI = false;

delete dlg;
}

Expand Down Expand Up @@ -4146,4 +4150,25 @@ void MainWindow::openAboutQtDialog() {

void MainWindow::versionCheck() {
new VersionCheck(false, this);
}
}

void MainWindow::on_muteCuePopup_triggered() {
if (Global::get().s.muteCueShown || Global::get().inConfigUI) {
return;
}

Global::get().s.muteCueShown = true;
QMessageBox mb(
QMessageBox::Warning, QLatin1String("Mumble"),
tr("That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?"),
QMessageBox::NoButton, this);
QPushButton *accept = mb.addButton(tr("Yes"), QMessageBox::YesRole);
QPushButton *reject = mb.addButton(tr("No"), QMessageBox::NoRole);
mb.setDefaultButton(accept);
mb.setEscapeButton(accept);
mb.exec();

if (mb.clickedButton() == reject) {
Global::get().s.bTxMuteCue = false;
}
}
1 change: 1 addition & 0 deletions src/mumble/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ public slots:
void context_triggered();
void updateTarget();
void updateMenuPermissions();
void on_muteCuePopup_triggered();
/// Handles state changes like talking mode changes and mute/unmute
/// or priority speaker flag changes for the gui user
void userStateChanged();
Expand Down
1 change: 1 addition & 0 deletions src/mumble/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ struct Settings {
QString qsTxAudioCueOff = cqsDefaultPushClickOn;

bool bTxMuteCue = true;
bool muteCueShown = false;
QString qsTxMuteCue = cqsDefaultMuteCue;

bool bTransmitPosition = false;
Expand Down
1 change: 1 addition & 0 deletions src/mumble/SettingsKeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const SettingsKey TRANSMIT_CUE_START_KEY = { "transmit_cue_
const SettingsKey TRANSMIT_CUE_STOP_KEY = { "transmit_cue_stop" };
const SettingsKey PLAY_MUTE_CUE_KEY = { "play_mute_cue" };
const SettingsKey MUTE_CUE_KEY = { "mute_cue" };
const SettingsKey MUTE_CUE_POPUP_SHOWN = { "mute_cue_popup_shown" };
const SettingsKey AUDIO_QUALITY_KEY = { "audio_quality" };
const SettingsKey LOUDNESS_KEY = { "loudness" };
const SettingsKey VOLUME_KEY = { "volume" };
Expand Down
1 change: 1 addition & 0 deletions src/mumble/SettingsMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
PROCESS(audio, TRANSMIT_CUE_STOP_KEY, qsTxAudioCueOff) \
PROCESS(audio, PLAY_MUTE_CUE_KEY, bTxMuteCue) \
PROCESS(audio, MUTE_CUE_KEY, qsTxMuteCue) \
PROCESS(audio, MUTE_CUE_POPUP_SHOWN, muteCueShown) \
PROCESS(audio, AUDIO_QUALITY_KEY, iQuality) \
PROCESS(audio, LOUDNESS_KEY, iMinLoudness) \
PROCESS(audio, VOLUME_KEY, fVolume) \
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6618,6 +6618,18 @@ Valid options are:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_bg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6615,6 +6615,18 @@ Valid options are:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6614,6 +6614,18 @@ Valid options are:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished">Ya</translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_ca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6640,6 +6640,18 @@ Valid options are:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6674,6 +6674,18 @@ Valid options are:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6618,6 +6618,18 @@ Valid options are:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_da.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6670,6 +6670,18 @@ Valid options are:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished">Ja</translation>
</message>
<message>
<source>No</source>
<translation type="unfinished">Nej</translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6761,6 +6761,18 @@ Gültige Optionen sind:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished">Ja</translation>
</message>
<message>
<source>No</source>
<translation type="unfinished">Nein</translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6768,6 +6768,18 @@ mumble://[&lt;username&gt;[:&lt;password&gt;]@]&lt;host&gt;[:&lt;port&gt;][/&lt;
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished">Ναι</translation>
</message>
<message>
<source>No</source>
<translation type="unfinished">Όχι</translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6613,6 +6613,18 @@ Valid options are:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_en_GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6667,6 +6667,18 @@ Valid options are:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_eo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6626,6 +6626,18 @@ Valid options are:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/mumble_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6769,6 +6769,18 @@ Las opciones válidas son:
<source>This will check if mumble is up to date</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>That sound was the mute cue. It activates when you speak while muted. Would you like to keep it enabled?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished">Sí</translation>
</message>
<message>
<source>No</source>
<translation type="unfinished">No</translation>
</message>
</context>
<context>
<name>Manual</name>
Expand Down
Loading

0 comments on commit bc03c56

Please sign in to comment.