Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shade: Audio Latency meter fix #11601

Merged
merged 4 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions res/skins/Shade/mixer_panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,13 @@

<WidgetGroup>
<Pos>113,28</Pos>
<Size>26,1</Size>
<Size>26,2</Size>
<Layout>horizontal</Layout>
<Children>
<VuMeter>
<TooltipId>audio_latency_usage</TooltipId>
<PathVu>skin:/audio_latency/audio_latency_usage.png</PathVu>
<PathBack>skin:/audio_latency/audio_latency_overload_back.png</PathBack>
<PathBack>skin:/audio_latency/audio_latency_usage_back.png</PathBack>
<PeakHoldSize>5</PeakHoldSize>
<PeakHoldTime>1000</PeakHoldTime>
<PeakFallTime>100</PeakFallTime>
Expand Down
2 changes: 1 addition & 1 deletion src/util/texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ QOpenGLTexture* createTexture(const QImage& image) {
QOpenGLTexture* pTexture = new QOpenGLTexture(image);
pTexture->setMinificationFilter(QOpenGLTexture::Linear);
pTexture->setMagnificationFilter(QOpenGLTexture::Linear);
pTexture->setWrapMode(QOpenGLTexture::ClampToBorder);
pTexture->setWrapMode(QOpenGLTexture::ClampToEdge);

return pTexture;
}
Expand Down
7 changes: 7 additions & 0 deletions src/widget/wvumeterbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ void WVuMeterBase::setup(const QDomNode& node, const SkinContext& context) {
m_iPeakFallTime = DEFAULT_FALLTIME;
}

if (height() < 2 || width() < 2) {
// This triggers a QT bug and displays a white widget instead.
// We warn here, because the skin designer may not use the affected mode.
SKIN_WARNING(node, context)
<< "VuMeterBase needs to have 2 pixel in all extents to be visible on all targets.";
}

setFocusPolicy(Qt::NoFocus);
}

Expand Down
4 changes: 2 additions & 2 deletions src/widget/wvumeterglsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void WVuMeterGLSL::paintGL() {
const double pixmapHeight = m_pTextureVu->height();
if (m_bHorizontal) {
const double widgetPosition = math_clamp(widgetWidth * m_dParameter, 0.0, widgetWidth);
QRectF targetRect(0, 0, widgetPosition, widgetHeight);
QRectF targetRect(0, 0, widgetPosition, math_min(pixmapHeight, widgetHeight));

const double pixmapPosition = math_clamp(
pixmapWidth * m_dParameter, 0.0, pixmapWidth);
Expand All @@ -89,7 +89,7 @@ void WVuMeterGLSL::paintGL() {
QRectF targetRect(widgetPeakPosition - widgetPeakHoldSize,
0,
widgetPeakHoldSize,
widgetHeight);
math_min(pixmapHeight, widgetHeight));

const double pixmapPeakPosition = math_clamp(
pixmapWidth * m_dPeakParameter, 0.0, pixmapWidth);
Expand Down
Loading