diff --git a/src/blackgui/components/audiodevicevolumesetupcomponent.cpp b/src/blackgui/components/audiodevicevolumesetupcomponent.cpp
index 93b17a0f4..81724ee31 100644
--- a/src/blackgui/components/audiodevicevolumesetupcomponent.cpp
+++ b/src/blackgui/components/audiodevicevolumesetupcomponent.cpp
@@ -72,9 +72,6 @@ namespace BlackGui
this->init();
});
- ui->pb_LevelIn->setValue(ui->pb_LevelIn->minimum());
- ui->pb_LevelOut->setValue(ui->pb_LevelOut->minimum());
-
// all tx/rec checkboxes
CGuiUtility::checkBoxesReadOnly(ui->fr_TxRec, true);
}
@@ -161,22 +158,18 @@ namespace BlackGui
ui->hs_VolumeOut->setValue(qRound(value / tr * r));
}
- void CAudioDeviceVolumeSetupComponent::setInLevel(int value, int from, int to)
+ void CAudioDeviceVolumeSetupComponent::setInLevel(double value)
{
- if (value > to) { value = to; }
- if (value < from) { value = from; }
- const double r = ui->pb_LevelIn->maximum() - ui->pb_LevelIn->minimum();
- const double tr = to - from;
- ui->pb_LevelIn->setValue(qRound(value / tr * r));
+ if (value > 1.0) { value = 1.0; }
+ if (value < 0.0) { value = 0.0; }
+ ui->wip_InLevelMeter->levelChanged(value);
}
- void CAudioDeviceVolumeSetupComponent::setOutLevel(int value, int from, int to)
+ void CAudioDeviceVolumeSetupComponent::setOutLevel(double value)
{
- if (value > to) { value = to; }
- if (value < from) { value = from; }
- const double r = ui->pb_LevelOut->maximum() - ui->pb_LevelOut->minimum();
- const double tr = to - from;
- ui->pb_LevelOut->setValue(qRound(value / tr * r));
+ if (value > 1.0) { value = 1.0; }
+ if (value < 0.0) { value = 0.0; }
+ ui->wip_OutLevelMeter->levelChanged(value);
}
void CAudioDeviceVolumeSetupComponent::setInfo(const QString &info)
@@ -249,12 +242,12 @@ namespace BlackGui
void CAudioDeviceVolumeSetupComponent::onOutputVU(double vu)
{
- this->setOutLevel(qRound(vu * 100.0), 0, 100);
+ this->setOutLevel(vu);
}
void CAudioDeviceVolumeSetupComponent::onInputVU(double vu)
{
- this->setInLevel(qRound(vu * 100.0), 0, 100);
+ this->setInLevel(vu);
}
void CAudioDeviceVolumeSetupComponent::onReloadDevices()
diff --git a/src/blackgui/components/audiodevicevolumesetupcomponent.h b/src/blackgui/components/audiodevicevolumesetupcomponent.h
index 0015fa452..456d6ec3b 100644
--- a/src/blackgui/components/audiodevicevolumesetupcomponent.h
+++ b/src/blackgui/components/audiodevicevolumesetupcomponent.h
@@ -51,9 +51,9 @@ namespace BlackGui
void setOutValue(int value, int from = BlackMisc::Audio::CSettings::OutMin, int to = BlackMisc::Audio::CSettings::OutMax);
//! @}
- //! Set input and output level values @{
- void setInLevel(int value, int from, int to);
- void setOutLevel(int value, int from, int to);
+ //! Set input and output level values 0..1 @{
+ void setInLevel(double value);
+ void setOutLevel(double value);
//! @}
//! Info string
diff --git a/src/blackgui/components/audiodevicevolumesetupcomponent.ui b/src/blackgui/components/audiodevicevolumesetupcomponent.ui
index d79b43a58..903b2aec8 100644
--- a/src/blackgui/components/audiodevicevolumesetupcomponent.ui
+++ b/src/blackgui/components/audiodevicevolumesetupcomponent.ui
@@ -6,41 +6,35 @@
0
0
- 227
- 254
+ 200
+ 267
Audio setup
- -
-
-
- 24
-
-
- %v
+
-
+
+
+ ...
- -
-
-
- 50
-
-
- Qt::Horizontal
-
-
-
- -
-
+
-
+
In
+ -
+
+
+ Info
+
+
+
-
@@ -58,9 +52,26 @@
- -
-
-
+
-
+
+
+ Disable realistic audio simulation
+
+
+
+ -
+
+
+ true
+
+
+ extra info goes here
+
+
+
+ -
+
+
0
@@ -74,9 +85,16 @@
0
-
-
+
+
+ -
+
- Loopback, test sound in- to output
+ ...
+
+
+
+ :/diagona/icons/diagona/icons/arrow-circle-135.png:/diagona/icons/diagona/icons/arrow-circle-135.png
@@ -90,13 +108,54 @@
- -
-
+
-
+
- Info
+ ...
+ -
+
+
+ Out
+
+
+
+ -
+
+
+
-
+
+
+ Tx1
+
+
+
+ -
+
+
+ Rec1
+
+
+
+ -
+
+
+ Tx2
+
+
+
+ -
+
+
+ Rec2
+
+
+
+
+
+
-
@@ -133,26 +192,9 @@
- -
-
-
- 50
-
-
- %v
-
-
-
- -
-
-
- In
-
-
-
- -
-
-
+
-
+
+
0
@@ -166,96 +208,62 @@
0
-
-
-
- -
-
+
- ...
-
-
-
- :/diagona/icons/diagona/icons/arrow-circle-135.png:/diagona/icons/diagona/icons/arrow-circle-135.png
+ Loopback, test sound in- to output
- -
-
+
-
+
- Disable realistic audio simulation
+ In
- -
-
-
- true
+
-
+
+
+ 50
-
- extra info goes here
+
+ Qt::Horizontal
- -
-
-
- Out
+
-
+
+
+
+ 0
+ 0
+
- -
-
-
- ...
+
-
+
+
+
+ 0
+ 0
+
- -
-
-
- ...
-
-
-
- -
-
-
-
-
-
-
- Tx1
-
-
-
- -
-
-
- Rec1
-
-
-
- -
-
-
- Tx2
-
-
-
- -
-
-
- Rec2
-
-
-
-
-
-
+
+
+ BlackGui::CLevelMeter
+ QFrame
+
+ 1
+
+
le_Info
cb_1Tx
@@ -269,7 +277,9 @@
cb_DisableAudioEffects
cb_SetupAudioLoopback
hs_VolumeIn
+ tb_ResetInVolume
hs_VolumeOut
+ tb_ResetOutVolume
diff --git a/src/blackgui/share/qss/stdwidget.qss b/src/blackgui/share/qss/stdwidget.qss
index ad90d48a9..f915b497e 100644
--- a/src/blackgui/share/qss/stdwidget.qss
+++ b/src/blackgui/share/qss/stdwidget.qss
@@ -716,18 +716,12 @@ QToolTip {
border: 1px solid white;
}
-BlackGui--Components--CAudioDeviceVolumeSetupComponent
-QProgressBar {
+BlackGui--CLevelMeter {
+ qproperty-lowColor: lightgray;
border: 1px solid grey;
border-radius: 5px;
+ padding: 1px;
height: 1em;
- /** background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 white, stop: 0.4 gray, stop:1 green); **/
-}
-
-BlackGui--Components--CAudioDeviceVolumeSetupComponent
-QProgressBar::chunk {
- width: 20px;
- margin: 0.0px;
}
/** T506 supervisor messages **/