mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-18 21:38:29 -04:00
frontend: Force update volume meter backgrounds
This commit is contained in:
@@ -275,7 +275,8 @@ void VolumeMeter::setPeakMeterType(enum obs_peak_meter_type peakMeterType)
|
||||
break;
|
||||
}
|
||||
|
||||
updateBackgroundCache();
|
||||
bool forceUpdate = true;
|
||||
updateBackgroundCache(forceUpdate);
|
||||
}
|
||||
|
||||
VolumeMeter::VolumeMeter(QWidget *parent, obs_source_t *source)
|
||||
@@ -455,7 +456,8 @@ void VolumeMeter::refreshColors()
|
||||
setForegroundWarningColor(getForegroundWarningColor());
|
||||
setForegroundErrorColor(getForegroundErrorColor());
|
||||
|
||||
updateBackgroundCache();
|
||||
bool forceUpdate = true;
|
||||
updateBackgroundCache(forceUpdate);
|
||||
}
|
||||
|
||||
QRect VolumeMeter::getBarRect() const
|
||||
@@ -648,17 +650,17 @@ void VolumeMeter::paintVTicks(QPainter &painter, int x, int y, int height)
|
||||
}
|
||||
}
|
||||
|
||||
void VolumeMeter::updateBackgroundCache()
|
||||
void VolumeMeter::updateBackgroundCache(bool force)
|
||||
{
|
||||
if (!size().isValid()) {
|
||||
if (!force && !size().isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (backgroundCache.size() == size() && !backgroundCache.isNull()) {
|
||||
if (!force && backgroundCache.size() == size() && !backgroundCache.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (displayNrAudioChannels <= 0) {
|
||||
if (!force && displayNrAudioChannels <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ private:
|
||||
uint64_t displayInputPeakHoldLastUpdateTime[MAX_AUDIO_CHANNELS];
|
||||
|
||||
QPixmap backgroundCache;
|
||||
void updateBackgroundCache();
|
||||
void updateBackgroundCache(bool force = false);
|
||||
|
||||
QFont tickFont;
|
||||
QRect tickTextTokenRect;
|
||||
|
||||
Reference in New Issue
Block a user