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:1037
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 S
369 .Position(wxALIGN_CENTER | wxTOP | wxBOTTOM)
370 .Name(XO("Power"))
371 .AddWindow(mEnableBtn);
372 }
373
374 mMenuBtn = S.Id( kMenuID )
375 .ToolTip(XO("Manage presets and options"))
376 .AddButton( XO("Presets && settings"), wxALIGN_CENTER | wxTOP | wxBOTTOM );
377
378 S.AddSpace(1, 0, 1);
379
380
381
383 {
384 mDebugBtn = S.Id(eDebugID)
385 .AddButton( XXO("Debu&g"),
386 wxALIGN_CENTER | wxTOP | wxBOTTOM );
387 }
388 }
389 S.EndHorizontalLay();
390 }
391 S.EndPanel();
392}
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:971
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 1090 of file EffectUI.cpp.

1091{
1093
1095 if (!IsOpenedFromEffectPanel()) {
1098 mpTempProjectState.reset();
1099 /*
1100 ProjectHistory::Get(mProject).PushState(
1101 XO("Removed %s effect").Format(mpState->GetEffect()->GetName()),
1102 XO("Removed Effect"),
1103 UndoPush::NONE
1104 );
1105 */
1106 }
1107 mInitialized = false;
1108 }
1109}
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 976 of file EffectUI.cpp.

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

◆ DoCancel()

void EffectUIHost::DoCancel ( )
private

Definition at line 606 of file EffectUI.cpp.

607{
608 if (!mDismissed) {
609 if (!mHadPriorState) {
610 // For the destructive effect dialog only
611 // Restore effect state from last updated preferences
612 mpAccess->ModifySettings([&](EffectSettings &settings) {
613 // ignore failure
614 return mEffectUIHost.GetDefinition().LoadUserPreset(
615 CurrentSettingsGroup(), settings).value_or(nullptr);
616 });
617 }
618 if (IsModal())
619 EndModal(0);
620 else
621 Hide();
622
623 mDismissed = true;
624 }
625}
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 487 of file EffectUI.cpp.

488{
489 return !IsModal();
490}

◆ Initialize()

bool EffectUIHost::Initialize ( )

Definition at line 394 of file EffectUI.cpp.

395{
396 mEnabled = mpAccess->Get().extra.GetActive();
397
398 // Build a "host" dialog, framing a panel that the client fills in.
399 // The frame includes buttons to preview, apply, load and save presets, etc.
400 EffectPanel *w {};
401 ShuttleGui S{ this, eIsCreating };
402 {
403 BuildTopBar(S);
404
405 // Make the panel for the client
406 Destroy_ptr<EffectPanel> uw{ safenew EffectPanel( S.GetParent() ) };
407 RTL_WORKAROUND(uw.get());
408
409 // Try to give the window a sensible default/minimum size
410 uw->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
411 mParent->GetSize().GetHeight() / 2));
412
413 // Let the client add things to the panel
414 ShuttleGui S1{ uw.get(), eIsCreating };
417 if (!mpEditor)
418 return false;
419
420 mIsGUI = mpEditor->IsGraphicalUI();
422
423 S.StartHorizontalLay( wxEXPAND );
424 {
425 S.Prop( 1 )
426 .Position(wxEXPAND)
427 .AddWindow((w = uw.release()));
428 }
429 S.EndHorizontalLay();
430
432 {
433 S.StartPanel();
434 {
435 S.SetBorder( InnerMargin );
436 S.StartHorizontalLay(wxEXPAND, 0);
437 {
438 if (!mIsBatch)
439 {
442 {
443 S.Id(kPlayID)
444 .ToolTip(XO("Preview effect"))
445 .AddButton( XXO("&Preview"),
446 wxALIGN_CENTER | wxTOP | wxBOTTOM );
447 }
448 }
449
450 S.AddSpace(1, 1, 1);
451 S.Id(wxID_CANCEL)
452 .AddButton(XXO("&Cancel"));
453
454 mApplyBtn = S.Id(wxID_APPLY)
455 .AddButton( XXO("&Apply"));
456 mApplyBtn->SetDefault();
457 }
458 S.EndHorizontalLay();
459 }
460 S.EndPanel();
461 }
462 }
463
464 Layout();
465 Fit();
466 Center();
467
469
470 w->SetAccept(!mIsGUI);
471
472 if (!mIsGUI)
473 {
474 w->SetFocus();
475 }
476 else if (!IsOpenedFromEffectPanel())
477 {
478 mApplyBtn->SetFocus();
479 }
480
482
483 SetMinSize(GetSize());
484 return true;
485}
@ 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:1009
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:1025
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 1037 of file EffectUI.cpp.

