Less choppy peak bars

Update the sample rate to 144 to keep up with high refresh rate
monitors.
This commit is contained in:
warmos 2022-08-26 22:12:16 +02:00 committed by Arun Raghavan
parent 8c20afdaec
commit eba9ca6898
3 changed files with 4 additions and 2 deletions

View File

@ -666,7 +666,7 @@ pa_stream* MainWindow::createMonitorStreamForSource(uint32_t source_idx, uint32_
ss.channels = 1; ss.channels = 1;
ss.format = PA_SAMPLE_FLOAT32; ss.format = PA_SAMPLE_FLOAT32;
ss.rate = 25; ss.rate = PEAKS_RATE;
memset(&attr, 0, sizeof(attr)); memset(&attr, 0, sizeof(attr));
attr.fragsize = sizeof(float); attr.fragsize = sizeof(float);

View File

@ -61,7 +61,7 @@ void MinimalStreamWidget::init() {
peakProgressBar.hide(); peakProgressBar.hide();
} }
#define DECAY_STEP .04 #define DECAY_STEP (1.0 / PEAKS_RATE)
void MinimalStreamWidget::updatePeak(double v) { void MinimalStreamWidget::updatePeak(double v) {

View File

@ -23,6 +23,8 @@
#include "pavucontrol.h" #include "pavucontrol.h"
#define PEAKS_RATE 144
class MinimalStreamWidget : public Gtk::VBox { class MinimalStreamWidget : public Gtk::VBox {
public: public:
MinimalStreamWidget(BaseObjectType* cobject); MinimalStreamWidget(BaseObjectType* cobject);