mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-07 15:49:42 +02:00
Bug 1091 Spectral Edit effects may have unpredictable results
This commit is contained in:
parent
28a634c5e2
commit
921f40255d
@ -563,30 +563,38 @@ bool NyquistEffect::Init()
|
|||||||
|
|
||||||
if (!mIsPrompt && mIsSpectral) {
|
if (!mIsPrompt && mIsSpectral) {
|
||||||
auto *project = FindProject();
|
auto *project = FindProject();
|
||||||
bool bAllowSpectralEditing = true;
|
bool bAllowSpectralEditing = false;
|
||||||
|
bool hasSpectral = false;
|
||||||
|
|
||||||
for ( auto t :
|
for ( auto t :
|
||||||
TrackList::Get( *project ).Selected< const WaveTrack >() ) {
|
TrackList::Get( *project ).Selected< const WaveTrack >() ) {
|
||||||
const auto displays = WaveTrackView::Get(*t).GetDisplays();
|
const auto displays = WaveTrackView::Get(*t).GetDisplays();
|
||||||
bool hasSpectral = (displays.end() != std::find(
|
if (displays.end() != std::find(
|
||||||
displays.begin(), displays.end(),
|
displays.begin(), displays.end(),
|
||||||
WaveTrackSubView::Type{ WaveTrackViewConstants::Spectrum, {} }
|
WaveTrackSubView::Type{ WaveTrackViewConstants::Spectrum, {} }))
|
||||||
) );
|
hasSpectral = true;
|
||||||
if ( !hasSpectral ||
|
if ( hasSpectral &&
|
||||||
!(t->GetSpectrogramSettings().SpectralSelectionEnabled())) {
|
(t->GetSpectrogramSettings().SpectralSelectionEnabled())) {
|
||||||
bAllowSpectralEditing = false;
|
bAllowSpectralEditing = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bAllowSpectralEditing || ((mF0 < 0.0) && (mF1 < 0.0))) {
|
if (!bAllowSpectralEditing || ((mF0 < 0.0) && (mF1 < 0.0))) {
|
||||||
Effect::MessageBox(
|
if (!hasSpectral) {
|
||||||
XO("To use 'Spectral effects', enable 'Spectral Selection'\n"
|
Effect::MessageBox(
|
||||||
"in the track Spectrogram settings and select the\n"
|
XO("Enable track spectrogram view before\n"
|
||||||
"frequency range for the effect to act on."),
|
"applying 'Spectral' effects."),
|
||||||
wxOK | wxICON_EXCLAMATION | wxCENTRE,
|
wxOK | wxICON_EXCLAMATION | wxCENTRE,
|
||||||
XO("Error") );
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user