-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevelmeter.h
More file actions
26 lines (21 loc) · 748 Bytes
/
Copy pathlevelmeter.h
File metadata and controls
26 lines (21 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include <QProgressBar>
QT_BEGIN_NAMESPACE
class QPropertyAnimation;
QT_END_NAMESPACE
// Small horizontal microphone-level meter for the toolbar. It subclasses
// QProgressBar so it inherits the app-wide orange progress-bar style (the look
// reused from the old dwell countdown — see BASE_STYLE in mainwindow.cpp) and
// animates smoothly toward each new input level so the bar glides instead of
// flickering with every audio buffer.
class LevelMeter : public QProgressBar
{
Q_OBJECT
public:
explicit LevelMeter(QWidget* parent = nullptr);
public slots:
// Normalised 0..1 amplitude (e.g. RMS) from AudioCapture::levelChanged.
void setLevel(qreal level);
private:
QPropertyAnimation* m_anim = nullptr;
};