/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/

void AlsaConfigDialogBase::setDefaults()
{
    sampleRateList->setCurrentItem(2);
    periodsSpin->setValue(2);
    framesList->setCurrentItem(5);    
}



void AlsaConfigDialogBase::saveConfig()
{

}


void AlsaConfigDialogBase::computeLatency()
{
    int frames = framesList->currentText().toInt();
    int periods = periodsSpin->value();
    int rate=sampleRateList->currentText().toInt();
    int periodSize=(frames<<2);
	
    float lat_val=periodSize * float(periods)/(float(rate)/1000 *8);
    latencyVal->setText(QString::number(lat_val,'f',2)+" ms");

    int bufsize_val=((periodSize * periods )>>2);
    bufferSizeVal->setText(QString::number(bufsize_val));
    
    periodSizeVal->setText(QString::number(periodSize));
}
