mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-19 12:41:54 -04:00
obs: Fix label in volume control
Use a dedicated method for setting the dB label in the volume control and make sure to call it regardless if the volume was changed through the slider or from somewhere else.
This commit is contained in:
1 parent
11106c2fce
commit
0f8b2faed4
2 files changed
+7
No files matched your search
@@ -36,6 +36,7 @@ void VolControl::OBSVolumeLevel(void *data, calldata_t *calldata)
|
||||
void VolControl::VolumeChanged()
|
||||
{
|
||||
slider->setValue((int) (obs_fader_get_deflection(obs_fader) * 100.0f));
|
||||
updateText();
|
||||
}
|
||||
|
||||
void VolControl::VolumeLevel(float mag, float peak, float peakHold)
|
||||
@@ -46,6 +47,11 @@ void VolControl::VolumeLevel(float mag, float peak, float peakHold)
|
||||
void VolControl::SliderChanged(int vol)
|
||||
{
|
||||
obs_fader_set_deflection(obs_fader, float(vol) * 0.01f);
|
||||
updateText();
|
||||
}
|
||||
|
||||
void VolControl::updateText()
|
||||
{
|
||||
volLabel->setText(QString::number(obs_fader_get_db(obs_fader), 'f', 1)
|
||||
.append(" dB"));
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ private slots:
|
||||
void VolumeChanged();
|
||||
void VolumeLevel(float mag, float peak, float peakHold);
|
||||
void SliderChanged(int vol);
|
||||
void updateText();
|
||||
|
||||
public:
|
||||
VolControl(OBSSource source);
|
||||
|
||||
Reference in new issue
Block a user