/****************************************************************************
** Form implementation generated from reading ui file 'AudioDialog.ui'
**
** Created: Wed Oct 2 21:14:42 2002
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "AudioDialogData.h"

#include <qvariant.h>
#include <qbuttongroup.h>
#include <qcombobox.h>
#include <qgroupbox.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/* 
 *  Constructs a AudioDialogData which is a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
AudioDialogData::AudioDialogData( QWidget* parent,  const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "AudioDialogData" );
    resize( 285, 274 ); 
    setCaption( trUtf8( "Audio configuration" ) );
    setFocusPolicy( QDialog::NoFocus );
    AudioDialogDataLayout = new QGridLayout( this, 1, 1, 6, 6, "AudioDialogDataLayout"); 

    freqBox = new QGroupBox( this, "freqBox" );
    freqBox->setFrameShape( QGroupBox::Box );
    freqBox->setFrameShadow( QGroupBox::Sunken );
    freqBox->setTitle( trUtf8( "Frequency" ) );

    frequencyBox = new QComboBox( FALSE, freqBox, "frequencyBox" );
    frequencyBox->insertItem( trUtf8( "8000" ) );
    frequencyBox->insertItem( trUtf8( "11025" ) );
    frequencyBox->insertItem( trUtf8( "16500" ) );
    frequencyBox->insertItem( trUtf8( "22050" ) );
    frequencyBox->insertItem( trUtf8( "27500" ) );
    frequencyBox->insertItem( trUtf8( "32000" ) );
    frequencyBox->insertItem( trUtf8( "37500" ) );
    frequencyBox->insertItem( trUtf8( "44100" ) );
    frequencyBox->insertItem( trUtf8( "48000" ) );
    frequencyBox->setGeometry( QRect( 10, 25, 85, 21 ) ); 
    frequencyBox->setFocusPolicy( QComboBox::TabFocus );
    frequencyBox->setCurrentItem( 3 );

    AudioDialogDataLayout->addMultiCellWidget( freqBox, 2, 2, 0, 2 );

    cancelButton = new QPushButton( this, "cancelButton" );
    cancelButton->setText( trUtf8( "&Cancel" ) );

    AudioDialogDataLayout->addWidget( cancelButton, 3, 2 );

    okButton = new QPushButton( this, "okButton" );
    okButton->setText( trUtf8( "&OK" ) );
    okButton->setDefault( TRUE );

    AudioDialogDataLayout->addWidget( okButton, 3, 1 );
    QSpacerItem* spacer = new QSpacerItem( 20, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
    AudioDialogDataLayout->addItem( spacer, 3, 0 );

    driverGrp = new QGroupBox( this, "driverGrp" );
    driverGrp->setTitle( trUtf8( "Driver" ) );

    driverBox = new QComboBox( FALSE, driverGrp, "driverBox" );
    driverBox->setGeometry( QRect( 10, 25, 110, 20 ) ); 

    AudioDialogDataLayout->addMultiCellWidget( driverGrp, 0, 0, 0, 2 );

    Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); 

    bitsGrp = new QButtonGroup( this, "bitsGrp" );
    bitsGrp->setTitle( trUtf8( "Sample precision" ) );
    bitsGrp->setExclusive( TRUE );

    bit8Btn = new QRadioButton( bitsGrp, "bit8Btn" );
    bit8Btn->setGeometry( QRect( 13, 23, 85, 19 ) ); 
    bit8Btn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, bit8Btn->sizePolicy().hasHeightForWidth() ) );
    bit8Btn->setText( trUtf8( "8-bit" ) );

    bit16Btn = new QRadioButton( bitsGrp, "bit16Btn" );
    bit16Btn->setGeometry( QRect( 13, 48, 90, 19 ) ); 
    bit16Btn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, bit16Btn->sizePolicy().hasHeightForWidth() ) );
    bit16Btn->setText( trUtf8( "16-bit" ) );
    Layout2->addWidget( bitsGrp );

    channelsGrp = new QButtonGroup( this, "channelsGrp" );
    channelsGrp->setTitle( trUtf8( "Channels" ) );
    channelsGrp->setExclusive( TRUE );

    stereoBtn = new QRadioButton( channelsGrp, "stereoBtn" );
    stereoBtn->setGeometry( QRect( 15, 50, 90, 19 ) ); 
    stereoBtn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, stereoBtn->sizePolicy().hasHeightForWidth() ) );
    stereoBtn->setText( trUtf8( "Stereo" ) );

    monoBtn = new QRadioButton( channelsGrp, "monoBtn" );
    monoBtn->setGeometry( QRect( 15, 25, 90, 19 ) ); 
    monoBtn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, monoBtn->sizePolicy().hasHeightForWidth() ) );
    monoBtn->setText( trUtf8( "Mono" ) );
    Layout2->addWidget( channelsGrp );

    AudioDialogDataLayout->addMultiCellLayout( Layout2, 1, 1, 0, 2 );

    // signals and slots connections
    connect( bitsGrp, SIGNAL( clicked(int) ), this, SLOT( setBitsPerSample(int) ) );
    connect( channelsGrp, SIGNAL( clicked(int) ), this, SLOT( setChannels(int) ) );
    connect( frequencyBox, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
    connect( driverBox, SIGNAL( activated(const QString&) ), this, SLOT( setDriver(const QString&) ) );
    connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );

    // tab order
    setTabOrder( okButton, cancelButton );
    setTabOrder( cancelButton, driverBox );
    setTabOrder( driverBox, bit8Btn );
    setTabOrder( bit8Btn, bit16Btn );
    setTabOrder( bit16Btn, monoBtn );
    setTabOrder( monoBtn, stereoBtn );
    setTabOrder( stereoBtn, frequencyBox );
}

/*  
 *  Destroys the object and frees any allocated resources
 */
AudioDialogData::~AudioDialogData()
{
    // no need to delete child widgets, Qt does it all for us
}

void AudioDialogData::setDriver( const QString & )
{
    qWarning( "AudioDialogData::setDriver( const QString & ): Not implemented yet!" );
}

void AudioDialogData::setBitsPerSample( int )
{
    qWarning( "AudioDialogData::setBitsPerSample( int ): Not implemented yet!" );
}

void AudioDialogData::setChannels( int )
{
    qWarning( "AudioDialogData::setChannels( int ): Not implemented yet!" );
}

void AudioDialogData::setFrequency( int )
{
    qWarning( "AudioDialogData::setFrequency( int ): Not implemented yet!" );
}

