#include "VUMeter.h"
#include "DACInterface.h"

float mVolumeScaling;

void VUMeterInit()
{
    mVolumeScaling = DAC_MAX_VALUE/AUDIO_CONSOLE_VOLUME_STEPS;
}


void VUMeterSetVolume(int MainVUVolume, int Zone2VUVolume)
{
    int Output = 0;
    if(MainVUVolume <= AUDIO_CONSOLE_MAX_VOLUME && MainVUVolume >= 0)
    {
        Output = (int)((float)MainVUVolume*mVolumeScaling);
        DACSetValue(BUREAU_DAC_CHANNEL,Output);
    }
    if(Zone2VUVolume <= AUDIO_CONSOLE_MAX_VOLUME && Zone2VUVolume >= 0)
    {
        Output = (int)((float)Zone2VUVolume*mVolumeScaling);
        DACSetValue(CUISINE_DAC_CHANNEL,Output);    
    }
}