forked from audacity/audacity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImportExportPrefs.cpp
More file actions
190 lines (161 loc) · 4.74 KB
/
Copy pathImportExportPrefs.cpp
File metadata and controls
190 lines (161 loc) · 4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/**********************************************************************
Audacity: A Digital Audio Editor
ImportExportPrefs.cpp
Joshua Haberman
Dominic Mazzoni
James Crook
*******************************************************************//**
\class ImportExportPrefs
\brief A PrefsPanel used to select import and export options.
*//*******************************************************************/
#include "../Audacity.h" // for USE_* macros
#include "ImportExportPrefs.h"
#include <wx/defs.h>
#include "../Prefs.h"
#include "../ShuttleGui.h"
ImportExportPrefs::ImportExportPrefs(wxWindow * parent, wxWindowID winid)
: PrefsPanel(parent, winid, XO("Import / Export"))
{
Populate();
}
ImportExportPrefs::~ImportExportPrefs()
{
}
ComponentInterfaceSymbol ImportExportPrefs::GetSymbol()
{
return IMPORT_EXPORT_PREFS_PLUGIN_SYMBOL;
}
TranslatableString ImportExportPrefs::GetDescription()
{
return XO("Preferences for ImportExport");
}
wxString ImportExportPrefs::HelpPageName()
{
return "Import_-_Export_Preferences";
}
/// Creates the dialog and its contents.
void ImportExportPrefs::Populate()
{
//------------------------- Main section --------------------
// Now construct the GUI itself.
// Use 'eIsCreatingFromPrefs' so that the GUI is
// initialised with values from gPrefs.
ShuttleGui S(this, eIsCreatingFromPrefs);
PopulateOrExchange(S);
// ----------------------- End of main section --------------
}
EnumSetting< bool > ImportExportPrefs::ExportDownMixSetting{
wxT("/FileFormats/ExportDownMixChoice"),
{
EnumValueSymbol{ wxT("MixDown"), XXO("&Mix down to Stereo or Mono") },
EnumValueSymbol{ wxT("Custom"), XXO("&Use Advanced Mixing Options") },
},
0, // true
// for migrating old preferences:
{
true, false,
},
wxT("/FileFormats/ExportDownMix"),
};
EnumSetting< bool > ImportExportPrefs::LabelStyleSetting{
wxT("/FileFormats/LabelStyleChoice"),
{
EnumValueSymbol{ wxT("Standard"), XXO("S&tandard") },
EnumValueSymbol{ wxT("Extended"), XXO("E&xtended (with frequency ranges)") },
},
0, // true
{
true, false,
},
};
EnumSetting< bool > ImportExportPrefs::AllegroStyleSetting{
wxT("/FileFormats/AllegroStyleChoice"),
{
EnumValueSymbol{ wxT("Seconds"), XXO("&Seconds") },
EnumValueSymbol{ wxT("Beats"), XXO("&Beats") },
},
0, // true
// for migrating old preferences:
{
true, false,
},
wxT("/FileFormats/AllegroStyle"),
};
void ImportExportPrefs::PopulateOrExchange(ShuttleGui & S)
{
S.SetBorder(2);
S.StartScroller();
S.StartStatic(XO("When exporting tracks to an audio file"));
{
// Bug 2692: Place button group in panel so tabbing will work and,
// on the Mac, VoiceOver will announce as radio buttons.
S.StartPanel();
{
S.StartRadioButtonGroup(ImportExportPrefs::ExportDownMixSetting);
{
S.TieRadioButton();
S.TieRadioButton();
}
S.EndRadioButtonGroup();
}
S.EndPanel();
S.TieCheckBox(XXO("S&how Metadata Tags editor before export"),
{wxT("/AudioFiles/ShowId3Dialog"),
true});
/* i18n-hint 'blank space' is space on the tracks with no audio in it*/
S.TieCheckBox(XXO("&Ignore blank space at the beginning"),
{wxT("/AudioFiles/SkipSilenceAtBeginning"),
false});
}
S.EndStatic();
S.StartStatic(XO("Exported Label Style:"));
{
// Bug 2692: Place button group in panel so tabbing will work and,
// on the Mac, VoiceOver will announce as radio buttons.
S.StartPanel();
{
S.StartRadioButtonGroup(ImportExportPrefs::LabelStyleSetting);
{
S.TieRadioButton();
S.TieRadioButton();
}
S.EndRadioButtonGroup();
}
S.EndPanel();
}
S.EndStatic();
#ifdef USE_MIDI
S.StartStatic(XO("Exported Allegro (.gro) files save time as:"));
{
// Bug 2692: Place button group in panel so tabbing will work and,
// on the Mac, VoiceOver will announce as radio buttons.
S.StartPanel();
{
S.StartRadioButtonGroup(ImportExportPrefs::AllegroStyleSetting);
{
S.TieRadioButton();
S.TieRadioButton();
}
S.EndRadioButtonGroup();
}
S.EndPanel();
}
S.EndStatic();
#endif
S.EndScroller();
}
bool ImportExportPrefs::Commit()
{
ShuttleGui S(this, eIsSavingToPrefs);
PopulateOrExchange(S);
return true;
}
namespace{
PrefsPanel::Registration sAttachment{ "ImportExport",
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
{
wxASSERT(parent); // to justify safenew
return safenew ImportExportPrefs(parent, winid);
}
};
}