Audacity 3.2.0
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
ImportExportPrefs Class Referencefinal

A PrefsPanel used to select import and export options. More...

#include <ImportExportPrefs.h>

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

Classes

struct  PopulatorItem
 
struct  RegisteredControls
 
struct  Traits
 

Public Types

using Populator = std::function< void(ShuttleGui &)>
 Type of function that adds to the Import/Export preference page. More...
 
- Public Types inherited from PrefsPanel
using Factories = std::vector< PrefsPanel::PrefsNode >
 
using Factory = std::function< PrefsPanel *(wxWindow *parent, wxWindowID winid, AudacityProject *) >
 

Public Member Functions

 ImportExportPrefs (wxWindow *parent, wxWindowID winid)
 
 ~ImportExportPrefs ()
 
ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
bool Commit () override
 
ManualPageID HelpPageName () override
 If not empty string, the Help button is added below the panel. More...
 
void PopulateOrExchange (ShuttleGui &S) override
 
- Public Member Functions inherited from PrefsPanel
 PrefsPanel (wxWindow *parent, wxWindowID winid, const TranslatableString &title)
 
virtual ~PrefsPanel ()
 
virtual void Preview ()
 
virtual bool Commit ()=0
 
virtual PluginPath GetPath () const override
 
virtual VendorSymbol GetVendor () const override
 
virtual wxString GetVersion () const override
 
virtual bool ShowsPreviewButton ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual ManualPageID HelpPageName ()
 If not empty string, the Help button is added below the panel. More...
 
virtual void Cancel ()
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
void SetLabel (const TranslatableString &label)
 
void SetName (const TranslatableString &name)
 
void SetToolTip (const TranslatableString &toolTip)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Static Public Attributes

static EnumSetting< bool > MusicFileImportSetting
 

Private Member Functions

void Populate ()
 Creates the dialog and its contents. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PrefsPanel
static FactoriesDefaultFactories ()
 

Detailed Description

A PrefsPanel used to select import and export options.

Definition at line 26 of file ImportExportPrefs.h.

Member Typedef Documentation

◆ Populator

using ImportExportPrefs::Populator = std::function<void(ShuttleGui&)>

Type of function that adds to the Import/Export preference page.

Definition at line 32 of file ImportExportPrefs.h.

Constructor & Destructor Documentation

◆ ImportExportPrefs()

ImportExportPrefs::ImportExportPrefs ( wxWindow *  parent,
wxWindowID  winid 
)

Definition at line 59 of file ImportExportPrefs.cpp.

60: PrefsPanel(parent, winid, XO("Import / Export"))
61{
62 Populate();
63}
XO("Cut/Copy/Paste")
void Populate()
Creates the dialog and its contents.
PrefsPanel(wxWindow *parent, wxWindowID winid, const TranslatableString &title)
Definition: PrefsPanel.h:94

References Populate().

Here is the call graph for this function:

◆ ~ImportExportPrefs()

ImportExportPrefs::~ImportExportPrefs ( )

Definition at line 65 of file ImportExportPrefs.cpp.

66{
67}

Member Function Documentation

◆ Commit()

bool ImportExportPrefs::Commit ( )
overridevirtual

Implements PrefsPanel.

Definition at line 165 of file ImportExportPrefs.cpp.

166{
169
170 return true;
171}
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
#define S(N)
Definition: ToChars.cpp:64
void PopulateOrExchange(ShuttleGui &S) override
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640

References eIsSavingToPrefs, PopulateOrExchange(), and S.

Here is the call graph for this function:

◆ GetDescription()

TranslatableString ImportExportPrefs::GetDescription ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 74 of file ImportExportPrefs.cpp.

75{
76 return XO("Preferences for ImportExport");
77}

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol ImportExportPrefs::GetSymbol ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 69 of file ImportExportPrefs.cpp.

70{
72}
#define IMPORT_EXPORT_PREFS_PLUGIN_SYMBOL

References IMPORT_EXPORT_PREFS_PLUGIN_SYMBOL.

◆ HelpPageName()

