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

    This file was auto-generated by the Introjucer!

    It contains the basic framework code for a JUCE plugin editor.

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

#include "PluginProcessor.h"
#include "PluginEditor.h"

using namespace gin;

//==============================================================================
ChannelMuteAudioProcessorEditor::ChannelMuteAudioProcessorEditor (ChannelMuteAudioProcessor& p)
    : gin::ProcessorEditor (p), cmProcessor (p)
{
    for (auto pp : p.getPluginParameters())
    {
        ParamComponent* pc;
        
        if (pp->isOnOff())
            pc = new Switch (pp);
        else
            pc = new Knob (pp);
        
        addAndMakeVisible (pc);
        controls.add (pc);
    }
    
    setGridSize (6, 1);
}

ChannelMuteAudioProcessorEditor::~ChannelMuteAudioProcessorEditor()
{
}

//==============================================================================
void ChannelMuteAudioProcessorEditor::resized()
{
    gin::ProcessorEditor::resized();

    componentForId (PARAM_MUTE_L)->setBounds (getGridArea (1, 0));
    componentForId (PARAM_LEVEL_L)->setBounds (getGridArea (2, 0));
    componentForId (PARAM_MUTE_R)->setBounds (getGridArea (3, 0));
    componentForId (PARAM_LEVEL_R)->setBounds (getGridArea (4, 0));
}
