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 ()
 
wxPanel * BuildButtonBar (wxWindow *parent, bool graphicalUI)
 
void BuildButtonBar (ShuttleGui &S, bool graphicalUI)
 
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 {}
 
wxButton * mPlayToggleBtn {}
 
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 226 of file EffectUI.cpp.

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

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

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

References mpEditor.

Member Function Documentation

◆ BuildButtonBar() [1/2]

void EffectUIHost::BuildButtonBar ( ShuttleGui S,
bool  graphicalUI 
)
private

Definition at line 353 of file EffectUI.cpp.

354{
355 mIsGUI = graphicalUI;
357
358 constexpr int margin = 3;
359
360 S.StartPanel();
361 {
362 S.SetBorder( margin );
363
364 S.StartHorizontalLay(wxEXPAND, 0);
365 {
367 {
368 mEnableBtn = MakeBitmapToggleButton(S.GetParent(),
369 theTheme.Image(bmpEffectOn), theTheme.Image(bmpEffectOff));
370 S
371 .Position(wxALIGN_CENTER | wxTOP | wxBOTTOM)
372 .Name(XO("Power"))
373 .AddWindow(mEnableBtn);
374 }
375
376 mMenuBtn = S.Id( kMenuID )
377 .ToolTip(XO("Manage presets and options"))
378 .AddButton( XO("Presets && settings"), wxALIGN_CENTER | wxTOP | wxBOTTOM );
379
380 S.AddSpace(1, 0, 1);
381
382 if (!mIsBatch)
383 {
387 {
389 .ToolTip(XO("Preview effect"))
390 .AddButton( { },
391 wxALIGN_CENTER | wxTOP | wxBOTTOM );
392 }
393 if(mPlayToggleBtn != nullptr)
394 {
395 //wxButton does not implement GetSizeFromText
396 //set button minimum size so that largest text fits
397 mPlayToggleBtn->SetLabel(_("Stop &Preview"));
398 auto a = mPlayToggleBtn->GetBestSize();
399 mPlayToggleBtn->SetLabel(_("&Preview"));
400 auto b = mPlayToggleBtn->GetBestSize();
401 mPlayToggleBtn->SetMinSize(a.x > b.x ? a : b);
402 }
403 }
404
406 {
407 mApplyBtn = S.Id(wxID_APPLY)
408 .AddButton( XXO("&Apply"),
409 wxALIGN_CENTER | wxTOP | wxBOTTOM );
410 mApplyBtn->SetDefault();
411 }
412
414 {
415 mDebugBtn = S.Id(eDebugID)
416 .AddButton( XXO("Debu&g"),
417 wxALIGN_CENTER | wxTOP | wxBOTTOM );
418 }
419 }
420 S.EndHorizontalLay();
421 }
422 S.EndPanel();
423}
@ EffectTypeAnalyze
@ EffectTypeTool
static const int kPlayID
Definition: EffectUI.cpp:130
static const int kMenuID
Definition: EffectUI.cpp:128
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
#define _(s)
Definition: Internat.h:73
@ eDebugID
Definition: ShuttleGui.h:613
THEME_API Theme theTheme
Definition: Theme.cpp:82
#define S(N)
Definition: ToChars.cpp:64
virtual EffectType GetType() const =0
Type determines how it behaves.
virtual bool EnablesDebug() const
Whether the effect dialog should have a Debug button; default, always false.
virtual bool IsBatchProcessing() const =0
bool mIsBatch
Definition: EffectUI.h:133
wxButton * mMenuBtn
Definition: EffectUI.h:136
bool mIsGUI
Definition: EffectUI.h:132
wxButton * mPlayToggleBtn
Definition: EffectUI.h:139
AButton * mEnableBtn
Definition: EffectUI.h:137
wxButton * mApplyBtn
Definition: EffectUI.h:135
wxButton * mDebugBtn
Definition: EffectUI.h:138
bool IsOpenedFromEffectPanel() const
Definition: EffectUI.cpp:965
wxImage & Image(int iIndex)
AButton * MakeBitmapToggleButton(wxWindow *parent, const wxImage &ImageOn, const wxImage &ImageOff)
Definition: EffectUI.cpp:343

