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 Track;
23class EffectUIHost;
24class EffectInstance;
25
26class AudacityProject;
27
30 : public wxEvtHandler // Must be the first base class!
31 , public ClientData::Base
32{
33public:
35 ~RealtimeEffectStateUI() override;
36
37 [[nodiscard]] bool IsShown() const noexcept;
38
40 // Pass non-null to cause autosave
41 void Hide(AudacityProject* project = nullptr);
43
44 void UpdateTrackData(const Track& track);
45
47 static const RealtimeEffectStateUI &Get(const RealtimeEffectState &state);
48
49 // Cause immediate or delayed autosave at a time when transport is stopped
51
52private:
53 void UpdateTitle();
54
56
57 wxWeakRef<EffectUIHost> mEffectUIHost;
58
60 wxString mTrackName;
62
65
66 void OnClose(wxCloseEvent & evt);
67 DECLARE_EVENT_TABLE()
68}; // class RealtimeEffectStateUI
Utility ClientData::Site to register hooks into a host class that attach client data.
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 Show(AudacityProject &project)
void Toggle(AudacityProject &project)
wxWeakRef< EffectUIHost > mEffectUIHost
AudacityProject * mpProject
static RealtimeEffectStateUI & Get(RealtimeEffectState &state)
void UpdateTrackData(const Track &track)
void Hide(AudacityProject *project=nullptr)
void AutoSave(AudacityProject &project)
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:122
Holds a msgid for the translation catalog; may also bind format arguments.
A convenient default parameter for class template Site.
Definition: ClientData.h:28