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:
parent
94b3bf3c22
commit
4ec1393c27
@ -637,6 +637,17 @@ bool NyquistEffect::Process()
|
|||||||
mTrackIndex = 0;
|
mTrackIndex = 0;
|
||||||
|
|
||||||
mNumSelectedChannels = 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());
|
SelectedTrackListOfKindIterator sel(Track::Wave, mOutputTracks.get());
|
||||||
for (WaveTrack *t = (WaveTrack *) sel.First(); t; t = (WaveTrack *) sel.Next()) {
|
for (WaveTrack *t = (WaveTrack *) sel.First(); t; t = (WaveTrack *) sel.Next()) {
|
||||||
mNumSelectedChannels++;
|
mNumSelectedChannels++;
|
||||||
@ -773,15 +784,12 @@ bool NyquistEffect::Process()
|
|||||||
mProps += wxString::Format(wxT("(putprop '*SELECTION* %d 'CHANNELS)\n"), mNumSelectedChannels);
|
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.
|
// Nyquist Prompt does not require a selection, but effects do.
|
||||||
bool bOnePassTool = (GetType() == EffectTypeTool);
|
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());
|
SelectedTrackListOfKindIterator iter(Track::Wave, mOutputTracks.get());
|
||||||
mCurTrack[0] = (WaveTrack *)iter.First();
|
mCurTrack[0] = (WaveTrack *)iter.First();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user