References _, eDebugID, EffectTypeAnalyze, EffectTypeTool, EffectDefinitionInterface::EnablesDebug(), EffectPlugin::GetDefinition(), EffectDefinitionInterface::GetType(), ThemeBase::Image(), EffectPlugin::IsBatchProcessing(), IsOpenedFromEffectPanel(), kMenuID, kPlayID, anonymous_namespace{EffectUI.cpp}::MakeBitmapToggleButton(), mApplyBtn, mDebugBtn, mEffectUIHost, mEnableBtn, mIsBatch, mIsGUI, mMenuBtn, mPlayToggleBtn, S, theTheme, XO(), and XXO().

Here is the call graph for this function:

◆ BuildButtonBar() [2/2]

wxPanel * EffectUIHost::BuildButtonBar ( wxWindow *  parent,
bool  graphicalUI 
)
private

Referenced by Initialize().

Here is the caller graph for this function:

◆ CleanupRealtime()

void EffectUIHost::CleanupRealtime ( )
private

Definition at line 1084 of file EffectUI.cpp.

1085{
1087
1089 if (!IsOpenedFromEffectPanel()) {
1092 mpTempProjectState.reset();
1093 /*
1094 ProjectHistory::Get(mProject).PushState(
1095 XO("Removed %s effect").Format(mpState->GetEffect()->GetName()),
1096 XO("Removed Effect"),
1097 UndoPush::NONE
1098 );
1099 */
1100 }
1101 mInitialized = false;
1102 }
1103}
static AudioIO * Get()
Definition: AudioIO.cpp:123
void RemoveState(AudacityProject &project, Track *pTrack, std::shared_ptr< RealtimeEffectState > pState)
Forwards to RealtimeEffectManager::RemoveState with proper init scope.
Definition: AudioIO.cpp:366
Observer::Subscription mAudioIOSubscription
Definition: EffectUI.h:115
std::shared_ptr< RealtimeEffectState > mpTempProjectState
Definition: EffectUI.h:127
Observer::Subscription mEffectStateSubscription
Definition: EffectUI.h:115
bool mInitialized
Definition: EffectUI.h:130
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 970 of file EffectUI.cpp.

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

◆ DoCancel()

void EffectUIHost::DoCancel ( )
private

Definition at line 602 of file EffectUI.cpp.

603{
604 if (!mDismissed) {
605 if (!mHadPriorState) {
606 // For the destructive effect dialog only
607 // Restore effect state from last updated preferences
608 mpAccess->ModifySettings([&](EffectSettings &settings) {
609 // ignore failure
610 return mEffectUIHost.GetDefinition().LoadUserPreset(
611 CurrentSettingsGroup(), settings).value_or(nullptr);
612 });
613 }
614 if (IsModal())
615 EndModal(0);
616 else
617 Hide();
618
619 mDismissed = true;
620 }
621}
const RegistryPath & CurrentSettingsGroup()
Component of a configuration key path, for last-used destructive settings.
static Settings & settings()
Definition: TrackInfo.cpp:83
bool mDismissed
Definition: EffectUI.h:148
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 483 of file EffectUI.cpp.

484{
485 return !IsModal();
486}

◆ Initialize()

bool EffectUIHost::Initialize ( )

Definition at line 425 of file EffectUI.cpp.

426{
427 mEnabled = mpAccess->Get().extra.GetActive();
428
429 // Build a "host" dialog, framing a panel that the client fills in.
430 // The frame includes buttons to preview, apply, load and save presets, etc.
431 EffectPanel *w {};
432 ShuttleGui S{ this, eIsCreating };
433 {
434 // Make the panel for the client
435 Destroy_ptr<EffectPanel> uw{ safenew EffectPanel( S.GetParent() ) };
436 RTL_WORKAROUND(uw.get());
437
438 // Try to give the window a sensible default/minimum size
439 uw->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
440 mParent->GetSize().GetHeight() / 2));
441
442 // Let the client add things to the panel
443 ShuttleGui S1{ uw.get(), eIsCreating };
446 if (!mpEditor)
447 return false;
448
449 BuildButtonBar(S, mpEditor->IsGraphicalUI());
450
451 S.StartHorizontalLay( wxEXPAND );
452 {
453 S.Prop( 1 )
454 .Position(wxEXPAND)
455 .AddWindow((w = uw.release()));
456 }
457 S.EndHorizontalLay();
458 }
459
460 Layout();
461 Fit();
462 Center();
463
465
466 w->SetAccept(!mIsGUI);
467
468 if (!mIsGUI)
469 {
470 w->SetFocus();
471 }
472 else if (!IsOpenedFromEffectPanel())
473 {
474 mApplyBtn->SetFocus();
475 }
476
478
479 SetMinSize(GetSize());
480 return true;
481}
#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:162
@ eIsCreating
Definition: ShuttleGui.h:37
void UpdateControls()
Definition: EffectUI.cpp:1003
wxPanel * BuildButtonBar(wxWindow *parent, bool graphicalUI)
void LoadUserPresets()
Definition: EffectUI.cpp:1019
bool mEnabled
Definition: EffectUI.h:141
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:625

References BuildButtonBar(), eIsCreating, IsOpenedFromEffectPanel(), LoadUserPresets(), mApplyBtn, mClient, mEffectUIHost, mEnabled, mIsGUI, mpAccess, mParent, mpEditor, mpInstance, mpOutputs, EffectUIServices::PopulateUI(), RTL_WORKAROUND, S, safenew, and UpdateControls().

Here is the call graph for this function:

◆ InitializeInstance()

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

Definition at line 1031 of file EffectUI.cpp.

1032{
1033 // We are still constructing and the return initializes a const member
1034 std::shared_ptr<EffectInstance> result;
1035
1036 auto mpState = mwState.lock();
1037
1038 bool priorState = (mpState != nullptr);
1039 if (!priorState) {
1040 auto gAudioIO = AudioIO::Get();
1041 mCapturing = gAudioIO->IsStreamActive() && gAudioIO->GetNumCaptureChannels() > 0 && !gAudioIO->IsMonitoring();
1042 }
1043
1045 if (!priorState)
1046 mwState = mpState = mpTempProjectState =
1048 if (mpState) {
1049 // Find the right instance to connect to the dialog
1050 if (!result)
1051 result = mpState->GetInstance();
1052
1053 mpAccess2 = mpState->GetAccess();
1054 if (!(mpAccess2->IsSameAs(*mpAccess)))
1055 // Decorate the given access object
1056 mpAccess = std::make_shared<EffectSettingsAccessTee>(
1058
1059 mEffectStateSubscription = mpState->Subscribe([this](RealtimeEffectStateChange state) {
1062 });
1063 }
1064
1065 if (!priorState) {
1067 switch (event.type) {
1068 case AudioIOEvent::CAPTURE:
1069 OnCapture(event); break;
1070 default:
1071 break;
1072 }
1073 });
1074 }
1075
1076 mInitialized = true;
1077 }
1078 else
1079 result = EffectBase::FindInstance(mEffectUIHost).value_or(nullptr);
1080
1081 return result;
1082}
static PluginID GetID(EffectPlugin &effect)
Definition: EffectUI.cpp:35
RealtimeEffectStateChange
std::shared_ptr< RealtimeEffectState > AddState(AudacityProject &project, Track *pTrack, const PluginID &id)
Forwards to RealtimeEffectManager::AddState with proper init scope.
Definition: AudioIO.cpp:345
static std::optional< InstancePointer > FindInstance(EffectPlugin &plugin)
Definition: EffectBase.cpp:321
bool mCapturing
Definition: EffectUI.h:143
EffectPlugin::EffectSettingsAccessPtr mpAccess2
Definition: EffectUI.h:124
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 965 of file EffectUI.cpp.

966{
967 return (mpTempProjectState == nullptr && mSupportsRealtime);
968}

References mpTempProjectState, and mSupportsRealtime.

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

Here is the caller graph for this function:

◆ LoadUserPresets()

void EffectUIHost::LoadUserPresets ( )
private

Definition at line 1019 of file EffectUI.cpp.

1020{
1021 mUserPresets.clear();
1022
1025
1026 std::sort( mUserPresets.begin(), mUserPresets.end() );
1027
1028 return;
1029}
RegistryPath UserPresetsGroup(const RegistryPath &name)
Compute part of a registry path, given a name which may be empty.
RegistryPaths mUserPresets
Definition: EffectUI.h:129
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 540 of file EffectUI.cpp.

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

References AlwaysEnabledFlag, CurrentSettingsGroup(), EffectUI::DoEffect(), EffectTypeGenerate, EffectTypeTool, ViewInfo::Get(), MenuManager::Get(), EffectPlugin::GetDefinition(), GetID(), ComponentInterface::GetName(), EffectDefinitionInterface::GetType(), NotifyingSelectedRegion::isPoint(), EffectManager::kConfigured, mApplyBtn, mDismissed, mEffectUIHost, mIsBatch, mpAccess, mProject, MenuManager::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 623 of file EffectUI.cpp.

624{
625 DoCancel();
626 Close();
627}
void DoCancel()
Definition: EffectUI.cpp:602

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

766{
767 if (evt.on) {
768 if (evt.pProject == &mProject)
769 mCapturing = true;
770 }
771 else {
772 mCapturing = false;
773 }
775}
bool on
Definition: AudioIO.h:77
AudacityProject * pProject
Definition: AudioIO.h:71

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

948{
949 if (!IsEscapeKey(evt))
950 {
951 evt.Skip();
952 return;
953 }
954
956 Close();
957 else
958 {
959 wxCommandEvent cancelEvt { wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL };
960
961 OnCancel(cancelEvt);
962 }
963}
wxEVT_COMMAND_BUTTON_CLICKED
void OnCancel(wxCommandEvent &evt)
Definition: EffectUI.cpp:623

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

525{
526 DoCancel();
528
529 if (mpEditor)
530 mpEditor->OnClose();
531
532 Hide();
533 Destroy();
534
535#if wxDEBUG_LEVEL
536 mClosed = true;
537#endif
538}
void CleanupRealtime()
Definition: EffectUI.cpp:1084

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

Here is the call graph for this function:

◆ OnDebug()

void EffectUIHost::OnDebug ( wxCommandEvent &  evt)
private

Definition at line 629 of file EffectUI.cpp.

630{
631 OnApply(evt);
632}
void OnApply(wxCommandEvent &evt)
Definition: EffectUI.cpp:540

References OnApply().

Here is the call graph for this function:

◆ OnDefaults()

void EffectUIHost::OnDefaults ( wxCommandEvent &  evt)
private

Definition at line 929 of file EffectUI.cpp.

930{
931 mpAccess->ModifySettings([&](EffectSettings &settings){
932 // ignore failure
933 return mEffectUIHost.GetDefinition().LoadFactoryDefaults(settings)
934 .value_or(nullptr);
935 });
937 return;
938}
bool TransferDataToWindow() override
Definition: EffectUI.cpp:273

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

802{
803 auto preset = mUserPresets[evt.GetId() - kDeletePresetID];
804
805 int res = AudacityMessageBox(
806 XO("Are you sure you want to delete \"%s\"?").Format( preset ),
807 XO("Delete Preset"),
808 wxICON_QUESTION | wxYES_NO);
809 if (res == wxYES)
810 {
813 }
814
816
817 return;
818}
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
static const int kDeletePresetID
Definition: EffectUI.cpp:134
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 740 of file EffectUI.cpp.

741{
743
744 auto mpState = mwState.lock();
745 if (mpState)
746 mpState->SetActive(mEnabled);
747
749}
bool IsDown()
Definition: AButton.h:208

References AButton::IsDown(), mEnableBtn, mEnabled, mwState, and UpdateControls().

Here is the call graph for this function:

◆ OnErase()

void EffectUIHost::OnErase ( wxEraseEvent &  evt)
private

Definition at line 512 of file EffectUI.cpp.

513{
514 // Ignore it
515}

◆ OnExport()

void EffectUIHost::OnExport ( wxCommandEvent &  evt)
private

Definition at line 912 of file EffectUI.cpp.

913{
914 // may throw
915 // exceptions are handled in AudacityApp::OnExceptionInMainLoop
918
919 return;
920}
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 790 of file EffectUI.cpp.

791{
792 mpAccess->ModifySettings([&](EffectSettings &settings){
794 return mEffectUIHost.GetDefinition().LoadFactoryPreset(
795 evt.GetId() - kFactoryPresetsID, settings).value_or(nullptr);
796 });
798 return;
799}
static const int kFactoryPresetsID
Definition: EffectUI.cpp:135

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

941{
942 evt.Skip();
943 if (mpAccess)
944 mpAccess->Flush();
945}

References mpAccess.

◆ OnImport()

