Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
EffectUIHost Class Referencefinal

#include <EffectUI.h>

Inheritance diagram for EffectUIHost:
[legend]
Collaboration diagram for EffectUIHost:
[legend]

Public Member Functions

 EffectUIHost (wxWindow *parent, AudacityProject &project, EffectBase &effect, EffectUIServices &client, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, const std::shared_ptr< RealtimeEffectState > &pPriorState={})
 
virtual ~EffectUIHost ()
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
int ShowModal () override
 
bool Initialize ()
 
EffectEditorGetEditor () const
 
bool HandleCommandKeystrokes () override
 
void SetClosed ()
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 
- Public Member Functions inherited from TopLevelKeystrokeHandlingWindow
virtual ~TopLevelKeystrokeHandlingWindow ()
 
virtual bool HandleCommandKeystrokes ()
 

Private Member Functions

std::shared_ptr< EffectInstanceInitializeInstance ()
 
void BuildTopBar (ShuttleGui &S)
 
void OnInitDialog (wxInitDialogEvent &evt)
 
void OnErase (wxEraseEvent &evt)
 
void OnPaint (wxPaintEvent &evt)
 
void OnClose (wxCloseEvent &evt)
 
void OnApply (wxCommandEvent &evt)
 
void DoCancel ()
 
void OnCancel (wxCommandEvent &evt)
 
void OnDebug (wxCommandEvent &evt)
 
void OnMenu (wxCommandEvent &evt)
 
void OnEnable (wxCommandEvent &evt)
 
void OnPlay (wxCommandEvent &evt)
 
void OnPlayback (AudioIOEvent)
 
void OnCapture (AudioIOEvent)
 
void OnUserPreset (wxCommandEvent &evt)
 
void OnFactoryPreset (wxCommandEvent &evt)
 
void OnDeletePreset (wxCommandEvent &evt)
 
void OnSaveAs (wxCommandEvent &evt)
 
void OnImport (wxCommandEvent &evt)
 
void OnExport (wxCommandEvent &evt)
 
void OnOptions (wxCommandEvent &evt)
 
void OnDefaults (wxCommandEvent &evt)
 
void OnIdle (wxIdleEvent &evt)
 
void OnCharHook (wxKeyEvent &evt)
 
bool IsOpenedFromEffectPanel () const
 
void UpdateControls ()
 
wxBitmap CreateBitmap (const char *const xpm[], bool up, bool pusher)
 
void LoadUserPresets ()
 
void CleanupRealtime ()
 

Private Attributes

Observer::Subscription mAudioIOSubscription
 
Observer::Subscription mEffectStateSubscription
 
AudacityProjectmProject
 
wxWindow *const mParent
 
EffectBasemEffectUIHost
 
EffectUIServicesmClient
 
const EffectPlugin::EffectSettingsAccessPtr mpGivenAccess
 
EffectPlugin::EffectSettingsAccessPtr mpAccess
 
EffectPlugin::EffectSettingsAccessPtr mpAccess2
 
std::weak_ptr< RealtimeEffectStatemwState {}
 
std::shared_ptr< RealtimeEffectStatempTempProjectState {}
 
RegistryPaths mUserPresets
 
bool mInitialized { false }
 
const bool mSupportsRealtime
 
bool mIsGUI {}
 
bool mIsBatch {}
 
wxButton * mApplyBtn {}
 
wxButton * mMenuBtn {}
 
AButtonmEnableBtn {}
 
wxButton * mDebugBtn {}
 
bool mEnabled { true }
 
bool mCapturing {}
 
SelectedRegion mRegion
 
double mPlayPos { 0.0 }
 
bool mDismissed {}
 
const bool mHadPriorState
 
const std::shared_ptr< EffectInstancempInstance
 
const EffectOutputs *const mpOutputs
 
std::unique_ptr< EffectEditormpEditor
 

Detailed Description

Definition at line 43 of file EffectUI.h.

Constructor & Destructor Documentation

◆ EffectUIHost()

EffectUIHost::EffectUIHost ( wxWindow *  parent,
AudacityProject project,
EffectBase effect,
EffectUIServices client,
std::shared_ptr< EffectInstance > &  pInstance,
EffectSettingsAccess access,
const std::shared_ptr< RealtimeEffectState > &  pPriorState = {} 
)

Definition at line 228 of file EffectUI.cpp.

