When writing code for a MIDI Control Surface, you'll likely come across the Control_Surface singleton. The program structure usually looks something like this:
The Control_Surface singleton is responsible for the following important tasks:
Control Surface keeps track of elements that inherit from the AH::UpdatableCRTP base class. Specifically, it keeps a list of all AH::ExtendedIOElements, MIDI_Interfaces, MIDI Output Elements, MIDI Input Elements and Display Elements. If you have certain elements that should not be initialized or updated by Control Surface, you can call AH::UpdatableCRTP::disable() before calling Control_Surface.begin()
. It is then your responsibility to call the AH::Updatable::begin() and AH::Updatable::update() functions whenever appropriate. You can also enable these disabled elements again using AH::UpdatableCRTP::enable().