void EffectUIHost::OnImport ( wxCommandEvent &  evt)
private

Definition at line 900 of file EffectUI.cpp.

901{
902 mpAccess->ModifySettings([&](EffectSettings &settings){
903 // ignore failure
904 return mClient.ImportPresets(mEffectUIHost, settings).value_or(nullptr);
905 });
908
909 return;
910}
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 489 of file EffectUI.cpp.

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

References BasicUI::FindFocus().

Here is the call graph for this function:

◆ OnMenu()

void EffectUIHost::OnMenu ( wxCommandEvent &  evt)
private

Definition at line 645 of file EffectUI.cpp.

646{
647 wxMenu menu;
648 menu.Bind(wxEVT_MENU, [](auto&){}, kUserPresetsDummyID);
649 menu.Bind(wxEVT_MENU, [](auto&){}, kDeletePresetDummyID);
651
652 if (mUserPresets.size() == 0)
653 {
654 menu.Append(kUserPresetsDummyID, _("User Presets"))->Enable(false);
655 }
656 else
657 {
658 auto sub = std::make_unique<wxMenu>();
659 for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
660 {
661 sub->Append(kUserPresetsID + i, mUserPresets[i]);
662 }
663 menu.Append(0, _("User Presets"), sub.release());
664 }
665
666 menu.Append(kSaveAsID, _("Save Preset..."));
667
668 if (mUserPresets.size() == 0)
669 {
670 menu.Append(kDeletePresetDummyID, _("Delete Preset"))->Enable(false);
671 }
672 else
673 {
674 auto sub = std::make_unique<wxMenu>();
675 for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++)
676 {
677 sub->Append(kDeletePresetID + i, mUserPresets[i]);
678 }
679 menu.Append(0, _("Delete Preset"), sub.release());
680 }
681
682 menu.AppendSeparator();
683
685
686 {
687 auto sub = std::make_unique<wxMenu>();
688 sub->Append(kDefaultsID, _("Defaults"));
689 if (factory.size() > 0)
690 {
691 sub->AppendSeparator();
692 for (size_t i = 0, cnt = factory.size(); i < cnt; i++)
693 {
694 auto label = factory[i];
695 if (label.empty())
696 {
697 label = _("None");
698 }
699
700 sub->Append(kFactoryPresetsID + i, label);
701 }
702 }
703 menu.Append(0, _("Factory Presets"), sub.release());
704 }
705
706 menu.AppendSeparator();
707 menu.Append(kImportID, _("Import..."))
709 menu.Append(kExportID, _("Export..."))
711 menu.AppendSeparator();
712 menu.Append(kOptionsID, _("Options..."))
713 ->Enable(mEffectUIHost.HasOptions());
714 menu.AppendSeparator();
715
716 {
717 auto sub = std::make_unique<wxMenu>();
718
719 auto &definition = mEffectUIHost.GetDefinition();
720 sub->Append(kDummyID, wxString::Format(_("Type: %s"),
721 ::wxGetTranslation( definition.GetFamily().Translation() )));
722 sub->Append(kDummyID, wxString::Format(_("Name: %s"), definition.GetName().Translation()));
723 sub->Append(kDummyID, wxString::Format(_("Version: %s"),
724 GetVersionForDisplay(definition)));
725 sub->Append(kDummyID, wxString::Format(_("Vendor: %s"), definition.GetVendor().Translation()));
726 sub->Append(kDummyID, wxString::Format(_("Description: %s"), definition.GetDescription().Translation()));
727 sub->Bind(wxEVT_MENU, [](auto&){}, kDummyID);
728
729 menu.Append(0, _("About"), sub.release());
730 }
731
732 wxWindow *btn = FindWindow(kMenuID);
733 wxRect r = btn->GetRect();
734 BasicMenu::Handle{ &menu }.Popup(
736 { r.GetLeft(), r.GetBottom() }
737 );
738}
static const int kImportID
Definition: EffectUI.cpp:122
static const int kExportID
Definition: EffectUI.cpp:123
static const int kOptionsID
Definition: EffectUI.cpp:125
static const int kDefaultsID
Definition: EffectUI.cpp:124
static const int kDummyID
Definition: EffectUI.cpp:120
static const int kSaveAsID
Definition: EffectUI.cpp:121
static const int kUserPresetsDummyID
Definition: EffectUI.cpp:126
static const int kDeletePresetDummyID
Definition: EffectUI.cpp:127
static const int kUserPresetsID
Definition: EffectUI.cpp:133
TranslatableString label
Definition: TagsEditor.cpp:164
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:635
static RegisteredToolbarFactory factory
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.

