Place both the waveform component and the zoomscrollbar inside the tab component page. Needs a bit more tweaking.

This commit is contained in:
xenakios 2018-02-27 22:15:14 +02:00
parent 65bdd1ce91
commit 3dfb6a3c80
2 changed files with 13 additions and 10 deletions

View File

@ -32,7 +32,7 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
m_wavefilter_tab(TabbedButtonBar::TabsAtTop), m_wavefilter_tab(TabbedButtonBar::TabsAtTop),
m_free_filter_component(p.getStretchSource()->getMutex()) m_free_filter_component(p.getStretchSource()->getMutex())
{ {
//addAndMakeVisible(&m_free_filter_component); m_wave_container = new Component;
m_free_filter_component.set_envelope(processor.m_free_filter_envelope); m_free_filter_component.set_envelope(processor.m_free_filter_envelope);
m_free_filter_component.TimeFromNormalized = [this](double x) m_free_filter_component.TimeFromNormalized = [this](double x)
{ {
@ -59,9 +59,6 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
m_info_label.setJustificationType(Justification::centredRight); m_info_label.setJustificationType(Justification::centredRight);
m_wavecomponent.GetFileCallback = [this]() { return processor.getAudioFile(); }; m_wavecomponent.GetFileCallback = [this]() { return processor.getAudioFile(); };
//addAndMakeVisible(&m_wavecomponent);
const auto& pars = processor.getParameters(); const auto& pars = processor.getParameters();
for (int i=0;i<pars.size();++i) for (int i=0;i<pars.size();++i)
@ -96,7 +93,7 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
} }
//addAndMakeVisible(&m_specvis); //addAndMakeVisible(&m_specvis);
addAndMakeVisible(&m_zs); m_wave_container->addAndMakeVisible(&m_zs);
m_zs.RangeChanged = [this](Range<double> r) m_zs.RangeChanged = [this](Range<double> r)
{ {
m_wavecomponent.setViewRange(r); m_wavecomponent.setViewRange(r);
@ -135,7 +132,8 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
{ {
processor.setDirty(); processor.setDirty();
}; };
m_wavefilter_tab.addTab("Waveform", Colours::white, &m_wavecomponent, false); m_wave_container->addAndMakeVisible(&m_wavecomponent);
m_wavefilter_tab.addTab("Waveform", Colours::white, m_wave_container, true);
m_wavefilter_tab.addTab("Free filter", Colours::white, &m_free_filter_component, false); m_wavefilter_tab.addTab("Free filter", Colours::white, &m_free_filter_component, false);
addAndMakeVisible(&m_wavefilter_tab); addAndMakeVisible(&m_wavefilter_tab);
@ -260,12 +258,16 @@ void PaulstretchpluginAudioProcessorEditor::resized()
m_parcomps[cpi_playrangeoffset]->setBounds(xoffs, yoffs, getWidth() - 2, 24); m_parcomps[cpi_playrangeoffset]->setBounds(xoffs, yoffs, getWidth() - 2, 24);
#endif #endif
yoffs += 25; yoffs += 25;
int remain_h = getHeight() - 1 - yoffs -15; int remain_h = getHeight() - 1 - yoffs;
m_spec_order_ed.setBounds(1, yoffs, getWidth() - 2, remain_h / 5 * 1); m_spec_order_ed.setBounds(1, yoffs, getWidth() - 2, remain_h / 5 * 1);
m_wavefilter_tab.setBounds(1, m_spec_order_ed.getBottom() + 1, getWidth() - 2, remain_h / 5 * 4);
m_wavecomponent.setBounds(m_wave_container->getX(), 0, m_wave_container->getWidth(),
m_wave_container->getHeight()-16);
m_zs.setBounds(m_wave_container->getX(), m_wavecomponent.getBottom(), m_wave_container->getWidth(), 15);
//m_wavecomponent.setBounds(1, m_spec_order_ed.getBottom()+1, getWidth()-2, remain_h/5*4); //m_wavecomponent.setBounds(1, m_spec_order_ed.getBottom()+1, getWidth()-2, remain_h/5*4);
m_wavefilter_tab.setBounds(1, m_spec_order_ed.getBottom()+1, getWidth()-2, remain_h/5*4);
m_zs.setBounds(1, m_wavefilter_tab.getBottom(), getWidth() - 2, 16);
} }
void PaulstretchpluginAudioProcessorEditor::timerCallback(int id) void PaulstretchpluginAudioProcessorEditor::timerCallback(int id)

View File

@ -232,6 +232,7 @@ private:
zoom_scrollbar m_zs; zoom_scrollbar m_zs;
EnvelopeComponent m_free_filter_component; EnvelopeComponent m_free_filter_component;
TabbedComponent m_wavefilter_tab; TabbedComponent m_wavefilter_tab;
Component* m_wave_container=nullptr;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessorEditor) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessorEditor)
}; };