mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-10 00:51:13 +02:00
TranslatableString for more scale and algorithm names
This commit is contained in:
parent
65b6d5aad5
commit
0ddeec9c3b
@ -159,25 +159,17 @@ const TranslatableStrings &SpectrogramSettings::GetScaleNames()
|
||||
}
|
||||
|
||||
//static
|
||||
const wxArrayStringEx &SpectrogramSettings::GetAlgorithmNames()
|
||||
const TranslatableStrings &SpectrogramSettings::GetAlgorithmNames()
|
||||
{
|
||||
class AlgorithmNamesArray final : public TranslatableStringArray
|
||||
{
|
||||
void Populate() override
|
||||
{
|
||||
mContents.insert( mContents.end(), {
|
||||
// Keep in correspondence with enum SpectrogramSettings::Algorithm:
|
||||
_("Frequencies") ,
|
||||
/* i18n-hint: the Reassignment algorithm for spectrograms */
|
||||
_("Reassignment") ,
|
||||
/* i18n-hint: EAC abbreviates "Enhanced Autocorrelation" */
|
||||
_("Pitch (EAC)") ,
|
||||
} );
|
||||
}
|
||||
static const TranslatableStrings results{
|
||||
// Keep in correspondence with enum SpectrogramSettings::Algorithm:
|
||||
XO("Frequencies") ,
|
||||
/* i18n-hint: the Reassignment algorithm for spectrograms */
|
||||
XO("Reassignment") ,
|
||||
/* i18n-hint: EAC abbreviates "Enhanced Autocorrelation" */
|
||||
XO("Pitch (EAC)") ,
|
||||
};
|
||||
|
||||
static AlgorithmNamesArray theArray;
|
||||
return theArray.Get();
|
||||
return results;
|
||||
}
|
||||
|
||||
bool SpectrogramSettings::Validate(bool quiet)
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
};
|
||||
|
||||
static const TranslatableStrings &GetScaleNames();
|
||||
static const wxArrayStringEx &GetAlgorithmNames();
|
||||
static const TranslatableStrings &GetAlgorithmNames();
|
||||
|
||||
static SpectrogramSettings &defaults();
|
||||
SpectrogramSettings();
|
||||
|
@ -242,7 +242,9 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
mAlgorithmChoice =
|
||||
S.Id(ID_ALGORITHM).TieChoice(_("A&lgorithm:"),
|
||||
mTempSettings.algorithm,
|
||||
SpectrogramSettings::GetAlgorithmNames());
|
||||
transform_container<wxArrayStringEx>(
|
||||
SpectrogramSettings::GetAlgorithmNames(),
|
||||
std::mem_fn( &TranslatableString::Translation ) ) );
|
||||
|
||||
S.Id(ID_WINDOW_SIZE).TieChoice(_("Window &size:"),
|
||||
mTempSettings.windowSize,
|
||||
|
@ -110,7 +110,9 @@ void WaveformPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
mScaleChoice =
|
||||
S.Id(ID_SCALE).TieChoice(_("S&cale:"),
|
||||
mTempSettings.scaleType,
|
||||
WaveformSettings::GetScaleNames());
|
||||
transform_container<wxArrayStringEx>(
|
||||
WaveformSettings::GetScaleNames(),
|
||||
std::mem_fn( &TranslatableString::Translation ) ) );
|
||||
|
||||
mRangeChoice =
|
||||
S.Id(ID_RANGE).TieChoice(_("Waveform dB &range:"),
|
||||
|
@ -147,20 +147,14 @@ void WaveformSettings::NextHigherDBRange()
|
||||
}
|
||||
|
||||
//static
|
||||
const wxArrayStringEx &WaveformSettings::GetScaleNames()
|
||||
const TranslatableStrings &WaveformSettings::GetScaleNames()
|
||||
{
|
||||
class ScaleNamesArray final : public TranslatableStringArray
|
||||
{
|
||||
void Populate() override
|
||||
{
|
||||
// Keep in correspondence with enum WaveTrack::WaveTrackDisplay:
|
||||
mContents.push_back(_("Linear"));
|
||||
mContents.push_back(_("Logarithmic"));
|
||||
}
|
||||
static const TranslatableStrings result{
|
||||
// Keep in correspondence with enum WaveTrack::WaveTrackDisplay:
|
||||
XO("Linear"),
|
||||
XO("Logarithmic"),
|
||||
};
|
||||
|
||||
static ScaleNamesArray theArray;
|
||||
return theArray.Get();
|
||||
return result;
|
||||
}
|
||||
|
||||
WaveformSettings::~WaveformSettings()
|
||||
|
@ -11,7 +11,7 @@ Paul Licameli
|
||||
#ifndef __AUDACITY_WAVEFORM_SETTINGS__
|
||||
#define __AUDACITY_WAVEFORM_SETTINGS__
|
||||
|
||||
class wxArrayStringEx;
|
||||
#include "../Internat.h" // for TranslatableStrings
|
||||
|
||||
class WaveformSettings
|
||||
{
|
||||
@ -58,7 +58,7 @@ public:
|
||||
stNumScaleTypes,
|
||||
};
|
||||
|
||||
static const wxArrayStringEx &GetScaleNames();
|
||||
static const TranslatableStrings &GetScaleNames();
|
||||
|
||||
ScaleType scaleType;
|
||||
int dBRange;
|
||||
|
Loading…
x
Reference in New Issue
Block a user