mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-09 05:01:57 +01:00
ChoiceSetting contains vectors; simplify constructions of it
This commit is contained in:
@@ -52,53 +52,36 @@ Resample::~Resample()
|
||||
}
|
||||
|
||||
//////////
|
||||
static const EnumValueSymbol methodNames[] = {
|
||||
static const std::initializer_list<EnumValueSymbol> methodNames{
|
||||
{ wxT("LowQuality"), XO("Low Quality (Fastest)") },
|
||||
{ wxT("MediumQuality"), XO("Medium Quality") },
|
||||
{ wxT("HighQuality"), XO("High Quality") },
|
||||
{ wxT("BestQuality"), XO("Best Quality (Slowest)") }
|
||||
};
|
||||
|
||||
static const size_t numMethods = WXSIZEOF(methodNames);
|
||||
|
||||
static const wxString fastMethodKey =
|
||||
wxT("/Quality/LibsoxrSampleRateConverterChoice");
|
||||
|
||||
static const wxString bestMethodKey =
|
||||
wxT("/Quality/LibsoxrHQSampleRateConverterChoice");
|
||||
|
||||
static const wxString oldFastMethodKey =
|
||||
wxT("/Quality/LibsoxrSampleRateConverter");
|
||||
|
||||
static const wxString oldBestMethodKey =
|
||||
wxT("/Quality/LibsoxrHQSampleRateConverter");
|
||||
|
||||
static const size_t fastMethodDefault = 1; // Medium Quality
|
||||
static const size_t bestMethodDefault = 3; // Best Quality
|
||||
|
||||
static const int intChoicesMethod[] = {
|
||||
static auto intChoicesMethod = {
|
||||
0, 1, 2, 3
|
||||
};
|
||||
|
||||
static_assert( WXSIZEOF(intChoicesMethod) == numMethods, "size mismatch" );
|
||||
|
||||
EnumSetting Resample::FastMethodSetting{
|
||||
fastMethodKey,
|
||||
methodNames, numMethods,
|
||||
fastMethodDefault,
|
||||
wxT("/Quality/LibsoxrSampleRateConverterChoice"),
|
||||
methodNames,
|
||||
1, // Medium Quality
|
||||
|
||||
// for migrating old preferences:
|
||||
intChoicesMethod,
|
||||
oldFastMethodKey
|
||||
wxT("/Quality/LibsoxrSampleRateConverter")
|
||||
};
|
||||
|
||||
EnumSetting Resample::BestMethodSetting
|
||||
{
|
||||
bestMethodKey,
|
||||
methodNames, numMethods,
|
||||
bestMethodDefault,
|
||||
wxT("/Quality/LibsoxrHQSampleRateConverterChoice"),
|
||||
methodNames,
|
||||
3, // Best Quality,
|
||||
|
||||
// for migrating old preferences:
|
||||
intChoicesMethod,
|
||||
oldBestMethodKey
|
||||
wxT("/Quality/LibsoxrHQSampleRateConverter")
|
||||
};
|
||||
|
||||
//////////
|
||||
|
||||
Reference in New Issue
Block a user