mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 00:03:52 +02:00
Redo sample display choice in Tracks preferences
This commit is contained in:
@@ -118,6 +118,34 @@ WaveTrack::WaveTrackDisplay TracksPrefs::ViewModeChoice()
|
||||
return (WaveTrack::WaveTrackDisplay) viewModeSetting.ReadInt();
|
||||
}
|
||||
|
||||
//////////
|
||||
static const IdentInterfaceSymbol choicesSampleDisplay[] = {
|
||||
{ wxT("ConnectDots"), XO("Connect dots") },
|
||||
{ wxT("StemPlot"), XO("Stem plot") }
|
||||
};
|
||||
static const size_t nChoicesSampleDisplay = WXSIZEOF( choicesSampleDisplay );
|
||||
static const int intChoicesSampleDisplay[] = {
|
||||
(int) WaveTrack::LinearInterpolate,
|
||||
(int) WaveTrack::StemPlot
|
||||
};
|
||||
static_assert(
|
||||
nChoicesSampleDisplay == WXSIZEOF(intChoicesSampleDisplay), "size mismatch" );
|
||||
|
||||
static const size_t defaultChoiceSampleDisplay = 1;
|
||||
|
||||
static EncodedEnumSetting sampleDisplaySetting{
|
||||
wxT("/GUI/SampleViewChoice"),
|
||||
choicesSampleDisplay, nChoicesSampleDisplay, defaultChoiceSampleDisplay,
|
||||
|
||||
intChoicesSampleDisplay,
|
||||
wxT("/GUI/SampleView")
|
||||
};
|
||||
|
||||
WaveTrack::SampleDisplay TracksPrefs::SampleViewChoice()
|
||||
{
|
||||
return (WaveTrack::SampleDisplay) sampleDisplaySetting.ReadInt();
|
||||
}
|
||||
|
||||
//////////
|
||||
TracksPrefs::TracksPrefs(wxWindow * parent, wxWindowID winid)
|
||||
/* i18n-hint: "Tracks" include audio recordings but also other collections of
|
||||
@@ -140,12 +168,6 @@ void TracksPrefs::Populate()
|
||||
|
||||
// How samples are displayed when zoomed in:
|
||||
|
||||
mSampleDisplayChoices.Add(_("Connect dots"));
|
||||
mSampleDisplayCodes.push_back((int) WaveTrack::LinearInterpolate);
|
||||
|
||||
mSampleDisplayChoices.Add(_("Stem plot"));
|
||||
mSampleDisplayCodes.push_back((int) WaveTrack::StemPlot);
|
||||
|
||||
mZoomChoices.Add( _("Fit to Width") );
|
||||
mZoomCodes.push_back( WaveTrack::kZoomToFit );
|
||||
mZoomChoices.Add( _("Zoom to Selection") );
|
||||
@@ -216,10 +238,7 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
viewModeSetting );
|
||||
|
||||
S.TieChoice(_("Display &samples:"),
|
||||
wxT("/GUI/SampleView"),
|
||||
1,
|
||||
mSampleDisplayChoices,
|
||||
mSampleDisplayCodes);
|
||||
sampleDisplaySetting );
|
||||
|
||||
S.TieTextBox(_("Default audio track &name:"),
|
||||
wxT("/GUI/TrackNames/DefaultTrackName"),
|
||||
|
||||
Reference in New Issue
Block a user