From c6faffd7319983c1f09807ebd26284b6c36d40e1 Mon Sep 17 00:00:00 2001 From: lllucius Date: Wed, 8 Oct 2014 01:47:01 +0000 Subject: [PATCH] Further Nyquist Prompt bug fixing from Steve With the addition of the preview button, it became evident that if an effect were to return text instead of audio, the processing loop would not stop properly. And he also found a case where the debug state wasn't reset after using the debug button. If this was following by the preview button the next time the effect was used, the debug window would reappear before the preview. --- src/effects/nyquist/Nyquist.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 638edc69a..a651ecaaa 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -756,7 +756,7 @@ bool EffectNyquist::Process() this->ReplaceProcessedTracks(success); - //mDebug = false; + mDebug = false; return success; } @@ -867,10 +867,14 @@ bool EffectNyquist::ProcessOne() rval = nyx_eval_expression(cmd.mb_str(wxConvUTF8)); if (rval == nyx_string) { - wxMessageBox(NyquistToWxString(nyx_get_string()), - wxT("Nyquist"), - wxOK | wxCENTRE, mParent); - return true; + wxMessageBox(NyquistToWxString(nyx_get_string()), + wxT("Nyquist"), + wxOK | wxCENTRE, mParent); + + // True if not process type. + // If not returning audio from process effect, + // return first reult then stop (disables preview). + return (!(GetEffectFlags() & PROCESS_EFFECT)); } if (rval == nyx_double) { @@ -879,7 +883,7 @@ bool EffectNyquist::ProcessOne() nyx_get_double()); wxMessageBox(str, wxT("Nyquist"), wxOK | wxCENTRE, mParent); - return true; + return (!(GetEffectFlags() & PROCESS_EFFECT)); } if (rval == nyx_int) { @@ -888,7 +892,7 @@ bool EffectNyquist::ProcessOne() nyx_get_int()); wxMessageBox(str, wxT("Nyquist"), wxOK | wxCENTRE, mParent); - return true; + return (!(GetEffectFlags() & PROCESS_EFFECT)); } if (rval == nyx_labels) { @@ -919,7 +923,7 @@ bool EffectNyquist::ProcessOne() ltrack->AddLabel(SelectedRegion(t0 + mT0, t1 + mT0), UTF8CTOWX(str)); } - return true; + return (!(GetEffectFlags() & PROCESS_EFFECT)); } if (rval != nyx_audio) {