From 8fd8fa390ef0b56746571c178af8acc60656f328 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sat, 14 May 2022 01:11:00 +0100 Subject: [PATCH] Fix mod meters in PA/RT --- audiohandler.h | 2 +- pahandler.cpp | 2 +- pahandler.h | 2 +- rthandler.cpp | 2 +- rthandler.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/audiohandler.h b/audiohandler.h index 1f56b2b..9c503ec 100644 --- a/audiohandler.h +++ b/audiohandler.h @@ -113,7 +113,7 @@ private: volatile bool ready = false; audioPacket tempBuf; quint16 currentLatency; - float amplitude; + float amplitude=0.0; qreal volume = 1.0; audioSetup setup; diff --git a/pahandler.cpp b/pahandler.cpp index 646142f..e0de0eb 100644 --- a/pahandler.cpp +++ b/pahandler.cpp @@ -313,5 +313,5 @@ int paHandler::getLatency() quint16 paHandler::getAmplitude() { - return amplitude; + return static_cast(amplitude * 255.0); } diff --git a/pahandler.h b/pahandler.h index f55a79f..cd55e95 100644 --- a/pahandler.h +++ b/pahandler.h @@ -80,7 +80,7 @@ private: quint32 lastSentSeq = 0; quint16 currentLatency; - quint16 amplitude = 0; + float amplitude=0.0; qreal volume = 1.0; audioSetup setup; diff --git a/rthandler.cpp b/rthandler.cpp index c6afb31..ea00958 100644 --- a/rthandler.cpp +++ b/rthandler.cpp @@ -334,5 +334,5 @@ int rtHandler::getLatency() quint16 rtHandler::getAmplitude() { - return amplitude; + return static_cast(amplitude * 255.0); } diff --git a/rthandler.h b/rthandler.h index e3461cc..5f34997 100644 --- a/rthandler.h +++ b/rthandler.h @@ -96,7 +96,7 @@ private: quint32 lastSentSeq = 0; quint16 currentLatency; - quint16 amplitude = 0; + float amplitude = 0.0; qreal volume = 1.0; audioSetup setup;