I am actually trying to solve a standard problem in plugin development: having a slider than can display alternatively two different types of values.
My slider should be able to switch between frequency display or note value display (1/8, 1/16 …).
Actually I have a custom slider “DualSlider” that inherits from Slider class and overrides getTextFromValue() / getValueFromText() , these methods implement a test that uses the value of a ToggleButton to switch the display mode. It works but in the current version my class DualSlider includes a pointer to my processor to test the ToggleButton, it’s not very generic … I will have to adapt that code if I want to use it in other projects.
Therefore, I think it would be better to implement a new class that have both properties from Slider and ToggleButton but I am not very confortable with this kind of topic… Does someone can advise me a good direction to start? Should I make a composition of Slider and ToggleButton or multiple inheritance from these classes? I guess I will have to manage many ambiguities because Slider and TB have a lot of methods in common…