comparison Source/Mappings/MappingFactory.h @ 49:90ce403d0dc5

Added OSC control over all main application functions. OSC messages can be sent to do most of the tasks available from the GUI.
author Andrew McPherson <andrewm@eecs.qmul.ac.uk>
date Mon, 13 Apr 2015 19:30:27 -0700
parents e8965409903e
children
comparison
equal deleted inserted replaced
48:2a9e5576905e 49:90ce403d0dc5
60 // Generic name for this type of factory 60 // Generic name for this type of factory
61 virtual const std::string factoryTypeName() { return "Unknown\nMapping"; } 61 virtual const std::string factoryTypeName() { return "Unknown\nMapping"; }
62 62
63 // Specific name for this particular factory 63 // Specific name for this particular factory
64 virtual string const getName() { return ""; } 64 virtual string const getName() { return ""; }
65 virtual string const getShortName() { return ""; }
65 virtual void setName(const string& name) {} 66 virtual void setName(const string& name) {}
66 67
67 virtual Mapping* mapping(int noteNumber) = 0; // Look up a mapping with the given note number 68 virtual Mapping* mapping(int noteNumber) = 0; // Look up a mapping with the given note number
68 virtual std::vector<int> activeMappings() = 0; // Return a list of all active notes 69 virtual std::vector<int> activeMappings() = 0; // Return a list of all active notes
69 70
122 KeyPositionTracker* positionTracker) = 0; 123 KeyPositionTracker* positionTracker) = 0;
123 124
124 // Notification from key that a note is about to be sent out 125 // Notification from key that a note is about to be sent out
125 virtual void noteWillBegin(int noteNumber, int midiChannel, int midiVelocity) = 0; 126 virtual void noteWillBegin(int noteNumber, int midiChannel, int midiVelocity) = 0;
126 127
128 #ifndef TOUCHKEYS_NO_GUI
127 // ***** GUI Support ***** 129 // ***** GUI Support *****
128 // There are two types of editors for a mapping: one is a small editor that fits in the 130 // There are two types of editors for a mapping: one is a small editor that fits in the
129 // list view for adjusting the most important parameters, the other goes in a window of 131 // list view for adjusting the most important parameters, the other goes in a window of
130 // its own to adjust every parameter. 132 // its own to adjust every parameter.
131 133
132 virtual bool hasBasicEditor() { return false; } 134 virtual bool hasBasicEditor() { return false; }
133 virtual MappingEditorComponent* createBasicEditor() { return nullptr; } 135 virtual MappingEditorComponent* createBasicEditor() { return nullptr; }
134 virtual bool hasExtendedEditor() { return false; } 136 virtual bool hasExtendedEditor() { return false; }
135 virtual MappingEditorComponent* createExtendedEditor() { return nullptr; } 137 virtual MappingEditorComponent* createExtendedEditor() { return nullptr; }
138 #endif
139
140 // ****** OSC Control ******
141 // As an alternative to GUI control, the mapping factories can receive OSC messages
142 // from the keyboard segment to which they are attached.
143 virtual OscMessage* oscControlMethod(const char *path, const char *types,
144 int numValues, lo_arg **values, void *data) {
145 // Nothing to do here in this virtual base class
146 return 0;
147 }
136 148
137 // ****** Preset Save/Load ****** 149 // ****** Preset Save/Load ******
138 // These methods generate XML settings files and reload values from them 150 // These methods generate XML settings files and reload values from them
139 // The specific implementation is up to the subclass 151 // The specific implementation is up to the subclass
140 152