Renamed envelope component members
This commit is contained in:
parent
46c7c59987
commit
e92f69e2a9
@ -31,12 +31,12 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
|
|||||||
{
|
{
|
||||||
m_wave_container = new Component;
|
m_wave_container = new Component;
|
||||||
m_free_filter_component.getEnvelopeComponent()->set_envelope(processor.m_free_filter_envelope);
|
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<double>(pow(x, 3.0), 0.0, 1.0, 30.0, processor.getSampleRateChecked()/2.0);
|
//return jmap<double>(pow(x, 3.0), 0.0, 1.0, 30.0, processor.getSampleRateChecked()/2.0);
|
||||||
return 30.0*pow(1.05946309436, x*115.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<double>(x, 0.0, 1.0, -48.0, 12.0);
|
return jmap<double>(x, 0.0, 1.0, -48.0, 12.0);
|
||||||
};
|
};
|
||||||
|
@ -21,8 +21,8 @@ EnvelopeComponent::EnvelopeComponent(CriticalSection* cs) : m_cs(cs)
|
|||||||
{
|
{
|
||||||
OnEnvelopeEdited = [](breakpoint_envelope*) {};
|
OnEnvelopeEdited = [](breakpoint_envelope*) {};
|
||||||
setWantsKeyboardFocus(true);
|
setWantsKeyboardFocus(true);
|
||||||
ValueFromNormalized = [](double x) { return x; };
|
YFromNormalized = [](double x) { return x; };
|
||||||
TimeFromNormalized = [](double x) { return x; };
|
XFromNormalized = [](double x) { return x; };
|
||||||
addChildComponent(&m_bubble);
|
addChildComponent(&m_bubble);
|
||||||
setOpaque(true);
|
setOpaque(true);
|
||||||
}
|
}
|
||||||
@ -34,8 +34,8 @@ EnvelopeComponent::~EnvelopeComponent()
|
|||||||
|
|
||||||
void EnvelopeComponent::show_bubble(int x, int y, const envelope_node& node)
|
void EnvelopeComponent::show_bubble(int x, int y, const envelope_node& node)
|
||||||
{
|
{
|
||||||
double scaledtime = TimeFromNormalized(node.Time);
|
double scaledtime = XFromNormalized(node.Time);
|
||||||
double scaledvalue = ValueFromNormalized(node.Value);
|
double scaledvalue = YFromNormalized(node.Value);
|
||||||
x -= 50;
|
x -= 50;
|
||||||
if (x < 0)
|
if (x < 0)
|
||||||
x = 0;
|
x = 0;
|
||||||
@ -81,7 +81,7 @@ void EnvelopeComponent::paint(Graphics& g)
|
|||||||
for (int i = 0; i < 10; ++i)
|
for (int i = 0; i < 10; ++i)
|
||||||
{
|
{
|
||||||
double norm = 1.0 / 10 * i;
|
double norm = 1.0 / 10 * i;
|
||||||
double hz = TimeFromNormalized(norm);
|
double hz = XFromNormalized(norm);
|
||||||
int xcor = getWidth() / 10 * i;
|
int xcor = getWidth() / 10 * i;
|
||||||
g.drawText(String(hz, 1), xcor, getHeight() - 20, 100, 20, Justification::topLeft);
|
g.drawText(String(hz, 1), xcor, getHeight() - 20, 100, 20, Justification::topLeft);
|
||||||
}
|
}
|
||||||
|
@ -47,8 +47,8 @@ public:
|
|||||||
std::function<void(EnvelopeComponent*, Graphics&)> EnvelopeUnderlayDraw;
|
std::function<void(EnvelopeComponent*, Graphics&)> EnvelopeUnderlayDraw;
|
||||||
std::function<void(EnvelopeComponent*, Graphics&)> EnvelopeOverlayDraw;
|
std::function<void(EnvelopeComponent*, Graphics&)> EnvelopeOverlayDraw;
|
||||||
std::function<void(breakpoint_envelope*)> OnEnvelopeEdited;
|
std::function<void(breakpoint_envelope*)> OnEnvelopeEdited;
|
||||||
std::function<double(double)> ValueFromNormalized;
|
std::function<double(double)> YFromNormalized;
|
||||||
std::function<double(double)> TimeFromNormalized;
|
std::function<double(double)> XFromNormalized;
|
||||||
void changeListenerCallback(ChangeBroadcaster*) override;
|
void changeListenerCallback(ChangeBroadcaster*) override;
|
||||||
void timerCallback(int id) override;
|
void timerCallback(int id) override;
|
||||||
//String getTooltip() override;
|
//String getTooltip() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user