References _, EffectPlugin::CanExportPresets(), TranslatableString::empty(), cloud::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 922 of file EffectUI.cpp.

923{
925
926 return;
927}
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 517 of file EffectUI.cpp.

518{
519 wxPaintDC dc(this);
520
521 dc.Clear();
522}

◆ OnPlay()

void EffectUIHost::OnPlay ( wxCommandEvent &  evt)
private

Definition at line 751 of file EffectUI.cpp.

752{
754 return;
755
756 auto updater = [this]{ TransferDataToWindow(); };
758 // After restoration of settings and effect state:
759 // In case any dialog control depends on mT1 or mDuration:
760 updater();
761
762 return;
763}
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 820 of file EffectUI.cpp.

821{
822 wxTextCtrl *text;
823 wxString name;
824 wxDialogWrapper dlg(this, wxID_ANY, XO("Save Preset"));
825
826 ShuttleGui S(&dlg, eIsCreating);
827
828 S.StartPanel();
829 {
830 S.StartVerticalLay(1);
831 {
832 S.StartHorizontalLay(wxALIGN_LEFT, 0);
833 {
834 text = S.AddTextBox(XXO("Preset name:"), name, 30);
835 }
836 S.EndHorizontalLay();
837 S.SetBorder(10);
838 S.AddStandardButtons();
839 }
840 S.EndVerticalLay();
841 }
842 S.EndPanel();
843
844 dlg.SetSize(dlg.GetSizer()->GetMinSize());
845 dlg.Center();
846 dlg.Fit();
847
848 while (true)
849 {
850 int rc = dlg.ShowModal();
851
852 if (rc != wxID_OK)
853 {
854 break;
855 }
856
857 name = text->GetValue();
858 if (name.empty())
859 {
861 this,
862 XO("You must specify a name"),
863 XO("Save Preset") );
864 md.Center();
865 md.ShowModal();
866 continue;
867 }
868
869 if ( make_iterator_range( mUserPresets ).contains( name ) )
870 {
872 this,
873 XO("Preset already exists.\n\nReplace?"),
874 XO("Save Preset"),
875 wxYES_NO | wxCANCEL | wxICON_EXCLAMATION );
876 md.Center();
877 int choice = md.ShowModal();
878 if (choice == wxID_CANCEL)
879 {
880 break;
881 }
882
883 if (choice == wxID_NO)
884 {
885 continue;
886 }
887 }
888
893
894 break;
895 }
896
897 return;
898}
const TranslatableString name
Definition: Distortion.cpp:76
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:448
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 777 of file EffectUI.cpp.

778{
779 int preset = evt.GetId() - kUserPresetsID;
780
781 mpAccess->ModifySettings([&](EffectSettings &settings){
782 // ignore failure
783 return mEffectUIHost.GetDefinition().LoadUserPreset(
784 UserPresetsGroup(mUserPresets[preset]), settings).value_or(nullptr);
785 });
787 return;
788}

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

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

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

286{
288 if (!wxDialogWrapper::Validate())
289 return false;
290
292 if (!wxDialogWrapper::TransferDataFromWindow())
293 return false;
294
296 if (!mpEditor->ValidateUI())
297 return false;
298
299 // Transfer-from takes non-const reference to settings
300 bool result = true;
301 mpAccess->ModifySettings([&](EffectSettings &settings){
302 const auto pServices =
304 // Allow other transfers, and reassignment of settings
305 result = (!pServices || pServices->TransferDataFromWindow(settings));
306 if (result) {
307 auto &definition = mEffectUIHost.GetDefinition();
308 if (definition.GetType() == EffectTypeGenerate) {
309 const auto seconds = settings.extra.GetDuration();
310 // Updating of the last-used generator duration in the config
313 seconds);
314 }
315 }
316 return nullptr;
317 });
318 mpAccess->Flush();
319 return result;
320}
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 273 of file EffectUI.cpp.

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

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

