andrewm@0: /* andrewm@0: TouchKeys: multi-touch musical keyboard control software andrewm@0: Copyright (c) 2013 Andrew McPherson andrewm@0: andrewm@0: This program is free software: you can redistribute it and/or modify andrewm@0: it under the terms of the GNU General Public License as published by andrewm@0: the Free Software Foundation, either version 3 of the License, or andrewm@0: (at your option) any later version. andrewm@0: andrewm@0: This program is distributed in the hope that it will be useful, andrewm@0: but WITHOUT ANY WARRANTY; without even the implied warranty of andrewm@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the andrewm@0: GNU General Public License for more details. andrewm@0: andrewm@0: You should have received a copy of the GNU General Public License andrewm@0: along with this program. If not, see . andrewm@0: andrewm@0: ===================================================================== andrewm@0: andrewm@0: MappingEditorComponent.h: Juce Component subclass from which all andrewm@0: mapping editors inherit. andrewm@0: */ andrewm@0: andrewm@0: andrewm@0: #ifndef __MAPPINGEDITORCOMPONENT_H_C93E7296__ andrewm@0: #define __MAPPINGEDITORCOMPONENT_H_C93E7296__ andrewm@0: andrewm@50: #ifndef TOUCHKEYS_NO_GUI andrewm@50: andrewm@0: #include "../../JuceLibraryCode/JuceHeader.h" andrewm@0: andrewm@0: //============================================================================== andrewm@0: /* andrewm@0: */ andrewm@0: class MappingEditorComponent : public Component andrewm@0: { andrewm@0: public: andrewm@0: MappingEditorComponent() andrewm@0: { andrewm@0: // In your constructor, you should add any child components, and andrewm@0: // initialise any special settings that your component needs. andrewm@0: andrewm@0: } andrewm@0: andrewm@0: virtual ~MappingEditorComponent() andrewm@0: { andrewm@0: } andrewm@0: andrewm@0: // Method to synchronize the GUI state to the underlying andrewm@0: // state of the mapping. Implemented in the subclass. andrewm@0: virtual void synchronize() {} andrewm@41: andrewm@41: // Get a human-readable name for the mapping andrewm@41: // Generally, extended editors should implement this but short editors andrewm@41: // don't need to andrewm@41: virtual String getDescription() { return "Mapping"; } andrewm@0: andrewm@0: virtual void paint (Graphics& g) andrewm@0: { andrewm@0: /* This demo code just fills the component's background and andrewm@0: draws some placeholder text to get you started. andrewm@0: andrewm@0: You should replace everything in this method with your own andrewm@0: drawing code.. andrewm@0: */ andrewm@0: andrewm@0: g.fillAll (Colours::white); // clear the background andrewm@0: andrewm@0: g.setColour (Colours::grey); andrewm@0: g.drawRect (getLocalBounds(), 1); // draw an outline around the component andrewm@0: andrewm@0: g.setColour (Colours::lightblue); andrewm@0: g.setFont (14.0f); andrewm@0: g.drawText ("MappingEditorComponent", getLocalBounds(), andrewm@0: Justification::centred, true); // draw some placeholder text andrewm@0: } andrewm@0: andrewm@0: virtual void resized() andrewm@0: { andrewm@0: // This method is where you should set the bounds of any child andrewm@0: // components that your component contains.. andrewm@0: andrewm@0: } andrewm@0: andrewm@0: private: andrewm@0: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MappingEditorComponent) andrewm@0: }; andrewm@0: andrewm@50: #endif // TOUCHKEYS_NO_GUI andrewm@0: andrewm@0: #endif // __MAPPINGEDITORCOMPONENT_H_C93E7296__