Renamed envelope component members

This commit is contained in:
xenakios 2018-07-08 14:38:50 +03:00
parent 46c7c59987
commit e92f69e2a9
3 changed files with 9 additions and 9 deletions

View File

@ -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<double>(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<double>(x, 0.0, 1.0, -48.0, 12.0);
};

View File

@ -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);
}

View File

@ -47,8 +47,8 @@ public:
std::function<void(EnvelopeComponent*, Graphics&)> EnvelopeUnderlayDraw;
std::function<void(EnvelopeComponent*, Graphics&)> EnvelopeOverlayDraw;
std::function<void(breakpoint_envelope*)> OnEnvelopeEdited;
std::function<double(double)> ValueFromNormalized;
std::function<double(double)> TimeFromNormalized;
std::function<double(double)> YFromNormalized;
std::function<double(double)> XFromNormalized;
void changeListenerCallback(ChangeBroadcaster*) override;
void timerCallback(int id) override;
//String getTooltip() override;