Definition at line 268 of file ExportMP3.cpp.
◆ MP3ExportOptionsEditor()
MP3ExportOptionsEditor::MP3ExportOptionsEditor |
( |
Listener * |
listener | ) |
|
|
inlineexplicit |
Definition at line 275 of file ExportMP3.cpp.
278 {
281 mValues[option.id] = option.defaultValue;
282 }
const std::initializer_list< ExportOption > MP3Options
std::unordered_map< int, ExportValue > mValues
std::vector< ExportOption > mOptions
References mOptions, and mValues.
◆ GetOption()
bool MP3ExportOptionsEditor::GetOption |
( |
int |
index, |
|
|
ExportOption & |
option |
|
) |
| const |
|
inlineoverridevirtual |
◆ GetOptionsCount()
int MP3ExportOptionsEditor::GetOptionsCount |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ GetSampleRateList()
Implements ExportOptionsEditor.
Definition at line 351 of file ExportMP3.cpp.
352 {
353
354 int highrate = 48000;
355 int lowrate = 8000;
356
358
359 if (rmode == "ABR") {
361 if (bitrate > 160) {
362 lowrate = 32000;
363 }
364 else if (bitrate < 32 || bitrate == 144) {
365 highrate = 24000;
366 }
367 }
368 else if (rmode == "CBR") {
370
371 if (bitrate > 160) {
372 lowrate = 32000;
373 }
374 else if (bitrate < 32 || bitrate == 144) {
375 highrate = 24000;
376 }
377 }
378
382 if(rate >= lowrate && rate <= highrate)
383 result.push_back(rate);
384
385 return result;
386 }
static const std::vector< int > sampRates
std::vector< int > SampleRateList
References MP3OptionIDMode, MP3OptionIDQualityABR, MP3OptionIDQualityCBR, mValues, and sampRates.
◆ GetValue()
bool MP3ExportOptionsEditor::GetValue |
( |
int |
id, |
|
|
ExportValue & |
value |
|
) |
| const |
|
inlineoverride |
Definition at line 340 of file ExportMP3.cpp.
341 {
342 const auto it =
mValues.find(
id);
344 {
345 value = it->second;
346 return true;
347 }
348 return false;
349 }
References mValues.
◆ Load()
Implements ExportOptionsEditor.
Definition at line 388 of file ExportMP3.cpp.
389 {
390 wxString mode;
391 if(config.
Read(
wxT(
"/FileFormats/MP3RateModeChoice"), &mode))
393 else
394 {
395
396 int index;
397 if(config.
Read(
wxT(
"/FileFormats/MP3RateMode"), &index))
399 }
400
405
407 }
void OnModeChange(const std::string &mode)
virtual bool Read(const wxString &key, bool *value) const =0
References mOptions, MP3OptionIDMode, MP3OptionIDQualityABR, MP3OptionIDQualityCBR, MP3OptionIDQualitySET, MP3OptionIDQualityVBR, mValues, OnModeChange(), audacity::BasicSettings::Read(), and wxT().
◆ OnModeChange()
void MP3ExportOptionsEditor::OnModeChange |
( |
const std::string & |
mode | ) |
|
|
inlineprivate |
◆ SetValue()
bool MP3ExportOptionsEditor::SetValue |
( |
int |
id, |
|
|
const ExportValue & |
value |
|
) |
| |
|
inlineoverride |
Definition at line 299 of file ExportMP3.cpp.
300 {
301 const auto it =
mValues.find(
id);
303 return false;
304 if(value.index() != it->second.index())
305 return false;
306
307 it->second = value;
308
309 switch(id)
310 {
312 {
313 const auto mode = *std::get_if<std::string>(&value);
316 {
323
325 }
326 } break;
331 {
334 } break;
335 default: break;
336 }
337 return true;
338 }
virtual void OnExportOptionChangeEnd()=0
Called after OnExportOptionChange
virtual void OnExportOptionChangeBegin()=0
Called before OnExportOptionChange
virtual void OnExportOptionChange(const ExportOption &option)=0
Called when option change.
virtual void OnSampleRateListChange()=0
References mListener, mOptions, MP3OptionIDMode, MP3OptionIDQualityABR, MP3OptionIDQualityCBR, MP3OptionIDQualitySET, MP3OptionIDQualityVBR, mValues, ExportOptionsEditor::Listener::OnExportOptionChange(), ExportOptionsEditor::Listener::OnExportOptionChangeBegin(), ExportOptionsEditor::Listener::OnExportOptionChangeEnd(), OnModeChange(), and ExportOptionsEditor::Listener::OnSampleRateListChange().
◆ Store()
Implements ExportOptionsEditor.
Definition at line 409 of file ExportMP3.cpp.
410 {
412 config.
Write(
wxT(
"/FileFormats/MP3RateModeChoice"), wxString(*std::get_if<std::string>(&it->second)));
413
415 config.
Write(
wxT(
"/FileFormats/MP3SetRate"), *std::get_if<int>(&it->second));
417 config.
Write(
wxT(
"/FileFormats/MP3AbrRate"), *std::get_if<int>(&it->second));
419 config.
Write(
wxT(
"/FileFormats/MP3CbrRate"), *std::get_if<int>(&it->second));
421 config.
Write(
wxT(
"/FileFormats/MP3VbrRate"), *std::get_if<int>(&it->second));
422 }
virtual bool Write(const wxString &key, bool value)=0
References MP3OptionIDMode, MP3OptionIDQualityABR, MP3OptionIDQualityCBR, MP3OptionIDQualitySET, MP3OptionIDQualityVBR, mValues, audacity::BasicSettings::Write(), and wxT().
◆ mListener
Listener* MP3ExportOptionsEditor::mListener {nullptr} |
|
private |
◆ mOptions
◆ mValues
std::unordered_map<int, ExportValue> MP3ExportOptionsEditor::mValues |
|
private |
The documentation for this class was generated from the following file: