[pulseaudio-commits] src/mainwindow.cc src/minimalstreamwidget.cc src/minimalstreamwidget.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 23 12:23:57 UTC 2023


 src/mainwindow.cc          |    2 +-
 src/minimalstreamwidget.cc |    2 +-
 src/minimalstreamwidget.h  |    2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit eba9ca6898c4883b88f80dbb83c5002fd19492b8
Author: warmos <warmos at warhome.eu>
Date:   Fri Aug 26 22:12:16 2022 +0200

    Less choppy peak bars
    
    Update the sample rate to 144 to keep up with high refresh rate
    monitors.

diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index eb32994..4199a37 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -666,7 +666,7 @@ pa_stream* MainWindow::createMonitorStreamForSource(uint32_t source_idx, uint32_
 
     ss.channels = 1;
     ss.format = PA_SAMPLE_FLOAT32;
-    ss.rate = 25;
+    ss.rate = PEAKS_RATE;
 
     memset(&attr, 0, sizeof(attr));
     attr.fragsize = sizeof(float);
diff --git a/src/minimalstreamwidget.cc b/src/minimalstreamwidget.cc
index b6c60e8..09b34b8 100644
--- a/src/minimalstreamwidget.cc
+++ b/src/minimalstreamwidget.cc
@@ -61,7 +61,7 @@ void MinimalStreamWidget::init() {
     peakProgressBar.hide();
 }
 
-#define DECAY_STEP .04
+#define DECAY_STEP (1.0 / PEAKS_RATE)
 
 void MinimalStreamWidget::updatePeak(double v) {
 
diff --git a/src/minimalstreamwidget.h b/src/minimalstreamwidget.h
index fbf6a99..24f2f6a 100644
--- a/src/minimalstreamwidget.h
+++ b/src/minimalstreamwidget.h
@@ -23,6 +23,8 @@
 
 #include "pavucontrol.h"
 
+#define PEAKS_RATE 144
+
 class MinimalStreamWidget : public Gtk::VBox {
 public:
     MinimalStreamWidget(BaseObjectType* cobject);



More information about the pulseaudio-commits mailing list