/* ========================================
 *  DCVoltage - DCVoltage.h
 *  Copyright (c) 2016 airwindows, Airwindows uses the MIT license
 * ======================================== */

#include "DCVoltage.h"

#ifdef SHR3D_SFX_CORE_AIRWINDOWS

namespace airwinconsolidated::DCVoltage {

void DCVoltage::processBlock(float **inputs, float **outputs, int sampleFrames) 
{
    float* in1  =  inputs[0];
    float* in2  =  inputs[1];
    float* out1 = outputs[0];
    float* out2 = outputs[1];

	double voltage = (A*2.0)-1.0;
    
    while (--sampleFrames >= 0)
    {
		*out1 = *in1 + voltage;
		*out2 = *in2 + voltage;

		in1++;
		in2++;
		out1++;
		out2++;
    }
}

} // end namespace

#endif // SHR3D_SFX_CORE_AIRWINDOWS
