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

  This is an automatically generated GUI class created by the Introjucer!

  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.

  Created with Introjucer version: 3.1.0

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

  The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
  Copyright 2004-13 by Raw Material Software Ltd.

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

#ifndef __JUCE_HEADER_AD3FF14AD0EF4DBE__
#define __JUCE_HEADER_AD3FF14AD0EF4DBE__

//[Headers]     -- You can add your own extra header files here --
#include <JuceHeader.h>
#include "PluginProcessor.h"
#include "ButtonLED.h"
#include "MidiCC_PopUp.h"
#include "VelKey_PopUp.h"
//[/Headers]

#include "ButtonLED.h"


//==============================================================================
/**
                                                                    //[Comments]
    An auto-generated component, created by the Jucer.

    Describe your class and how it works here!
                                                                    //[/Comments]
*/
class JaySynthAudioProcessorEditor  : public AudioProcessorEditor,
                                      public Timer,
                                      public ButtonListener,
                                      public ActionListener,
                                      public MidiCC_PopUp_Listener,
                                      public VelKey_PopUp_Listener,
                                      public SliderListener,
                                      public LabelListener,
                                      public ComboBoxListener
{
public:
    //==============================================================================
    JaySynthAudioProcessorEditor (JaySynthAudioProcessor* ownerFilter, bool has_wt);
    ~JaySynthAudioProcessorEditor();

    //==============================================================================
    //[UserMethods]     -- You can add your own custom methods in this section.
     void timerCallback();
	 void update_sliders();
	 void paramUpdate(int paramID, bool doHostUpdate);
	 void buttonClicked (Button* buttonThatWasClicked);
	 void mouseDoubleClick (const MouseEvent &m);
	 void mouseDown (const MouseEvent &m);
	 void changeListenerCallback (ChangeBroadcaster* source);
	 void actionListenerCallback (const String &message);
	void MidiCC_PopUp_event(int event);
	void VelKey_PopUp_event(int event);
	void MidiCC_PopUp_show(Component *componentThatWasClicked);
	void VelKey_PopUp_show(Component *componentThatWasClicked);
	int ModSrc0_findByName(String name);
	int ModSrc1_findByName(String name);
	int ModSrcOP_findByName(String name);
	int ModSrc1_CB_getIndex(int srcID, int opID);

    //[/UserMethods]

    void paint (Graphics& g);
    void resized();
    void sliderValueChanged (Slider* sliderThatWasMoved);
    void labelTextChanged (Label* labelThatHasChanged);
    void comboBoxChanged (ComboBox* comboBoxThatHasChanged);

    // Binary resources:
    static const char* led_23_red_png;
    static const int led_23_red_pngSize;
    static const char* led_23_red1_png;
    static const int led_23_red1_pngSize;


private:
    //[UserVariables]   -- You can add your own custom variables in this section.
     JaySynthAudioProcessor* getProcessor() const
    {
        return static_cast <JaySynthAudioProcessor*> (getAudioProcessor());
    }
	TooltipWindow *m_tooltipWindow;
	MidiCC_PopUp *m_MidiCC_PopUp;
	VelKey_PopUp *m_VelKey_PopUp;
	String m_mod_src0_names[VOICE_NUM_MOD_SOURCES_0];
	String m_mod_src1_names[VOICE_NUM_MOD_SOURCES_1];
	String m_mod_src_op_names[VOICE_NUM_MOD_OPS];
	String m_mod_src0_cb_names[VOICE_NUM_MOD_SOURCES_0];
	String m_mod_src1_cb_names[(VOICE_NUM_MOD_SOURCES_1-1)*VOICE_NUM_MOD_OPS + 1];
    File m_fileChooserDirectory;
    //[/UserVariables]

    //==============================================================================
    ScopedPointer<Label> m_label_colon;
    ScopedPointer<Slider> m_slider_master_volume;
    ScopedPointer<Slider> m_slider_vcf_f;
    ScopedPointer<Slider> m_slider_vcf_q;
    ScopedPointer<Slider> m_slider_osc0_det;
    ScopedPointer<Slider> m_slider_osc1_det;
    ScopedPointer<Slider> m_slider_osc0_transpose;
    ScopedPointer<Slider> m_slider_osc1_transpose;
    ScopedPointer<Slider> m_slider_vca_env_attack;
    ScopedPointer<Slider> m_slider_vca_env_decay;
    ScopedPointer<Slider> m_slider_vca_env_release;
    ScopedPointer<Slider> m_slider_vca_env_sustain;
    ScopedPointer<Slider> m_slider_vcf_env_attack;
    ScopedPointer<Slider> m_slider_vcf_env_decay;
    ScopedPointer<Slider> m_slider_vcf_env_release;
    ScopedPointer<Slider> m_slider_vcf_env_sustain;
    ScopedPointer<Slider> m_slider_vcf_env_amount;
    ScopedPointer<Label> m_label_vcf_env_attack;
    ScopedPointer<Label> m_label_vcf_f;
    ScopedPointer<Label> m_label_vca_env_attack;
    ScopedPointer<Label> m_label_vca_env_decay;
    ScopedPointer<Label> m_label_vca_env_sustain;
    ScopedPointer<Label> m_label_vca_env_release;
    ScopedPointer<Label> m_label_vcf_env_decay;
    ScopedPointer<Label> m_label_vcf_env_sustain;
    ScopedPointer<Label> m_label_vcf_env_release;
    ScopedPointer<Label> m_label_vcf_q;
    ScopedPointer<Label> m_label_vcf_env_amount;
    ScopedPointer<Label> m_label_master_volume;
    ScopedPointer<Label> m_label_osc0_transpose;
    ScopedPointer<Label> m_label_osc1_transpose;
    ScopedPointer<Label> m_label_osc0_det;
    ScopedPointer<Label> m_label_osc1_det;
    ScopedPointer<Slider> m_slider_vca_env_amount;
    ScopedPointer<Label> m_label_vca_env_amount;
    ScopedPointer<Slider> m_slider_osc0_dutycycle;
    ScopedPointer<Slider> m_slider_osc1_dutycycle;
    ScopedPointer<Label> m_label_osc0_dutycycle;
    ScopedPointer<Label> m_label_osc1_dutycycle;
    ScopedPointer<Slider> m_slider_lfo0_speed;
    ScopedPointer<Slider> m_slider_osc1_fm_amt0;
    ScopedPointer<Slider> m_slider_osc0_fm_amt0;
    ScopedPointer<Label> m_label_lfo0_speed;
    ScopedPointer<Label> m_label_osc0_fm_amt0;
    ScopedPointer<Label> m_label_osc1_fm_amt0;
    ScopedPointer<Slider> m_slider_vcf_f_amt0;
    ScopedPointer<Label> m_label_vcf_f_amt0;
    ScopedPointer<Slider> m_slider_lfo1_speed;
    ScopedPointer<Label> m_label_lfo1_speed;
    ScopedPointer<ComboBox> m_comboBox_osc0_shape;
    ScopedPointer<ComboBox> m_comboBox_osc1_shape;
    ScopedPointer<ComboBox> m_comboBox_lfo0_shape;
    ScopedPointer<ComboBox> m_comboBox_lfo1_shape;
    ScopedPointer<Slider> m_slider_lfo2_speed;
    ScopedPointer<Slider> m_slider_lfo3_speed;
    ScopedPointer<ComboBox> m_comboBox_lfo2_shape;
    ScopedPointer<ComboBox> m_comboBox_lfo3_shape;
    ScopedPointer<Label> m_label_lfo2_speed;
    ScopedPointer<Label> m_label_lfo3_speed;
    ScopedPointer<ComboBox> m_comboBox_vcf_f_src0;
    ScopedPointer<ComboBox> m_comboBox_osc0_fm_src0;
    ScopedPointer<ComboBox> m_comboBox_osc1_fm_src0;
    ScopedPointer<Slider> m_slider_vca_am_amt0;
    ScopedPointer<Label> m_label_vca_am_amt0;
    ScopedPointer<ComboBox> m_comboBox_vca_am_src0;
    ScopedPointer<Slider> m_slider_vca_pan_amt0;
    ScopedPointer<Label> m_label_vca_pan_amt0;
    ScopedPointer<ComboBox> m_comboBox_vca_pan_src0;
    ScopedPointer<Label> m_label_synth_name;
    ScopedPointer<Label> m_label_synth_version;
    ScopedPointer<ComboBox> m_comboBox_vcf_type;
    ScopedPointer<Slider> m_slider_lfo0_smooth;
    ScopedPointer<Label> m_label_lfo0_smooth;
    ScopedPointer<Slider> m_slider_lfo1_smooth;
    ScopedPointer<Label> m_label_lfo1_smooth;
    ScopedPointer<Slider> m_slider_lfo2_smooth;
    ScopedPointer<Label> m_label_lfo2_smooth;
    ScopedPointer<Slider> m_slider_lfo3_smooth;
    ScopedPointer<Label> m_label_lfo3_smooth;
    ScopedPointer<Slider> m_slider_osc0_pwm_amt0;
    ScopedPointer<Label> m_label_osc0_pwm_amt0;
    ScopedPointer<Slider> m_slider_osc1_pwm_amt0;
    ScopedPointer<Label> m_label_osc1_pwm_amt0;
    ScopedPointer<ComboBox> m_comboBox_osc0_pwm_src0;
    ScopedPointer<ComboBox> m_comboBox_osc1_pwm_src0;
    ScopedPointer<Slider> m_slider_osc0_level;
    ScopedPointer<Label> m_label_osc0_level;
    ScopedPointer<Slider> m_slider_osc1_level;
    ScopedPointer<Label> m_label_osc1_level;
    ScopedPointer<Slider> m_slider_noise_level;
    ScopedPointer<Label> m_label_noise_level;
    ScopedPointer<ComboBox> m_comboBox_noise_shape;
    ScopedPointer<ButtonLED> m_btn_noise_enable_led;
    ScopedPointer<ButtonLED> m_btn_osc0_enable;
    ScopedPointer<ButtonLED> m_btn_osc1_enable;
    ScopedPointer<Label> m_label_patch_name;
    ScopedPointer<TextButton> m_button_patch_incr;
    ScopedPointer<TextButton> m_button_patch_decr;
    ScopedPointer<Label> m_label_patch_number;
    ScopedPointer<Label> m_label_osc1_pb_min;
    ScopedPointer<Label> m_label_osc1_pb_max;
    ScopedPointer<Label> m_label_osc0_pb_max;
    ScopedPointer<Label> m_label_osc0_pb_min;
    ScopedPointer<Slider> m_slider_master_tune;
    ScopedPointer<Label> m_label_master_tune;
    ScopedPointer<ToggleButton> m_button_humanize_enable;
    ScopedPointer<ComboBox> m_comboBox_vcf_order;
    ScopedPointer<Slider> m_slider_portamento_time;
    ScopedPointer<Label> m_label_portamento_time;
    ScopedPointer<ToggleButton> m_button_unisono_enable;
    ScopedPointer<Slider> m_slider_humanize_var_vco;
    ScopedPointer<Slider> m_slider_voice_pan_spread;
    ScopedPointer<Label> m_label_voice_pan_spread;
    ScopedPointer<Slider> m_slider_humanize_var_vcf;
    ScopedPointer<Slider> m_slider_humanize_var_env;
    ScopedPointer<Label> m_label_unisono_num_voices;
    ScopedPointer<ToggleButton> m_button_osc0_restart_enable;
    ScopedPointer<ToggleButton> m_button_osc1_restart_enable;
    ScopedPointer<ToggleButton> m_button_mono_enable;
    ScopedPointer<ComboBox> m_comboBox_osc1_fm_src1;
    ScopedPointer<ComboBox> m_comboBox_osc1_pwm_src1;
    ScopedPointer<ComboBox> m_comboBox_osc0_fm_src1;
    ScopedPointer<ComboBox> m_comboBox_osc0_pwm_src1;
    ScopedPointer<ComboBox> m_comboBox_osc1_am_src0;
    ScopedPointer<ComboBox> m_comboBox_osc1_am_src1;
    ScopedPointer<Slider> m_slider_osc1_am_amt0;
    ScopedPointer<Label> m_label_osc1_am_amt0;
    ScopedPointer<ComboBox> m_comboBox_osc0_am_src0;
    ScopedPointer<ComboBox> m_comboBox_osc0_am_src1;
    ScopedPointer<Slider> m_slider_osc0_am_amt0;
    ScopedPointer<Label> m_label_osc0_am_amt0;
    ScopedPointer<Slider> m_slider_env2_attack;
    ScopedPointer<Slider> m_slider_env2_decay;
    ScopedPointer<Slider> m_slider_env2_release;
    ScopedPointer<Slider> m_slider_env2_sustain;
    ScopedPointer<Label> m_label_env2_attack;
    ScopedPointer<Label> m_label_env2_decay;
    ScopedPointer<Label> m_label_env2_sustain;
    ScopedPointer<Label> m_label_env2_release;
    ScopedPointer<Slider> m_slider_env3_attack;
    ScopedPointer<Slider> m_slider_env3_decay;
    ScopedPointer<Slider> m_slider_env3_release;
    ScopedPointer<Slider> m_slider_env3_sustain;
    ScopedPointer<Label> m_label_env3_attack;
    ScopedPointer<Label> m_label_env3_decay;
    ScopedPointer<Label> m_label_env3_sustain;
    ScopedPointer<Label> m_label_env3_release;
    ScopedPointer<ComboBox> m_comboBox_vcf_f_src1;
    ScopedPointer<Slider> m_slider_vcf_q_amt0;
    ScopedPointer<Label> m_label_vcf_q_amt0;
    ScopedPointer<ComboBox> m_comboBox_vcf_q_src0;
    ScopedPointer<ComboBox> m_comboBox_vcf_q_src1;
    ScopedPointer<Label> m_label_humanize_var_vco;
    ScopedPointer<Label> m_label_humanize_var_vcf;
    ScopedPointer<Label> m_label_humanize_var_env;
    ScopedPointer<ButtonLED> m_btn_limiter_led;
    ScopedPointer<Label> m_label_limiter_led;
    ScopedPointer<Slider> m_slider_lfo0_delay;
    ScopedPointer<Label> m_label_lfo0_delay;
    ScopedPointer<Slider> m_slider_lfo0_attack;
    ScopedPointer<Label> m_label_lfo0_attack;
    ScopedPointer<Slider> m_slider_lfo1_delay;
    ScopedPointer<Label> m_label_lfo1_delay;
    ScopedPointer<Slider> m_slider_lfo1_attack;
    ScopedPointer<Label> m_label_lfo1_attack;
    ScopedPointer<Slider> m_slider_lfo2_delay;
    ScopedPointer<Label> m_label_lfo2_delay;
    ScopedPointer<Slider> m_slider_lfo2_attack;
    ScopedPointer<Label> m_label_lfo2_attack;
    ScopedPointer<Slider> m_slider_lfo3_delay;
    ScopedPointer<Label> m_label_lfo3_delay;
    ScopedPointer<Slider> m_slider_lfo3_attack;
    ScopedPointer<Label> m_label_lfo3_attack;
    ScopedPointer<ToggleButton> m_button_lfo0_restart_enable;
    ScopedPointer<ToggleButton> m_button_lfo0_individual_enable;
    ScopedPointer<Slider> m_slider_lfo0_symmetry;
    ScopedPointer<Label> m_label_lfo0_symmetry;
    ScopedPointer<Slider> m_slider_lfo1_symmetry;
    ScopedPointer<Label> m_label_lfo1_symmetry;
    ScopedPointer<ToggleButton> m_button_lfo1_restart_enable;
    ScopedPointer<ToggleButton> m_button_lfo1_individual_enable;
    ScopedPointer<ToggleButton> m_button_lfo2_restart_enable;
    ScopedPointer<ToggleButton> m_button_lfo2_individual_enable;
    ScopedPointer<Slider> m_slider_lfo2_symmetry;
    ScopedPointer<Label> m_label_lfo2_symmetry;
    ScopedPointer<Slider> m_slider_lfo3_symmetry;
    ScopedPointer<Label> m_label_lfo3_symmetry;
    ScopedPointer<ToggleButton> m_button_lfo3_restart_enable;
    ScopedPointer<ToggleButton> m_button_lfo3_individual_enable;
    ScopedPointer<Slider> m_slider_osc0_fm_amt1;
    ScopedPointer<Label> m_label_osc0_fm_amt1;
    ScopedPointer<Slider> m_slider_osc0_pwm_amt1;
    ScopedPointer<Label> m_label_osc0_pwm_amt1;
    ScopedPointer<Slider> m_slider_osc0_am_amt1;
    ScopedPointer<Label> m_label_osc0_am_amt1;
    ScopedPointer<Slider> m_slider_osc1_fm_amt1;
    ScopedPointer<Label> m_label_osc1_fm_amt1;
    ScopedPointer<Slider> m_slider_osc1_pwm_amt1;
    ScopedPointer<Label> m_label_osc1_pwm_amt1;
    ScopedPointer<Slider> m_slider_osc1_am_amt1;
    ScopedPointer<Label> m_label_osc1_am_amt1;
    ScopedPointer<Slider> m_slider_vcf_f_amt1;
    ScopedPointer<Label> m_label_vcf_f_amt1;
    ScopedPointer<Slider> m_slider_vcf_q_amt1;
    ScopedPointer<Label> m_label_vcf_q_amt1;
    ScopedPointer<ToggleButton> m_button_mono_retrigger;
    ScopedPointer<Label> m_label_max_num_voices;
    ScopedPointer<Label> m_label_num_voices_playing;
    ScopedPointer<Label> m_labelDebug;
    ScopedPointer<ButtonLED> m_btn_midiClockLed;
    ScopedPointer<Label> m_label_lfo0_midisync_factor;
    ScopedPointer<Slider> m_slider_lfo0_midisync_divisor;
    ScopedPointer<ComboBox> m_comboBox_lfo0_midisync_mode;
    ScopedPointer<TextButton> m_button_bank_load;
    ScopedPointer<TextButton> m_button_bank_save;
    ScopedPointer<TextButton> m_button_patch_load;
    ScopedPointer<TextButton> m_button_patch_save;


    //==============================================================================
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JaySynthAudioProcessorEditor)
};

//[EndFile] You can add extra defines here...
//[/EndFile]

#endif   // __JUCE_HEADER_AD3FF14AD0EF4DBE__
