1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Bug 1091 Spectral Edit effects may have unpredictable results

This commit is contained in:
SteveDaulton 2021-04-25 14:39:41 +01:00
parent 28a634c5e2
commit 921f40255d

View File

@ -563,30 +563,38 @@ bool NyquistEffect::Init()
if (!mIsPrompt && mIsSpectral) {
auto *project = FindProject();
bool bAllowSpectralEditing = true;
bool bAllowSpectralEditing = false;
bool hasSpectral = false;
for ( auto t :
TrackList::Get( *project ).Selected< const WaveTrack >() ) {
const auto displays = WaveTrackView::Get(*t).GetDisplays();
bool hasSpectral = (displays.end() != std::find(
if (displays.end() != std::find(
displays.begin(), displays.end(),
WaveTrackSubView::Type{ WaveTrackViewConstants::Spectrum, {} }
) );
if ( !hasSpectral ||
!(t->GetSpectrogramSettings().SpectralSelectionEnabled())) {
bAllowSpectralEditing = false;
WaveTrackSubView::Type{ WaveTrackViewConstants::Spectrum, {} }))
hasSpectral = true;
if ( hasSpectral &&
(t->GetSpectrogramSettings().SpectralSelectionEnabled())) {
bAllowSpectralEditing = true;
break;
}
}
if (!bAllowSpectralEditing || ((mF0 < 0.0) && (mF1 < 0.0))) {
Effect::MessageBox(
XO("To use 'Spectral effects', enable 'Spectral Selection'\n"
"in the track Spectrogram settings and select the\n"
"frequency range for the effect to act on."),
if (!hasSpectral) {
Effect::MessageBox(
XO("Enable track spectrogram view before\n"
"applying 'Spectral' effects."),
wxOK | wxICON_EXCLAMATION | wxCENTRE,
XO("Error") );
} else {
Effect::MessageBox(
XO("To use 'Spectral effects', enable 'Spectral Selection'\n"
"in the track Spectrogram settings and select the\n"
"frequency range for the effect to act on."),
wxOK | wxICON_EXCLAMATION | wxCENTRE,
XO("Error") );
}
return false;
}
}