10 #include "vu_common.h"
16 class LRAMeter : public QWidget
21 LRAMeter(QWidget *parent);
23 void set_levels(float level_lufs, float range_low_lufs, float range_high_lufs) {
24 std::lock_guard<std::mutex> lock(level_mutex);
25 this->level_lufs = level_lufs;
26 this->range_low_lufs = range_low_lufs;
27 this->range_high_lufs = range_high_lufs;
28 QMetaObject::invokeMethod(this, "update", Qt::AutoConnection);
31 double lufs_to_pos(float level_lu, int height)
33 return ::lufs_to_pos(level_lu, height, min_level, max_level);
36 void set_min_level(float min_level)
38 this->min_level = min_level;
39 recalculate_pixmaps();
42 void set_max_level(float max_level)
44 this->max_level = max_level;
45 recalculate_pixmaps();
48 void set_ref_level(float ref_level_lufs)
50 this->ref_level_lufs = ref_level_lufs;
54 void resizeEvent(QResizeEvent *event) override;
55 void paintEvent(QPaintEvent *event) override;
56 void recalculate_pixmaps();
58 std::mutex level_mutex;
59 float level_lufs = -HUGE_VAL;
60 float range_low_lufs = -HUGE_VAL;
61 float range_high_lufs = -HUGE_VAL;
62 float min_level = -18.0f, max_level = 9.0f, ref_level_lufs = -23.0f;
64 QPixmap on_pixmap, off_pixmap;