Attempt to store and recall current GUI tab index but not working...

This commit is contained in:
xenakios 2018-06-29 15:13:49 +03:00
parent 473f4aa3e1
commit 5c900ee9b6
5 changed files with 20 additions and 4 deletions

View File

@ -26,7 +26,7 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
: AudioProcessorEditor(&p), : AudioProcessorEditor(&p),
m_wavecomponent(p.m_afm,p.m_thumb.get()), m_wavecomponent(p.m_afm,p.m_thumb.get()),
processor(p), m_perfmeter(&p), processor(p), m_perfmeter(&p),
m_wavefilter_tab(TabbedButtonBar::TabsAtTop), m_wavefilter_tab(p.m_cur_tab_index),
m_free_filter_component(&p) m_free_filter_component(&p)
{ {
m_wave_container = new Component; m_wave_container = new Component;
@ -443,6 +443,8 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id)
processor.m_free_filter_envelope->updateMinMaxValues(); processor.m_free_filter_envelope->updateMinMaxValues();
m_free_filter_component.repaint(); m_free_filter_component.repaint();
m_spec_order_ed.repaint(); m_spec_order_ed.repaint();
//if (m_wavefilter_tab.getCurrentTabIndex() != processor.m_cur_tab_index)
// m_wavefilter_tab.setCurrentTabIndex(processor.m_cur_tab_index, false);
} }
} }

View File

@ -246,6 +246,18 @@ private:
int m_slidwidth = 400; int m_slidwidth = 400;
}; };
class MyTabComponent : public TabbedComponent
{
public:
MyTabComponent(int& curtab) : TabbedComponent(TabbedButtonBar::TabsAtTop), m_cur_tab(curtab) {}
void currentTabChanged(int newCurrentTabIndex, const String&) override
{
m_cur_tab = newCurrentTabIndex;
}
private:
int& m_cur_tab;
};
class PaulstretchpluginAudioProcessorEditor : public AudioProcessorEditor, class PaulstretchpluginAudioProcessorEditor : public AudioProcessorEditor,
public MultiTimer, public FileDragAndDropTarget, public DragAndDropContainer public MultiTimer, public FileDragAndDropTarget, public DragAndDropContainer
{ {
@ -280,7 +292,7 @@ private:
zoom_scrollbar m_zs; zoom_scrollbar m_zs;
RatioMixerEditor m_ratiomixeditor{ 8 }; RatioMixerEditor m_ratiomixeditor{ 8 };
FreeFilterComponent m_free_filter_component; FreeFilterComponent m_free_filter_component;
TabbedComponent m_wavefilter_tab; MyTabComponent m_wavefilter_tab;
Component* m_wave_container=nullptr; Component* m_wave_container=nullptr;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessorEditor) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessorEditor)
}; };

View File

@ -246,6 +246,7 @@ ValueTree PaulstretchpluginAudioProcessor::getStateTree(bool ignoreoptions, bool
storeToTreeProperties(paramtree, nullptr, "playwhenhostrunning", m_play_when_host_plays, "capturewhenhostrunning", m_capture_when_host_plays); storeToTreeProperties(paramtree, nullptr, "playwhenhostrunning", m_play_when_host_plays, "capturewhenhostrunning", m_capture_when_host_plays);
storeToTreeProperties(paramtree, nullptr, "mutewhilecapturing", m_mute_while_capturing); storeToTreeProperties(paramtree, nullptr, "mutewhilecapturing", m_mute_while_capturing);
} }
storeToTreeProperties(paramtree, nullptr, "tabaindex", m_cur_tab_index);
storeToTreeProperties(paramtree, nullptr, "waveviewrange", m_wave_view_range); storeToTreeProperties(paramtree, nullptr, "waveviewrange", m_wave_view_range);
ValueTree freefilterstate = m_free_filter_envelope->saveState(Identifier("freefilter_envelope")); ValueTree freefilterstate = m_free_filter_envelope->saveState(Identifier("freefilter_envelope"));
paramtree.addChild(freefilterstate, -1, nullptr); paramtree.addChild(freefilterstate, -1, nullptr);
@ -263,6 +264,7 @@ void PaulstretchpluginAudioProcessor::setStateFromTree(ValueTree tree)
m_load_file_with_state = tree.getProperty("loadfilewithstate", true); m_load_file_with_state = tree.getProperty("loadfilewithstate", true);
getFromTreeProperties(tree, "playwhenhostrunning", m_play_when_host_plays, getFromTreeProperties(tree, "playwhenhostrunning", m_play_when_host_plays,
"capturewhenhostrunning", m_capture_when_host_plays,"mutewhilecapturing",m_mute_while_capturing); "capturewhenhostrunning", m_capture_when_host_plays,"mutewhilecapturing",m_mute_while_capturing);
getFromTreeProperties(tree, "tabaindex", m_cur_tab_index);
if (tree.hasProperty("numspectralstagesb")) if (tree.hasProperty("numspectralstagesb"))
{ {
std::vector<SpectrumProcess> old_order = m_stretch_source->getSpectrumProcessOrder(); std::vector<SpectrumProcess> old_order = m_stretch_source->getSpectrumProcessOrder();

View File

@ -213,7 +213,7 @@ public:
pointer_sized_int value, pointer_sized_int value,
void* ptr, void* ptr,
float opt) override; float opt) override;
int m_cur_tab_index = 0;
private: private:

View File

@ -20,7 +20,7 @@ History :
-Changed "Octaves" module to "Ratios". The Ratios module has more shifters than the previous -Changed "Octaves" module to "Ratios". The Ratios module has more shifters than the previous
Octaves module and allows changing the pitch ratios (and the shifters mix) Octaves module and allows changing the pitch ratios (and the shifters mix)
in a separate tabbed page in the GUI. in a separate tabbed page in the GUI.
-Spectral module enabled parameters changed to target named modules instead of chain slots -Spectral module enabled parameters changed to target particular modules instead of chain slots
-Save and restore some additional settings -Save and restore some additional settings
04-01-2018 1.1.2 04-01-2018 1.1.2
-Rebuilt with latest JUCE to fix parameter automation issue for example in Ableton Live -Rebuilt with latest JUCE to fix parameter automation issue for example in Ableton Live