MCPcopy Create free account
hub / github.com/audacity/audacity / Process

Method Process

libraries/lib-nyquist-effects/NyquistBase.cpp:644–1099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

642};
643
644bool NyquistBase::Process(EffectInstance&, EffectSettings& settings)
645{
646 if (mIsPrompt && mControls.size() > 0 && !IsBatchProcessing())
647 {
648 auto& nyquistSettings = GetSettings(settings);
649 auto cleanup = finally([&] {
650 // Free up memory
651 nyquistSettings.proxySettings = {};
652 });
653 NyquistBase proxy { NYQUIST_WORKER_ID };
654 proxy.SetCommand(mInputCmd);
655 proxy.mDebug = nyquistSettings.proxyDebug;
656 proxy.mControls = move(nyquistSettings.controls);
657 auto result = Delegate(proxy, nyquistSettings.proxySettings);
658 if (result)
659 {
660 mT0 = proxy.mT0;
661 mT1 = proxy.mT1;
662 }
663 return result;
664 }
665
666 // Check for reentrant Nyquist commands.
667 // I'm choosing to mark skipped Nyquist commands as successful even though
668 // they are skipped. The reason is that when Nyquist calls out to a chain,
669 // and that chain contains Nyquist, it will be clearer if the chain
670 // completes skipping Nyquist, rather than doing nothing at all.
671 if (mReentryCount > 0)
672 return true;
673
674 // Restore the reentry counter (to zero) when we exit.
675 auto countRestorer = valueRestorer(mReentryCount);
676 mReentryCount++;
677 RegisterFunctions();
678
679 bool success = true;
680 int nEffectsSoFar = EffectOutputTracks::nEffectsDone;
681 mProjectChanged = false;
682 EffectManager& em = EffectManager::Get();
683 em.SetSkipStateFlag(false);
684
685 // This code was added in a fix for bug 2392 (no preview for Nyquist)
686 // It was commented out in a fix for bug 2428 (no progress dialog from a
687 // macro)
688 // if (mExternal) {
689 // mProgress->Hide();
690 //}
691
692 mOutputTime = 0;
693 mCount = 0;
694 const auto scale =
695 (GetType() == EffectTypeProcess ? 0.5 : 1.0) / GetNumWaveGroups();
696
697 mStop = false;
698 mBreak = false;
699 mCont = false;
700
701 mTrackIndex = 0;

Callers

nothing calls this directly

Calls 15

IsBatchProcessingFunction · 0.85
GetSettingsFunction · 0.85
finallyFunction · 0.85
moveFunction · 0.85
valueRestorerFunction · 0.85
RegisterFunctionsFunction · 0.85
GetFunction · 0.85
GetNumWaveGroupsFunction · 0.85
GetSystemLanguageCodeFunction · 0.85
ShowMessageBoxFunction · 0.85
VerbatimFunction · 0.85
GroupFunction · 0.85

Tested by

no test coverage detected