Audacity 3.2.0
RealtimeEffectStateUI.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 RealtimeEffectStateUI.h
7
8 Dmitry Vedenko
9
10**********************************************************************/
11#pragma once
12
13// wx/weakref.h misses this include
14#include <type_traits>
15#include <wx/weakref.h>
16#include <wx/event.h>
17
18#include "ClientData.h"
19#include "Observer.h"
20
22class EffectUIHost;
23class EffectInstance;
24
25class AudacityProject;
26
29 : public wxEvtHandler // Must be the first base class!
30 , public ClientData::Base
31{
32public:
34 ~RealtimeEffectStateUI() override;
35
36 [[nodiscard]] bool IsShown() const noexcept;
37
39 // Pass non-null to cause autosave
40 void Hide(AudacityProject* project = nullptr);
42
45 void SetTargetName(const wxString& name);
46
48 static const RealtimeEffectStateUI &Get(const RealtimeEffectState &state);
49
50 // Cause immediate or delayed autosave at a time when transport is stopped
52
53private:
54 void UpdateTitle();
55
57
58 wxWeakRef<EffectUIHost> mEffectUIHost;
59
61 wxString mTargetName;
63
66
67 void OnClose(wxCloseEvent & evt);
68 DECLARE_EVENT_TABLE()
69}; // class RealtimeEffectStateUI
Utility ClientData::Site to register hooks into a host class that attach client data.
const TranslatableString name
Definition: Distortion.cpp:76
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
Performs effect computation.
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
UI state for realtime effect.
Observer::Subscription mParameterChangedSubscription
TranslatableString mEffectName
bool IsShown() const noexcept
Observer::Subscription mProjectWindowDestroyedSubscription
void OnClose(wxCloseEvent &evt)
RealtimeEffectStateUI(RealtimeEffectState &state)
RealtimeEffectState & mRealtimeEffectState
void SetTargetName(const wxString &name)
void Show(AudacityProject &project)
void Toggle(AudacityProject &project)
wxWeakRef< EffectUIHost > mEffectUIHost
AudacityProject * mpProject
static RealtimeEffectStateUI & Get(RealtimeEffectState &state)
void Hide(AudacityProject *project=nullptr)
void AutoSave(AudacityProject &project)
Holds a msgid for the translation catalog; may also bind format arguments.
A convenient default parameter for class template Site.
Definition: ClientData.h:29