From c2f90ac41e8d4e093abf02caeae8410a4aa192d2 Mon Sep 17 00:00:00 2001 From: "stevethefiddle@gmail.com" Date: Mon, 17 Nov 2014 16:04:08 +0000 Subject: [PATCH] Change *selection* tracks property to a list rather than a total - greater flexibility for plugins. --- src/effects/nyquist/Nyquist.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 5fef08e1b..548745d57 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -730,11 +730,18 @@ bool EffectNyquist::Process() int numLabel = 0; int numMidi = 0; int numTime = 0; + wxString waveTrackList = wxT(""); // track positions of selected audio tracks. + for (t = all.First(); t; t = all.Next()) { switch (t->GetKind()) { - case Track::Wave: numWave++; break; + case Track::Wave: + numWave++; + if (t->GetSelected()) { + waveTrackList += wxString::Format(wxT("%d "), 1 + numTracks); + } + break; case Track::Label: numLabel++; break; #if defined(USE_MIDI) case Track::Note: numMidi++; break; @@ -759,9 +766,7 @@ bool EffectNyquist::Process() SelectedTrackListOfKindIterator sel(Track::Wave, mOutputTracks); int numChannels = 0; - numTracks = 0; for (WaveTrack *t = (WaveTrack *) sel.First(); t; t = (WaveTrack *) sel.Next()) { - numTracks++; numChannels++; if (mT1 >= mT0) { if (t->GetLinked()) { @@ -773,7 +778,7 @@ bool EffectNyquist::Process() mProps += wxString::Format(wxT("(putprop '*SELECTION* (float %g) 'START)\n"), mT0); mProps += wxString::Format(wxT("(putprop '*SELECTION* (float %g) 'END)\n"), mT1); - mProps += wxString::Format(wxT("(putprop '*SELECTION* %d 'TRACKS)\n"), numTracks); + mProps += wxString::Format(wxT("(putprop '*SELECTION* (list %s) 'TRACKS)\n"), waveTrackList.c_str()); mProps += wxString::Format(wxT("(putprop '*SELECTION* %d 'CHANNELS)\n"), numChannels); wxString lowHz = wxT("nil");