233: wxDialogWrapper(parent, wxID_ANY, effect.GetDefinition().GetName(),
234 wxDefaultPosition, wxDefaultSize,
235 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
236, mEffectUIHost{ effect }
237, mClient{ client }
238// Grab a pointer to the access object,
239// extending its lifetime while this remains:
240, mpGivenAccess{ access.shared_from_this() }
242, mwState{ pPriorState }
243, mProject{ project }
244, mParent{ parent }
246, mHadPriorState{ (pPriorState != nullptr) }
248, mpOutputs{ pPriorState ? pPriorState->GetOutputs() : nullptr }
249{
250 // Assign the out parameter
251 pInstance = mpInstance;
252#if defined(__WXMAC__)
253 MacMakeWindowFloating(GetHandle());
254#endif
255
256 SetName( effect.GetDefinition().GetName() );
257
258 // This style causes Validate() and TransferDataFromWindow() to visit
259 // sub-windows recursively, applying any wxValidators
260 SetExtraStyle(GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
261}
void MacMakeWindowFloating(NSView *handle)
const auto project
TranslatableString GetName() const
virtual const EffectSettingsManager & GetDefinition() const =0
const EffectPlugin::EffectSettingsAccessPtr mpGivenAccess
Definition: EffectUI.h:121
AudacityProject & mProject
Definition: EffectUI.h:116
EffectBase & mEffectUIHost
Definition: EffectUI.h:118
EffectPlugin::EffectSettingsAccessPtr mpAccess
Definition: EffectUI.h:122
const EffectOutputs *const mpOutputs
Definition: EffectUI.h:155
EffectUIServices & mClient
Definition: EffectUI.h:119
const bool mHadPriorState
Definition: EffectUI.h:147
std::shared_ptr< EffectInstance > InitializeInstance()
Definition: EffectUI.cpp:1038
const bool mSupportsRealtime
Definition: EffectUI.h:130
const std::shared_ptr< EffectInstance > mpInstance
Definition: EffectUI.h:154
std::weak_ptr< RealtimeEffectState > mwState
Definition: EffectUI.h:124
wxWindow *const mParent
Definition: EffectUI.h:117

References EffectPlugin::GetDefinition(), ComponentInterface::GetName(), MacMakeWindowFloating(), mpInstance, and wxDialogWrapper::SetName().

Here is the call graph for this function:

◆ ~EffectUIHost()

EffectUIHost::~EffectUIHost ( )
virtual

Definition at line 263 of file EffectUI.cpp.

264{
265 if (mpEditor)
266 mpEditor->Disconnect();
267 DestroyChildren();
268 wxASSERT(mClosed);
269}
std::unique_ptr< EffectEditor > mpEditor
Definition: EffectUI.h:157

References mpEditor.

Member Function Documentation

◆ BuildTopBar()

void EffectUIHost::BuildTopBar ( ShuttleGui S)
private

Definition at line 356 of file EffectUI.cpp.

357{
358 S.StartPanel();
359 {
360 S.SetBorder( InnerMargin );
361
362 S.StartHorizontalLay(wxEXPAND, 0);
363 {
365 {
366 mEnableBtn = MakeBitmapToggleButton(S.GetParent(),
367 theTheme.Image(bmpEffectOn), theTheme.Image(bmpEffectOff));
368 mEnableBtn->SetBackgroundColour(GetBackgroundColour());
369 S
370 .Position(wxALIGN_CENTER | wxTOP | wxBOTTOM)
371 .Name(XO("Power"))
372 .AddWindow(mEnableBtn);
373 }
374
375 mMenuBtn = S.Id( kMenuID )
376 .ToolTip(XO("Manage presets and options"))
377 .AddButton( XO("Presets && settings"), wxALIGN_CENTER | wxTOP | wxBOTTOM );
378
379 S.AddSpace(1, 0, 1);
380
381
382
384 {
385 mDebugBtn = S.Id(eDebugID)
386 .AddButton( XXO("Debu&g"),
387 wxALIGN_CENTER | wxTOP | wxBOTTOM );
388 }
389 }
390 S.EndHorizontalLay();
391 }
392 S.EndPanel();
393}
static const int kMenuID
Definition: EffectUI.cpp:130
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
@ eDebugID
Definition: ShuttleGui.h:628
THEME_API Theme theTheme
Definition: Theme.cpp:82
#define S(N)
Definition: ToChars.cpp:64
virtual bool EnablesDebug() const
Whether the effect dialog should have a Debug button; default, always false.
wxButton * mMenuBtn
Definition: EffectUI.h:135
AButton * mEnableBtn
Definition: EffectUI.h:136
wxButton * mDebugBtn
Definition: EffectUI.h:137
bool IsOpenedFromEffectPanel() const
Definition: EffectUI.cpp:972
wxImage & Image(int iIndex)
AButton * MakeBitmapToggleButton(wxWindow *parent, const wxImage &ImageOn, const wxImage &ImageOff)
Definition: EffectUI.cpp:345

References eDebugID, EffectDefinitionInterface::EnablesDebug(), EffectPlugin::GetDefinition(), ThemeBase::Image(), anonymous_namespace{EffectUI.cpp}::InnerMargin, IsOpenedFromEffectPanel(), kMenuID, anonymous_namespace{EffectUI.cpp}::MakeBitmapToggleButton(), mDebugBtn, mEffectUIHost, mEnableBtn, mMenuBtn, S, theTheme, XO(), and XXO().

Referenced by Initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CleanupRealtime()

void EffectUIHost::CleanupRealtime ( )
private

Definition at line 1091 of file EffectUI.cpp.

1092{
1094
1096 if (!IsOpenedFromEffectPanel()) {
1099 mpTempProjectState.reset();
1100 /*
1101 ProjectHistory::Get(mProject).PushState(
1102 XO("Removed %s effect").Format(mpState->GetEffect()->GetName()),
1103 XO("Removed Effect"),
1104 UndoPush::NONE
1105 );
1106 */
1107 }
1108 mInitialized = false;
1109 }
1110}
static AudioIO * Get()
Definition: AudioIO.cpp:126
void RemoveState(AudacityProject &project, ChannelGroup *pGroup, std::shared_ptr< RealtimeEffectState > pState)
Forwards to RealtimeEffectManager::RemoveState with proper init scope.
Definition: AudioIO.cpp:369
Observer::Subscription mAudioIOSubscription
Definition: EffectUI.h:114
std::shared_ptr< RealtimeEffectState > mpTempProjectState
Definition: EffectUI.h:126
Observer::Subscription mEffectStateSubscription
Definition: EffectUI.h:114
bool mInitialized
Definition: EffectUI.h:129
void Reset() noexcept
Breaks the connection (constant time)
Definition: Observer.cpp:101

References AudioIO::Get(), IsOpenedFromEffectPanel(), mAudioIOSubscription, mEffectStateSubscription, mInitialized, mProject, mpTempProjectState, mSupportsRealtime, AudioIO::RemoveState(), and Observer::Subscription::Reset().

Referenced by OnClose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateBitmap()

wxBitmap EffectUIHost::CreateBitmap ( const char *const  xpm[],
bool  up,
bool  pusher 
)
private

Definition at line 977 of file EffectUI.cpp.

978{
979 wxMemoryDC dc;
980 wxBitmap pic(xpm);
981
982 wxBitmap mod(pic.GetWidth() + 6, pic.GetHeight() + 6, 24);
983 dc.SelectObject(mod);
984
985#if defined(__WXGTK__)
986 wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND);
987#else
988 wxColour newColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
989#endif
990
991 dc.SetBackground(wxBrush(newColour));
992 dc.Clear();
993
994 int offset = 3;
995 if (pusher)
996 {
997 if (!up)
998 {
999 offset += 1;
1000 }
1001 }
1002
1003 dc.DrawBitmap(pic, offset, offset, true);
1004
1005 dc.SelectObject(wxNullBitmap);
1006
1007 return mod;
1008}

◆ DoCancel()

void EffectUIHost::DoCancel ( )
private

Definition at line 607 of file EffectUI.cpp.

608{
609 if (!mDismissed) {
610 if (!mHadPriorState) {
611 // For the destructive effect dialog only
612 // Restore effect state from last updated preferences
613 mpAccess->ModifySettings([&](EffectSettings &settings) {
614 // ignore failure
615 return mEffectUIHost.GetDefinition().LoadUserPreset(
616 CurrentSettingsGroup(), settings).value_or(nullptr);
617 });
618 }
619 if (IsModal())
620 EndModal(0);
621 else
622 Hide();
623
624 mDismissed = true;
625 }
626}
const RegistryPath & CurrentSettingsGroup()
Component of a configuration key path, for last-used destructive settings.
static Settings & settings()
Definition: TrackInfo.cpp:51
bool mDismissed
Definition: EffectUI.h:146
Externalized state of a plug-in.

