summaryrefslogtreecommitdiff
path: root/plugins/ZaMultiCompX2/ZaMultiCompX2UI.hpp
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2014-04-15 15:30:54 +1000
committerDamien Zammit <damien@zamaudio.com>2014-04-15 15:30:54 +1000
commit465390c75f2e2e385cf90be0396961eb7aa69302 (patch)
tree888cc2acd2146b705a31cedeb555acc70a447983 /plugins/ZaMultiCompX2/ZaMultiCompX2UI.hpp
parent2f66cd7c71b2f1fae823f566f3bbe04f91a3c879 (diff)
Added comp curves to UI
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Diffstat (limited to 'plugins/ZaMultiCompX2/ZaMultiCompX2UI.hpp')
-rw-r--r--plugins/ZaMultiCompX2/ZaMultiCompX2UI.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/plugins/ZaMultiCompX2/ZaMultiCompX2UI.hpp b/plugins/ZaMultiCompX2/ZaMultiCompX2UI.hpp
index 810f56a..708e4b5 100644
--- a/plugins/ZaMultiCompX2/ZaMultiCompX2UI.hpp
+++ b/plugins/ZaMultiCompX2/ZaMultiCompX2UI.hpp
@@ -24,6 +24,8 @@
#include "ImageKnob.hpp"
#include "ImageSlider.hpp"
+#define COMPOINTS 1000
+#define MAX_COMP 3
#include "ZaMultiCompX2Artwork.hpp"
#include "ZaMultiCompX2Plugin.hpp"
@@ -58,6 +60,9 @@ protected:
return ZaMultiCompX2Artwork::zamulticompx2Height;
}
+ void compcurve(float in, int k, float* x, float* y);
+ void calc_compcurves(void);
+
// -------------------------------------------------------------------
// DSP Callbacks
@@ -78,6 +83,24 @@ protected:
void onDisplay() override;
+inline double
+to_dB(double g) {
+ return (20.*log10(g));
+}
+
+inline double
+from_dB(double gdb) {
+ return (exp(gdb/20.*log(10.)));
+}
+
+inline double
+sanitize_denormal(double value) {
+ if (!std::isnormal(value)) {
+ return (0.);
+ }
+ return value;
+}
+
private:
Image fImgBackground;
ImageKnob* fKnobAttack;
@@ -107,6 +130,14 @@ private:
float fLedYellowValueL;
float fLedYellowValueR;
Rectangle<int> fCanvasArea;
+ float fAttack;
+ float fRelease;
+ float fThresh;
+ float fRatio;
+ float fKnee;
+ float fMakeup[MAX_COMP];
+ float compx[MAX_COMP][COMPOINTS];
+ float compy[MAX_COMP][COMPOINTS];
};
// -----------------------------------------------------------------------