Audacity  3.0.3
Public Member Functions | Private Attributes | List of all members
AudioUnitEffectOptionsDialog Class Referencefinal
Inheritance diagram for AudioUnitEffectOptionsDialog:
[legend]
Collaboration diagram for AudioUnitEffectOptionsDialog:
[legend]

Public Member Functions

 AudioUnitEffectOptionsDialog (wxWindow *parent, EffectHostInterface *host)
 
virtual ~AudioUnitEffectOptionsDialog ()
 
void PopulateOrExchange (ShuttleGui &S)
 
void OnOk (wxCommandEvent &evt)
 
- 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
 

Private Attributes

EffectHostInterfacemHost
 
bool mUseLatency
 
TranslatableString mUIType
 

Detailed Description

Definition at line 498 of file AudioUnitEffect.cpp.

Constructor & Destructor Documentation

◆ AudioUnitEffectOptionsDialog()

AudioUnitEffectOptionsDialog::AudioUnitEffectOptionsDialog ( wxWindow *  parent,
EffectHostInterface host 
)

Definition at line 521 of file AudioUnitEffect.cpp.

522 : wxDialogWrapper(parent, wxID_ANY, XO("Audio Unit Effect Options"))
523 {
524  mHost = host;
525 
526  mHost->GetSharedConfig(wxT("Options"), wxT("UseLatency"), mUseLatency, true);
527 
528  // Expect one of three string values from the config file
529  wxString uiType;
530  mHost->GetSharedConfig(wxT("Options"), wxT("UIType"), uiType, wxT("Full"));
531 
532  // Get the localization of the string for display to the user
533  mUIType = TranslatableString{ uiType, {} };
534 
535  ShuttleGui S(this, eIsCreating);
537 }

References eIsCreating.

◆ ~AudioUnitEffectOptionsDialog()

AudioUnitEffectOptionsDialog::~AudioUnitEffectOptionsDialog ( )
virtual

Definition at line 539 of file AudioUnitEffect.cpp.

540 {
541 }

Member Function Documentation

◆ OnOk()

void AudioUnitEffectOptionsDialog::OnOk ( wxCommandEvent &  evt)

Definition at line 608 of file AudioUnitEffect.cpp.

609 {
610  if (!Validate())
611  {
612  return;
613  }
614 
617 
618  // un-translate the type
619  auto uiType = mUIType.MSGID().GET();
620 
621  mHost->SetSharedConfig(wxT("Options"), wxT("UseLatency"), mUseLatency);
622  mHost->SetSharedConfig(wxT("Options"), wxT("UIType"), uiType);
623 
624  EndModal(wxID_OK);
625 }

References eIsGettingFromDialog, Identifier::GET(), mHost, TranslatableString::MSGID(), mUIType, mUseLatency, PopulateOrExchange(), and ConfigClientInterface::SetSharedConfig().

Here is the call graph for this function:

◆ PopulateOrExchange()

void AudioUnitEffectOptionsDialog::PopulateOrExchange ( ShuttleGui S)

Definition at line 543 of file AudioUnitEffect.cpp.

544 {
545 
546  S.SetBorder(5);
547  S.StartHorizontalLay(wxEXPAND, 1);
548  {
549  S.StartVerticalLay(false);
550  {
551  S.StartStatic(XO("Latency Compensation"));
552  {
554 "As part of their processing, some Audio Unit effects must delay returning "
555 "audio to Audacity. When not compensating for this delay, you will "
556 "notice that small silences have been inserted into the audio. "
557 "Enabling this option will provide that compensation, but it may "
558 "not work for all Audio Unit effects."),
559  false, 0, 650);
560 
561  S.StartHorizontalLay(wxALIGN_LEFT);
562  {
563  S.TieCheckBox(XXO("Enable &compensation"),
564  mUseLatency);
565  }
566  S.EndHorizontalLay();
567  }
568  S.EndStatic();
569 
570  S.StartStatic(XO("User Interface"));
571  {
573 "Select \"Full\" to use the graphical interface if supplied by the Audio Unit."
574 " Select \"Generic\" to use the system supplied generic interface."
575 #if defined(HAVE_AUDIOUNIT_BASIC_SUPPORT)
576 " Select \"Basic\" for a basic text-only interface."
577 #endif
578 " Reopen the effect for this to take effect."),
579  false, 0, 650);
580 
581  S.StartHorizontalLay(wxALIGN_LEFT);
582  {
583  S.TieChoice(XXO("Select &interface"),
584  mUIType,
585  {
586  XO("Full"),
587  XO("Generic"),
588 #if defined(HAVE_AUDIOUNIT_BASIC_SUPPORT)
589  XO("Basic")
590 #endif
591  });
592  }
593  S.EndHorizontalLay();
594  }
595  S.EndStatic();
596  }
597  S.EndVerticalLay();
598  }
599  S.EndHorizontalLay();
600 
601  S.AddStandardButtons();
602 
603  Layout();
604  Fit();
605  Center();
606 }

References ShuttleGui::AddStandardButtons(), ShuttleGuiBase::AddVariableText(), ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndStatic(), ShuttleGuiBase::EndVerticalLay(), mUIType, mUseLatency, ShuttleGuiBase::SetBorder(), ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartStatic(), ShuttleGuiBase::StartVerticalLay(), ShuttleGuiBase::TieCheckBox(), ShuttleGuiBase::TieChoice(), XO, and XXO.

Referenced by OnOk().

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

Member Data Documentation

◆ mHost

EffectHostInterface* AudioUnitEffectOptionsDialog::mHost
private

Definition at line 509 of file AudioUnitEffect.cpp.

Referenced by OnOk().

◆ mUIType

TranslatableString AudioUnitEffectOptionsDialog::mUIType
private

Definition at line 512 of file AudioUnitEffect.cpp.

Referenced by OnOk(), and PopulateOrExchange().

◆ mUseLatency

bool AudioUnitEffectOptionsDialog::mUseLatency
private

Definition at line 511 of file AudioUnitEffect.cpp.

Referenced by OnOk(), and PopulateOrExchange().


The documentation for this class was generated from the following file:
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
eIsGettingFromDialog
@ eIsGettingFromDialog
Definition: ShuttleGui.h:39
AudioUnitEffectOptionsDialog::mUseLatency
bool mUseLatency
Definition: AudioUnitEffect.cpp:511
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
XO
#define XO(s)
Definition: Internat.h:31
AudioUnitEffectOptionsDialog::mUIType
TranslatableString mUIType
Definition: AudioUnitEffect.cpp:512
AudioUnitEffectOptionsDialog::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: AudioUnitEffect.cpp:543
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1177
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1167
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
ConfigClientInterface::GetSharedConfig
virtual bool GetSharedConfig(const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval)=0
Identifier::GET
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:893
ConfigClientInterface::SetSharedConfig
virtual bool SetSharedConfig(const RegistryPath &group, const RegistryPath &key, const wxString &value)=0
AudioUnitEffectOptionsDialog::mHost
EffectHostInterface * mHost
Definition: AudioUnitEffect.cpp:509
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
TranslatableString::MSGID
Identifier MSGID() const
MSGID is the English lookup key in the catalog, not necessarily for user's eyes if locale is some oth...
Definition: TranslatableString.cpp:17
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2444
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
ShuttleGuiBase::AddVariableText
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Definition: ShuttleGui.cpp:463
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:922
ShuttleGuiBase::TieChoice
wxChoice * TieChoice(const TranslatableString &Prompt, TranslatableString &Selected, const TranslatableStrings &choices)
Definition: ShuttleGui.cpp:1727
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631