Fix missing support for lv2core#sampleRate (Fixes #5767)

This multiplies port's min/max value with the processing sample rate
that is used for the plugin. This fixes damaged audio in GLAME
Butterworth High-/Lowpass from #5767.
This commit is contained in:
Johannes Lorenz
2020-11-12 21:31:40 +01:00
committed by Johannes Lorenz
parent 48bc9db71d
commit 1c2107f4c6
4 changed files with 24 additions and 11 deletions

View File

@@ -108,11 +108,17 @@ struct Meta
Flow m_flow = Flow::Unknown;
Vis m_vis = Vis::None;
float m_def = .0f, m_min = .0f, m_max = .0f;
bool m_optional = false;
bool m_used = true;
std::vector<PluginIssue> get(const LilvPlugin* plugin, std::size_t portNum);
float def() const { return m_def; }
float min(sample_rate_t sr) const { return m_sampleRate ? sr * m_min : m_min; }
float max(sample_rate_t sr) const { return m_sampleRate ? sr * m_max : m_max; }
private:
float m_def = .0f, m_min = .0f, m_max = .0f;
bool m_sampleRate = false;
};
struct PortBase : public Meta