1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-05 23:19:06 +02:00

Error if Nyquist Prompt requires track election

This commit is contained in:
Steve Daulton 2018-08-21 16:28:59 +01:00
parent 94b3bf3c22
commit 4ec1393c27

View File

@ -637,6 +637,17 @@ bool NyquistEffect::Process()
mTrackIndex = 0;
mNumSelectedChannels = 0;
// If in tool mode, then we don't do anything with the track and selection.
bool bOnePassTool = (GetType() == EffectTypeTool);
// We must copy all the tracks, because Paste needs label tracks to ensure
// correct sync-lock group behavior when the timeline is affected; then we just want
// to operate on the selected wave tracks.
// Also need to set up mOutputTracks for channel count.
if( !bOnePassTool )
CopyInputTracks(Track::All);
SelectedTrackListOfKindIterator sel(Track::Wave, mOutputTracks.get());
for (WaveTrack *t = (WaveTrack *) sel.First(); t; t = (WaveTrack *) sel.Next()) {
mNumSelectedChannels++;
@ -773,15 +784,12 @@ bool NyquistEffect::Process()
mProps += wxString::Format(wxT("(putprop '*SELECTION* %d 'CHANNELS)\n"), mNumSelectedChannels);
}
// If in tool mode, then we don't do anything with the track and selection.
bool bOnePassTool = (GetType() == EffectTypeTool);
// Nyquist Prompt does not require a selection, but effects do.
if (!bOnePassTool && (mNumSelectedChannels == 0)) {
wxString message = _("Cannot run command without a selection.");
Effect::MessageBox(message, wxOK | wxCENTRE | wxICON_EXCLAMATION, _("Nyquist Error"));
}
// We must copy all the tracks, because Paste needs label tracks to ensure
// correct sync-lock group behavior when the timeline is affected; then we just want
// to operate on the selected wave tracks
if( !bOnePassTool )
CopyInputTracks(Track::All);
SelectedTrackListOfKindIterator iter(Track::Wave, mOutputTracks.get());
mCurTrack[0] = (WaveTrack *)iter.First();