11namespace tracktion {
inline namespace engine
23 void setActive (
bool shouldBeActive);
24 bool isActive() {
return learnActive; }
32 void assignmentChanged (ChangeType t);
54 virtual void midiLearnStatusChanged (
bool isActive) = 0;
55 virtual void midiLearnAssignmentChanged (ChangeType) {}
64 bool learnActive =
false;
66 void addListener (
Listener* l) { listeners.
add (l); }
67 void removeListener (Listener* l) { listeners.
remove (l); }
85 Assignment() : id (CustomControlSurface::none) {}
void add(ListenerClass *listenerToAdd)
void remove(ListenerClass *listenerToRemove)
ActionID
enum used to determine the action type.
The Engine is the central class for all tracktion sessions.
Base class for things that can be assigned to external control surfaces, not plugin paramters.
void addAssignent(Assignment)
Adds an assignment to the list.
void handleMenuResult(int menuResult)
If you've shown a custom menu this will be called with the result which you should handle appropriate...
int getFaderIndex()
Returns the fader index which varies depending on the track num and selected bank etc.
juce::Array< Assignment > & getAssignments()
This should return any assignments that should be shown by the pop-up component.
bool isSingleAssignment() const noexcept
Should return true if only one action can be assigned from this control.
virtual Track::Ptr getControlledTrack()
Should return the track that this control represents or nullptr if it is track independant.
void buildMenu(juce::PopupMenu &)
Builds a menu of actions that can be assigned by this control.
virtual bool isAssignable()=0
Should return true if the control is currently assignable.
virtual juce::String getDescription()=0
Should return a brief description such as "Track 1 Aux Send" or "Track 4 Record Arm".
Manages the Midi learn state and Listener interface to notify subclasses when the state changes.
Subclass this to be notified when the MidiLearn state changes.