Audacity 3.2.0
LV2EffectMeter.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file LV2EffectMeter.h
6 @brief widget to paint a varying bar in plain LV2 UI
7
8 Paul Licameli split from LV2Effect.cpp
9
10 Audacity(R) is copyright (c) 1999-2013 Audacity Team.
11 License: GPL v2 or later. See License.txt.
12
13*********************************************************************/
14
15#ifndef __AUDACITY_LV2_EFFECT_METER__
16#define __AUDACITY_LV2_EFFECT_METER__
17
18#include <wx/window.h>
19#include "LV2Ports.h"
20
22class LV2EffectMeter final : public wxWindow
23{
24public:
25 LV2EffectMeter(wxWindow *parent,
26 const LV2ControlPortPtr ctrl, const float &value);
27 virtual ~LV2EffectMeter();
29 {
30 // Stop using mValue, it may be dangling
31 mConnected = false;
32 }
33
34private:
35 void OnErase(wxEraseEvent &evt);
36 void OnPaint(wxPaintEvent &evt);
37 void OnIdle(wxIdleEvent &evt);
38 void OnSize(wxSizeEvent &evt);
39
40private:
41 bool mConnected{ true };
43 const float &mValue;
45
46 DECLARE_EVENT_TABLE()
47};
48
49#endif
std::shared_ptr< LV2ControlPort > LV2ControlPortPtr
Definition: LV2Ports.h:202
UI widget that watches a floating point location and then updates a bar.
void OnErase(wxEraseEvent &evt)
LV2EffectMeter(wxWindow *parent, const LV2ControlPortPtr ctrl, const float &value)
const float & mValue
const LV2ControlPortPtr mControlPort
void OnPaint(wxPaintEvent &evt)
void OnSize(wxSizeEvent &evt)
void OnIdle(wxIdleEvent &evt)
virtual ~LV2EffectMeter()