References CurrentSettingsGroup(), EffectPlugin::GetDefinition(), mDismissed, mEffectUIHost, mHadPriorState, mpAccess, and settings().

Referenced by OnCancel(), and OnClose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetEditor()

EffectEditor * EffectUIHost::GetEditor ( ) const
inline

Definition at line 66 of file EffectUI.h.

66{ return mpEditor.get(); }

References mpEditor.

◆ HandleCommandKeystrokes()

bool EffectUIHost::HandleCommandKeystrokes ( )
overridevirtual

By default returns true, meaning that keystrokes should be handled by associated CommandManager.

Reimplemented from TopLevelKeystrokeHandlingWindow.

Definition at line 488 of file EffectUI.cpp.

489{
490 return !IsModal();
491}

◆ Initialize()

bool EffectUIHost::Initialize ( )

Definition at line 395 of file EffectUI.cpp.

396{
397 mEnabled = mpAccess->Get().extra.GetActive();
398
399 // Build a "host" dialog, framing a panel that the client fills in.
400 // The frame includes buttons to preview, apply, load and save presets, etc.
401 EffectPanel *w {};
402 ShuttleGui S{ this, eIsCreating };
403 {
404 BuildTopBar(S);
405
406 // Make the panel for the client
407 Destroy_ptr<EffectPanel> uw{ safenew EffectPanel( S.GetParent() ) };
408 RTL_WORKAROUND(uw.get());
409
410 // Try to give the window a sensible default/minimum size
411 uw->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
412 mParent->GetSize().GetHeight() / 2));
413
414 // Let the client add things to the panel
415 ShuttleGui S1{ uw.get(), eIsCreating };
418 if (!mpEditor)
419 return false;
420
421 mIsGUI = mpEditor->IsGraphicalUI();
423
424 S.StartHorizontalLay( wxEXPAND );
425 {
426 S.Prop( 1 )
427 .Position(wxEXPAND)
428 .AddWindow((w = uw.release()));
429 }
430 S.EndHorizontalLay();
431
433 {
434 S.StartPanel();
435 {
436 S.SetBorder( InnerMargin );
437 S.StartHorizontalLay(wxEXPAND, 0);
438 {
439 if (!mIsBatch)
440 {
443 {
444 S.Id(kPlayID)
445 .ToolTip(XO("Preview effect"))
446 .AddButton( XXO("&Preview"),
447 wxALIGN_CENTER | wxTOP | wxBOTTOM );
448 }
449 }
450
451 S.AddSpace(1, 1, 1);
452 S.Id(wxID_CANCEL)
453 .AddButton(XXO("&Cancel"));
454
455 mApplyBtn = S.Id(wxID_APPLY)
456 .AddButton( XXO("&Apply"));
457 mApplyBtn->SetDefault();
458 }
459 S.EndHorizontalLay();
460 }
461 S.EndPanel();
462 }
463 }
464
465 Layout();
466 Fit();
467 Center();
468
470
471 w->SetAccept(!mIsGUI);
472
473 if (!mIsGUI)
474 {
475 w->SetFocus();
476 }
477 else if (!IsOpenedFromEffectPanel())
478 {
479 mApplyBtn->SetFocus();
480 }
481
483
484 SetMinSize(GetSize());
485 return true;
486}
@ EffectTypeAnalyze
@ EffectTypeTool
static const int kPlayID
Definition: EffectUI.cpp:132
#define RTL_WORKAROUND(pWnd)
Definition: GUISettings.h:20
#define safenew
Definition: MemoryX.h:10
std::unique_ptr< T, Destroyer< T > > Destroy_ptr
a convenience for using Destroyer
Definition: MemoryX.h:164
@ eIsCreating
Definition: ShuttleGui.h:37
virtual EffectType GetType() const =0
Type determines how it behaves.
virtual bool IsBatchProcessing() const =0
void UpdateControls()
Definition: EffectUI.cpp:1010
bool mIsBatch
Definition: EffectUI.h:132
bool mIsGUI
Definition: EffectUI.h:131
void BuildTopBar(ShuttleGui &S)
Definition: EffectUI.cpp:356
wxButton * mApplyBtn
Definition: EffectUI.h:134
void LoadUserPresets()
Definition: EffectUI.cpp:1026
bool mEnabled
Definition: EffectUI.h:139
virtual std::unique_ptr< EffectEditor > PopulateUI(const EffectPlugin &plugin, ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) const =0
Adds controls to a panel that is given as the parent window of S
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640

References BuildTopBar(), EffectTypeAnalyze, EffectTypeTool, eIsCreating, EffectPlugin::GetDefinition(), EffectDefinitionInterface::GetType(), anonymous_namespace{EffectUI.cpp}::InnerMargin, EffectPlugin::IsBatchProcessing(), IsOpenedFromEffectPanel(), kPlayID, LoadUserPresets(), mApplyBtn, mClient, mEffectUIHost, mEnabled, mIsBatch, mIsGUI, mpAccess, mParent, mpEditor, mpInstance, mpOutputs, EffectUIServices::PopulateUI(), RTL_WORKAROUND, S, safenew, UpdateControls(), XO(), and XXO().

Here is the call graph for this function:

◆ InitializeInstance()

std::shared_ptr< EffectInstance > EffectUIHost::InitializeInstance ( )
private

Definition at line 1038 of file EffectUI.cpp.

1039{
1040 // We are still constructing and the return initializes a const member
1041 std::shared_ptr<EffectInstance> result;
1042
1043 auto mpState = mwState.lock();
1044
1045 bool priorState = (mpState != nullptr);
1046 if (!priorState) {
1047 auto gAudioIO = AudioIO::Get();
1048 mCapturing = gAudioIO->IsStreamActive() && gAudioIO->GetNumCaptureChannels() > 0 && !gAudioIO->IsMonitoring();
1049 }
1050
1052 if (!priorState)
1053 mwState = mpState = mpTempProjectState =
1055 if (mpState) {
1056 // Find the right instance to connect to the dialog
1057 if (!result)
1058 result = mpState->GetInstance();
1059
1060 mpAccess2 = mpState->GetAccess();
1061 if (!(mpAccess2->IsSameAs(*mpAccess)))
1062 // Decorate the given access object
1063 mpAccess = std::make_shared<EffectSettingsAccessTee>(
1065
1066 mEffectStateSubscription = mpState->Subscribe([this](RealtimeEffectStateChange state) {
1069 });
1070 }
1071
1072 if (!priorState) {
1074 switch (event.type) {
1075 case AudioIOEvent::CAPTURE:
1076 OnCapture(event); break;
1077 default:
1078 break;
1079 }
1080 });
1081 }
1082
1083 mInitialized = true;
1084 }
1085 else
1086 result = EffectBase::FindInstance(mEffectUIHost).value_or(nullptr);
1087
1088 return result;
1089}
static PluginID GetID(EffectPlugin &effect)
Definition: EffectUI.cpp:38
RealtimeEffectStateChange
std::shared_ptr< RealtimeEffectState > AddState(AudacityProject &project, ChannelGroup *pGroup, const PluginID &id)
Forwards to RealtimeEffectManager::AddState with proper init scope.
Definition: AudioIO.cpp:347
static std::optional< InstancePointer > FindInstance(EffectPlugin &plugin)
Definition: EffectBase.cpp:239
bool mCapturing
Definition: EffectUI.h:141
EffectPlugin::EffectSettingsAccessPtr mpAccess2
Definition: EffectUI.h:123
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
Definition: Observer.h:199
enum AudioIOEvent::Type type

References AudioIO::AddState(), EffectOn, EffectBase::FindInstance(), AudioIO::Get(), GetID(), mAudioIOSubscription, mCapturing, mEffectStateSubscription, mEffectUIHost, mEnabled, mInitialized, mpAccess, mpAccess2, mProject, mpTempProjectState, mSupportsRealtime, mwState, Observer::Publisher< Message, NotifyAll >::Subscribe(), AudioIOEvent::type, and UpdateControls().

Here is the call graph for this function:

◆ IsOpenedFromEffectPanel()

bool EffectUIHost::IsOpenedFromEffectPanel ( ) const
private

Definition at line 972 of file EffectUI.cpp.

973{
974 return (mpTempProjectState == nullptr && mSupportsRealtime);
975}

References mpTempProjectState, and mSupportsRealtime.

Referenced by BuildTopBar(), CleanupRealtime(), Initialize(), OnCharHook(), and UpdateControls().

Here is the caller graph for this function:

◆ LoadUserPresets()

void EffectUIHost::LoadUserPresets ( )
private

Definition at line 1026 of file EffectUI.cpp.

1027{
1028 mUserPresets.clear();
1029
1032
1033 std::sort( mUserPresets.begin(), mUserPresets.end() );
1034
1035 return;
1036}
RegistryPath UserPresetsGroup(const RegistryPath &name)
Compute part of a registry path, given a name which may be empty.
RegistryPaths mUserPresets
Definition: EffectUI.h:128
bool GetConfigSubgroups(const EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group, RegistryPaths &subgroups)

References PluginSettings::GetConfigSubgroups(), EffectPlugin::GetDefinition(), mEffectUIHost, mUserPresets, PluginSettings::Private, and UserPresetsGroup().

Referenced by Initialize(), OnDeletePreset(), OnImport(), OnMenu(), and OnSaveAs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnApply()

void EffectUIHost::OnApply ( wxCommandEvent &  evt)
private

Definition at line 545 of file EffectUI.cpp.

