Definition at line 272 of file ExportMP3.cpp.
◆ MP3ExportOptionsEditor()
MP3ExportOptionsEditor::MP3ExportOptionsEditor |
( |
Listener * |
listener | ) |
|
|
inlineexplicit |
Definition at line 279 of file ExportMP3.cpp.
282 {
285 mValues[option.id] = option.defaultValue;
286 }
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 355 of file ExportMP3.cpp.
356 {
357
358 int highrate = 48000;
359 int lowrate = 8000;
360
362
363 if (rmode == "ABR") {
365 if (bitrate > 160) {
366 lowrate = 32000;
367 }
368 else if (bitrate < 32 || bitrate == 144) {
369 highrate = 24000;
370 }
371 }
372 else if (rmode == "CBR") {
374
375 if (bitrate > 160) {
376 lowrate = 32000;
377 }
378 else if (bitrate < 32 || bitrate == 144) {
379 highrate = 24000;
380 }
381 }
382
386 if(rate >= lowrate && rate <= highrate)
387 result.push_back(rate);
388
389 return result;
390 }
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 344 of file ExportMP3.cpp.
345 {
346 const auto it =
mValues.find(
id);
348 {
349 value = it->second;
350 return true;
351 }
352 return false;
353 }
References mValues.
◆ Load()
Implements ExportOptionsEditor.
Definition at line 392 of file ExportMP3.cpp.
393 {
394 wxString mode;
395 if(config.
Read(
wxT(
"/FileFormats/MP3RateModeChoice"), &mode))
397 else
398 {
399
400 int index;
401 if(config.
Read(
wxT(
"/FileFormats/MP3RateMode"), &index))
403 }
404
409
411 }
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 303 of file ExportMP3.cpp.
304 {
305 const auto it =
mValues.find(
id);
307 return false;
308 if(value.index() != it->second.index())
309 return false;
310
311 it->second = value;
312
313 switch(id)
314 {
316 {
317 const auto mode = *std::get_if<std::string>(&value);
320 {
327
329 }
330 } break;
335 {
338 } break;
339 default: break;
340 }
341 return true;
342 }
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 413 of file ExportMP3.cpp.
414 {
416 config.
Write(
wxT(
"/FileFormats/MP3RateModeChoice"), wxString(*std::get_if<std::string>(&it->second)));
417
419 config.
Write(
wxT(
"/FileFormats/MP3SetRate"), *std::get_if<int>(&it->second));
421 config.
Write(
wxT(
"/FileFormats/MP3AbrRate"), *std::get_if<int>(&it->second));
423 config.
Write(
wxT(
"/FileFormats/MP3CbrRate"), *std::get_if<int>(&it->second));
425 config.
Write(
wxT(
"/FileFormats/MP3VbrRate"), *std::get_if<int>(&it->second));
426 }
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: