gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit df954e116c7ca7d62f858cf86daaaffe71d3cdd0
parent dfa788412700062c111856bb56e8a940e0faac50
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Fri, 16 Jul 2021 01:41:55 +0200

report plugin latency to host

Diffstat:
Msource/jucePlugin/PluginProcessor.cpp | 1+
Msource/synthLib/device.h | 1+
Msource/synthLib/plugin.cpp | 5+++++
Msource/synthLib/plugin.h | 2++
4 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/source/jucePlugin/PluginProcessor.cpp b/source/jucePlugin/PluginProcessor.cpp @@ -91,6 +91,7 @@ void AudioPluginAudioProcessor::prepareToPlay (double sampleRate, int samplesPer m_plugin.setSamplerate(static_cast<float>(sampleRate)); m_plugin.setBlockSize(samplesPerBlock); + setLatencySamples(m_plugin.getLatencySamples()); } void AudioPluginAudioProcessor::releaseResources() diff --git a/source/synthLib/device.h b/source/synthLib/device.h @@ -17,6 +17,7 @@ namespace synthLib virtual ~Device(); virtual void process(float** _inputs, float** _outputs, size_t _size, const std::vector<SMidiEvent>& _midiIn, std::vector<SMidiEvent>& _midiOut); void setBlockSize(size_t _size); + uint32_t getLatencySamples() const { return m_nextLatency; } void startDSPThread(); diff --git a/source/synthLib/plugin.cpp b/source/synthLib/plugin.cpp @@ -229,4 +229,9 @@ namespace synthLib std::lock_guard lock(m_lock); m_device->setBlockSize(_blockSize); } + + uint32_t Plugin::getLatencySamples() const + { + return m_device->getLatencySamples(); + } } diff --git a/source/synthLib/plugin.h b/source/synthLib/plugin.h @@ -21,6 +21,8 @@ namespace synthLib void setSamplerate(float _samplerate); void setBlockSize(size_t _blockSize); + uint32_t getLatencySamples() const; + void process(float** _inputs, float** _outputs, size_t _count, float _bpm, float _ppqPos, bool _isPlaying); void getMidiOut(std::vector<SMidiEvent>& _midiOut);