mirror of
https://github.com/cookiengineer/audacity
synced 2026-04-02 12:35:11 +02:00
WaveTrackView::BuildSubViews can be simplified...
... The setting of scale type now happens in the default constructor of WaveformSettings, which calls LoadPrefs. Since creation of WaveformSettings is always forced, we don't need the distinction between WaveTrack::GetWaveformSettings and WaveTrack::GetIndependentWaveformSettings. That distinction was more analogy with the handling of SpectrogramSettings that we don't need now.
This commit is contained in:
@@ -704,22 +704,13 @@ void WaveTrack::UseSpectralPrefs( bool bUse )
|
||||
|
||||
const WaveformSettings &WaveTrack::GetWaveformSettings() const
|
||||
{
|
||||
if (mpWaveformSettings)
|
||||
return *mpWaveformSettings;
|
||||
else
|
||||
return WaveformSettings::defaults();
|
||||
// Create on demand
|
||||
return const_cast<WaveTrack*>(this)->GetWaveformSettings();
|
||||
}
|
||||
|
||||
WaveformSettings &WaveTrack::GetWaveformSettings()
|
||||
{
|
||||
if (mpWaveformSettings)
|
||||
return *mpWaveformSettings;
|
||||
else
|
||||
return WaveformSettings::defaults();
|
||||
}
|
||||
|
||||
WaveformSettings &WaveTrack::GetIndependentWaveformSettings()
|
||||
{
|
||||
// Create on demand
|
||||
if (!mpWaveformSettings)
|
||||
mpWaveformSettings = std::make_unique<WaveformSettings>(WaveformSettings::defaults());
|
||||
return *mpWaveformSettings;
|
||||
|
||||
Reference in New Issue
Block a user