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