Audacity 3.2.0
CompressionMeterPanel.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 CompressionMeterPanel.h
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
11#pragma once
12
15#include "LockFreeQueue.h"
16#include "MeterValueProvider.h"
17#include "Observer.h"
18#include "wxPanelWrapper.h"
19#include <functional>
20#include <wx/timer.h>
21
23class wxPaintDC;
24
26{
27public:
29 wxWindow* parent, int id, CompressorInstance& instance, float dbRange,
30 std::function<void()> onClipped);
31
32 void SetDbRange(float dbRange);
33 void Reset();
34 void ResetClipped();
35
36protected:
38
39private:
40 void PaintMeter(
41 wxPaintDC& dc, const wxColor& color, const wxRect& rect,
42 const MeterValueProvider& provider);
43
44 void OnPaint(wxPaintEvent& evt);
45 void OnTimer(wxTimerEvent& evt);
46
47 bool AcceptsFocus() const override;
48 // So that wxPanel is not included in Tab traversal - see wxWidgets bug 15581
49 bool AcceptsFocusFromKeyboard() const override;
50
51 const std::shared_ptr<DynamicRangeProcessorMeterValuesQueue>
55 const std::function<void()> mOnClipped;
56 std::unique_ptr<MeterValueProvider> mCompressionMeter;
57 std::unique_ptr<MeterValueProvider> mOutputMeter;
59
60 wxTimer mTimer;
61 bool mStopWhenZero = false;
62 bool mClipped = false;
63};
CompressionMeterPanel(wxWindow *parent, int id, CompressorInstance &instance, float dbRange, std::function< void()> onClipped)
bool AcceptsFocus() const override
const std::function< void()> mOnClipped
void SetDbRange(float dbRange)
std::unique_ptr< MeterValueProvider > mCompressionMeter
void OnTimer(wxTimerEvent &evt)
void PaintMeter(wxPaintDC &dc, const wxColor &color, const wxRect &rect, const MeterValueProvider &provider)
void OnPaint(wxPaintEvent &evt)
std::unique_ptr< MeterValueProvider > mOutputMeter
const Observer::Subscription mPlaybackStartStopSubscription
bool AcceptsFocusFromKeyboard() const override
const Observer::Subscription mPlaybackPausedSubscription
const std::shared_ptr< DynamicRangeProcessorMeterValuesQueue > mMeterValuesQueue
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70