Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2021-05-13 21:57:22 +0300
committerRobert Adam <dev@robert-adam.de>2021-05-15 18:37:29 +0300
commitaf1c4749a1c9b43c09546e560b95f1542c665cae (patch)
treeba21bd33a0293625f962db6e385d8f96b85685f8 /src
parent685480ef75dc567121ece519833e12821b4703fd (diff)
FEAT(client): Revamp positional audio settings page
The following things were changed/adapted: - Ordering of sliders to be grouped more logically - Tooltips - Added SpinBox to display and manually edit values (also partly beyond the slider's range) - Increased slider range for maximum distance to 200m (instead 100m) Fixes #4990
Diffstat (limited to 'src')
-rw-r--r--src/mumble/AudioConfigDialog.cpp97
-rw-r--r--src/mumble/AudioConfigDialog.h6
-rw-r--r--src/mumble/AudioOutput.ui227
3 files changed, 193 insertions, 137 deletions
diff --git a/src/mumble/AudioConfigDialog.cpp b/src/mumble/AudioConfigDialog.cpp
index 40e0a2fbb..91cf47f5e 100644
--- a/src/mumble/AudioConfigDialog.cpp
+++ b/src/mumble/AudioConfigDialog.cpp
@@ -12,6 +12,8 @@
#include "Utils.h"
#include "Global.h"
+#include <QSignalBlocker>
+
const QString AudioOutputDialog::name = QLatin1String("AudioOutputWidget");
const QString AudioInputDialog::name = QLatin1String("AudioInputWidget");
@@ -604,7 +606,7 @@ AudioOutputDialog::AudioOutputDialog(Settings &st) : ConfigWidget(st) {
qsOtherVolume->setAccessibleName(tr("Attenuation of other applications during speech"));
qsMinDistance->setAccessibleName(tr("Minimum distance"));
qsMaxDistance->setAccessibleName(tr("Maximum distance"));
- qsMaxDistVolume->setAccessibleName(tr("Minimum volume"));
+ qsMinimumVolume->setAccessibleName(tr("Minimum volume"));
qsBloom->setAccessibleName(tr("Bloom"));
qsPacketDelay->setAccessibleName(tr("Delay variance"));
qsPacketLoss->setAccessibleName(tr("Packet loss"));
@@ -621,6 +623,40 @@ AudioOutputDialog::AudioOutputDialog(Settings &st) : ConfigWidget(st) {
qcbLoopback->addItem(tr("Server"), Settings::Server);
qcbDevice->view()->setTextElideMode(Qt::ElideRight);
+
+ // Distance in cm
+ qsMinDistance->setRange(0, 200);
+ // Distance in m
+ qsbMinimumDistance->setRange(0.0, 50.0);
+ // Distance in cm
+ qsMaxDistance->setRange(10, 2000);
+ // Distance in m
+ qsbMaximumDistance->setRange(1.0, 1000.0);
+ qsMinimumVolume->setRange(0, 100);
+ qsbMinimumVolume->setRange(qsMinimumVolume->minimum(), qsMinimumVolume->maximum());
+ qsBloom->setRange(0, 75);
+ qsbBloom->setRange(qsBloom->minimum(), qsBloom->maximum());
+
+ QString minDistanceTooltip = tr("Distance at which audio volume from another player starts decreasing");
+ QString maxDistanceTooltip = tr("Distance at which a player's audio volume has reached its minimum value");
+ QString minVolumeTooltip =
+ tr("The minimum volume a player's audio will fade out to with increasing distance. Set to 0% for it to fade "
+ "into complete silence for a realistic maximum hearing distance.");
+ QString bloomTooltip = tr("If an audio source is close enough, blooming will cause the audio to be played on all "
+ "speakers more or less regardless of their position (albeit with lower volume)");
+
+ qlMinDistance->setToolTip(minDistanceTooltip);
+ qsMinDistance->setToolTip(minDistanceTooltip);
+ qsbMinimumDistance->setToolTip(minDistanceTooltip);
+ qlMaxDistance->setToolTip(maxDistanceTooltip);
+ qsMaxDistance->setToolTip(maxDistanceTooltip);
+ qsbMaximumDistance->setToolTip(maxDistanceTooltip);
+ qlMinimumVolume->setToolTip(minVolumeTooltip);
+ qsMinimumVolume->setToolTip(minVolumeTooltip);
+ qsbMinimumVolume->setToolTip(minVolumeTooltip);
+ qlBloom->setToolTip(bloomTooltip);
+ qsBloom->setToolTip(bloomTooltip);
+ qsbBloom->setToolTip(bloomTooltip);
}
QString AudioOutputDialog::title() const {
@@ -675,10 +711,10 @@ void AudioOutputDialog::load(const Settings &r) {
loadComboBox(qcbLoopback, r.lmLoopMode);
loadSlider(qsPacketDelay, static_cast< int >(r.dMaxPacketDelay));
loadSlider(qsPacketLoss, iroundf(r.dPacketLoss * 100.0f + 0.5f));
- loadSlider(qsMinDistance, iroundf(r.fAudioMinDistance * 10.0f + 0.5f));
- loadSlider(qsMaxDistance, iroundf(r.fAudioMaxDistance * 10.0f + 0.5f));
- loadSlider(qsMaxDistVolume, iroundf(r.fAudioMaxDistVolume * 100.0f + 0.5f));
- loadSlider(qsBloom, iroundf(r.fAudioBloom * 100.0f + 0.5f));
+ qsbMinimumDistance->setValue(r.fAudioMinDistance);
+ qsbMaximumDistance->setValue(r.fAudioMaxDistance);
+ qsbMinimumVolume->setValue(r.fAudioMaxDistVolume * 100);
+ qsbBloom->setValue(r.fAudioBloom * 100);
loadCheckBox(qcbHeadphones, r.bPositionalHeadphone);
loadCheckBox(qcbPositional, r.bPositionalAudio);
@@ -701,10 +737,10 @@ void AudioOutputDialog::save() const {
s.lmLoopMode = static_cast< Settings::LoopMode >(qcbLoopback->currentIndex());
s.dMaxPacketDelay = static_cast< float >(qsPacketDelay->value());
s.dPacketLoss = static_cast< float >(qsPacketLoss->value()) / 100.0f;
- s.fAudioMinDistance = static_cast< float >(qsMinDistance->value()) / 10.0f;
- s.fAudioMaxDistance = static_cast< float >(qsMaxDistance->value()) / 10.0f;
- s.fAudioMaxDistVolume = static_cast< float >(qsMaxDistVolume->value()) / 100.0f;
- s.fAudioBloom = static_cast< float >(qsBloom->value()) / 100.0f;
+ s.fAudioMinDistance = static_cast< float >(qsbMinimumDistance->value());
+ s.fAudioMaxDistance = static_cast< float >(qsbMaximumDistance->value());
+ s.fAudioMaxDistVolume = static_cast< float >(qsbMinimumVolume->value()) / 100.0f;
+ s.fAudioBloom = static_cast< float >(qsbBloom->value()) / 100.0f;
s.bPositionalAudio = qcbPositional->isChecked();
s.bPositionalHeadphone = qcbHeadphones->isChecked();
s.bExclusiveOutput = qcbExclusive->isChecked();
@@ -800,24 +836,43 @@ void AudioOutputDialog::on_qcbLoopback_currentIndexChanged(int v) {
qlPacketLoss->setEnabled(ena);
}
-void AudioOutputDialog::on_qsMinDistance_valueChanged(int v) {
- qlMinDistance->setText(tr("%1 m").arg(v / 10.0, 0, 'f', 1));
- if (qsMaxDistance->value() < v)
- qsMaxDistance->setValue(v);
+void AudioOutputDialog::on_qsMinDistance_valueChanged(int value) {
+ QSignalBlocker blocker(qsbMinimumDistance);
+ qsbMinimumDistance->setValue(value / 10.0f);
+}
+
+void AudioOutputDialog::on_qsbMinimumDistance_valueChanged(double value) {
+ QSignalBlocker blocker(qsMinDistance);
+ qsMinDistance->setValue(value * 10);
+}
+
+void AudioOutputDialog::on_qsMaxDistance_valueChanged(int value) {
+ QSignalBlocker blocker(qsbMaximumDistance);
+ qsbMaximumDistance->setValue(value / 10.0f);
+}
+void AudioOutputDialog::on_qsbMaximumDistance_valueChanged(double value) {
+ QSignalBlocker blocker(qsMaxDistance);
+ qsMaxDistance->setValue(value * 10);
+}
+
+void AudioOutputDialog::on_qsMinimumVolume_valueChanged(int value) {
+ QSignalBlocker blocker(qsbMinimumVolume);
+ qsbMinimumVolume->setValue(value);
}
-void AudioOutputDialog::on_qsMaxDistance_valueChanged(int v) {
- qlMaxDistance->setText(tr("%1 m").arg(v / 10.0, 0, 'f', 1));
- if (qsMinDistance->value() > v)
- qsMinDistance->setValue(v);
+void AudioOutputDialog::on_qsbMinimumVolume_valueChanged(int value) {
+ QSignalBlocker blocker(qsMinimumVolume);
+ qsMinimumVolume->setValue(value);
}
-void AudioOutputDialog::on_qsMaxDistVolume_valueChanged(int v) {
- qlMaxDistVolume->setText(tr("%1 %").arg(v));
+void AudioOutputDialog::on_qsBloom_valueChanged(int value) {
+ QSignalBlocker blocker(qsbBloom);
+ qsbBloom->setValue(value);
}
-void AudioOutputDialog::on_qsBloom_valueChanged(int v) {
- qlBloom->setText(tr("%1 %").arg(v + 100));
+void AudioOutputDialog::on_qsbBloom_valueChanged(int value) {
+ QSignalBlocker blocker(qsBloom);
+ qsBloom->setValue(value);
}
void AudioOutputDialog::on_qcbAttenuateOthersOnTalk_clicked(bool checked) {
diff --git a/src/mumble/AudioConfigDialog.h b/src/mumble/AudioConfigDialog.h
index 603d0e5e9..63bad0cd3 100644
--- a/src/mumble/AudioConfigDialog.h
+++ b/src/mumble/AudioConfigDialog.h
@@ -90,9 +90,13 @@ public slots:
void on_qsPacketLoss_valueChanged(int v);
void on_qcbLoopback_currentIndexChanged(int v);
void on_qsMinDistance_valueChanged(int v);
+ void on_qsbMinimumDistance_valueChanged(double v);
void on_qsMaxDistance_valueChanged(int v);
+ void on_qsbMaximumDistance_valueChanged(double v);
void on_qsBloom_valueChanged(int v);
- void on_qsMaxDistVolume_valueChanged(int v);
+ void on_qsbBloom_valueChanged(int v);
+ void on_qsMinimumVolume_valueChanged(int v);
+ void on_qsbMinimumVolume_valueChanged(int v);
void on_qcbSystem_currentIndexChanged(int);
void on_qcbAttenuateOthersOnTalk_clicked(bool checked);
void on_qcbAttenuateOthers_clicked(bool checked);
diff --git a/src/mumble/AudioOutput.ui b/src/mumble/AudioOutput.ui
index 0ffea8eaf..60cae290a 100644
--- a/src/mumble/AudioOutput.ui
+++ b/src/mumble/AudioOutput.ui
@@ -431,194 +431,193 @@
<string>Positional Audio</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
- <item row="1" column="1">
- <widget class="QLabel" name="qliMinDistancce">
- <property name="text">
- <string>Minimum Distance</string>
+ <item row="6" column="2">
+ <widget class="QSlider" name="qsMaxDistance">
+ <property name="toolTip">
+ <string/>
</property>
- <property name="buddy">
- <cstring>qsMinDistance</cstring>
+ <property name="whatsThis">
+ <string>This sets the maximum distance for sound calculations. When farther away than this, other users' speech volume will not decrease any further.</string>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
- <item row="1" column="4">
- <widget class="QLabel" name="qlMinDistance">
- <property name="minimumSize">
- <size>
- <width>40</width>
- <height>0</height>
- </size>
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="qcbPositional">
+ <property name="text">
+ <string>Enable</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QCheckBox" name="qcbHeadphones">
+ <property name="toolTip">
+ <string>The connected &quot;speakers&quot; are actually headphones</string>
</property>
<property name="whatsThis">
<string>Checking this indicates that you don't have speakers connected, just headphones. This is important, as speakers are usually in front of you, while headphones are directly to your left/right.</string>
</property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QLabel" name="qliMaxDistVolume">
<property name="text">
- <string>Minimum Volume</string>
- </property>
- <property name="buddy">
- <cstring>qsMaxDistance</cstring>
+ <string>Headphones</string>
</property>
</widget>
</item>
- <item row="3" column="1">
- <widget class="QLabel" name="qliMaxDistancce">
+ <item row="8" column="5">
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
- <string>Maximum Distance</string>
+ <string>%</string>
</property>
- <property name="buddy">
- <cstring>qsMaxDistance</cstring>
+ </widget>
+ </item>
+ <item row="8" column="3">
+ <widget class="QSpinBox" name="qsbBloom"/>
+ </item>
+ <item row="3" column="3">
+ <widget class="QDoubleSpinBox" name="qsbMinimumDistance">
+ <property name="decimals">
+ <number>1</number>
</property>
</widget>
</item>
- <item row="1" column="2">
- <widget class="QSlider" name="qsMinDistance">
+ <item row="7" column="2">
+ <widget class="QSlider" name="qsMinimumVolume">
<property name="toolTip">
- <string>Minimum distance to user before sound volume decreases</string>
- </property>
- <property name="statusTip">
<string/>
</property>
<property name="whatsThis">
- <string>This sets the minimum distance for sound calculations. The volume of other users' speech will not decrease until they are at least this far away from you.</string>
- </property>
- <property name="minimum">
- <number>10</number>
- </property>
- <property name="maximum">
- <number>200</number>
+ <string>What should the volume be at the maximum distance?</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QCheckBox" name="qcbPositional">
+ <item row="7" column="1">
+ <widget class="QLabel" name="qlMinimumVolume">
<property name="text">
- <string>Enable</string>
+ <string>Minimum Volume</string>
+ </property>
+ <property name="buddy">
+ <cstring>qsMaxDistance</cstring>
</property>
</widget>
</item>
- <item row="2" column="2">
- <widget class="QSlider" name="qsBloom">
- <property name="toolTip">
- <string>Factor for sound volume increase</string>
- </property>
- <property name="whatsThis">
- <string>How much should sound volume increase for sources that are really close?</string>
- </property>
- <property name="minimum">
- <number>0</number>
- </property>
- <property name="maximum">
- <number>75</number>
+ <item row="6" column="5">
+ <widget class="QLabel" name="label_3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <property name="text">
+ <string>m</string>
</property>
</widget>
</item>
- <item row="0" column="2">
- <widget class="QCheckBox" name="qcbHeadphones">
- <property name="toolTip">
- <string>The connected &quot;speakers&quot; are actually headphones</string>
- </property>
- <property name="whatsThis">
- <string>Checking this indicates that you don't have speakers connected, just headphones. This is important, as speakers are usually in front of you, while headphones are directly to your left/right.</string>
- </property>
+ <item row="6" column="1">
+ <widget class="QLabel" name="qlMaxDistance">
<property name="text">
- <string>Headphones</string>
+ <string>Maximum Distance</string>
+ </property>
+ <property name="buddy">
+ <cstring>qsMaxDistance</cstring>
</property>
</widget>
</item>
- <item row="4" column="4">
- <widget class="QLabel" name="qlMaxDistVolume">
- <property name="minimumSize">
- <size>
- <width>40</width>
- <height>0</height>
- </size>
+ <item row="7" column="5">
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
<property name="text">
- <string notr="true">mv</string>
+ <string>%</string>
</property>
</widget>
</item>
- <item row="4" column="2">
- <widget class="QSlider" name="qsMaxDistVolume">
+ <item row="8" column="2">
+ <widget class="QSlider" name="qsBloom">
<property name="toolTip">
- <string>The minimum volume a player's audio will fade out to with increasing distance. Set to 0% for it to fade into complete silence for a realistic maximum hearing distance.</string>
+ <string>Factor for sound volume increase</string>
</property>
<property name="whatsThis">
- <string>What should the volume be at the maximum distance?</string>
- </property>
- <property name="maximum">
- <number>100</number>
+ <string>How much should sound volume increase for sources that are really close?</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
- <item row="2" column="4">
+ <item row="8" column="1">
<widget class="QLabel" name="qlBloom">
- <property name="minimumSize">
- <size>
- <width>40</width>
- <height>0</height>
- </size>
- </property>
<property name="text">
- <string notr="true">bl</string>
- </property>
- </widget>
- </item>
- <item row="3" column="4">
- <widget class="QLabel" name="qlMaxDistance">
- <property name="minimumSize">
- <size>
- <width>40</width>
- <height>0</height>
- </size>
+ <string>Bloom</string>
</property>
- <property name="text">
- <string notr="true">md</string>
+ <property name="buddy">
+ <cstring>qsMinimumVolume</cstring>
</property>
</widget>
</item>
<item row="3" column="2">
- <widget class="QSlider" name="qsMaxDistance">
+ <widget class="QSlider" name="qsMinDistance">
<property name="toolTip">
- <string>Maximum distance, beyond which speech volume won't decrease</string>
- </property>
- <property name="whatsThis">
- <string>This sets the maximum distance for sound calculations. When farther away than this, other users' speech volume will not decrease any further.</string>
+ <string/>
</property>
- <property name="minimum">
- <number>10</number>
+ <property name="statusTip">
+ <string/>
</property>
- <property name="maximum">
- <number>1000</number>
+ <property name="whatsThis">
+ <string>This sets the minimum distance for sound calculations. The volume of other users' speech will not decrease until they are at least this far away from you.</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QLabel" name="qliBloom">
+ <item row="6" column="3">
+ <widget class="QDoubleSpinBox" name="qsbMaximumDistance">
+ <property name="decimals">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLabel" name="qlMinDistance">
<property name="text">
- <string>Bloom</string>
+ <string>Minimum Distance</string>
</property>
<property name="buddy">
- <cstring>qsMaxDistVolume</cstring>
+ <cstring>qsMinDistance</cstring>
</property>
</widget>
</item>
+ <item row="3" column="5">
+ <widget class="QLabel" name="label_4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="3">
+ <widget class="QSpinBox" name="qsbMinimumVolume"/>
+ </item>
</layout>
</widget>
</item>
@@ -765,8 +764,6 @@
<tabstop>qsDelay</tabstop>
<tabstop>qsMinDistance</tabstop>
<tabstop>qsBloom</tabstop>
- <tabstop>qsMaxDistance</tabstop>
- <tabstop>qsMaxDistVolume</tabstop>
<tabstop>qcbLoopback</tabstop>
<tabstop>qsPacketDelay</tabstop>
<tabstop>qsPacketLoss</tabstop>