Initial work to move the free filter parameter components to the free gilter tab page

This commit is contained in:
xenakios 2018-06-29 14:23:48 +03:00
parent 4f203de39a
commit 2d6dce9572
2 changed files with 26 additions and 4 deletions

View File

@ -30,13 +30,13 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
m_free_filter_component(p.getStretchSource()->getMutex())
{
m_wave_container = new Component;
m_free_filter_component.set_envelope(processor.m_free_filter_envelope);
m_free_filter_component.TimeFromNormalized = [this](double x)
m_free_filter_component.getEnvelopeComponent()->set_envelope(processor.m_free_filter_envelope);
m_free_filter_component.getEnvelopeComponent()->TimeFromNormalized = [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.ValueFromNormalized = [this](double x)
m_free_filter_component.getEnvelopeComponent()->ValueFromNormalized = [this](double x)
{
return jmap<double>(x, 0.0, 1.0, -48.0, 12.0);
};
@ -1511,3 +1511,13 @@ void RatioMixerEditor::paint(Graphics & g)
for (int i = 0; i < 8; ++i)
g.drawText(String(i + 1), slidw / 2 + slidw * i - 8, 1, 15, 15, Justification::centred);
}
FreeFilterComponent::FreeFilterComponent(CriticalSection* cs) : m_env(cs), m_cs(cs)
{
addAndMakeVisible(m_env);
}
void FreeFilterComponent::resized()
{
m_env.setBounds(200, 0, getWidth() - 200, getHeight());
}

View File

@ -230,6 +230,18 @@ private:
uptrvec<Slider> m_ratio_level_sliders;
};
class FreeFilterComponent : public Component
{
public:
FreeFilterComponent(CriticalSection* cs);
void resized() override;
EnvelopeComponent* getEnvelopeComponent() { return &m_env; }
private:
EnvelopeComponent m_env;
uptrvec<ParameterComponent> m_parcomps;
CriticalSection* m_cs = nullptr;
};
class PaulstretchpluginAudioProcessorEditor : public AudioProcessorEditor,
public MultiTimer, public FileDragAndDropTarget, public DragAndDropContainer
{
@ -263,7 +275,7 @@ private:
String m_last_err;
zoom_scrollbar m_zs;
RatioMixerEditor m_ratiomixeditor{ 8 };
EnvelopeComponent m_free_filter_component;
FreeFilterComponent m_free_filter_component;
TabbedComponent m_wavefilter_tab;
Component* m_wave_container=nullptr;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessorEditor)