Store and restore zoomscrollbar positions. Readme change.

This commit is contained in:
xenakios 2018-02-14 18:38:54 +02:00
parent e3d893ee9e
commit 178d68b0ec
4 changed files with 10 additions and 2 deletions

View File

@ -83,7 +83,9 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
m_zs.RangeChanged = [this](Range<double> r)
{
m_wavecomponent.setViewRange(r);
processor.m_wave_view_range = r;
};
m_zs.setRange(processor.m_wave_view_range, true);
setSize (1000, 30+(pars.size()/2)*25+200+15);
m_wavecomponent.TimeSelectionChangedCallback = [this](Range<double> range, int which)
{
@ -229,7 +231,7 @@ void PaulstretchpluginAudioProcessorEditor::resized()
int remain_h = getHeight() - 1 - yoffs -15;
m_spec_order_ed.setBounds(1, yoffs, getWidth() - 2, remain_h / 5 * 1);
m_wavecomponent.setBounds(1, m_spec_order_ed.getBottom()+1, getWidth()-2, remain_h/5*4);
m_zs.setBounds(1, m_wavecomponent.getBottom(), getWidth() - 2, 14);
m_zs.setBounds(1, m_wavecomponent.getBottom(), getWidth() - 2, 16);
//m_specvis.setBounds(1, yoffs, getWidth() - 2, getHeight() - 1 - yoffs);
}
@ -1132,6 +1134,8 @@ void zoom_scrollbar::paint(Graphics &g)
void zoom_scrollbar::setRange(Range<double> rng, bool docallback)
{
if (rng.isEmpty())
return;
m_therange = rng.constrainRange({ 0.0,1.0 });
if (RangeChanged && docallback)
RangeChanged(m_therange);

View File

@ -225,6 +225,7 @@ ValueTree PaulstretchpluginAudioProcessor::getStateTree(bool ignoreoptions, bool
paramtree.setProperty("prebufamount", -1, nullptr);
paramtree.setProperty("loadfilewithstate", m_load_file_with_state, nullptr);
}
storeToTreeProperties(paramtree, nullptr, "waveviewrange", m_wave_view_range);
return paramtree;
}
@ -246,6 +247,7 @@ void PaulstretchpluginAudioProcessor::setStateFromTree(ValueTree tree)
}
m_stretch_source->setSpectrumProcessOrder(order);
}
getFromTreeProperties(tree, "waveviewrange", m_wave_view_range);
for (int i = 0; i < getNumParameters(); ++i)
{
auto par = getFloatParameter(i);

View File

@ -163,6 +163,7 @@ public:
bool m_state_dirty = false;
std::unique_ptr<AudioThumbnail> m_thumb;
bool m_show_technical_info = false;
Range<double> m_wave_view_range;
private:

View File

@ -8,8 +8,9 @@ Released under GNU General Public License v.2 license.
History :
02-13-2018 1.0.1
02-14-2018 1.0.1
-Increased maximum number of input channels to 8
-Added zoom/scroll bar for waveform
-GUI performance improvement/bug fix during capture mode
02-09-2018 1.0.0
-Control/Command click on waveform seeks (if click within active play range)