Used as a workaround for issue #2555: some plugins do not accept changes via IEditController::setParamNormalized, but seem to read current parameter values directly from the DSP model. When processing is disabled this call helps synchronize internal state of the IEditController, so that next time UI is opened it displays correct values. As a side effect subsequent call to IAudioProcessor::proces
| 823 | //As a side effect subsequent call to IAudioProcessor::process may flush |
| 824 | //plugin internal buffers |
| 825 | void VST3Wrapper::FlushParameters(EffectSettings& settings, bool* hasChanges) |
| 826 | { |
| 827 | if(!mActive) |
| 828 | { |
| 829 | auto componentHandler = static_cast<ComponentHandler*>(mComponentHandler.get()); |
| 830 | componentHandler->FlushCache(settings); |
| 831 | |
| 832 | const auto doProcessing = !GetSettings(settings).parameterChanges.empty(); |
| 833 | |
| 834 | if(hasChanges != nullptr) |
| 835 | *hasChanges = doProcessing; |
| 836 | |
| 837 | if(!doProcessing) |
| 838 | return; |
| 839 | |
| 840 | SetupProcessing(*mEffectComponent, mSetup); |
| 841 | mActive = true; |
| 842 | if(mEffectComponent->setActive(true) == Steinberg::kResultOk) |
| 843 | { |
| 844 | ConsumeChanges(settings); |
| 845 | if(mAudioProcessor->setProcessing(true) != Steinberg::kResultFalse) |
| 846 | { |
| 847 | mProcessContext.sampleRate = mSetup.sampleRate; |
| 848 | mProcessContext.state = 0; |
| 849 | Process(nullptr, nullptr, 0); |
| 850 | mAudioProcessor->setProcessing(false); |
| 851 | } |
| 852 | } |
| 853 | mEffectComponent->setActive(false); |
| 854 | mActive = false; |
| 855 | } |
| 856 | else if(hasChanges != nullptr) |
| 857 | *hasChanges = false; |
| 858 | } |
| 859 | |
| 860 | size_t VST3Wrapper::Process(const float* const* inBlock, float* const* outBlock, size_t blockLen) |
| 861 | { |
no test coverage detected