1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-21 06:40:08 +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 spectralEditp;
using namespace WaveTrackViewConstants;
mCurTrack[0]->TypeSwitch(
[&](const WaveTrack *wt) {
type = wxT("wave");
spectralEditp = mCurTrack[0]->GetSpectrogramSettings().SpectralSelectionEnabled()? wxT("T") : wxT("NIL");
auto displays = WaveTrackView::Get( *wt ).GetDisplays();
auto format = [&]( decltype(displays[0]) display ){
switch ( display.id )
{
case Waveform:
return wxT("\"Waveform\"");
case Spectrum:
return wxT("\"Spectrogram\"");
default: return wxT("NIL");
}
auto format = [&]( decltype(displays[0]) display ) {
// Get the English name of the view type, without menu codes,
// as a string that Lisp can examine
return wxString::Format( wxT("\"%s\""),
display.name.Stripped().Debug() );
};
if (displays.empty())
view = wxT("NIL");