1038{
1039 // We are still constructing and the return initializes a const member
1040 std::shared_ptr<EffectInstance> result;
1041
1042 auto mpState = mwState.lock();
1043
1044 bool priorState = (mpState != nullptr);
1045 if (!priorState) {
1046 auto gAudioIO = AudioIO::Get();
1047 mCapturing = gAudioIO->IsStreamActive() && gAudioIO->GetNumCaptureChannels() > 0 && !gAudioIO->IsMonitoring();
1048 }
1049
1051 if (!priorState)
1052 mwState = mpState = mpTempProjectState =
1054 if (mpState) {
1055 // Find the right instance to connect to the dialog
1056 if (!result)
1057 result = mpState->GetInstance();
1058
1059 mpAccess2 = mpState->GetAccess();
1060 if (!(mpAccess2->IsSameAs(*mpAccess)))
1061 // Decorate the given access object
1062 mpAccess = std::make_shared<EffectSettingsAccessTee>(
1064
1065 mEffectStateSubscription = mpState->Subscribe([this](RealtimeEffectStateChange state) {
1068 });
1069 }
1070
1071 if (!priorState) {
1073 switch (event.type) {
1074 case AudioIOEvent::CAPTURE:
1075 OnCapture(event); break;
1076 default:
1077 break;
1078 }
1079 });
1080 }
1081
1082 mInitialized = true;
1083 }
1084 else
1085 result = EffectBase::FindInstance(mEffectUIHost).value_or(nullptr);
1086
1087 return result;
1088}
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 971 of file EffectUI.cpp.

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

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 1025 of file EffectUI.cpp.

1026{
1027 mUserPresets.clear();
1028
1031
1032 std::sort( mUserPresets.begin(), mUserPresets.end() );
1033
1034 return;
1035}
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 544 of file EffectUI.cpp.

545{
546 auto &project = mProject;
547
548 // On wxGTK (wx2.8.12), the default action is still executed even if
549 // the button is disabled. This appears to affect all wxDialogs, not
550 // just our Effects dialogs. So, this is a only temporary workaround
551 // for legacy effects that disable the OK button. Hopefully this has
552 // been corrected in wx3.
553 if (!mApplyBtn->IsEnabled())
554 {
555 return;
556 }
557
558 // Honor the "select all if none" preference...a little hackish, but whatcha gonna do...
559 if (!mIsBatch &&
563 {
564 auto flags = AlwaysEnabledFlag;
565 bool allowed =
568 flags,
570 if (!allowed)
571 return;
572 }
573
574 if (!TransferDataFromWindow() ||
575 // This is the main place where there is a side-effect on the config
576 // file to remember the last-used settings of an effect, just before
577 // applying the effect destructively.
580 return;
581
582 if (IsModal())
583 {
584 mDismissed = true;
585
586 EndModal(evt.GetId());
587
588 Close();
589
590 return;
591 }
592
593 // Progress dialog no longer yields, so this "shouldn't" be necessary (yet to be proven
594 // for sure), but it is a nice visual cue that something is going on.
595 mApplyBtn->Disable();
596 auto cleanup = finally( [&] { mApplyBtn->Enable(); } );
597
598 CommandContext context( project );
599 // This is absolute hackage...but easy and I can't think of another way just now.
600 //
601 // It should callback to the EffectManager to kick off the processing
604}
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:1148

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 627 of file EffectUI.cpp.

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

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 771 of file EffectUI.cpp.

772{
773 if (evt.on) {
774 if (evt.pProject == &mProject)
775 mCapturing = true;
776 }
777 else {
778 mCapturing = false;
779 }
781}
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 953 of file EffectUI.cpp.

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

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 528 of file EffectUI.cpp.

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

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

Here is the call graph for this function:

◆ OnDebug()

void EffectUIHost::OnDebug ( wxCommandEvent &  evt)
private

Definition at line 633 of file EffectUI.cpp.

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

References OnApply().

Here is the call graph for this function:

◆ OnDefaults()

void EffectUIHost::OnDefaults ( wxCommandEvent &  evt)
private

Definition at line 935 of file EffectUI.cpp.

936{
937 mpAccess->ModifySettings([&](EffectSettings &settings){
938 // ignore failure
939 return mEffectUIHost.GetDefinition().LoadFactoryDefaults(settings)
940 .value_or(nullptr);
941 });
943 return;
944}
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 807 of file EffectUI.cpp.

808{
809 auto preset = mUserPresets[evt.GetId() - kDeletePresetID];
810
811 int res = AudacityMessageBox(
812 XO("Are you sure you want to delete \"%s\"?").Format( preset ),
813 XO("Delete Preset"),
814 wxICON_QUESTION | wxYES_NO);
815 if (res == wxYES)
816 {
819 }
820
822
823 return;
824}
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 744 of file EffectUI.cpp.

745{
747
748 auto mpState = mwState.lock();
749 if (mpState) {
750 mpState->SetActive(mEnabled);
752 }
753
755}
bool IsDown()
Definition: AButton.h:225
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 516 of file EffectUI.cpp.

517{
518 // Ignore it
519}

◆ OnExport()

void EffectUIHost::OnExport ( wxCommandEvent &  evt)
private

Definition at line 918 of file EffectUI.cpp.

919{
920 // may throw
921 // exceptions are handled in AudacityApp::OnExceptionInMainLoop
924
925 return;
926}
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 796 of file EffectUI.cpp.

797{
798 mpAccess->ModifySettings([&](EffectSettings &settings){
800 return mEffectUIHost.GetDefinition().LoadFactoryPreset(
801 evt.GetId() - kFactoryPresetsID, settings).value_or(nullptr);
802 });
804 return;
805}
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 946 of file EffectUI.cpp.

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

References mpAccess.

◆ OnImport()

void EffectUIHost::OnImport ( wxCommandEvent &  evt)
private

Definition at line 906 of file EffectUI.cpp.

907{
908 mpAccess->ModifySettings([&](EffectSettings &settings){
909 // ignore failure
910 return mClient.ImportPresets(mEffectUIHost, settings).value_or(nullptr);
911 });
914
915 return;
916}
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 493 of file EffectUI.cpp.

494{
495 // Do default handling
496 wxDialogWrapper::OnInitDialog(evt);
497
498#if wxCHECK_VERSION(3, 0, 0)
499 //#warning "check to see if this still needed in wx3"
500#endif
501
502 // Pure hackage coming down the pike...
503 //
504 // I have no idea why, but if a wxTextCtrl is the first control in the
505 // panel, then its contents will not be automatically selected when the
506 // dialog is displayed.
507 //
508 // So, we do the selection manually.
509 wxTextCtrl *focused = wxDynamicCast(FindFocus(), wxTextCtrl);
510 if (focused)
511 {
512 focused->SelectAll();
513 }
514}
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 649 of file EffectUI.cpp.

650{
651 wxMenu menu;
652 menu.Bind(wxEVT_MENU, [](auto&){}, kUserPresetsDummyID);
653 menu.Bind(wxEVT_MENU, [](auto&){}, kDeletePresetDummyID);
655
656 if (mUserPresets.size() == 0)
657 {
658 menu.Append(kUserPresetsDummyID, _("User Presets"))->Enable(false);
659 }
660 else
661 {
662 auto sub = std::make_unique<wxMenu>();
663 for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
664 {
665 sub->Append(kUserPresetsID + i, mUserPresets[i]);
666 }
667 menu.Append(0, _("User Presets"), sub.release());
668 }
669
670 menu.Append(kSaveAsID, _("Save Preset..."));
671
672 if (mUserPresets.size() == 0)
673 {
674 menu.Append(kDeletePresetDummyID, _("Delete Preset"))->Enable(false);
675 }
676 else
677 {
678 auto sub = std::make_unique<wxMenu>();
679 for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
680 {
681 sub->Append(kDeletePresetID + i, mUserPresets[i]);
682 }
683 menu.Append(0, _("Delete Preset"), sub.release());
684 }
685
686 menu.AppendSeparator();
687
689
690 {
691 auto sub = std::make_unique<wxMenu>();
692 sub->Append(kDefaultsID, _("Defaults"));
693 if (factory.size() > 0)
694 {
695 sub->AppendSeparator();
696 for (size_t i = 0, cnt = factory.size(); i < cnt; i++)
697 {
698 auto label = factory[i];
699 if (label.empty())
700 {
701 label = _("None");
702 }
703
704 sub->Append(kFactoryPresetsID + i, label);
705 }
706 }
707 menu.Append(0, _("Factory Presets"), sub.release());
708 }
709
710 menu.AppendSeparator();
711 menu.Append(kImportID, _("Import..."))
713 menu.Append(kExportID, _("Export..."))
715 menu.AppendSeparator();
716 menu.Append(kOptionsID, _("Options..."))
717 ->Enable(mEffectUIHost.HasOptions());
718 menu.AppendSeparator();
719
720 {
721 auto sub = std::make_unique<wxMenu>();
722
723 auto &definition = mEffectUIHost.GetDefinition();
724 sub->Append(kDummyID, wxString::Format(_("Type: %s"),
725 ::wxGetTranslation( definition.GetFamily().Translation() )));
726 sub->Append(kDummyID, wxString::Format(_("Name: %s"), definition.GetName().Translation()));
727 sub->Append(kDummyID, wxString::Format(_("Version: %s"),
728 GetVersionForDisplay(definition)));
729 sub->Append(kDummyID, wxString::Format(_("Vendor: %s"), definition.GetVendor().Translation()));
730 sub->Append(kDummyID, wxString::Format(_("Description: %s"), definition.GetDescription().Translation()));
731 sub->Bind(wxEVT_MENU, [](auto&){}, kDummyID);
732
733 menu.Append(0, _("About"), sub.release());
734 }
735
736 wxWindow *btn = FindWindow(kMenuID);
737 wxRect r = btn->GetRect();
738 BasicMenu::Handle{ &menu }.Popup(
740 { r.GetLeft(), r.GetBottom() }
741 );
742}
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:639
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 928 of file EffectUI.cpp.

929{
931
932 return;
933}
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 521 of file EffectUI.cpp.

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

◆ OnPlay()

void EffectUIHost::OnPlay ( wxCommandEvent &  evt)
private

Definition at line 757 of file EffectUI.cpp.

758{
760 return;
761
762 auto updater = [this]{ TransferDataToWindow(); };
764 // After restoration of settings and effect state:
765 // In case any dialog control depends on mT1 or mDuration:
766 updater();
767
768 return;
769}
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 826 of file EffectUI.cpp.

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

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

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 1009 of file EffectUI.cpp.

1010{
1011 if (mIsBatch)
1012 {
1013 return;
1014 }
1015
1017 {
1019 return;
1020 }
1021
1022 mApplyBtn->Enable(!mCapturing);
1023}
void PushDown()
Definition: AButton.cpp:642
void PopUp()
Definition: AButton.cpp:650

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: