/*
  ==============================================================================

  This is an automatically generated file created by the Jucer!

  Creation date:  19 Aug 2012 10:54:59am

  Be careful when adding custom code to these files, as only the code within
  the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  and re-saved.

  Jucer version: 1.12

  ------------------------------------------------------------------------------

  The Jucer is part of the JUCE library - "Jules' Utility Class Extensions"
  Copyright 2004-6 by Raw Material Software ltd.

  ==============================================================================
*/

//[Headers] You can add your own extra header files here...
#include <synth/param_scale.h>
//[/Headers]

#include "MidiCC_PopUp.h"


//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]

//==============================================================================
MidiCC_PopUp::MidiCC_PopUp (JaySynthMidiCC *pMidiCC, int paramID, synth_float_t currParamValue, JaySynth::midiCC_info_t *pCurrMidiCCinfo, String name, MidiCC_PopUp_Listener *listener)
    : Component (L"MidiCC PopUp"),
      textButton_OK (0),
      label_MidiCC_ID (0),
      label_control_min (0),
      label_control_max (0),
      slider_test (0),
      button_move_sliders_enable (0),
      button_assign_enable (0),
      button_midi_learn (0),
      label_parameter_name (0),
      button_apply_on_patch_init (0)
{
    addAndMakeVisible (textButton_OK = new TextButton (L"OK"));
    textButton_OK->addListener (this);

    addAndMakeVisible (label_MidiCC_ID = new Label (L"MidiCC ID",
                                                    L"0"));
    label_MidiCC_ID->setTooltip (L"This is the Midi-Controller Number");
    label_MidiCC_ID->setFont (Font (15.0000f, Font::plain));
    label_MidiCC_ID->setJustificationType (Justification::centredRight);
    label_MidiCC_ID->setEditable (true, true, false);
    label_MidiCC_ID->setColour (Label::textColourId, Colours::white);
    label_MidiCC_ID->setColour (TextEditor::textColourId, Colours::black);
    label_MidiCC_ID->setColour (TextEditor::backgroundColourId, Colour (0x0));
    label_MidiCC_ID->setColour (TextEditor::highlightColourId, Colours::yellow);
    label_MidiCC_ID->addListener (this);

    addAndMakeVisible (label_control_min = new Label (L"Control Min",
                                                      L"0"));
    label_control_min->setTooltip (L"Parameter minimum value");
    label_control_min->setFont (Font (15.0000f, Font::plain));
    label_control_min->setJustificationType (Justification::centredRight);
    label_control_min->setEditable (true, true, false);
    label_control_min->setColour (Label::textColourId, Colours::white);
    label_control_min->setColour (TextEditor::textColourId, Colours::black);
    label_control_min->setColour (TextEditor::backgroundColourId, Colour (0x0));
    label_control_min->setColour (TextEditor::highlightColourId, Colours::yellow);
    label_control_min->addListener (this);

    addAndMakeVisible (label_control_max = new Label (L"Control Max",
                                                      L"0"));
    label_control_max->setTooltip (L"Parameter maximum value");
    label_control_max->setFont (Font (15.0000f, Font::plain));
    label_control_max->setJustificationType (Justification::centredRight);
    label_control_max->setEditable (true, true, false);
    label_control_max->setColour (Label::textColourId, Colours::white);
    label_control_max->setColour (TextEditor::textColourId, Colours::black);
    label_control_max->setColour (TextEditor::backgroundColourId, Colour (0x0));
    label_control_max->setColour (TextEditor::highlightColourId, Colours::yellow);
    label_control_max->addListener (this);

    addAndMakeVisible (slider_test = new Slider (L"Test Slider"));
    slider_test->setTooltip (L"Test Slider");
    slider_test->setRange (0, 1, 0);
    slider_test->setSliderStyle (Slider::LinearHorizontal);
    slider_test->setTextBoxStyle (Slider::NoTextBox, true, 80, 20);
    slider_test->addListener (this);

    addAndMakeVisible (button_move_sliders_enable = new ToggleButton (L"MoveParams Enable"));
    button_move_sliders_enable->setTooltip (L"If \'Absolute = no\', the parameter is alterered relatively from the given slider position on the main window in the specified range. If \'\'Absolute = yes\', the midi controller alters parameter absolutely in the specified range. In this mode sliders really move on the main window.");
    button_move_sliders_enable->setButtonText (String::empty);
    button_move_sliders_enable->addListener (this);

    addAndMakeVisible (button_assign_enable = new ToggleButton (L"Assign Enable"));
    button_assign_enable->setTooltip (L"Set this to make MIDI-Controller assignment active");
    button_assign_enable->setButtonText (String::empty);
    button_assign_enable->addListener (this);

    addAndMakeVisible (button_midi_learn = new ToggleButton (L"Midi Learn Button"));
    button_midi_learn->setTooltip (L"Set this to learn MIDI-Controller number from MIDI-controller movement");
    button_midi_learn->setButtonText (String::empty);
    button_midi_learn->addListener (this);
    button_midi_learn->setColour (ToggleButton::textColourId, Colours::white);

    addAndMakeVisible (label_parameter_name = new Label (L"Parameter Name",
                                                         L"Parameter Name"));
    label_parameter_name->setFont (Font (20.0000f, Font::plain));
    label_parameter_name->setJustificationType (Justification::centred);
    label_parameter_name->setEditable (false, false, false);
    label_parameter_name->setColour (Label::textColourId, Colours::white);
    label_parameter_name->setColour (TextEditor::textColourId, Colours::black);
    label_parameter_name->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (button_apply_on_patch_init = new ToggleButton (L"Apply on Patch Init Enable"));
    button_apply_on_patch_init->setTooltip (L"Set this to apply current Midi-Controller position on initialization of this patch (e.g. Program change)");
    button_apply_on_patch_init->setButtonText (String::empty);
    button_apply_on_patch_init->addListener (this);


    //[UserPreSize]
    //[/UserPreSize]

    setSize (248, 280);


    //[Constructor] You can add your own custom stuff here..
	this->pMidiCC = pMidiCC;
	pSavedMidiCCinfo = pCurrMidiCCinfo;
	pMidiCC_container = pMidiCC->getAtParamID(paramID);

	savedParamValue = currParamValue;
	lastMidiCCvalue = pSavedMidiCCinfo[pMidiCC->getControllerID(pMidiCC_container)].value;

	this->currentParamValue = savedParamValue;
	this->currentControlValue = 0;
	if (isEnabled())
	{
		this->currentParamValue = toParam(pMidiCC->getParam(pMidiCC_container), (synth_float_t)lastMidiCCvalue);
		this->currentControlValue = toParam(pMidiCC->getControl(pMidiCC_container), (synth_float_t)lastMidiCCvalue);
	}
	lastParamValue = this->currentParamValue;
	lastControlValue = this->currentControlValue;
	GetMin();
	GetMax();
	restoreTestSlider();

	label_MidiCC_ID->setText(String(pMidiCC->getControllerID(pMidiCC_container)), juce::NotificationType::dontSendNotification);
	label_parameter_name->setText(name, juce::NotificationType::dontSendNotification);

	button_assign_enable->setToggleState(pMidiCC->isAssigned(pMidiCC_container), juce::NotificationType::dontSendNotification);
	button_move_sliders_enable->setToggleState(pMidiCC->doChangeParameter(pMidiCC_container), juce::NotificationType::dontSendNotification);
	button_apply_on_patch_init->setToggleState(pMidiCC->doApplyOnPatchInit(pMidiCC_container), juce::NotificationType::dontSendNotification);

	button_assign_enable->setTriggeredOnMouseDown (true);
	button_assign_enable->setClickingTogglesState(true);
	button_move_sliders_enable->setTriggeredOnMouseDown (true);
	button_move_sliders_enable->setClickingTogglesState(true);
	button_midi_learn->setTriggeredOnMouseDown (true);
	button_midi_learn->setClickingTogglesState(true);
	button_apply_on_patch_init->setTriggeredOnMouseDown (true);
	button_apply_on_patch_init->setClickingTogglesState(true);

	addListener(listener);
    listeners.call (&MidiCC_PopUp_Listener::MidiCC_PopUp_event, POPUP_CREATED);
    //[/Constructor]
}

MidiCC_PopUp::~MidiCC_PopUp()
{
    //[Destructor_pre]. You can add your own custom destruction code here..
    //[/Destructor_pre]

    deleteAndZero (textButton_OK);
    deleteAndZero (label_MidiCC_ID);
    deleteAndZero (label_control_min);
    deleteAndZero (label_control_max);
    deleteAndZero (slider_test);
    deleteAndZero (button_move_sliders_enable);
    deleteAndZero (button_assign_enable);
    deleteAndZero (button_midi_learn);
    deleteAndZero (label_parameter_name);
    deleteAndZero (button_apply_on_patch_init);


    //[Destructor]. You can add your own custom destruction code here..
    //[/Destructor]
}

//==============================================================================
void MidiCC_PopUp::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    g.setColour (Colour (0xff2a64a5));
    g.fillRoundedRectangle (0.0f, 4.0f, 244.0f, 274.0f, 10.0000f);

    g.setColour (Colours::white);
    g.drawRoundedRectangle (2.0f, 3.0f, 243.0f, 274.0f, 7.0000f, 4.0000f);

    g.setColour (Colours::white);
    g.setFont (Font (15.0000f, Font::plain));
    g.drawText (L"Midi Controller",
                16, 122, 94, 20,
                Justification::centredLeft, true);

    g.setColour (Colours::white);
    g.setFont (Font (15.0000f, Font::plain));
    g.drawText (L"Active",
                16, 48, 62, 20,
                Justification::centredLeft, true);

    g.setColour (Colours::white);
    g.setFont (Font (15.0000f, Font::plain));
    g.drawText (L"Absolute",
                16, 68, 59, 20,
                Justification::centredLeft, true);

    g.setColour (Colours::white);
    g.setFont (Font (15.0000f, Font::plain));
    g.drawText (L"Minimum",
                16, 142, 75, 20,
                Justification::centredLeft, true);

    g.setColour (Colours::white);
    g.setFont (Font (15.0000f, Font::plain));
    g.drawText (L"Maximum",
                16, 162, 75, 20,
                Justification::centredLeft, true);

    g.setColour (Colours::white);
    g.setFont (Font (15.0000f, Font::plain));
    g.drawText (L"Test it",
                18, 194, 46, 20,
                Justification::centredLeft, true);

    g.setColour (Colours::white);
    g.setFont (Font (15.0000f, Font::plain));
    g.drawText (L"Learn",
                192, 122, 38, 20,
                Justification::centredLeft, true);

    g.setColour (Colours::white);
    g.setFont (Font (15.0000f, Font::plain));
    g.drawText (L"Apply on patch init",
                16, 88, 120, 20,
                Justification::centredLeft, true);

    //[UserPaint] Add your own custom painting code here..
    //[/UserPaint]
}

void MidiCC_PopUp::resized()
{
    textButton_OK->setBounds (22, 238, 202, 22);
    label_MidiCC_ID->setBounds (119, 122, 48, 20);
    label_control_min->setBounds (103, 144, 64, 20);
    label_control_max->setBounds (103, 166, 64, 20);
    slider_test->setBounds (64, 192, 168, 26);
    button_move_sliders_enable->setBounds (148, 68, 20, 20);
    button_assign_enable->setBounds (148, 48, 20, 20);
    button_midi_learn->setBounds (172, 122, 20, 20);
    label_parameter_name->setBounds (12, 12, 212, 24);
    button_apply_on_patch_init->setBounds (148, 88, 20, 20);
    //[UserResized] Add your own custom resize handling here..
    //[/UserResized]
}

void MidiCC_PopUp::buttonClicked (Button* buttonThatWasClicked)
{
    //[UserbuttonClicked_Pre]
	bool state;
    //[/UserbuttonClicked_Pre]

    if (buttonThatWasClicked == textButton_OK)
    {
        //[UserButtonCode_textButton_OK] -- add your button handler code here..
		currentControlValue = 0;
		if (isEnabled() && !doChangeParameter())
			currentControlValue = toParam(pMidiCC->getControl(pMidiCC_container), (synth_float_t)lastMidiCCvalue);

		currentParamValue = savedParamValue;
		if (isEnabled() && doChangeParameter())
			currentParamValue = toParam(pMidiCC->getParam(pMidiCC_container), (synth_float_t)lastMidiCCvalue);

	    listeners.call (&MidiCC_PopUp_Listener::MidiCC_PopUp_event, POPUP_OK);
        //[/UserButtonCode_textButton_OK]
    }
    else if (buttonThatWasClicked == button_move_sliders_enable)
    {
        //[UserButtonCode_button_move_sliders_enable] -- add your button handler code here..
		state = buttonThatWasClicked->getToggleState();
		pMidiCC->setDoChangeParameter(pMidiCC_container, state);
		if (state)
		{
			currentParamValue = lastParamValue;
			lastControlValue = currentControlValue;
		}
		else
		{
			currentControlValue = lastControlValue;
			lastParamValue = currentParamValue;
		}
		GetMin();
		GetMax();
	    listeners.call (&MidiCC_PopUp_Listener::MidiCC_PopUp_event, POPUP_PARAM_CHANGED);
        //[/UserButtonCode_button_move_sliders_enable]
    }
    else if (buttonThatWasClicked == button_assign_enable)
    {
        //[UserButtonCode_button_assign_enable] -- add your button handler code here..
		if (buttonThatWasClicked->getToggleState())
			pMidiCC->add(pMidiCC_container, label_MidiCC_ID->getText().getIntValue());
		else
			pMidiCC->remove(pMidiCC_container, label_MidiCC_ID->getText().getIntValue());

		if (isEnabled())
		{
			currentParamValue = toParam(pMidiCC->getParam(pMidiCC_container), (synth_float_t)lastMidiCCvalue);
			currentControlValue = toParam(pMidiCC->getControl(pMidiCC_container), (synth_float_t)lastMidiCCvalue);
		}
	    listeners.call (&MidiCC_PopUp_Listener::MidiCC_PopUp_event, POPUP_PARAM_CHANGED);
        //[/UserButtonCode_button_assign_enable]
    }
    else if (buttonThatWasClicked == button_midi_learn)
    {
        //[UserButtonCode_button_midi_learn] -- add your button handler code here..
        //[/UserButtonCode_button_midi_learn]
    }
    else if (buttonThatWasClicked == button_apply_on_patch_init)
    {
        //[UserButtonCode_button_apply_on_patch_init] -- add your button handler code here..
		state = buttonThatWasClicked->getToggleState();
		pMidiCC->setDoApplyOnPatchInit(pMidiCC_container, state);
	    listeners.call (&MidiCC_PopUp_Listener::MidiCC_PopUp_event, POPUP_PARAM_CHANGED);
        //[/UserButtonCode_button_apply_on_patch_init]
    }

    //[UserbuttonClicked_Post]
    //[/UserbuttonClicked_Post]
}

void MidiCC_PopUp::labelTextChanged (Label* labelThatHasChanged)
{
    //[UserlabelTextChanged_Pre]
    //[/UserlabelTextChanged_Pre]

    if (labelThatHasChanged == label_MidiCC_ID)
    {
        //[UserLabelCode_label_MidiCC_ID] -- add your label text handling code here..
		pMidiCC->setControllerID(pMidiCC_container, label_MidiCC_ID->getText().getIntValue());
		label_MidiCC_ID->setText(String(pMidiCC->getControllerID(pMidiCC_container)), juce::NotificationType::dontSendNotification);
		button_midi_learn->setToggleState(false, juce::NotificationType::dontSendNotification);
		lastMidiCCvalue = pSavedMidiCCinfo[pMidiCC->getControllerID(pMidiCC_container)].value;
		if (isEnabled())
		{
			currentParamValue = toParam(pMidiCC->getParam(pMidiCC_container), (synth_float_t)lastMidiCCvalue);
			currentControlValue = toParam(pMidiCC->getControl(pMidiCC_container), (synth_float_t)lastMidiCCvalue);
		}
	    listeners.call (&MidiCC_PopUp_Listener::MidiCC_PopUp_event, POPUP_PARAM_CHANGED);
        //[/UserLabelCode_label_MidiCC_ID]
    }
    else if (labelThatHasChanged == label_control_min)
    {
        //[UserLabelCode_label_control_min] -- add your label text handling code here..
		SetMin();
	    listeners.call (&MidiCC_PopUp_Listener::MidiCC_PopUp_event, POPUP_PARAM_CHANGED);
        //[/UserLabelCode_label_control_min]
    }
    else if (labelThatHasChanged == label_control_max)
    {
        //[UserLabelCode_label_control_max] -- add your label text handling code here..
		SetMax();
	    listeners.call (&MidiCC_PopUp_Listener::MidiCC_PopUp_event, POPUP_PARAM_CHANGED);
        //[/UserLabelCode_label_control_max]
    }

    //[UserlabelTextChanged_Post]
    //[/UserlabelTextChanged_Post]
}

void MidiCC_PopUp::sliderValueChanged (Slider* sliderThatWasMoved)
{
    //[UsersliderValueChanged_Pre]
    //[/UsersliderValueChanged_Pre]

    if (sliderThatWasMoved == slider_test)
    {
        //[UserSliderCode_slider_test] -- add your slider handling code here..
	    if (doChangeParameter())
		{
			slider_test->setTooltip (String(toParam(pMidiCC->getParam(pMidiCC_container), (synth_float_t)slider_test->getValue())));
		}
    	else
		{
			if (lastControlValue == 0)
				slider_test->setTooltip (L"0.0");
			else
				slider_test->setTooltip (String(toParam(pMidiCC->getControl(pMidiCC_container), (synth_float_t)slider_test->getValue())));
		}
    	TestValueUpdate();
	    listeners.call (&MidiCC_PopUp_Listener::MidiCC_PopUp_event, POPUP_PARAM_CHANGED);
        //[/UserSliderCode_slider_test]
    }

    //[UsersliderValueChanged_Post]
    //[/UsersliderValueChanged_Post]
}



//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
void MidiCC_PopUp::mouseWheelMove(const MouseEvent &/*event*/, const MouseWheelDetails &/*wheel*/)
{
}

void MidiCC_PopUp::GetMin()
{
	if (doChangeParameter())
	{
		label_control_min->setText(String(pMidiCC->getParamMin(pMidiCC_container)), juce::NotificationType::dontSendNotification);
	}
	else
	{
		label_control_min->setText(String(pMidiCC->getControlMin(pMidiCC_container)), juce::NotificationType::dontSendNotification);
	}
}

void MidiCC_PopUp::GetMax()
{
	if (doChangeParameter())
	{
		label_control_max->setText(String(pMidiCC->getParamMax(pMidiCC_container)), juce::NotificationType::dontSendNotification);
	}
	else
	{
		label_control_max->setText(String(pMidiCC->getControlMax(pMidiCC_container)), juce::NotificationType::dontSendNotification);
	}
}

void MidiCC_PopUp::SetMin()
{
	synth_float_t value;
	param_info_t *pConstraints = pMidiCC->getConstraints(pMidiCC_container);
	param_info_t *pInfo = NULL;

	value = (synth_float_t)label_control_min->getText().getFloatValue();
	while (doChangeParameter())
	{
		pInfo = pMidiCC->getParam(pMidiCC_container);
		if (value < pConstraints->pmin)
			value = pConstraints->pmin;

		if (value > pInfo->pmax)
			value = pInfo->pmax;

		// Min == Max => crash
		if (value == pMidiCC->getParamMax(pMidiCC_container))
			break;

		pMidiCC->setParamMin(pMidiCC_container, value);
		break;
	}

	while (!doChangeParameter())
	{
		pInfo = pMidiCC->getControl(pMidiCC_container);
		if (fabs(value) > fabs(pConstraints->pmax))
			value = pConstraints->pmax*fabs(value)/value;

		// Min == Max => crash
		if (value == pMidiCC->getControlMax(pMidiCC_container))
			break;

		pMidiCC->setControlMin(pMidiCC_container, value);
		break;
	}

	label_control_min->setText(String(pInfo->pmin), juce::NotificationType::dontSendNotification);
}

void MidiCC_PopUp::SetMax()
{
	synth_float_t value;
	param_info_t *pConstraints = pMidiCC->getConstraints(pMidiCC_container);
	param_info_t *pInfo = NULL;

	value = (synth_float_t)label_control_max->getText().getFloatValue();
	while (doChangeParameter())
	{
		pInfo = pMidiCC->getParam(pMidiCC_container);
		if (value > pConstraints->pmax)
			value = pConstraints->pmax;

		if (value < pInfo->pmin)
			value = pInfo->pmin;

		// Min == Max => crash
		if (value == pMidiCC->getParamMin(pMidiCC_container))
			break;

		pMidiCC->setParamMax(pMidiCC_container, value);
		break;
	}

	while (!doChangeParameter())
	{
		pInfo = pMidiCC->getControl(pMidiCC_container);
		value = (synth_float_t)label_control_max->getText().getFloatValue();
		if (fabs(value) > fabs(pConstraints->pmax))
			value = pConstraints->pmax*fabs(value)/value;

		// Min == Max => crash
		if (value == pMidiCC->getControlMin(pMidiCC_container))
			break;

		pMidiCC->setControlMax(pMidiCC_container, value);
		break;
	}

	label_control_max->setText(String(pInfo->pmax), juce::NotificationType::dontSendNotification);
}
//[/MiscUserCode]