1004{
1005 if (mIsBatch)
1006 {
1007 return;
1008 }
1009
1011 {
1013 return;
1014 }
1015
1016 mApplyBtn->Enable(!mCapturing);
1017}
void PushDown()
Definition: AButton.cpp:577
void PopUp()
Definition: AButton.cpp:585

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 135 of file EffectUI.h.

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

◆ mAudioIOSubscription

Observer::Subscription EffectUIHost::mAudioIOSubscription
private

Definition at line 115 of file EffectUI.h.

Referenced by CleanupRealtime(), and InitializeInstance().

◆ mCapturing

bool EffectUIHost::mCapturing {}
private

Definition at line 143 of file EffectUI.h.

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

◆ mClient

EffectUIServices& EffectUIHost::mClient
private

Definition at line 120 of file EffectUI.h.

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

◆ mDebugBtn

wxButton* EffectUIHost::mDebugBtn {}
private

Definition at line 138 of file EffectUI.h.

Referenced by BuildButtonBar().

◆ mDismissed

bool EffectUIHost::mDismissed {}
private

Definition at line 148 of file EffectUI.h.

Referenced by DoCancel(), and OnApply().

◆ mEffectStateSubscription

Observer::Subscription EffectUIHost::mEffectStateSubscription
private

Definition at line 115 of file EffectUI.h.

Referenced by CleanupRealtime(), and InitializeInstance().

◆ mEffectUIHost

EffectBase& EffectUIHost::mEffectUIHost
private

◆ mEnableBtn

AButton* EffectUIHost::mEnableBtn {}
private

Definition at line 137 of file EffectUI.h.

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

◆ mEnabled

bool EffectUIHost::mEnabled { true }
private

Definition at line 141 of file EffectUI.h.

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

◆ mHadPriorState

const bool EffectUIHost::mHadPriorState
private

Definition at line 149 of file EffectUI.h.

Referenced by DoCancel().

◆ mInitialized

bool EffectUIHost::mInitialized { false }
private

Definition at line 130 of file EffectUI.h.

Referenced by CleanupRealtime(), and InitializeInstance().

◆ mIsBatch

bool EffectUIHost::mIsBatch {}
private

Definition at line 133 of file EffectUI.h.

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

◆ mIsGUI

bool EffectUIHost::mIsGUI {}
private

Definition at line 132 of file EffectUI.h.

Referenced by BuildButtonBar(), and Initialize().

◆ mMenuBtn

wxButton* EffectUIHost::mMenuBtn {}
private

Definition at line 136 of file EffectUI.h.

Referenced by BuildButtonBar().

◆ mpAccess

EffectPlugin::EffectSettingsAccessPtr EffectUIHost::mpAccess
private

◆ mpAccess2

EffectPlugin::EffectSettingsAccessPtr EffectUIHost::mpAccess2
private

Definition at line 124 of file EffectUI.h.

Referenced by InitializeInstance().

◆ mParent

wxWindow* const EffectUIHost::mParent
private

Definition at line 118 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 122 of file EffectUI.h.

◆ mpInstance

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

Definition at line 156 of file EffectUI.h.

Referenced by EffectUIHost(), and Initialize().

◆ mPlayPos

double EffectUIHost::mPlayPos { 0.0 }
private

Definition at line 146 of file EffectUI.h.

◆ mPlayToggleBtn

wxButton* EffectUIHost::mPlayToggleBtn {}
private

Definition at line 139 of file EffectUI.h.

Referenced by BuildButtonBar().

◆ mpOutputs

const EffectOutputs* const EffectUIHost::mpOutputs
private

Definition at line 157 of file EffectUI.h.

Referenced by Initialize().

◆ mProject

AudacityProject& EffectUIHost::mProject
private

Definition at line 117 of file EffectUI.h.

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

◆ mpTempProjectState

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

Definition at line 127 of file EffectUI.h.

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

◆ mRegion

SelectedRegion EffectUIHost::mRegion
private

Definition at line 145 of file EffectUI.h.

◆ mSupportsRealtime

const bool EffectUIHost::mSupportsRealtime
private

Definition at line 131 of file EffectUI.h.

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

◆ mUserPresets

RegistryPaths EffectUIHost::mUserPresets
private

Definition at line 129 of file EffectUI.h.

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

◆ mwState

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

Definition at line 125 of file EffectUI.h.

Referenced by InitializeInstance(), and OnEnable().


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