546{
547 auto &project = mProject;
548
549 // On wxGTK (wx2.8.12), the default action is still executed even if
550 // the button is disabled. This appears to affect all wxDialogs, not
551 // just our Effects dialogs. So, this is a only temporary workaround
552 // for legacy effects that disable the OK button. Hopefully this has
553 // been corrected in wx3.
554 if (!mApplyBtn->IsEnabled())
555 {
556 return;
557 }
558
559 // Honor the "select all if none" preference...a little hackish, but whatcha gonna do...
560 if (!mIsBatch &&
564 {
565 auto flags = AlwaysEnabledFlag;
566 bool allowed =
569 flags,
571 if (!allowed)
572 return;
573 }
574
575 if (!TransferDataFromWindow() ||
576 // This is the main place where there is a side-effect on the config
577 // file to remember the last-used settings of an effect, just before
578 // applying the effect destructively.
581 return;
582
583 if (IsModal())
584 {
585 mDismissed = true;
586
587 EndModal(evt.GetId());
588
589 Close();
590
591 return;
592 }
593
594 // Progress dialog no longer yields, so this "shouldn't" be necessary (yet to be proven
595 // for sure), but it is a nice visual cue that something is going on.
596 mApplyBtn->Disable();
597 auto cleanup = finally( [&] { mApplyBtn->Enable(); } );
598
599 CommandContext context( project );
600 // This is absolute hackage...but easy and I can't think of another way just now.
601 //
602 // It should callback to the EffectManager to kick off the processing
605}
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
const ReservedCommandFlag & TimeSelectedFlag()
const ReservedCommandFlag & WaveTracksSelectedFlag()
@ EffectTypeGenerate
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
static CommandManager & Get(AudacityProject &project)
bool ReportIfActionNotAllowed(const TranslatableString &Name, CommandFlag &flags, CommandFlag flagsRqd)
virtual bool SaveUserPreset(const RegistryPath &name, const EffectSettings &settings) const =0
Save settings in the configuration file as a user-named preset.
bool TransferDataFromWindow() override
Definition: EffectUI.cpp:287
bool isPoint() const
Definition: ViewInfo.h:40
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:216
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
Definition: EffectUI.cpp:1149

References AlwaysEnabledFlag, CurrentSettingsGroup(), EffectUI::DoEffect(), EffectTypeGenerate, EffectTypeTool, CommandManager::Get(), ViewInfo::Get(), EffectPlugin::GetDefinition(), GetID(), ComponentInterface::GetName(), EffectDefinitionInterface::GetType(), NotifyingSelectedRegion::isPoint(), EffectManager::kConfigured, mApplyBtn, mDismissed, mEffectUIHost, mIsBatch, mpAccess, mProject, project, CommandManager::ReportIfActionNotAllowed(), EffectSettingsManager::SaveUserPreset(), ViewInfo::selectedRegion, TimeSelectedFlag(), TransferDataFromWindow(), and WaveTracksSelectedFlag().

Referenced by OnDebug().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnCancel()

void EffectUIHost::OnCancel ( wxCommandEvent &  evt)
private

Definition at line 628 of file EffectUI.cpp.

629{
630 DoCancel();
631 Close();
632}
void DoCancel()
Definition: EffectUI.cpp:607

References DoCancel().

Referenced by OnCharHook().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnCapture()

void EffectUIHost::OnCapture ( AudioIOEvent  evt)
private

Definition at line 772 of file EffectUI.cpp.

773{
774 if (evt.on) {
775 if (evt.pProject == &mProject)
776 mCapturing = true;
777 }
778 else {
779 mCapturing = false;
780 }
782}
bool on
Definition: AudioIO.h:67
AudacityProject * pProject
Definition: AudioIO.h:60

References mCapturing, mProject, AudioIOEvent::on, AudioIOEvent::pProject, and UpdateControls().

Here is the call graph for this function:

◆ OnCharHook()

void EffectUIHost::OnCharHook ( wxKeyEvent &  evt)
private

Definition at line 954 of file EffectUI.cpp.

955{
956 if (!IsEscapeKey(evt))
957 {
958 evt.Skip();
959 return;
960 }
961
963 Close();
964 else
965 {
966 wxCommandEvent cancelEvt { wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL };
967
968 OnCancel(cancelEvt);
969 }
970}
wxEVT_COMMAND_BUTTON_CLICKED
void OnCancel(wxCommandEvent &evt)
Definition: EffectUI.cpp:628

References IsOpenedFromEffectPanel(), OnCancel(), and wxEVT_COMMAND_BUTTON_CLICKED.

Here is the call graph for this function:

◆ OnClose()

void EffectUIHost::OnClose ( wxCloseEvent &  evt)
private

Definition at line 529 of file EffectUI.cpp.

530{
531 DoCancel();
533
534 if (mpEditor)
535 mpEditor->OnClose();
536
537 Hide();
538 Destroy();
539
540#if wxDEBUG_LEVEL
541 mClosed = true;
542#endif
543}
void CleanupRealtime()
Definition: EffectUI.cpp:1091

References CleanupRealtime(), DoCancel(), and mpEditor.

Here is the call graph for this function:

◆ OnDebug()

void EffectUIHost::OnDebug ( wxCommandEvent &  evt)
private

Definition at line 634 of file EffectUI.cpp.

635{
636 OnApply(evt);
637}
void OnApply(wxCommandEvent &evt)
Definition: EffectUI.cpp:545

References OnApply().

Here is the call graph for this function:

◆ OnDefaults()

void EffectUIHost::OnDefaults ( wxCommandEvent &  evt)
private

Definition at line 936 of file EffectUI.cpp.

937{
938 mpAccess->ModifySettings([&](EffectSettings &settings){
939 // ignore failure
940 return mEffectUIHost.GetDefinition().LoadFactoryDefaults(settings)
941 .value_or(nullptr);
942 });
944 return;
945}
bool TransferDataToWindow() override
Definition: EffectUI.cpp:275

References EffectPlugin::GetDefinition(), mEffectUIHost, mpAccess, settings(), and TransferDataToWindow().

Here is the call graph for this function:

◆ OnDeletePreset()

void EffectUIHost::OnDeletePreset ( wxCommandEvent &  evt)
private

Definition at line 808 of file EffectUI.cpp.

809{
810 auto preset = mUserPresets[evt.GetId() - kDeletePresetID];
811
812 int res = AudacityMessageBox(
813 XO("Are you sure you want to delete \"%s\"?").Format( preset ),
814 XO("Delete Preset"),
815 wxICON_QUESTION | wxYES_NO);
816 if (res == wxYES)
817 {
820 }
821
823
824 return;
825}
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
static const int kDeletePresetID
Definition: EffectUI.cpp:136
EffectReverbSettings preset
Definition: Reverb.cpp:44
Abstract base class used in importing a file.
bool RemoveConfigSubgroup(const EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group)

References AudacityMessageBox(), EffectPlugin::GetDefinition(), kDeletePresetID, LoadUserPresets(), mEffectUIHost, mUserPresets, preset, PluginSettings::Private, PluginSettings::RemoveConfigSubgroup(), UserPresetsGroup(), and XO().

Here is the call graph for this function:

◆ OnEnable()

void EffectUIHost::OnEnable ( wxCommandEvent &  evt)
private

Definition at line 745 of file EffectUI.cpp.

746{
748
749 auto mpState = mwState.lock();
750 if (mpState) {
751 mpState->SetActive(mEnabled);
753 }
754
756}
bool IsDown()
Definition: AButton.h:226
static UndoManager & Get(AudacityProject &project)
Definition: UndoManager.cpp:71
void MarkUnsaved()

References UndoManager::Get(), AButton::IsDown(), UndoManager::MarkUnsaved(), mEnableBtn, mEnabled, mProject, mwState, and UpdateControls().

Here is the call graph for this function:

◆ OnErase()

void EffectUIHost::OnErase ( wxEraseEvent &  evt)
private

Definition at line 517 of file EffectUI.cpp.

518{
519 // Ignore it
520}

◆ OnExport()

void EffectUIHost::OnExport ( wxCommandEvent &  evt)
private

Definition at line 919 of file EffectUI.cpp.

920{
921 // may throw
922 // exceptions are handled in AudacityApp::OnExceptionInMainLoop
925
926 return;
927}
virtual void ExportPresets(const EffectPlugin &plugin, const EffectSettings &settings) const =0

References EffectUIServices::ExportPresets(), mClient, mEffectUIHost, mpAccess, and TransferDataFromWindow().

Here is the call graph for this function:

◆ OnFactoryPreset()

void EffectUIHost::OnFactoryPreset ( wxCommandEvent &  evt)
private

ignore failure

Definition at line 797 of file EffectUI.cpp.

798{
799 mpAccess->ModifySettings([&](EffectSettings &settings){
801 return mEffectUIHost.GetDefinition().LoadFactoryPreset(
802 evt.GetId() - kFactoryPresetsID, settings).value_or(nullptr);
803 });
805 return;
806}
static const int kFactoryPresetsID
Definition: EffectUI.cpp:137

References EffectPlugin::GetDefinition(), kFactoryPresetsID, mEffectUIHost, mpAccess, settings(), and TransferDataToWindow().

Here is the call graph for this function:

◆ OnIdle()

void EffectUIHost::OnIdle ( wxIdleEvent &  evt)
private

Definition at line 947 of file EffectUI.cpp.

948{
949 evt.Skip();
950 if (mpAccess)
951 mpAccess->Flush();
952}

References mpAccess.

◆ OnImport()

void EffectUIHost::OnImport ( wxCommandEvent &  evt)
private

Definition at line 907 of file EffectUI.cpp.

908{
909 mpAccess->ModifySettings([&](EffectSettings &settings){
910 // ignore failure
911 return mClient.ImportPresets(mEffectUIHost, settings).value_or(nullptr);
912 });
915
916 return;
917}
virtual OptionalMessage ImportPresets(const EffectPlugin &plugin, EffectSettings &settings) const =0

References EffectUIServices::ImportPresets(), LoadUserPresets(), mClient, mEffectUIHost, mpAccess, settings(), and TransferDataToWindow().

Here is the call graph for this function:

◆ OnInitDialog()

void EffectUIHost::OnInitDialog ( wxInitDialogEvent &  evt)
private

Definition at line 494 of file EffectUI.cpp.

495{
496 // Do default handling
497 wxDialogWrapper::OnInitDialog(evt);
498
499#if wxCHECK_VERSION(3, 0, 0)
500 //#warning "check to see if this still needed in wx3"
501#endif
502
503 // Pure hackage coming down the pike...
504 //
505 // I have no idea why, but if a wxTextCtrl is the first control in the
506 // panel, then its contents will not be automatically selected when the
507 // dialog is displayed.
508 //
509 // So, we do the selection manually.
510 wxTextCtrl *focused = wxDynamicCast(FindFocus(), wxTextCtrl);
511 if (focused)
512 {
513 focused->SelectAll();
514 }
515}
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
Definition: BasicUI.h:383

References BasicUI::FindFocus().

Here is the call graph for this function:

◆ OnMenu()

void EffectUIHost::OnMenu ( wxCommandEvent &  evt)
private

Definition at line 650 of file EffectUI.cpp.

651{
652 wxMenu menu;
653 menu.Bind(wxEVT_MENU, [](auto&){}, kUserPresetsDummyID);
654 menu.Bind(wxEVT_MENU, [](auto&){}, kDeletePresetDummyID);
656
657 if (mUserPresets.size() == 0)
658 {
659 menu.Append(kUserPresetsDummyID, _("User Presets"))->Enable(false);
660 }
661 else
662 {
663 auto sub = std::make_unique<wxMenu>();
664 for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
665 {
666 sub->Append(kUserPresetsID + i, mUserPresets[i]);
667 }
668 menu.Append(0, _("User Presets"), sub.release());
669 }
670
671 menu.Append(kSaveAsID, _("Save Preset..."));
672
673 if (mUserPresets.size() == 0)
674 {
675 menu.Append(kDeletePresetDummyID, _("Delete Preset"))->Enable(false);
676 }
677 else
678 {
679 auto sub = std::make_unique<wxMenu>();
680 for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
681 {
682 sub->Append(kDeletePresetID + i, mUserPresets[i]);
683 }
684 menu.Append(0, _("Delete Preset"), sub.release());
685 }
686
687 menu.AppendSeparator();
688
690
691 {
692 auto sub = std::make_unique<wxMenu>();
693 sub->Append(kDefaultsID, _("Defaults"));
694 if (factory.size() > 0)
695 {
696 sub->AppendSeparator();
697 for (size_t i = 0, cnt = factory.size(); i < cnt; i++)
698 {
699 auto label = factory[i];
700 if (label.empty())
701 {
702 label = _("None");
703 }
704
705 sub->Append(kFactoryPresetsID + i, label);
706 }
707 }
708 menu.Append(0, _("Factory Presets"), sub.release());
709 }
710
711 menu.AppendSeparator();
712 menu.Append(kImportID, _("Import..."))
714 menu.Append(kExportID, _("Export..."))
716 menu.AppendSeparator();
717 menu.Append(kOptionsID, _("Options..."))
718 ->Enable(mEffectUIHost.HasOptions());
719 menu.AppendSeparator();
720
721 {
722 auto sub = std::make_unique<wxMenu>();
723
724 auto &definition = mEffectUIHost.GetDefinition();
725 sub->Append(kDummyID, wxString::Format(_("Type: %s"),
726 ::wxGetTranslation( definition.GetFamily().Translation() )));
727 sub->Append(kDummyID, wxString::Format(_("Name: %s"), definition.GetName().Translation()));
728 sub->Append(kDummyID, wxString::Format(_("Version: %s"),
729 GetVersionForDisplay(definition)));
730 sub->Append(kDummyID, wxString::Format(_("Vendor: %s"), definition.GetVendor().Translation()));
731 sub->Append(kDummyID, wxString::Format(_("Description: %s"), definition.GetDescription().Translation()));
732 sub->Bind(wxEVT_MENU, [](auto&){}, kDummyID);
733
734 menu.Append(0, _("About"), sub.release());
735 }
736
737 wxWindow *btn = FindWindow(kMenuID);
738 wxRect r = btn->GetRect();
739 BasicMenu::Handle{ &menu }.Popup(
741 { r.GetLeft(), r.GetBottom() }
742 );
743}
static RegisteredToolbarFactory factory
static const int kImportID
Definition: EffectUI.cpp:124
static const int kExportID
Definition: EffectUI.cpp:125
static const int kOptionsID
Definition: EffectUI.cpp:127
static const int kDefaultsID
Definition: EffectUI.cpp:126
static const int kDummyID
Definition: EffectUI.cpp:122
static const int kSaveAsID
Definition: EffectUI.cpp:123
static const int kUserPresetsDummyID
Definition: EffectUI.cpp:128
static const int kDeletePresetDummyID
Definition: EffectUI.cpp:129
static const int kUserPresetsID
Definition: EffectUI.cpp:135
#define _(s)
Definition: Internat.h:73
TranslatableString label
Definition: TagsEditor.cpp:165
void Popup(const BasicUI::WindowPlacement &window, const Point &pos={})
Display the menu at pos, invoke at most one action, then hide it.
Definition: BasicMenu.cpp:209
virtual bool HasOptions() const =0
virtual bool CanExportPresets() const =0
Whether the effect supports export of presets to files, and importing too.
virtual RegistryPaths GetFactoryPresets() const =0
Report names of factory presets.
wxString GetVersionForDisplay(const EffectDefinitionInterface &definition)
Definition: EffectUI.cpp:640
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.

References _, EffectPlugin::CanExportPresets(), TranslatableString::empty(), factory, EffectPlugin::GetDefinition(), EffectSettingsManager::GetFactoryPresets(), anonymous_namespace{EffectUI.cpp}::GetVersionForDisplay(), EffectPlugin::HasOptions(), kDefaultsID, kDeletePresetDummyID, kDeletePresetID, kDummyID, kExportID, kFactoryPresetsID, kImportID, kMenuID, kOptionsID, kSaveAsID, kUserPresetsDummyID, kUserPresetsID, label, LoadUserPresets(), mEffectUIHost, mUserPresets, and BasicMenu::Handle::Popup().

Here is the call graph for this function:

◆ OnOptions()

void EffectUIHost::OnOptions ( wxCommandEvent &  evt)
private

Definition at line 929 of file EffectUI.cpp.

930{
932
933 return;
934}
virtual void ShowOptions(const EffectPlugin &plugin) const =0

References mClient, mEffectUIHost, and EffectUIServices::ShowOptions().

Here is the call graph for this function:

◆ OnPaint()

void EffectUIHost::OnPaint ( wxPaintEvent &  evt)
private

Definition at line 522 of file EffectUI.cpp.

523{
524 wxPaintDC dc(this);
525
526 dc.Clear();
527}

◆ OnPlay()

void EffectUIHost::OnPlay ( wxCommandEvent &  evt)
private

Definition at line 758 of file EffectUI.cpp.

759{
761 return;
762
763 auto updater = [this]{ TransferDataToWindow(); };
765 // After restoration of settings and effect state:
766 // In case any dialog control depends on mT1 or mDuration:
767 updater();
768
769 return;
770}
void EffectPreview(EffectBase &effect, EffectSettingsAccess &access, std::function< void()> updateUI, bool dryOnly)
Calculate temporary tracks of limited length with effect applied and play.
static CustomUpdaterValue updater

References EffectPreview(), mEffectUIHost, mpAccess, TransferDataFromWindow(), TransferDataToWindow(), and updater.

Here is the call graph for this function:

◆ OnPlayback()

void EffectUIHost::OnPlayback ( AudioIOEvent  )
private

◆ OnSaveAs()

void EffectUIHost::OnSaveAs ( wxCommandEvent &  evt)
private

Definition at line 827 of file EffectUI.cpp.

828{
829 wxTextCtrl *text;
830 wxString name;
831 wxDialogWrapper dlg(this, wxID_ANY, XO("Save Preset"));
832
833 ShuttleGui S(&dlg, eIsCreating);
834
835 S.StartPanel();
836 {
837 S.StartVerticalLay(1);
838 {
839 S.StartHorizontalLay(wxALIGN_LEFT, 0);
840 {
841 text = S.AddTextBox(XXO("Preset name:"), name, 30);
842 }
843 S.EndHorizontalLay();
844 S.SetBorder(10);
845 S.AddStandardButtons();
846 }
847 S.EndVerticalLay();
848 }
849 S.EndPanel();
850
851 dlg.SetSize(dlg.GetSizer()->GetMinSize());
852 dlg.Center();
853 dlg.Fit();
854
855 while (true)
856 {
857 int rc = dlg.ShowModal();
858
859 if (rc != wxID_OK)
860 {
861 break;
862 }
863
864 name = text->GetValue();
865 if (name.empty())
866 {
868 this,
869 XO("You must specify a name"),
870 XO("Save Preset") );
871 md.Center();
872 md.ShowModal();
873 continue;
874 }
875
876 if ( make_iterator_range( mUserPresets ).contains( name ) )
877 {
879 this,
880 XO("Preset already exists.\n\nReplace?"),
881 XO("Save Preset"),
882 wxYES_NO | wxCANCEL | wxICON_EXCLAMATION );
883 md.Center();
884 int choice = md.ShowModal();
885 if (choice == wxID_CANCEL)
886 {
887 break;
888 }
889
890 if (choice == wxID_NO)
891 {
892 continue;
893 }
894 }
895
900
901 break;
902 }
903
904 return;
905}
const TranslatableString name
Definition: Distortion.cpp:76
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: IteratorX.h:210
Wrap wxMessageDialog so that caption IS translatable.