//==============================================================================
#if 0
/*  -- Jucer information section --

    This is where the Jucer puts all of its metadata, so don't change anything in here!

BEGIN_JUCER_METADATA

<JUCER_COMPONENT documentType="Component" className="MidiCC_PopUp" componentName="MidiCC PopUp"
                 parentClasses="public Component" constructorParams="JaySynthMidiCC *pMidiCC, int paramID, synth_float_t currParamValue, JaySynth::midiCC_info_t *pCurrMidiCCinfo, String name, MidiCC_PopUp_Listener *listener"
                 variableInitialisers="" snapPixels="2" snapActive="1" snapShown="1"
                 overlayOpacity="0.330000013" fixedSize="1" initialWidth="248"
                 initialHeight="280">
  <BACKGROUND backgroundColour="ffffff">
    <ROUNDRECT pos="0 4 244 274" cornerSize="10" fill="solid: ff2a64a5" hasStroke="0"/>
    <ROUNDRECT pos="2 3 243 274" cornerSize="7" fill="solid: 2a98a5" hasStroke="1"
               stroke="4, mitered, butt" strokeColour="solid: ffffffff"/>
    <TEXT pos="16 122 94 20" fill="solid: ffffffff" hasStroke="0" text="Midi Controller"
          fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
    <TEXT pos="16 48 62 20" fill="solid: ffffffff" hasStroke="0" text="Active"
          fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
    <TEXT pos="16 68 59 20" fill="solid: ffffffff" hasStroke="0" text="Absolute"
          fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
    <TEXT pos="16 142 75 20" fill="solid: ffffffff" hasStroke="0" text="Minimum"
          fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
    <TEXT pos="16 162 75 20" fill="solid: ffffffff" hasStroke="0" text="Maximum"
          fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
    <TEXT pos="18 194 46 20" fill="solid: ffffffff" hasStroke="0" text="Test it"
          fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
    <TEXT pos="192 122 38 20" fill="solid: ffffffff" hasStroke="0" text="Learn"
          fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
    <TEXT pos="16 88 120 20" fill="solid: ffffffff" hasStroke="0" text="Apply on patch init"
          fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
  </BACKGROUND>
  <TEXTBUTTON name="OK" id="267da4575448eb96" memberName="textButton_OK" virtualName=""
              explicitFocusOrder="0" pos="22 238 202 22" buttonText="OK" connectedEdges="0"
              needsCallback="1" radioGroupId="0"/>
  <LABEL name="MidiCC ID" id="9e3707850116f781" memberName="label_MidiCC_ID"
         virtualName="" explicitFocusOrder="0" pos="135 122 32 20" tooltip="This is the Midi-Controller Number"
         textCol="ffffffff" edTextCol="ff000000" edBkgCol="0" hiliteCol="ffffff00"
         labelText="0" editableSingleClick="1" editableDoubleClick="1"
         focusDiscardsChanges="0" fontname="Default font" fontsize="15"
         bold="0" italic="0" justification="34"/>
  <LABEL name="Control Min" id="21f18ed07994e110" memberName="label_control_min"
         virtualName="" explicitFocusOrder="0" pos="103 144 64 20" tooltip="Parameter minimum value"
         textCol="ffffffff" edTextCol="ff000000" edBkgCol="0" hiliteCol="ffffff00"
         labelText="0" editableSingleClick="1" editableDoubleClick="1"
         focusDiscardsChanges="0" fontname="Default font" fontsize="15"
         bold="0" italic="0" justification="34"/>
  <LABEL name="Control Max" id="3ee0f72a9b303f9e" memberName="label_control_max"
         virtualName="" explicitFocusOrder="0" pos="103 166 64 20" tooltip="Parameter maximum value"
         textCol="ffffffff" edTextCol="ff000000" edBkgCol="0" hiliteCol="ffffff00"
         labelText="0" editableSingleClick="1" editableDoubleClick="1"
         focusDiscardsChanges="0" fontname="Default font" fontsize="15"
         bold="0" italic="0" justification="34"/>
  <SLIDER name="Test Slider" id="f0f88072fbe8ebb6" memberName="slider_test"
          virtualName="" explicitFocusOrder="0" pos="64 192 168 26" tooltip="Test Slider"
          min="0" max="1" int="0" style="LinearHorizontal" textBoxPos="NoTextBox"
          textBoxEditable="0" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <TOGGLEBUTTON name="MoveParams Enable" id="fbf5e58207823635" memberName="button_move_sliders_enable"
                virtualName="" explicitFocusOrder="0" pos="148 68 20 20" tooltip="If 'Absolute = no', the parameter is alterered relatively from the given slider position on the main window in the specified range. If ''Absolute = yes', the midi controller alters parameter absolutely in the specified range. In this mode sliders really move on the main window."
                buttonText="" connectedEdges="0" needsCallback="1" radioGroupId="0"
                state="0"/>
  <TOGGLEBUTTON name="Assign Enable" id="ef80c20aeccf72e1" memberName="button_assign_enable"
                virtualName="" explicitFocusOrder="0" pos="148 48 20 20" tooltip="Set this to make MIDI-Controller assignment active"
                buttonText="" connectedEdges="0" needsCallback="1" radioGroupId="0"
                state="0"/>
  <TOGGLEBUTTON name="Midi Learn Button" id="df893ef1c6251377" memberName="button_midi_learn"
                virtualName="" explicitFocusOrder="0" pos="172 122 20 20" tooltip="Set this to learn MIDI-Controller number from MIDI-controller movement"
                txtcol="ffffffff" buttonText="" connectedEdges="0" needsCallback="1"
                radioGroupId="0" state="0"/>
  <LABEL name="Parameter Name" id="7bc54e014ee69b2f" memberName="label_parameter_name"
         virtualName="" explicitFocusOrder="0" pos="12 12 212 24" textCol="ffffffff"
         edTextCol="ff000000" edBkgCol="0" labelText="Parameter Name"
         editableSingleClick="0" editableDoubleClick="0" focusDiscardsChanges="0"
         fontname="Default font" fontsize="20" bold="0" italic="0" justification="36"/>
  <TOGGLEBUTTON name="Apply on Patch Init Enable" id="2783ab3e54887ccc" memberName="button_apply_on_patch_init"
                virtualName="" explicitFocusOrder="0" pos="148 88 20 20" tooltip="Set this to apply current Midi-Controller position on initialization of this patch (e.g. Program change)"
                buttonText="" connectedEdges="0" needsCallback="1" radioGroupId="0"
                state="0"/>
</JUCER_COMPONENT>

END_JUCER_METADATA
*/
#endif
