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

#include <LV2PreferencesDialog.h>

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

Public Member Functions

 LV2PreferencesDialog (const EffectDefinitionInterface &effect)
 
virtual ~LV2PreferencesDialog ()
 
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

const EffectDefinitionInterfacemEffect
 
int mBufferSize {}
 
bool mUseLatency {}
 
bool mUseGUI {}
 

Detailed Description

Definition at line 34 of file LV2PreferencesDialog.h.

Constructor & Destructor Documentation

◆ LV2PreferencesDialog()

LV2PreferencesDialog::LV2PreferencesDialog ( const EffectDefinitionInterface effect)
explicit

Definition at line 34 of file LV2PreferencesDialog.cpp.

36 : wxDialogWrapper{ nullptr, wxID_ANY, XO("LV2 Effect Settings") }
37 , mEffect{ effect }
38{
39 using namespace LV2Preferences;
45}
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:37
#define S(N)
Definition: ToChars.cpp:64
const EffectDefinitionInterface & mEffect
void PopulateOrExchange(ShuttleGui &S)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
LV2_API bool GetUseGUI(const EffectDefinitionInterface &effect, bool &useGUI)
LV2_API bool GetUseLatency(const EffectDefinitionInterface &effect, bool &useLatency)
LV2_API bool GetBufferSize(const EffectDefinitionInterface &effect, int &bufferSize)

References XO().

Here is the call graph for this function:

◆ ~LV2PreferencesDialog()

LV2PreferencesDialog::~LV2PreferencesDialog ( )
virtualdefault

Member Function Documentation

◆ OnOk()

void LV2PreferencesDialog::OnOk ( wxCommandEvent &  evt)

Definition at line 130 of file LV2PreferencesDialog.cpp.

131{
132 if (!Validate())
133 {
134 return;
135 }
136
139
140 using namespace LV2Preferences;
144
145 EndModal(wxID_OK);
146}
@ eIsGettingFromDialog
Definition: ShuttleGui.h:38
LV2_API bool SetBufferSize(const EffectDefinitionInterface &effect, int bufferSize)
LV2_API bool SetUseLatency(const EffectDefinitionInterface &effect, bool useLatency)
LV2_API bool SetUseGUI(const EffectDefinitionInterface &effect, bool useGUI)

References eIsGettingFromDialog, mBufferSize, mEffect, mUseGUI, mUseLatency, PopulateOrExchange(), S, LV2Preferences::SetBufferSize(), LV2Preferences::SetUseGUI(), and LV2Preferences::SetUseLatency().

Here is the call graph for this function:

◆ PopulateOrExchange()

void LV2PreferencesDialog::PopulateOrExchange ( ShuttleGui S)

Definition at line 49 of file LV2PreferencesDialog.cpp.

50{
51 S.SetBorder(5);
52 S.StartHorizontalLay(wxEXPAND, 1);
53 {
54 S.StartVerticalLay(false);
55 {
56 // This really shouldn't be required for LV2 plugins because they have the ability
57 // to specify their exact requirements in the TTL file and/or to check the host
58 // supplied min/max values. However, I've run across one (Harrison Consoles XT-EQ)
59 // that crashed on sizes greater than 8192.
60 S.StartStatic(XO("Buffer Size"));
61 {
62 IntegerValidator<int> vld(&mBufferSize);
63 vld.SetRange(8, LV2Preferences::DEFAULT_BLOCKSIZE);
64
65 S.AddVariableText( XO(
66"The buffer size controls the number of samples sent to the effect "
67"on each iteration. Smaller values will cause slower processing and "
68"some effects require 8192 samples or less to work properly. However "
69"most effects can accept large buffers and using them will greatly "
70"reduce processing time."),
71 false, 0, 650);
72
73 S.StartHorizontalLay(wxALIGN_LEFT);
74 {
75 wxTextCtrl *t;
76 t = S.TieNumericTextBox(
77 XXO("&Buffer Size (8 to %d) samples:")
80 12);
81 t->SetMinSize(wxSize(100, -1));
82 t->SetValidator(vld);
83 }
84 S.EndHorizontalLay();
85 }
86 S.EndStatic();
87
88 S.StartStatic(XO("Latency Compensation"));
89 {
90 S.AddVariableText( XO(
91"As part of their processing, some LV2 effects must delay returning "
92"audio to Audacity. When not compensating for this delay, you will "
93"notice that small silences have been inserted into the audio. "
94"Enabling this setting will provide that compensation, but it may "
95"not work for all LV2 effects."),
96 false, 0, 650);
97
98 S.StartHorizontalLay(wxALIGN_LEFT);
99 {
100 S.TieCheckBox(XXO("Enable &compensation"),
102 }
103 S.EndHorizontalLay();
104 }
105 S.EndStatic();
106
107 S.StartStatic(XO("Graphical Mode"));
108 {
109 S.AddVariableText( XO(
110"LV2 effects can have a graphical interface for setting parameter values."
111" A basic text-only method is also available. "
112" Reopen the effect for this to take effect."),
113 false, 0, 650);
114 S.TieCheckBox(XXO("Enable &graphical interface"),
115 mUseGUI);
116 }
117 S.EndStatic();
118 }
119 S.EndVerticalLay();
120 }
121 S.EndHorizontalLay();
122
123 S.AddStandardButtons();
124
125 Layout();
126 Fit();
127 Center();
128}
XXO("&Cut/Copy/Paste Toolbar")
Abstract base class used in importing a file.
constexpr auto DEFAULT_BLOCKSIZE
Maximum block size in number of samples (not bytes)

References LV2Preferences::DEFAULT_BLOCKSIZE, mBufferSize, mUseGUI, mUseLatency, S, 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

◆ mBufferSize

int LV2PreferencesDialog::mBufferSize {}
private

Definition at line 46 of file LV2PreferencesDialog.h.

Referenced by OnOk(), and PopulateOrExchange().

◆ mEffect

const EffectDefinitionInterface& LV2PreferencesDialog::mEffect
private

Definition at line 45 of file LV2PreferencesDialog.h.

Referenced by OnOk().

◆ mUseGUI

bool LV2PreferencesDialog::mUseGUI {}
private

Definition at line 48 of file LV2PreferencesDialog.h.

Referenced by OnOk(), and PopulateOrExchange().

◆ mUseLatency

bool LV2PreferencesDialog::mUseLatency {}
private

Definition at line 47 of file LV2PreferencesDialog.h.

Referenced by OnOk(), and PopulateOrExchange().


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