bool EffectNyquist::SetXlispPath() { wxString fname; fname = mXlispPath + wxFILE_SEP_PATH + wxT("nyinit.lsp"); if (!(::wxFileExists(fname))) { mXlispPath = wxT(""); } if (mXlispPath == wxT("")) { wxArrayString audacityPathList = wxGetApp().audacityPathList; wxArrayString pathList; wxArrayString files; unsigned int i; for (i = 0; i < audacityPathList.GetCount(); i++) { wxString prefix = audacityPathList[i] + wxFILE_SEP_PATH; wxGetApp().AddUniquePathToPathList(prefix + wxT("nyquist"), pathList); } wxGetApp().FindFilesInPathList(wxT("nyquist.lsp"), pathList, files); if (files.GetCount() > 0) { mXlispPath = ::wxPathOnly(files[0]); } } /* set_xlisp_path doesn't handle fn_Str() in Unicode build. May or may not actually work. */ nyx_set_xlisp_path(mXlispPath.mb_str()); fname = mXlispPath + wxFILE_SEP_PATH + wxT("nyinit.lsp"); return ::wxFileExists(fname); }
bool NyquistEffectsModule::Initialize() { wxArrayString audacityPathList = wxGetApp().audacityPathList; for (size_t i = 0, cnt = audacityPathList.GetCount(); i < cnt; i++) { wxFileName name(audacityPathList[i], wxT("")); name.AppendDir(wxT("nyquist")); name.SetFullName(wxT("nyquist.lsp")); if (name.FileExists()) { // set_xlisp_path doesn't handle fn_Str() in Unicode build. May or may not actually work. nyx_set_xlisp_path(name.GetPath().ToUTF8()); return true; } } wxLogWarning(wxT("Critical Nyquist files could not be found. Nyquist effects will not work.")); return false; }
void NyquistEffectsModule::Terminate() { nyx_set_xlisp_path(NULL); return; }