gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

tabgroup.h (850B)


      1 #pragma once
      2 
      3 #include <string>
      4 #include <vector>
      5 
      6 namespace juce
      7 {
      8 	class Button;
      9 	class Component;
     10 }
     11 
     12 namespace genericUI
     13 {
     14 	class Editor;
     15 
     16 	class TabGroup
     17 	{
     18 	public:
     19 		TabGroup() = default;
     20 		TabGroup(std::string _name, std::vector<std::string> _pageNames, std::vector<std::string> _buttonNames);
     21 
     22 		bool isValid() const
     23 		{
     24 			return !m_name.empty() && !m_buttonNames.empty() && m_buttonNames.size() == m_pageNames.size();
     25 		}
     26 
     27 		void create(const Editor& _editor);
     28 
     29 		const std::string& getName() const { return m_name; }
     30 
     31 		bool selectTabWithComponent(const juce::Component* _component) const;
     32 
     33 	private:
     34 		void setPage(const size_t _page) const;
     35 
     36 		std::string m_name;
     37 
     38 		std::vector<std::string> m_pageNames;
     39 		std::vector<std::string> m_buttonNames;
     40 
     41 		std::vector<juce::Component*> m_tabs;
     42 		std::vector<juce::Button*> m_tabButtons;
     43 	};
     44 }