ManualPageID ImportExportPrefs::HelpPageName ( )
overridevirtual

If not empty string, the Help button is added below the panel.

Default returns empty string.

Reimplemented from PrefsPanel.

Definition at line 79 of file ImportExportPrefs.cpp.

80{
81 return "Import_-_Export_Preferences";
82}

◆ Populate()

void ImportExportPrefs::Populate ( )
private

Creates the dialog and its contents.

Definition at line 85 of file ImportExportPrefs.cpp.

86{
87 //------------------------- Main section --------------------
88 // Now construct the GUI itself.
89 // Use 'eIsCreatingFromPrefs' so that the GUI is
90 // initialised with values from gPrefs.
93 // ----------------------- End of main section --------------
94}
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:46

References eIsCreatingFromPrefs, PopulateOrExchange(), and S.

Referenced by ImportExportPrefs().

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

◆ PopulateOrExchange()

void ImportExportPrefs::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 112 of file ImportExportPrefs.cpp.

113{
114 S.SetBorder(2);
115 S.StartScroller();
116
117 // Add registered controls
118 using namespace Registry;
120 PathStart,
121 { {wxT(""), wxT("LabelStyle,AllegroTimeOption") } },
122 };
123
124 // visit the registry to collect the plug-ins properly
125 // sorted
128 [&](const PopulatorItem &item, auto &) { item.mPopulator(S); },
129 &top, &PopulatorItem::Registry());
130
131
132 auto musicImportsBox = S.StartStatic(XO("Music Imports"));
133 {
134 const auto header = S.AddVariableText(
135 XO("When Audacity detects music in file imported on empty project"));
136#if wxUSE_ACCESSIBILITY
137 if (musicImportsBox != nullptr)
138 {
139 musicImportsBox->SetName(header->GetLabel());
140 safenew WindowAccessible(musicImportsBox);
141 }
142#endif
143#if defined(__WXMAC__)
144 // see https://bugzilla.audacityteam.org/show_bug.cgi?id=2692
145 S.StartPanel();
146#endif
147 {
148 S.StartRadioButtonGroup(ImportExportPrefs::MusicFileImportSetting);
149 {
150 S.TieRadioButton();
151 S.TieRadioButton();
152 S.TieRadioButton();
153 }
154 S.EndRadioButtonGroup();
155 }
156#if defined(__WXMAC__)
157 S.EndPanel();
158#endif
159 }
160 S.EndStatic();
161
162 S.EndScroller();
163}
wxT("CloseDown"))
static const auto PathStart
#define safenew
Definition: MemoryX.h:10
static EnumSetting< bool > MusicFileImportSetting
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
void Visit(const Visitors &visitors, const GroupItem< RegistryTraits > *pTopItem, const GroupItem< RegistryTraits > *pRegistry={}, typename RegistryTraits::ComputedItemContextType &computedItemContext=RegistryTraits::ComputedItemContextType::Instance)
Definition: Registry.h:609
static Registry::GroupItem< Traits > & Registry()

References ImportExportPrefs::PopulatorItem::mPopulator, MusicFileImportSetting, PathStart, ImportExportPrefs::PopulatorItem::Registry(), S, safenew, Registry::Visit(), wxT(), and XO().

Referenced by Commit(), and Populate().

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

Member Data Documentation

◆ MusicFileImportSetting

EnumSetting< bool > ImportExportPrefs::MusicFileImportSetting
static
Initial value:
{
wxT("/FileFormats/MusicFileImportSettingChoice"),
{
wxT("Yes"),
XXO(
"S&witch view to Beats and Measures and align with musical grid") },
EnumValueSymbol { wxT("Ask"), XXO("&Ask me each time") },
EnumValueSymbol { wxT("No"), XXO("Do &nothing") },
},
1,
{ false, true, false },
wxT("/FileFormats/MusicFileImportSetting"),
}
XXO("&Cut/Copy/Paste Toolbar")
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...

Definition at line 48 of file ImportExportPrefs.h.

Referenced by PopulateOrExchange(), and AudacityMirProject::ShouldBeReconfigured().


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