1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-14 17:14:07 +01:00

Separate default waveform scale choice in Tracks preferences...

... Some complications in handling correct migration of preferences from
config files in older versions
This commit is contained in:
Paul Licameli
2020-01-13 17:34:21 -05:00
parent 6c3731061f
commit b45e3e8aac
6 changed files with 93 additions and 72 deletions

View File

@@ -1206,13 +1206,12 @@ void WaveTrackView::BuildSubViews() const
// Force creation always:
WaveformSettings &settings = static_cast< WaveTrack* >( pTrack.get() )
->GetIndependentWaveformSettings();
if (display == WaveTrackViewConstants::obsoleteWaveformDBDisplay) {
display = WaveTrackViewConstants::Waveform;
settings.scaleType = WaveformSettings::stLogarithmic;
}
->GetIndependentWaveformSettings();
// Set the default scale type to linear or log, even if we are showing
// spectrogram
settings.scaleType = TracksPrefs::WaveformScaleChoice();
pThis->DoSetDisplay( display );
}
}

View File

@@ -43,27 +43,3 @@ WaveTrackViewConstants::ConvertLegacyDisplayValue(int oldValue)
}
return newValue;
}
// static
WaveTrackViewConstants::Display
WaveTrackViewConstants::ValidateWaveTrackDisplay(Display display)
{
switch (display) {
// non-obsolete codes
case Waveform:
case obsoleteWaveformDBDisplay:
case Spectrum:
return display;
// obsolete codes
case obsolete1: // was SpectrumLogDisplay
case obsolete2: // was SpectralSelectionDisplay
case obsolete3: // was SpectralSelectionLogDisplay
case obsolete4: // was PitchDisplay
return Spectrum;
// codes out of bounds (from future prefs files?)
default:
return MinDisplay;
}
}

View File

@@ -77,9 +77,6 @@ namespace WaveTrackViewConstants
// Handle remapping of enum values from 2.1.0 and earlier
Display ConvertLegacyDisplayValue(int oldValue);
// Handle restriction of range of values of the enum from future versions
Display ValidateWaveTrackDisplay(Display display);
}
#endif