Merge pull request #1983 from cg2121/infinity-symbol
UI: Display infinity symbol when volume is at 0 percent
This commit is contained in:
commit
6d6330ff03
@ -82,7 +82,7 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *, obs_source_t *source_)
|
||||
volume->setValue(obs_mul_to_db(vol));
|
||||
|
||||
if (volume->value() < MIN_DB)
|
||||
volume->setSpecialValueText("-inf dB");
|
||||
volume->setSpecialValueText("-" + QT_UTF8("\u221E") + " dB");
|
||||
|
||||
forceMono->setChecked((flags & OBS_SOURCE_FLAG_FORCE_MONO) != 0);
|
||||
|
||||
@ -293,7 +293,7 @@ void OBSAdvAudioCtrl::SourceMixersChanged(uint32_t mixers)
|
||||
void OBSAdvAudioCtrl::volumeChanged(double db)
|
||||
{
|
||||
if (db < MIN_DB) {
|
||||
volume->setSpecialValueText("-inf dB");
|
||||
volume->setSpecialValueText("-" + QT_UTF8("\u221E") + " dB");
|
||||
db = -INFINITY;
|
||||
}
|
||||
|
||||
|
@ -74,9 +74,15 @@ void VolControl::SliderChanged(int vol)
|
||||
|
||||
void VolControl::updateText()
|
||||
{
|
||||
QString db = QString::number(obs_fader_get_db(obs_fader), 'f', 1)
|
||||
.append(" dB");
|
||||
volLabel->setText(db);
|
||||
QString text;
|
||||
float db = obs_fader_get_db(obs_fader);
|
||||
|
||||
if (db < -96.0f)
|
||||
text = "-" + QT_UTF8("\u221E") + " dB";
|
||||
else
|
||||
text = QString::number(db, 'f', 1).append(" dB");
|
||||
|
||||
volLabel->setText(text);
|
||||
|
||||
bool muted = obs_source_muted(source);
|
||||
const char *accTextLookup = muted ? "VolControl.SliderMuted"
|
||||
|
Loading…
x
Reference in New Issue
Block a user