andrewm@42: /* andrewm@42: ============================================================================== andrewm@42: andrewm@42: This is an automatically generated GUI class created by the Introjucer! andrewm@42: andrewm@42: Be careful when adding custom code to these files, as only the code within andrewm@42: the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded andrewm@42: and re-saved. andrewm@42: andrewm@42: Created with Introjucer version: 3.1.0 andrewm@42: andrewm@42: ------------------------------------------------------------------------------ andrewm@42: andrewm@42: The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" andrewm@42: Copyright 2004-13 by Raw Material Software Ltd. andrewm@42: andrewm@42: ============================================================================== andrewm@42: */ andrewm@42: andrewm@42: //[Headers] You can add your own extra header files here... andrewm@50: #ifndef TOUCHKEYS_NO_GUI andrewm@42: //[/Headers] andrewm@42: andrewm@42: #include "TouchkeyMultiFingerTriggerMappingShortEditor.h" andrewm@42: andrewm@42: andrewm@42: //[MiscUserDefs] You can add your own user definitions and misc code here... andrewm@42: const int TouchkeyMultiFingerTriggerMappingShortEditor::kNoteSame = 256; andrewm@42: const int TouchkeyMultiFingerTriggerMappingShortEditor::kNoteOffset = 1; andrewm@42: //[/MiscUserDefs] andrewm@42: andrewm@42: //============================================================================== andrewm@42: TouchkeyMultiFingerTriggerMappingShortEditor::TouchkeyMultiFingerTriggerMappingShortEditor (TouchkeyMultiFingerTriggerMappingFactory& factory) andrewm@42: : factory_(factory) andrewm@42: { andrewm@42: addAndMakeVisible (controlLabel = new Label ("control label", andrewm@42: "Touches:")); andrewm@42: controlLabel->setFont (Font (15.00f, Font::plain)); andrewm@42: controlLabel->setJustificationType (Justification::centredRight); andrewm@42: controlLabel->setEditable (false, false, false); andrewm@42: controlLabel->setColour (TextEditor::textColourId, Colours::black); andrewm@42: controlLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@42: andrewm@42: addAndMakeVisible (touchesComboBox = new ComboBox ("control combo box")); andrewm@42: touchesComboBox->setEditableText (false); andrewm@42: touchesComboBox->setJustificationType (Justification::centredLeft); andrewm@42: touchesComboBox->setTextWhenNothingSelected (String::empty); andrewm@42: touchesComboBox->setTextWhenNoChoicesAvailable ("(no choices)"); andrewm@42: touchesComboBox->addListener (this); andrewm@42: andrewm@42: addAndMakeVisible (controlLabel2 = new Label ("control label", andrewm@42: "Repeat Taps:")); andrewm@42: controlLabel2->setFont (Font (15.00f, Font::plain)); andrewm@42: controlLabel2->setJustificationType (Justification::centredLeft); andrewm@42: controlLabel2->setEditable (false, false, false); andrewm@42: controlLabel2->setColour (TextEditor::textColourId, Colours::black); andrewm@42: controlLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@42: andrewm@42: addAndMakeVisible (tapsComboBox = new ComboBox ("control combo box")); andrewm@42: tapsComboBox->setEditableText (false); andrewm@42: tapsComboBox->setJustificationType (Justification::centredLeft); andrewm@42: tapsComboBox->setTextWhenNothingSelected (String::empty); andrewm@42: tapsComboBox->setTextWhenNoChoicesAvailable ("(no choices)"); andrewm@42: tapsComboBox->addListener (this); andrewm@42: andrewm@42: addAndMakeVisible (controlLabel3 = new Label ("control label", andrewm@42: "Note:")); andrewm@42: controlLabel3->setFont (Font (15.00f, Font::plain)); andrewm@42: controlLabel3->setJustificationType (Justification::centredRight); andrewm@42: controlLabel3->setEditable (false, false, false); andrewm@42: controlLabel3->setColour (TextEditor::textColourId, Colours::black); andrewm@42: controlLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@42: andrewm@42: addAndMakeVisible (noteComboBox = new ComboBox ("control combo box")); andrewm@42: noteComboBox->setEditableText (false); andrewm@42: noteComboBox->setJustificationType (Justification::centredLeft); andrewm@42: noteComboBox->setTextWhenNothingSelected (String::empty); andrewm@42: noteComboBox->setTextWhenNoChoicesAvailable ("(no choices)"); andrewm@42: noteComboBox->addListener (this); andrewm@42: andrewm@42: addAndMakeVisible (sendOnReleaseButton = new ToggleButton ("new toggle button")); andrewm@42: sendOnReleaseButton->setButtonText ("Also send on release"); andrewm@42: sendOnReleaseButton->addListener (this); andrewm@42: andrewm@42: andrewm@42: //[UserPreSize] andrewm@42: for(int i = 1; i <= 3; i++) { andrewm@42: touchesComboBox->addItem(String(i), i); andrewm@42: } andrewm@42: for(int i = 1; i <= 5; i++) { andrewm@42: tapsComboBox->addItem(String(i), i); andrewm@42: } andrewm@42: noteComboBox->addItem("Same", kNoteSame); andrewm@42: for(int i = 0; i <= 127; i++) { andrewm@42: noteComboBox->addItem(String(i), i + kNoteOffset); andrewm@42: } andrewm@42: //[/UserPreSize] andrewm@42: andrewm@42: setSize (328, 71); andrewm@42: andrewm@42: andrewm@42: //[Constructor] You can add your own custom stuff here.. andrewm@42: //[/Constructor] andrewm@42: } andrewm@42: andrewm@42: TouchkeyMultiFingerTriggerMappingShortEditor::~TouchkeyMultiFingerTriggerMappingShortEditor() andrewm@42: { andrewm@42: //[Destructor_pre]. You can add your own custom destruction code here.. andrewm@42: //[/Destructor_pre] andrewm@42: andrewm@42: controlLabel = nullptr; andrewm@42: touchesComboBox = nullptr; andrewm@42: controlLabel2 = nullptr; andrewm@42: tapsComboBox = nullptr; andrewm@42: controlLabel3 = nullptr; andrewm@42: noteComboBox = nullptr; andrewm@42: sendOnReleaseButton = nullptr; andrewm@42: andrewm@42: andrewm@42: //[Destructor]. You can add your own custom destruction code here.. andrewm@42: //[/Destructor] andrewm@42: } andrewm@42: andrewm@42: //============================================================================== andrewm@42: void TouchkeyMultiFingerTriggerMappingShortEditor::paint (Graphics& g) andrewm@42: { andrewm@42: //[UserPrePaint] Add your own custom painting code here.. andrewm@42: //[/UserPrePaint] andrewm@42: andrewm@42: g.fillAll (Colours::white); andrewm@42: andrewm@42: //[UserPaint] Add your own custom painting code here.. andrewm@42: //[/UserPaint] andrewm@42: } andrewm@42: andrewm@42: void TouchkeyMultiFingerTriggerMappingShortEditor::resized() andrewm@42: { andrewm@42: controlLabel->setBounds (8, 8, 64, 24); andrewm@42: touchesComboBox->setBounds (72, 8, 80, 24); andrewm@42: controlLabel2->setBounds (160, 8, 80, 24); andrewm@42: tapsComboBox->setBounds (240, 8, 80, 24); andrewm@42: controlLabel3->setBounds (8, 40, 64, 24); andrewm@42: noteComboBox->setBounds (72, 40, 80, 24); andrewm@42: sendOnReleaseButton->setBounds (168, 40, 152, 24); andrewm@42: //[UserResized] Add your own custom resize handling here.. andrewm@42: //[/UserResized] andrewm@42: } andrewm@42: andrewm@42: void TouchkeyMultiFingerTriggerMappingShortEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged) andrewm@42: { andrewm@42: //[UsercomboBoxChanged_Pre] andrewm@42: //[/UsercomboBoxChanged_Pre] andrewm@42: andrewm@42: if (comboBoxThatHasChanged == touchesComboBox) andrewm@42: { andrewm@42: //[UserComboBoxCode_touchesComboBox] -- add your combo box handling code here.. andrewm@42: factory_.setTouchesForTrigger(touchesComboBox->getSelectedId()); andrewm@42: //[/UserComboBoxCode_touchesComboBox] andrewm@42: } andrewm@42: else if (comboBoxThatHasChanged == tapsComboBox) andrewm@42: { andrewm@42: //[UserComboBoxCode_tapsComboBox] -- add your combo box handling code here.. andrewm@42: factory_.setConsecutiveTapsForTrigger(tapsComboBox->getSelectedId()); andrewm@42: //[/UserComboBoxCode_tapsComboBox] andrewm@42: } andrewm@42: else if (comboBoxThatHasChanged == noteComboBox) andrewm@42: { andrewm@42: //[UserComboBoxCode_noteComboBox] -- add your combo box handling code here.. andrewm@42: int note = noteComboBox->getSelectedId(); andrewm@42: if(note == kNoteSame) andrewm@42: note = -1; andrewm@42: else andrewm@42: note -= kNoteOffset; andrewm@42: factory_.setTriggerOnNoteNumber(note); andrewm@42: factory_.setTriggerOffNoteNumber(note); andrewm@42: //[/UserComboBoxCode_noteComboBox] andrewm@42: } andrewm@42: andrewm@42: //[UsercomboBoxChanged_Post] andrewm@42: //[/UsercomboBoxChanged_Post] andrewm@42: } andrewm@42: andrewm@42: void TouchkeyMultiFingerTriggerMappingShortEditor::buttonClicked (Button* buttonThatWasClicked) andrewm@42: { andrewm@42: //[UserbuttonClicked_Pre] andrewm@42: //[/UserbuttonClicked_Pre] andrewm@42: andrewm@42: if (buttonThatWasClicked == sendOnReleaseButton) andrewm@42: { andrewm@42: //[UserButtonCode_sendOnReleaseButton] -- add your button handler code here.. andrewm@42: if(sendOnReleaseButton->getToggleState()) { andrewm@42: factory_.setTriggerOffAction(TouchkeyMultiFingerTriggerMapping::kActionNoteOn); andrewm@42: } andrewm@42: else { andrewm@42: factory_.setTriggerOffAction(TouchkeyMultiFingerTriggerMapping::kActionNone); andrewm@42: } andrewm@42: //[/UserButtonCode_sendOnReleaseButton] andrewm@42: } andrewm@42: andrewm@42: //[UserbuttonClicked_Post] andrewm@42: //[/UserbuttonClicked_Post] andrewm@42: } andrewm@42: andrewm@42: andrewm@42: andrewm@42: //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... andrewm@42: void TouchkeyMultiFingerTriggerMappingShortEditor::synchronize() { andrewm@42: touchesComboBox->setSelectedId(factory_.getTouchesForTrigger(), dontSendNotification); andrewm@42: tapsComboBox->setSelectedId(factory_.getConsecutiveTapsForTrigger(), dontSendNotification); andrewm@42: andrewm@42: int note = factory_.getTriggerOnNoteNumber(); andrewm@42: if(note < 0) andrewm@42: noteComboBox->setSelectedId(kNoteSame, dontSendNotification); andrewm@42: else andrewm@42: noteComboBox->setSelectedId(note + kNoteOffset, dontSendNotification); andrewm@42: andrewm@42: if(factory_.getTriggerOffAction() == TouchkeyMultiFingerTriggerMapping::kActionNoteOn) andrewm@42: sendOnReleaseButton->setToggleState(true, dontSendNotification); andrewm@42: else andrewm@42: sendOnReleaseButton->setToggleState(false, dontSendNotification); andrewm@42: } andrewm@42: //[/MiscUserCode] andrewm@42: andrewm@42: andrewm@42: //============================================================================== andrewm@42: #if 0 andrewm@42: /* -- Introjucer information section -- andrewm@42: andrewm@42: This is where the Introjucer stores the metadata that describe this GUI layout, so andrewm@42: make changes in here at your peril! andrewm@42: andrewm@42: BEGIN_JUCER_METADATA andrewm@42: andrewm@42: andrewm@42: andrewm@42: andrewm@42: andrewm@42: END_JUCER_METADATA andrewm@42: */ andrewm@42: #endif andrewm@42: andrewm@42: andrewm@42: //[EndFile] You can add extra defines here... andrewm@50: #endif // TOUCHKEYS_NO_GUI andrewm@42: //[/EndFile]