Audacity  3.0.3
ImportExportPrefs.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  ImportExportPrefs.cpp
6 
7  Joshua Haberman
8  Dominic Mazzoni
9  James Crook
10 
11 *******************************************************************//*******************************************************************/
17 
18 
19 #include "ImportExportPrefs.h"
20 
21 #include <wx/defs.h>
22 
23 #include "../Prefs.h"
24 #include "../ShuttleGui.h"
25 
26 ImportExportPrefs::ImportExportPrefs(wxWindow * parent, wxWindowID winid)
27 : PrefsPanel(parent, winid, XO("Import / Export"))
28 {
29  Populate();
30 }
31 
33 {
34 }
35 
37 {
39 }
40 
42 {
43  return XO("Preferences for ImportExport");
44 }
45 
47 {
48  return "Import_-_Export_Preferences";
49 }
50 
53 {
54  //------------------------- Main section --------------------
55  // Now construct the GUI itself.
56  // Use 'eIsCreatingFromPrefs' so that the GUI is
57  // initialised with values from gPrefs.
60  // ----------------------- End of main section --------------
61 }
62 
64  wxT("/FileFormats/ExportDownMixChoice"),
65  {
66  EnumValueSymbol{ wxT("MixDown"), XXO("&Mix down to Stereo or Mono") },
67  EnumValueSymbol{ wxT("Custom"), XXO("&Use Advanced Mixing Options") },
68  },
69  0, // true
70 
71  // for migrating old preferences:
72  {
73  true, false,
74  },
75  wxT("/FileFormats/ExportDownMix"),
76 };
77 
79  wxT("/FileFormats/LabelStyleChoice"),
80  {
81  EnumValueSymbol{ wxT("Standard"), XXO("S&tandard") },
82  EnumValueSymbol{ wxT("Extended"), XXO("E&xtended (with frequency ranges)") },
83  },
84  0, // true
85 
86  {
87  true, false,
88  },
89 };
90 
92  wxT("/FileFormats/AllegroStyleChoice"),
93  {
94  EnumValueSymbol{ wxT("Seconds"), XXO("&Seconds") },
95  EnumValueSymbol{ wxT("Beats"), XXO("&Beats") },
96  },
97  0, // true
98 
99  // for migrating old preferences:
100  {
101  true, false,
102  },
103  wxT("/FileFormats/AllegroStyle"),
104 };
105 
107 {
108  S.SetBorder(2);
109  S.StartScroller();
110 
111  S.StartStatic(XO("When exporting tracks to an audio file"));
112  {
113  // Bug 2692: Place button group in panel so tabbing will work and,
114  // on the Mac, VoiceOver will announce as radio buttons.
115  S.StartPanel();
116  {
118  {
119  S.TieRadioButton();
120  S.TieRadioButton();
121  }
123  }
124  S.EndPanel();
125 
126  S.TieCheckBox(XXO("S&how Metadata Tags editor before export"),
127  {wxT("/AudioFiles/ShowId3Dialog"),
128  true});
129  /* i18n-hint 'blank space' is space on the tracks with no audio in it*/
130  S.TieCheckBox(XXO("&Ignore blank space at the beginning"),
131  {wxT("/AudioFiles/SkipSilenceAtBeginning"),
132  false});
133  }
134  S.EndStatic();
135 
136  S.StartStatic(XO("Exported Label Style:"));
137  {
138  // Bug 2692: Place button group in panel so tabbing will work and,
139  // on the Mac, VoiceOver will announce as radio buttons.
140  S.StartPanel();
141  {
143  {
144  S.TieRadioButton();
145  S.TieRadioButton();
146  }
148  }
149  S.EndPanel();
150  }
151  S.EndStatic();
152 
153 #ifdef USE_MIDI
154  S.StartStatic(XO("Exported Allegro (.gro) files save time as:"));
155  {
156  // Bug 2692: Place button group in panel so tabbing will work and,
157  // on the Mac, VoiceOver will announce as radio buttons.
158  S.StartPanel();
159  {
161  {
162  S.TieRadioButton();
163  S.TieRadioButton();
164  }
166  }
167  S.EndPanel();
168  }
169  S.EndStatic();
170 #endif
171  S.EndScroller();
172 }
173 
175 {
176  ShuttleGui S(this, eIsSavingToPrefs);
178 
179  return true;
180 }
181 
182 namespace{
184  [](wxWindow *parent, wxWindowID winid, AudacityProject *)
185  {
186  wxASSERT(parent); // to justify safenew
187  return safenew ImportExportPrefs(parent, winid);
188  }
189 };
190 }
ImportExportPrefs
A PrefsPanel used to select import and export options.
Definition: ImportExportPrefs.h:27
ShuttleGuiBase::StartRadioButtonGroup
void StartRadioButtonGroup(const ChoiceSetting &Setting)
Call this before any TieRadioButton calls.
Definition: ShuttleGui.cpp:1569
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
ShuttleGuiBase::EndRadioButtonGroup
void EndRadioButtonGroup()
Definition: ShuttleGui.cpp:1586
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1603
ImportExportPrefs::ExportDownMixSetting
static EnumSetting< bool > ExportDownMixSetting
Definition: ImportExportPrefs.h:29
PrefsPanel::Registration
Definition: PrefsPanel.h:84
XO
#define XO(s)
Definition: Internat.h:31
ShuttleGuiBase::StartPanel
wxPanel * StartPanel(int iStyle=0)
Definition: ShuttleGui.cpp:983
ShuttleGuiBase::EndPanel
void EndPanel()
Definition: ShuttleGui.cpp:1011
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterface.h:61
ShuttleGuiBase::EndScroller
void EndScroller()
Definition: ShuttleGui.cpp:964
ImportExportPrefs::AllegroStyleSetting
static EnumSetting< bool > AllegroStyleSetting
Definition: ImportExportPrefs.h:31
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::StartScroller
wxScrolledWindow * StartScroller(int iStyle=0)
Definition: ShuttleGui.cpp:931
ImportExportPrefs::ImportExportPrefs
ImportExportPrefs(wxWindow *parent, wxWindowID winid)
Definition: ImportExportPrefs.cpp:26
ImportExportPrefs::GetDescription
TranslatableString GetDescription() override
Definition: ImportExportPrefs.cpp:41
ImportExportPrefs.h
ImportExportPrefs::Commit
bool Commit() override
Definition: ImportExportPrefs.cpp:174
ImportExportPrefs::HelpPageName
wxString HelpPageName() override
Definition: ImportExportPrefs.cpp:46
ImportExportPrefs::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: ImportExportPrefs.cpp:106
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:886
eIsSavingToPrefs
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:112
ImportExportPrefs::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: ImportExportPrefs.cpp:36
ImportExportPrefs::~ImportExportPrefs
~ImportExportPrefs()
Definition: ImportExportPrefs.cpp:32
EnumSetting< bool >
IMPORT_EXPORT_PREFS_PLUGIN_SYMBOL
#define IMPORT_EXPORT_PREFS_PLUGIN_SYMBOL
Definition: ImportExportPrefs.h:22
ShuttleGuiBase::TieRadioButton
wxRadioButton * TieRadioButton()
This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair.
Definition: ShuttleGui.cpp:1510
PrefsPanel
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Definition: PrefsPanel.h:51
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:484
eIsCreatingFromPrefs
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:46
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:915
safenew
#define safenew
Definition: MemoryX.h:10
ImportExportPrefs::LabelStyleSetting
static EnumSetting< bool > LabelStyleSetting
Definition: ImportExportPrefs.h:30
ImportExportPrefs::Populate
void Populate()
Creates the dialog and its contents.
Definition: ImportExportPrefs.cpp:52
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:625
anonymous_namespace{ImportExportPrefs.cpp}::sAttachment
PrefsPanel::Registration sAttachment
Definition: ImportExportPrefs.cpp:183