Attempt to store and recall current GUI tab index but not working...
This commit is contained in:
		@@ -26,7 +26,7 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
 | 
			
		||||
	: AudioProcessorEditor(&p),
 | 
			
		||||
	m_wavecomponent(p.m_afm,p.m_thumb.get()),
 | 
			
		||||
	processor(p), m_perfmeter(&p),
 | 
			
		||||
    m_wavefilter_tab(TabbedButtonBar::TabsAtTop),
 | 
			
		||||
    m_wavefilter_tab(p.m_cur_tab_index),
 | 
			
		||||
	m_free_filter_component(&p)
 | 
			
		||||
{
 | 
			
		||||
	m_wave_container = new Component;
 | 
			
		||||
@@ -443,6 +443,8 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id)
 | 
			
		||||
		processor.m_free_filter_envelope->updateMinMaxValues();
 | 
			
		||||
		m_free_filter_component.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);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -246,6 +246,18 @@ private:
 | 
			
		||||
	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, 
 | 
			
		||||
	public MultiTimer, public FileDragAndDropTarget, public DragAndDropContainer
 | 
			
		||||
{
 | 
			
		||||
@@ -280,7 +292,7 @@ private:
 | 
			
		||||
	zoom_scrollbar m_zs;
 | 
			
		||||
	RatioMixerEditor m_ratiomixeditor{ 8 };
 | 
			
		||||
	FreeFilterComponent m_free_filter_component;
 | 
			
		||||
	TabbedComponent m_wavefilter_tab;
 | 
			
		||||
	MyTabComponent m_wavefilter_tab;
 | 
			
		||||
	Component* m_wave_container=nullptr;
 | 
			
		||||
	JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessorEditor)
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -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, "mutewhilecapturing", m_mute_while_capturing);
 | 
			
		||||
	}
 | 
			
		||||
	storeToTreeProperties(paramtree, nullptr, "tabaindex", m_cur_tab_index);
 | 
			
		||||
	storeToTreeProperties(paramtree, nullptr, "waveviewrange", m_wave_view_range);
 | 
			
		||||
    ValueTree freefilterstate = m_free_filter_envelope->saveState(Identifier("freefilter_envelope"));
 | 
			
		||||
    paramtree.addChild(freefilterstate, -1, nullptr);
 | 
			
		||||
@@ -263,6 +264,7 @@ void PaulstretchpluginAudioProcessor::setStateFromTree(ValueTree tree)
 | 
			
		||||
            m_load_file_with_state = tree.getProperty("loadfilewithstate", true);
 | 
			
		||||
			getFromTreeProperties(tree, "playwhenhostrunning", m_play_when_host_plays, 
 | 
			
		||||
				"capturewhenhostrunning", m_capture_when_host_plays,"mutewhilecapturing",m_mute_while_capturing);
 | 
			
		||||
			getFromTreeProperties(tree, "tabaindex", m_cur_tab_index);
 | 
			
		||||
			if (tree.hasProperty("numspectralstagesb"))
 | 
			
		||||
			{
 | 
			
		||||
				std::vector<SpectrumProcess> old_order = m_stretch_source->getSpectrumProcessOrder();
 | 
			
		||||
 
 | 
			
		||||
@@ -213,7 +213,7 @@ public:
 | 
			
		||||
		pointer_sized_int value,
 | 
			
		||||
		void* ptr,
 | 
			
		||||
		float opt) override;
 | 
			
		||||
 | 
			
		||||
	int m_cur_tab_index = 0;
 | 
			
		||||
private:
 | 
			
		||||
	
 | 
			
		||||
	
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@ History :
 | 
			
		||||
	-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) 
 | 
			
		||||
	 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
 | 
			
		||||
04-01-2018 1.1.2 
 | 
			
		||||
	-Rebuilt with latest JUCE to fix parameter automation issue for example in Ableton Live
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user