Mercurial > hg > touchkeys
comparison Source/GUI/KeyboardZoneComponent.h @ 0:3580ffe87dc8
First commit of TouchKeys public pre-release.
author | Andrew McPherson <andrewm@eecs.qmul.ac.uk> |
---|---|
date | Mon, 11 Nov 2013 18:19:35 +0000 |
parents | |
children | 0bcbe28a25a2 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3580ffe87dc8 |
---|---|
1 /* | |
2 ============================================================================== | |
3 | |
4 This is an automatically generated GUI class created by the Introjucer! | |
5 | |
6 Be careful when adding custom code to these files, as only the code within | |
7 the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded | |
8 and re-saved. | |
9 | |
10 Created with Introjucer version: 3.1.0 | |
11 | |
12 ------------------------------------------------------------------------------ | |
13 | |
14 The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" | |
15 Copyright 2004-13 by Raw Material Software Ltd. | |
16 | |
17 ============================================================================== | |
18 */ | |
19 | |
20 #ifndef __JUCE_HEADER_E3CF42F64919BE28__ | |
21 #define __JUCE_HEADER_E3CF42F64919BE28__ | |
22 | |
23 //[Headers] -- You can add your own extra header files here -- | |
24 #include "JuceHeader.h" | |
25 #include "MappingListComponent.h" | |
26 #include "../MainApplicationController.h" | |
27 #include "../TouchKeys/MidiKeyboardSegment.h" | |
28 //[/Headers] | |
29 | |
30 | |
31 | |
32 //============================================================================== | |
33 /** | |
34 //[Comments] | |
35 An auto-generated component, created by the Introjucer. | |
36 | |
37 Describe your class and how it works here! | |
38 //[/Comments] | |
39 */ | |
40 class KeyboardZoneComponent : public Component, | |
41 public TextEditor::Listener, | |
42 public ComboBoxListener, | |
43 public ButtonListener | |
44 { | |
45 public: | |
46 //============================================================================== | |
47 KeyboardZoneComponent (); | |
48 ~KeyboardZoneComponent(); | |
49 | |
50 //============================================================================== | |
51 //[UserMethods] -- You can add your own custom methods in this section. | |
52 void setMainApplicationController(MainApplicationController *controller) { | |
53 // Attach the user interface to the controller and vice-versa | |
54 controller_ = controller; | |
55 mappingListComponent->setMainApplicationController(controller_); | |
56 if(controller_ != 0) { | |
57 // Update the controls to reflect the current state | |
58 updateOutputDeviceList(); | |
59 synchronize(true); | |
60 } | |
61 } | |
62 | |
63 void setKeyboardSegment(MidiKeyboardSegment *segment) { | |
64 keyboardSegment_ = segment; | |
65 mappingListComponent->setKeyboardSegment(keyboardSegment_); | |
66 if(controller_ != 0) { | |
67 // Update the controls to reflect the current state | |
68 updateOutputDeviceList(); | |
69 synchronize(true); | |
70 } | |
71 } | |
72 | |
73 MidiKeyboardSegment* keyboardSegment() { | |
74 return keyboardSegment_; | |
75 } | |
76 | |
77 // TextEditor listener methods | |
78 void textEditorTextChanged(TextEditor &editor) {} | |
79 void textEditorReturnKeyPressed(TextEditor &editor); | |
80 void textEditorEscapeKeyPressed(TextEditor &editor); | |
81 void textEditorFocusLost(TextEditor &editor); | |
82 | |
83 // Synchronize UI state to match underlying state of the back end | |
84 void synchronize(bool forceUpdates = false); | |
85 | |
86 // Update the range of the keyboard segment | |
87 void updateSegmentRange(); | |
88 | |
89 static void staticMappingChosenCallback(int result, KeyboardZoneComponent* component) { | |
90 if (result != 0 && component != 0) | |
91 component->mappingChosenCallback(result); | |
92 } | |
93 void mappingChosenCallback(int result); | |
94 //[/UserMethods] | |
95 | |
96 void paint (Graphics& g); | |
97 void resized(); | |
98 void comboBoxChanged (ComboBox* comboBoxThatHasChanged); | |
99 void buttonClicked (Button* buttonThatWasClicked); | |
100 | |
101 | |
102 | |
103 private: | |
104 //[UserVariables] -- You can add your own custom variables in this section. | |
105 | |
106 enum { | |
107 // Offsets between Juce UI IDs and positions in vector | |
108 kMidiOutputDeviceComboBoxOffset = 3, | |
109 kMidiOutputModeComboBoxOffset = 1 | |
110 }; | |
111 | |
112 // Update list of MIDI output devices | |
113 void updateOutputDeviceList(); | |
114 | |
115 // Create popup menu for mapping list | |
116 void createMappingListPopup(); | |
117 | |
118 MainApplicationController *controller_; // Pointer to the main application controller | |
119 MidiKeyboardSegment *keyboardSegment_; // Pointer to the segment this component controls | |
120 std::vector<int> midiOutputDeviceIDs_; | |
121 int lastSelectedMidiOutputID_; | |
122 //[/UserVariables] | |
123 | |
124 //============================================================================== | |
125 ScopedPointer<GroupComponent> midiOutputGroupComponent; | |
126 ScopedPointer<ComboBox> midiOutputDeviceComboBox; | |
127 ScopedPointer<Label> label4; | |
128 ScopedPointer<Label> label5; | |
129 ScopedPointer<ComboBox> midiOutputModeComboBox; | |
130 ScopedPointer<ToggleButton> midiOutputVoiceStealingButton; | |
131 ScopedPointer<Label> label2; | |
132 ScopedPointer<TextEditor> midiOutputChannelLowEditor; | |
133 ScopedPointer<TextEditor> midiOutputChannelHighEditor; | |
134 ScopedPointer<Label> label3; | |
135 ScopedPointer<GroupComponent> midiOutputGroupComponent2; | |
136 ScopedPointer<Label> label7; | |
137 ScopedPointer<ComboBox> rangeLowComboBox; | |
138 ScopedPointer<ComboBox> rangeHighComboBox; | |
139 ScopedPointer<ToggleButton> useAftertouchButton; | |
140 ScopedPointer<ToggleButton> usePitchWheelButton; | |
141 ScopedPointer<ToggleButton> useControllersButton; | |
142 ScopedPointer<Label> label6; | |
143 ScopedPointer<TextEditor> midiOutputTransposeEditor; | |
144 ScopedPointer<MappingListComponent> mappingListComponent; | |
145 ScopedPointer<Label> label8; | |
146 ScopedPointer<TextButton> addMappingButton; | |
147 | |
148 | |
149 //============================================================================== | |
150 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (KeyboardZoneComponent) | |
151 }; | |
152 | |
153 //[EndFile] You can add extra defines here... | |
154 //[/EndFile] | |
155 | |
156 #endif // __JUCE_HEADER_E3CF42F64919BE28__ |