From e92f69e2a933be9550201d803eb8a5cb6705a250 Mon Sep 17 00:00:00 2001 From: xenakios Date: Sun, 8 Jul 2018 14:38:50 +0300 Subject: [PATCH] Renamed envelope component members --- Source/PluginEditor.cpp | 4 ++-- Source/envelope_component.cpp | 10 +++++----- Source/envelope_component.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index eba9cbd..f17673f 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -31,12 +31,12 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau { m_wave_container = new Component; m_free_filter_component.getEnvelopeComponent()->set_envelope(processor.m_free_filter_envelope); - m_free_filter_component.getEnvelopeComponent()->TimeFromNormalized = [this](double x) + m_free_filter_component.getEnvelopeComponent()->XFromNormalized = [this](double x) { //return jmap(pow(x, 3.0), 0.0, 1.0, 30.0, processor.getSampleRateChecked()/2.0); return 30.0*pow(1.05946309436, x*115.0); }; - m_free_filter_component.getEnvelopeComponent()->ValueFromNormalized = [this](double x) + m_free_filter_component.getEnvelopeComponent()->YFromNormalized = [this](double x) { return jmap(x, 0.0, 1.0, -48.0, 12.0); }; diff --git a/Source/envelope_component.cpp b/Source/envelope_component.cpp index 6c752e6..ee6a70f 100644 --- a/Source/envelope_component.cpp +++ b/Source/envelope_component.cpp @@ -21,8 +21,8 @@ EnvelopeComponent::EnvelopeComponent(CriticalSection* cs) : m_cs(cs) { OnEnvelopeEdited = [](breakpoint_envelope*) {}; setWantsKeyboardFocus(true); - ValueFromNormalized = [](double x) { return x; }; - TimeFromNormalized = [](double x) { return x; }; + YFromNormalized = [](double x) { return x; }; + XFromNormalized = [](double x) { return x; }; addChildComponent(&m_bubble); setOpaque(true); } @@ -34,8 +34,8 @@ EnvelopeComponent::~EnvelopeComponent() void EnvelopeComponent::show_bubble(int x, int y, const envelope_node& node) { - double scaledtime = TimeFromNormalized(node.Time); - double scaledvalue = ValueFromNormalized(node.Value); + double scaledtime = XFromNormalized(node.Time); + double scaledvalue = YFromNormalized(node.Value); x -= 50; if (x < 0) x = 0; @@ -81,7 +81,7 @@ void EnvelopeComponent::paint(Graphics& g) for (int i = 0; i < 10; ++i) { double norm = 1.0 / 10 * i; - double hz = TimeFromNormalized(norm); + double hz = XFromNormalized(norm); int xcor = getWidth() / 10 * i; g.drawText(String(hz, 1), xcor, getHeight() - 20, 100, 20, Justification::topLeft); } diff --git a/Source/envelope_component.h b/Source/envelope_component.h index b4011e1..ca0ff93 100644 --- a/Source/envelope_component.h +++ b/Source/envelope_component.h @@ -47,8 +47,8 @@ public: std::function EnvelopeUnderlayDraw; std::function EnvelopeOverlayDraw; std::function OnEnvelopeEdited; - std::function ValueFromNormalized; - std::function TimeFromNormalized; + std::function YFromNormalized; + std::function XFromNormalized; void changeListenerCallback(ChangeBroadcaster*) override; void timerCallback(int id) override; //String getTooltip() override;