diff --git a/src/WaveTrack.cpp b/src/WaveTrack.cpp index 41d968b8d..4f1aa8873 100644 --- a/src/WaveTrack.cpp +++ b/src/WaveTrack.cpp @@ -263,7 +263,7 @@ WaveTrack::WaveTrackDisplay WaveTrack::FindDefaultViewMode() // Prefer the NEW preference key if it is present WaveTrack::WaveTrackDisplay viewMode; - gPrefs->Read(wxT("/GUI/DefaultViewModeNew"), (int*)&viewMode, -1); + gPrefs->Read(wxT("/GUI/DefaultViewModeNew"), &viewMode, -1); // Default to the old key only if not, default the value if it's not there either wxASSERT(WaveTrack::MinDisplay >= 0); diff --git a/src/WaveTrack.h b/src/WaveTrack.h index a142fc792..ec027afde 100644 --- a/src/WaveTrack.h +++ b/src/WaveTrack.h @@ -527,7 +527,9 @@ private: // and will be taken out of the WaveTrack class: // - enum WaveTrackDisplay { + + typedef int WaveTrackDisplay; + enum WaveTrackDisplayValues : int { // DO NOT REORDER OLD VALUES! Replace obsoletes with placeholders. diff --git a/src/commands/SetTrackInfoCommand.cpp b/src/commands/SetTrackInfoCommand.cpp index acd20167b..d71e1e781 100644 --- a/src/commands/SetTrackInfoCommand.cpp +++ b/src/commands/SetTrackInfoCommand.cpp @@ -167,7 +167,7 @@ bool SetTrackCommand::Apply(const CommandContext & context) bool bIsSecondChannel = false; while (t ) { - bool bThisTrack = + bool bThisTrack = (bHasTrackIndex && (i==mTrackIndex)) || (bHasChannelIndex && (j==mChannelIndex ) ) || (!bHasTrackIndex && !bHasChannelIndex) ; @@ -191,9 +191,9 @@ bool SetTrackCommand::Apply(const CommandContext & context) if( wt && bHasDisplayType ) wt->SetDisplay( - (mDisplayType == kWaveform) ? - WaveTrack::WaveTrackDisplay::Waveform - : WaveTrack::WaveTrackDisplay::Spectrum + (mDisplayType == kWaveform) ? + WaveTrack::WaveTrackDisplayValues::Waveform + : WaveTrack::WaveTrackDisplayValues::Spectrum ); if( wt && bHasScaleType ) wt->GetIndependentWaveformSettings().scaleType = diff --git a/src/prefs/SpectrogramSettings.h b/src/prefs/SpectrogramSettings.h index de7f8ada6..81f9db896 100644 --- a/src/prefs/SpectrogramSettings.h +++ b/src/prefs/SpectrogramSettings.h @@ -53,7 +53,8 @@ public: // Do not assume that this enumeration will remain the // same as NumberScaleType in future. That enum may become // more general purpose. - enum ScaleType { + typedef int ScaleType; + enum ScaleTypeValues : int { stLinear, stLogarithmic, stMel, @@ -131,7 +132,8 @@ public: bool spectralSelection; // But should this vary per track? -- PRL #endif - enum Algorithm { + typedef int Algorithm; + enum AlgorithmValues : int { algSTFT = 0, algReassignment, algPitchEAC, diff --git a/src/prefs/SpectrumPrefs.cpp b/src/prefs/SpectrumPrefs.cpp index 44f254c64..527982bcc 100644 --- a/src/prefs/SpectrumPrefs.cpp +++ b/src/prefs/SpectrumPrefs.cpp @@ -176,7 +176,7 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S) S.StartTwoColumn(); { S.Id(ID_SCALE).TieChoice(_("S&cale") + wxString(wxT(":")), - *(int*)&mTempSettings.scaleType, + mTempSettings.scaleType, &mScaleChoices); mMinFreq = @@ -226,7 +226,7 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S) { mAlgorithmChoice = S.Id(ID_ALGORITHM).TieChoice(_("A&lgorithm") + wxString(wxT(":")), - *(int*)&mTempSettings.algorithm, + mTempSettings.algorithm, &mAlgorithmChoices); S.Id(ID_WINDOW_SIZE).TieChoice(_("Window &size:"), diff --git a/src/prefs/WaveformPrefs.cpp b/src/prefs/WaveformPrefs.cpp index 862134f4a..2c6e0ded7 100644 --- a/src/prefs/WaveformPrefs.cpp +++ b/src/prefs/WaveformPrefs.cpp @@ -92,12 +92,12 @@ void WaveformPrefs::PopulateOrExchange(ShuttleGui & S) { mScaleChoice = S.Id(ID_SCALE).TieChoice(_("S&cale") + wxString(wxT(":")), - *(int*)&mTempSettings.scaleType, + mTempSettings.scaleType, &mScaleChoices); mRangeChoice = S.Id(ID_RANGE).TieChoice(_("Waveform dB &range") + wxString(wxT(":")), - *(int*)&mTempSettings.dBRange, + mTempSettings.dBRange, &mRangeChoices); S.SetSizeHints(mRangeChoices); } diff --git a/src/prefs/WaveformSettings.h b/src/prefs/WaveformSettings.h index 52e7e4d41..3ad4ae257 100644 --- a/src/prefs/WaveformSettings.h +++ b/src/prefs/WaveformSettings.h @@ -50,7 +50,8 @@ public: void NextLowerDBRange(); void NextHigherDBRange(); - enum ScaleType { + typedef int ScaleType; + enum ScaleTypeValues : int { stLinear, stLogarithmic,