References eIsCreating, TranslatableString::empty(), EffectPlugin::GetDefinition(), LoadUserPresets(), make_iterator_range(), mEffectUIHost, mpAccess, mUserPresets, name, S, EffectSettingsManager::SaveUserPreset(), TransferDataFromWindow(), UserPresetsGroup(), XO(), and XXO().

Here is the call graph for this function:

◆ OnUserPreset()

void EffectUIHost::OnUserPreset ( wxCommandEvent &  evt)
private

Definition at line 784 of file EffectUI.cpp.

785{
786 int preset = evt.GetId() - kUserPresetsID;
787
788 mpAccess->ModifySettings([&](EffectSettings &settings){
789 // ignore failure
790 return mEffectUIHost.GetDefinition().LoadUserPreset(
791 UserPresetsGroup(mUserPresets[preset]), settings).value_or(nullptr);
792 });
794 return;
795}

References EffectPlugin::GetDefinition(), kUserPresetsID, mEffectUIHost, mpAccess, mUserPresets, preset, settings(), TransferDataToWindow(), and UserPresetsGroup().

Here is the call graph for this function:

◆ SetClosed()

void EffectUIHost::SetClosed ( )
inline

Definition at line 70 of file EffectUI.h.

70 {
71#if wxDEBUG_LEVEL
72 mClosed = true;
73#endif
74 }

