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

    APVTSListener.cpp
    Created: 24 May 2025 11:10:36am
    Author:  Luigi

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

#include "APVTSListeners.h"

APVTSListeners::APVTSListeners() {}

APVTSListeners::~APVTSListeners() {}

void APVTSListeners::setEqualizerProcessor(CMLSEqualizer* equalizer) {
    this->equalizerProcessor = equalizer;
}

void APVTSListeners::setDistortionProcssor(CMLSDistortion* distortion) {
    this->distortionProcessor = distortion;
}

void APVTSListeners::setChorusProcessor(CMLSChorus* chorus) {
    this->chorusProcessor = chorus;
}

void APVTSListeners::setDelayProcessor(CMLSDelay* delay) {
    this->delayProcessor = delay;
}

void APVTSListeners::setReverbProcessor(CMLSReverb* reverbProcessor) {
    this->reverbProcessor = reverbProcessor;
}

void APVTSListeners::parameterChanged(const juce::String& parameterID, float newValue) {
    if (parameterID == "EQLOWBANDGAIN") {
        this->equalizerProcessor->setEqLowGain(newValue);
    }
    else if (parameterID == "EQHIGHBANDGAIN") {
        this->equalizerProcessor->setEqHighGain(newValue);
    }
    else if (parameterID == "DISTORTIONDRIVE") {
        this->distortionProcessor->setDrive(newValue);
    }
    else if (parameterID == "DISTORTIONMIX") {
        this->distortionProcessor->setMix(newValue);
    }
    else if (parameterID == "CHORUSDRYWET") {
        this->chorusProcessor->setDryWet(newValue);
    }
    else if (parameterID == "CHORUSAMOUNT") {
        this->chorusProcessor->setAmount(newValue);
    }
    else if (parameterID == "DELAYDRYWET") {
        this->delayProcessor->setDryWet(newValue);
    }
    else if (parameterID == "DELAYAMOUNT") {
        this->delayProcessor->setAmount(newValue);
    }
    else if (parameterID == "REVERBROOMSIZE") {
		this->reverbProcessor->setRoomSize(newValue);
	}
    else if (parameterID == "REVERBDRYWET") {
		this->reverbProcessor->setDryWet(newValue);
    }
}