Audacity 3.2.0
DynamicRangeProcessorHistoryPanel.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 DynamicRangeProcessorHistoryPanel.h
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
11#pragma once
12
15#include "Observer.h"
16#include "wxPanelWrapper.h"
17#include <chrono>
18#include <functional>
19#include <optional>
20#include <wx/geometry.h>
21#include <wx/timer.h>
22
24class wxPaintEvent;
25class wxEraseEvent;
26
28{
29public:
30 static constexpr auto minWidth = 600;
31
33 wxWindow* parent, wxWindowID winid, CompressorInstance& instance,
34 std::function<void(float)> onDbRangeChanged);
35
37 {
38 const float firstPacketTime;
39 const std::chrono::steady_clock::time_point start;
40 std::chrono::steady_clock::time_point now;
41 };
42
43 // For now no-opt functions, but there are plans to add visibility toggles.
44 void ShowInput(bool show);
45 void ShowOutput(bool show);
46 void ShowActual(bool show);
47 void ShowTarget(bool show);
48
50
51private:
52 void OnPaint(wxPaintEvent& evt);
53 void OnSize(wxSizeEvent& evt);
54 void OnTimer(wxTimerEvent& evt);
56
57 bool AcceptsFocus() const override;
58 // So that wxPanel is not included in Tab traversal - see wxWidgets bug 15581
59 bool AcceptsFocusFromKeyboard() const override;
60
62 std::shared_ptr<DynamicRangeProcessorOutputPacketQueue> mOutputQueue;
63 std::vector<DynamicRangeProcessorOutputPacket> mPacketBuffer;
64 std::optional<DynamicRangeProcessorHistory> mHistory;
66 const std::function<void(float)> mOnDbRangeChanged;
70 wxTimer mTimer;
71 std::optional<ClockSynchronization> mSync;
72 std::vector<double> mX;
73 std::vector<wxPoint2DDouble> mTarget; // Compression
74 std::vector<wxPoint2DDouble> mActual; // Compression
75 std::vector<wxPoint2DDouble> mInput;
76 std::vector<wxPoint2DDouble> mOutput;
78 bool mShowInput = true;
79 bool mShowOutput = true;
80 bool mShowActual = true;
81 bool mShowTarget = true;
82};
A clock that can be paused and resumed.
const Observer::Subscription mPlaybackEventSubscription
std::optional< DynamicRangeProcessorHistory > mHistory
std::optional< ClockSynchronization > mSync
const Observer::Subscription mInitializeProcessingSettingsSubscription
DynamicRangeProcessorHistoryPanel(wxWindow *parent, wxWindowID winid, CompressorInstance &instance, std::function< void(float)> onDbRangeChanged)
const Observer::Subscription mRealtimeResumeSubscription
void InitializeForPlayback(CompressorInstance &instance, double sampleRate)
std::shared_ptr< DynamicRangeProcessorOutputPacketQueue > mOutputQueue
std::vector< DynamicRangeProcessorOutputPacket > mPacketBuffer
const std::function< void(float)> mOnDbRangeChanged
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70