1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-21 14:50:06 +02:00

Remove another exhaustive switch on view sub-types, in Nyquist.cpp

This commit is contained in:
Paul Licameli 2020-01-18 17:48:40 -05:00
parent 7cff170cf7
commit d2ccde77e7

View File

@ -1091,21 +1091,16 @@ bool NyquistEffect::ProcessOne()
wxString bitFormat; wxString bitFormat;
wxString spectralEditp; wxString spectralEditp;
using namespace WaveTrackViewConstants;
mCurTrack[0]->TypeSwitch( mCurTrack[0]->TypeSwitch(
[&](const WaveTrack *wt) { [&](const WaveTrack *wt) {
type = wxT("wave"); type = wxT("wave");
spectralEditp = mCurTrack[0]->GetSpectrogramSettings().SpectralSelectionEnabled()? wxT("T") : wxT("NIL"); spectralEditp = mCurTrack[0]->GetSpectrogramSettings().SpectralSelectionEnabled()? wxT("T") : wxT("NIL");
auto displays = WaveTrackView::Get( *wt ).GetDisplays(); auto displays = WaveTrackView::Get( *wt ).GetDisplays();
auto format = [&]( decltype(displays[0]) display ) { auto format = [&]( decltype(displays[0]) display ) {
switch ( display.id ) // Get the English name of the view type, without menu codes,
{ // as a string that Lisp can examine
case Waveform: return wxString::Format( wxT("\"%s\""),
return wxT("\"Waveform\""); display.name.Stripped().Debug() );
case Spectrum:
return wxT("\"Spectrogram\"");
default: return wxT("NIL");
}
}; };
if (displays.empty()) if (displays.empty())
view = wxT("NIL"); view = wxT("NIL");