Index: BatchCommands.cpp =================================================================== --- BatchCommands.cpp (revision 11253) +++ BatchCommands.cpp (working copy) @@ -270,11 +270,13 @@ int additionalEffects=ADVANCED_EFFECT; if( project->GetCleanSpeechMode() ) additionalEffects = 0; - effects = EffectManager::Get().GetEffects(PROCESS_EFFECT | BUILTIN_EFFECT | additionalEffects); + effects = EffectManager::Get().GetEffects(PROCESS_EFFECT | BUILTIN_EFFECT | PLUGIN_EFFECT | additionalEffects); for(i=0; iGetCount(); i++) { - command=(*effects)[i]->GetEffectIdentifier(); - if (!command.IsEmpty()) { - commands.Add( command); + if ((*effects)[i]->SupportsChains()) { + command=(*effects)[i]->GetEffectIdentifier(); + if (!command.IsEmpty()) { + commands.Add( command); + } } } delete effects; Index: effects/Effect.h =================================================================== --- effects/Effect.h (revision 11253) +++ effects/Effect.h (working copy) @@ -107,7 +107,14 @@ return mFlags; } - virtual bool TransferParameters( Shuttle & shuttle ){ + // Return true if the effect supports processing via batch chains. + virtual bool SupportsChains() { + // All builtin effect support chains (???) + return (mFlags & BUILTIN_EFFECT) != 0; + } + + // Called to set or retrieve parameter values. Return true if successful. + virtual bool TransferParameters( Shuttle & shuttle ) { return true; } Index: effects/nyquist/Nyquist.cpp =================================================================== --- effects/nyquist/Nyquist.cpp (revision 11253) +++ effects/nyquist/Nyquist.cpp (working copy) @@ -85,6 +85,11 @@ mBreak = false; mCont = false; + if (!SetXlispPath()) { + wxLogWarning(wxT("Critical Nyquist files could not be found. Nyquist effects will not work.")); + return; + } + if (fName == wxT("")) { // Interactive Nyquist mOK = true; @@ -332,8 +337,6 @@ void EffectNyquist::ParseFile() { - wxLogDebug(wxT("EffectNyquist::ParseFile called")); - wxTextFile f(mFileName.GetFullPath()); if (!f.Open()) return; @@ -420,12 +423,84 @@ return ::wxFileExists(fname); } -bool EffectNyquist::PromptUser() +bool EffectNyquist::SupportsChains() { - if (!SetXlispPath()) { - return false; + return (GetEffectFlags() & PROCESS_EFFECT) != 0; +} + +bool EffectNyquist::TransferParameters( Shuttle & shuttle ) +{ + for (size_t i = 0; i < mControls.GetCount(); i++) { + NyqControl *ctrl = &mControls[i]; + double d = ctrl->val; + bool good = false; + + if (d == UNINITIALIZED_CONTROL) { + if (ctrl->type != NYQ_CTRL_STRING) { + if (!shuttle.mbStoreInClient) { + d = GetCtrlValue(ctrl->valStr); + } + } + } + + if (ctrl->type == NYQ_CTRL_REAL) { + good = shuttle.TransferDouble(ctrl->var, d, 0.0); + } + else if (ctrl->type == NYQ_CTRL_INT) { + int val = (int) d; + good = shuttle.TransferInt(ctrl->var, val, 0); + d = (double) val; + } + else if (ctrl->type == NYQ_CTRL_CHOICE) { + //str is coma separated labels for each choice + wxString str = ctrl->label; + wxArrayString choices; + + while (1) { + int ci = str.Find( ',' ); //coma index + + if (ci == -1) { + choices.Add( str ); + break; + } + else { + choices.Add(str.Left(ci)); + } + + str = str.Right(str.length() - ci - 1); + } + + int cnt = choices.GetCount(); + if (choices.GetCount() > 0) { + wxString *array = NULL; + array = new wxString[cnt]; + for (int j = 0; j < cnt; j++ ) { + array[j] = choices[j]; + } + + int val = (int) d; + good = shuttle.TransferEnum(ctrl->var, val, cnt, array); + d = (double) val; + + delete [] array; + } + } + else if (ctrl->type == NYQ_CTRL_STRING) { + good = shuttle.TransferString(ctrl->var, ctrl->valStr, wxEmptyString); + } + + if (ctrl->type != NYQ_CTRL_STRING) { + if (shuttle.mbStoreInClient && good) { + ctrl->val = d; + } + } } + return true; +} + +bool EffectNyquist::PromptUser() +{ if (mInteractive) { NyquistInputDialog dlog(wxGetTopLevelParent(NULL), -1, _("Nyquist Prompt"), Index: effects/nyquist/Nyquist.h =================================================================== --- effects/nyquist/Nyquist.h (revision 11253) +++ effects/nyquist/Nyquist.h (working copy) @@ -111,11 +111,15 @@ virtual wxString GetEffectAction() { return mAction; } - + virtual bool PromptUser(); virtual bool Process(); + // Batch chain support + virtual bool SupportsChains(); + virtual bool TransferParameters( Shuttle & shuttle ); + private: static wxString NyquistToWxString(const char *nyqString); Index: Shuttle.cpp =================================================================== --- Shuttle.cpp (revision 11253) +++ Shuttle.cpp (working copy) @@ -204,10 +204,15 @@ iValue = 0;// default index if none other selected. if( ExchangeWithMaster( Name )) { - int i; - for(i=0;i