◆ ShowModal()

int EffectUIHost::ShowModal ( )
override

Definition at line 328 of file EffectUI.cpp.

329{
331 {
332 mApplyBtn->SetLabel(XXO("&Generate").Translation());
333 }
334
335 Layout();
336
337 return wxDialogWrapper::ShowModal();
338}

References EffectTypeGenerate, EffectPlugin::GetDefinition(), EffectDefinitionInterface::GetType(), mApplyBtn, mEffectUIHost, and XXO().

Here is the call graph for this function:

◆ TransferDataFromWindow()

bool EffectUIHost::TransferDataFromWindow ( )
override

Do validations of any wxValidator objects

Do transfers of any wxValidator objects

Do other custom validation and transfer actions

Definition at line 287 of file EffectUI.cpp.

288{
290 if (!wxDialogWrapper::Validate())
291 return false;
292
294 if (!wxDialogWrapper::TransferDataFromWindow())
295 return false;
296
298 if (!mpEditor->ValidateUI())
299 return false;
300
301 // Transfer-from takes non-const reference to settings
302 bool result = true;
303 mpAccess->ModifySettings([&](EffectSettings &settings){
304 const auto pServices =
306 // Allow other transfers, and reassignment of settings
307 result = (!pServices || pServices->TransferDataFromWindow(settings));
308 if (result) {
309 auto &definition = mEffectUIHost.GetDefinition();
310 if (definition.GetType() == EffectTypeGenerate) {
311 const auto seconds = settings.extra.GetDuration();
312 // Updating of the last-used generator duration in the config
315 seconds);
316 }
317 }
318 return nullptr;
319 });
320 mpAccess->Flush();
321 return result;
322}
static const RegistryPath & DurationKey()
bool SetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, const Value &value)

References CurrentSettingsGroup(), EffectSettingsExtra::DurationKey(), EffectTypeGenerate, EffectPlugin::GetDefinition(), mEffectUIHost, mpAccess, mpEditor, PluginSettings::Private, PluginSettings::SetConfig(), and settings().

Referenced by OnApply(), OnExport(), OnPlay(), and OnSaveAs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TransferDataToWindow()

bool EffectUIHost::TransferDataToWindow ( )
override

Do other appearance updates

Do validators

Definition at line 275 of file EffectUI.cpp.

