diff options
author | warmos <warmos@warhome.eu> | 2022-08-26 22:12:16 +0200 |
---|---|---|
committer | Arun Raghavan <arun@asymptotic.io> | 2023-06-23 08:21:08 -0400 |
commit | eba9ca6898c4883b88f80dbb83c5002fd19492b8 (patch) | |
tree | 69004156b4d1c03e250c6cb9bf6f7ea113bb6754 /src | |
parent | 8c20afdaecb14e806ca5841105aadc139164d8bc (diff) |
Less choppy peak bars
Update the sample rate to 144 to keep up with high refresh rate
monitors.
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow.cc | 2 | ||||
-rw-r--r-- | src/minimalstreamwidget.cc | 2 | ||||
-rw-r--r-- | src/minimalstreamwidget.h | 2 |
3 files changed, 4 insertions, 2 deletions
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); |