andrewm@51: /* andrewm@51: ============================================================================== andrewm@51: andrewm@51: This is an automatically generated GUI class created by the Introjucer! andrewm@51: andrewm@51: Be careful when adding custom code to these files, as only the code within andrewm@51: the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded andrewm@51: and re-saved. andrewm@51: andrewm@51: Created with Introjucer version: 3.1.1 andrewm@51: andrewm@51: ------------------------------------------------------------------------------ andrewm@51: andrewm@51: The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" andrewm@51: Copyright 2004-13 by Raw Material Software Ltd. andrewm@51: andrewm@51: ============================================================================== andrewm@51: */ andrewm@51: andrewm@51: //[Headers] You can add your own extra header files here... andrewm@51: #ifndef TOUCHKEYS_NO_GUI andrewm@51: //[/Headers] andrewm@51: andrewm@51: #include "TouchkeyKeyDivisionMappingShortEditor.h" andrewm@51: andrewm@51: andrewm@51: //[MiscUserDefs] You can add your own user definitions and misc code here... andrewm@51: //[/MiscUserDefs] andrewm@51: andrewm@51: //============================================================================== andrewm@51: TouchkeyKeyDivisionMappingShortEditor::TouchkeyKeyDivisionMappingShortEditor (TouchkeyKeyDivisionMappingFactory& factory) andrewm@51: : factory_(factory) andrewm@51: { andrewm@51: addAndMakeVisible (tuningComboBox = new ComboBox ("tuning combo box")); andrewm@51: tuningComboBox->setEditableText (false); andrewm@51: tuningComboBox->setJustificationType (Justification::centredLeft); andrewm@51: tuningComboBox->setTextWhenNothingSelected (String::empty); andrewm@51: tuningComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); andrewm@51: tuningComboBox->addListener (this); andrewm@51: andrewm@51: addAndMakeVisible (tuningLabel = new Label ("tuning label", andrewm@51: TRANS("Tuning:"))); andrewm@51: tuningLabel->setFont (Font (15.00f, Font::plain)); andrewm@51: tuningLabel->setJustificationType (Justification::centredLeft); andrewm@51: tuningLabel->setEditable (false, false, false); andrewm@51: tuningLabel->setColour (TextEditor::textColourId, Colours::black); andrewm@51: tuningLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@51: andrewm@51: addAndMakeVisible (controlLabel = new Label ("control label", andrewm@51: TRANS("Control:"))); andrewm@51: controlLabel->setFont (Font (15.00f, Font::plain)); andrewm@51: controlLabel->setJustificationType (Justification::centredLeft); andrewm@51: controlLabel->setEditable (false, false, false); andrewm@51: controlLabel->setColour (TextEditor::textColourId, Colours::black); andrewm@51: controlLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@51: andrewm@51: addAndMakeVisible (controlComboBox = new ComboBox ("control combo box")); andrewm@51: controlComboBox->setEditableText (false); andrewm@51: controlComboBox->setJustificationType (Justification::centredLeft); andrewm@51: controlComboBox->setTextWhenNothingSelected (String::empty); andrewm@51: controlComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); andrewm@51: controlComboBox->addListener (this); andrewm@51: andrewm@51: addAndMakeVisible (retriggerButton = new ToggleButton ("retrigger button")); andrewm@51: retriggerButton->setButtonText (TRANS("Retriggerable")); andrewm@51: retriggerButton->addListener (this); andrewm@51: andrewm@51: andrewm@51: //[UserPreSize] andrewm@51: controlComboBox->addItem("Position", TouchkeyKeyDivisionMapping::kDetectionParameterYPosition); andrewm@51: controlComboBox->addItem("Number of Touches", TouchkeyKeyDivisionMapping::kDetectionParameterNumberOfTouches); andrewm@51: controlComboBox->addItem("Both", TouchkeyKeyDivisionMapping::kDetectionParameterYPositionAndNumberOfTouches); andrewm@51: andrewm@51: tuningComboBox->addItem("19-tone Equal Temperament", TouchkeyKeyDivisionMappingFactory::kTuningPreset19TET + 1); andrewm@51: tuningComboBox->addItem("24-tone Equal Temperament", TouchkeyKeyDivisionMappingFactory::kTuningPreset24TET + 1); andrewm@51: tuningComboBox->addItem("31-tone Equal Temperament", TouchkeyKeyDivisionMappingFactory::kTuningPreset31TET + 1); andrewm@51: tuningComboBox->addItem("36-tone Equal Temperament", TouchkeyKeyDivisionMappingFactory::kTuningPreset36TET + 1); andrewm@51: tuningComboBox->addItem("Yarman-24c Maqam Tuning", TouchkeyKeyDivisionMappingFactory::kTuningPresetYarman24c + 1); andrewm@51: //[/UserPreSize] andrewm@51: andrewm@51: setSize (328, 71); andrewm@51: andrewm@51: andrewm@51: //[Constructor] You can add your own custom stuff here.. andrewm@51: //[/Constructor] andrewm@51: } andrewm@51: andrewm@51: TouchkeyKeyDivisionMappingShortEditor::~TouchkeyKeyDivisionMappingShortEditor() andrewm@51: { andrewm@51: //[Destructor_pre]. You can add your own custom destruction code here.. andrewm@51: //[/Destructor_pre] andrewm@51: andrewm@51: tuningComboBox = nullptr; andrewm@51: tuningLabel = nullptr; andrewm@51: controlLabel = nullptr; andrewm@51: controlComboBox = nullptr; andrewm@51: retriggerButton = nullptr; andrewm@51: andrewm@51: andrewm@51: //[Destructor]. You can add your own custom destruction code here.. andrewm@51: //[/Destructor] andrewm@51: } andrewm@51: andrewm@51: //============================================================================== andrewm@51: void TouchkeyKeyDivisionMappingShortEditor::paint (Graphics& g) andrewm@51: { andrewm@51: //[UserPrePaint] Add your own custom painting code here.. andrewm@51: //[/UserPrePaint] andrewm@51: andrewm@51: g.fillAll (Colours::white); andrewm@51: andrewm@51: //[UserPaint] Add your own custom painting code here.. andrewm@51: //[/UserPaint] andrewm@51: } andrewm@51: andrewm@51: void TouchkeyKeyDivisionMappingShortEditor::resized() andrewm@51: { andrewm@51: //[UserPreResize] Add your own custom resize code here.. andrewm@51: //[/UserPreResize] andrewm@51: andrewm@51: tuningComboBox->setBounds (72, 8, 248, 24); andrewm@51: tuningLabel->setBounds (8, 8, 72, 24); andrewm@51: controlLabel->setBounds (8, 40, 72, 24); andrewm@51: controlComboBox->setBounds (72, 40, 88, 24); andrewm@51: retriggerButton->setBounds (176, 40, 136, 24); andrewm@51: //[UserResized] Add your own custom resize handling here.. andrewm@51: //[/UserResized] andrewm@51: } andrewm@51: andrewm@51: void TouchkeyKeyDivisionMappingShortEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged) andrewm@51: { andrewm@51: //[UsercomboBoxChanged_Pre] andrewm@51: //[/UsercomboBoxChanged_Pre] andrewm@51: andrewm@51: if (comboBoxThatHasChanged == tuningComboBox) andrewm@51: { andrewm@51: //[UserComboBoxCode_tuningComboBox] -- add your combo box handling code here.. andrewm@51: // Offset the value by 1 since preset numbering starts from 0 but combo box IDs start from 1... andrewm@51: factory_.setTuningPreset(tuningComboBox->getSelectedId() - 1); andrewm@51: //[/UserComboBoxCode_tuningComboBox] andrewm@51: } andrewm@51: else if (comboBoxThatHasChanged == controlComboBox) andrewm@51: { andrewm@51: //[UserComboBoxCode_controlComboBox] -- add your combo box handling code here.. andrewm@51: factory_.setDetectionParameter(controlComboBox->getSelectedId()); andrewm@51: //[/UserComboBoxCode_controlComboBox] andrewm@51: } andrewm@51: andrewm@51: //[UsercomboBoxChanged_Post] andrewm@51: //[/UsercomboBoxChanged_Post] andrewm@51: } andrewm@51: andrewm@51: void TouchkeyKeyDivisionMappingShortEditor::buttonClicked (Button* buttonThatWasClicked) andrewm@51: { andrewm@51: //[UserbuttonClicked_Pre] andrewm@51: //[/UserbuttonClicked_Pre] andrewm@51: andrewm@51: if (buttonThatWasClicked == retriggerButton) andrewm@51: { andrewm@51: //[UserButtonCode_retriggerButton] -- add your button handler code here.. andrewm@51: factory_.setRetriggerable(retriggerButton->getToggleState()); andrewm@51: //[/UserButtonCode_retriggerButton] andrewm@51: } andrewm@51: andrewm@51: //[UserbuttonClicked_Post] andrewm@51: //[/UserbuttonClicked_Post] andrewm@51: } andrewm@51: andrewm@51: andrewm@51: andrewm@51: //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... andrewm@51: void TouchkeyKeyDivisionMappingShortEditor::synchronize() andrewm@51: { andrewm@51: retriggerButton->setToggleState(factory_.getRetriggerable(), dontSendNotification); andrewm@51: controlComboBox->setSelectedId(factory_.getDetectionParameter()); andrewm@51: tuningComboBox->setSelectedId(factory_.getTuningPreset() + 1); andrewm@51: } andrewm@51: //[/MiscUserCode] andrewm@51: andrewm@51: andrewm@51: //============================================================================== andrewm@51: #if 0 andrewm@51: /* -- Introjucer information section -- andrewm@51: andrewm@51: This is where the Introjucer stores the metadata that describe this GUI layout, so andrewm@51: make changes in here at your peril! andrewm@51: andrewm@51: BEGIN_JUCER_METADATA andrewm@51: andrewm@51: andrewm@51: andrewm@51: andrewm@51: andrewm@51: andrewm@51: END_JUCER_METADATA andrewm@51: */ andrewm@51: #endif andrewm@51: andrewm@51: andrewm@51: //[EndFile] You can add extra defines here... andrewm@51: #endif // TOUCHKEYS_NO_GUI andrewm@51: //[/EndFile]