276{
277 // Transfer-to takes const reference to settings
278 const auto pServices =
280 return (!pServices || pServices->TransferDataToWindow(mpAccess->Get())) &&
282 mpEditor->UpdateUI() &&
284 wxDialogWrapper::TransferDataToWindow();
285}

References mEffectUIHost, mpAccess, and mpEditor.

Referenced by OnDefaults(), OnFactoryPreset(), OnImport(), OnPlay(), and OnUserPreset().

Here is the caller graph for this function:

◆ UpdateControls()

void EffectUIHost::UpdateControls ( )
private

Definition at line 1010 of file EffectUI.cpp.

1011{
1012 if (mIsBatch)
1013 {
1014 return;
1015 }
1016
1018 {
1020 return;
1021 }
1022
1023 mApplyBtn->Enable(!mCapturing);
1024}
void PushDown()
Definition: AButton.cpp:644
void PopUp()
Definition: AButton.cpp:652

References IsOpenedFromEffectPanel(), mApplyBtn, mCapturing, mEnableBtn, mEnabled, mIsBatch, AButton::PopUp(), and AButton::PushDown().

Referenced by Initialize(), InitializeInstance(), OnCapture(), and OnEnable().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mApplyBtn

wxButton* EffectUIHost::mApplyBtn {}
private

Definition at line 134 of file EffectUI.h.

Referenced by Initialize(), OnApply(), ShowModal(), and UpdateControls().

◆ mAudioIOSubscription

Observer::Subscription EffectUIHost::mAudioIOSubscription
private

Definition at line 114 of file EffectUI.h.

Referenced by CleanupRealtime(), and InitializeInstance().

◆ mCapturing

bool EffectUIHost::mCapturing {}
private

Definition at line 141 of file EffectUI.h.

Referenced by InitializeInstance(), OnCapture(), and UpdateControls().

◆ mClient

EffectUIServices& EffectUIHost::mClient
private

Definition at line 119 of file EffectUI.h.

Referenced by Initialize(), OnExport(), OnImport(), and OnOptions().

◆ mDebugBtn

wxButton* EffectUIHost::mDebugBtn {}
private

Definition at line 137 of file EffectUI.h.

Referenced by BuildTopBar().

◆ mDismissed

bool EffectUIHost::mDismissed {}
private

Definition at line 146 of file EffectUI.h.

Referenced by DoCancel(), and OnApply().

◆ mEffectStateSubscription

Observer::Subscription EffectUIHost::mEffectStateSubscription
private

Definition at line 114 of file EffectUI.h.

Referenced by CleanupRealtime(), and InitializeInstance().

◆ mEffectUIHost

EffectBase& EffectUIHost::mEffectUIHost
private

◆ mEnableBtn

AButton* EffectUIHost::mEnableBtn {}
private

Definition at line 136 of file EffectUI.h.

Referenced by BuildTopBar(), OnEnable(), and UpdateControls().

◆ mEnabled

bool EffectUIHost::mEnabled { true }
private

Definition at line 139 of file EffectUI.h.

Referenced by Initialize(), InitializeInstance(), OnEnable(), and UpdateControls().

◆ mHadPriorState

const bool EffectUIHost::mHadPriorState
private

Definition at line 147 of file EffectUI.h.

Referenced by DoCancel().

◆ mInitialized

bool EffectUIHost::mInitialized { false }
private

Definition at line 129 of file EffectUI.h.

Referenced by CleanupRealtime(), and InitializeInstance().

◆ mIsBatch

bool EffectUIHost::mIsBatch {}
private

Definition at line 132 of file EffectUI.h.

Referenced by Initialize(), OnApply(), and UpdateControls().

◆ mIsGUI

bool EffectUIHost::mIsGUI {}
private

Definition at line 131 of file EffectUI.h.

Referenced by Initialize().

◆ mMenuBtn

wxButton* EffectUIHost::mMenuBtn {}
private

Definition at line 135 of file EffectUI.h.

Referenced by BuildTopBar().

◆ mpAccess

EffectPlugin::EffectSettingsAccessPtr EffectUIHost::mpAccess
private

◆ mpAccess2

EffectPlugin::EffectSettingsAccessPtr EffectUIHost::mpAccess2
private

Definition at line 123 of file EffectUI.h.

Referenced by InitializeInstance().

◆ mParent

wxWindow* const EffectUIHost::mParent
private

Definition at line 117 of file EffectUI.h.

Referenced by Initialize().

◆ mpEditor

std::unique_ptr<EffectEditor> EffectUIHost::mpEditor
private

◆ mpGivenAccess

const EffectPlugin::EffectSettingsAccessPtr EffectUIHost::mpGivenAccess
private
Invariant
not null

Definition at line 121 of file EffectUI.h.

◆ mpInstance

const std::shared_ptr<EffectInstance> EffectUIHost::mpInstance
private

Definition at line 154 of file EffectUI.h.

Referenced by EffectUIHost(), and Initialize().

◆ mPlayPos

double EffectUIHost::mPlayPos { 0.0 }
private

Definition at line 144 of file EffectUI.h.

◆ mpOutputs

const EffectOutputs* const EffectUIHost::mpOutputs
private

Definition at line 155 of file EffectUI.h.

Referenced by Initialize().

◆ mProject

AudacityProject& EffectUIHost::mProject
private

Definition at line 116 of file EffectUI.h.

Referenced by CleanupRealtime(), InitializeInstance(), OnApply(), OnCapture(), and OnEnable().

◆ mpTempProjectState

std::shared_ptr<RealtimeEffectState> EffectUIHost::mpTempProjectState {}
private

Definition at line 126 of file EffectUI.h.

Referenced by CleanupRealtime(), InitializeInstance(), and IsOpenedFromEffectPanel().

◆ mRegion

SelectedRegion EffectUIHost::mRegion
private

Definition at line 143 of file EffectUI.h.

◆ mSupportsRealtime

const bool EffectUIHost::mSupportsRealtime
private

Definition at line 130 of file EffectUI.h.

Referenced by CleanupRealtime(), InitializeInstance(), and IsOpenedFromEffectPanel().

◆ mUserPresets

RegistryPaths EffectUIHost::mUserPresets
private

Definition at line 128 of file EffectUI.h.

Referenced by LoadUserPresets(), OnDeletePreset(), OnMenu(), OnSaveAs(), and OnUserPreset().

◆ mwState

std::weak_ptr<RealtimeEffectState> EffectUIHost::mwState {}
private

Definition at line 124 of file EffectUI.h.

Referenced by InitializeInstance(), and OnEnable().


The documentation for this class was generated from the following files: