/****************************************************************************
** Form implementation generated from reading ui file 'CdboAudioOptBase.ui'
**
** Created: Mon Apr 29 02:38:37 2002
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "CdboAudioOptBase.h"
#include "CdboAudioOptBase.moc"

#include <qvariant.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qframe.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/* 
 *  Constructs a CdboAudioOptBase which is a child of 'parent', with the 
 *  name 'name'.' 
 */
CdboAudioOptBase::CdboAudioOptBase( QWidget* parent,  const char* name )
    : KCModule( parent, name )
{
    if ( !name )
	setName( "CdboAudioOptBase" );
    resize( 530, 445 ); 
    setMinimumSize( QSize( 530, 445 ) );
    setCaption( trUtf8( "Audio Copy Settings" ) );
    CdboAudioOptBaseLayout = new QVBoxLayout( this, 0, 0, "CdboAudioOptBaseLayout"); 

    Frame5 = new QFrame( this, "Frame5" );
    Frame5->setMinimumSize( QSize( 0, 440 ) );
    Frame5->setMaximumSize( QSize( 5500, 32767 ) );
    Frame5->setFrameShape( QFrame::StyledPanel );
    Frame5->setFrameShadow( QFrame::Raised );
    Frame5Layout = new QGridLayout( Frame5, 1, 1, 11, 6, "Frame5Layout"); 

    ButtonGroup3_2 = new QButtonGroup( Frame5, "ButtonGroup3_2" );
    ButtonGroup3_2->setTitle( trUtf8( "General Options" ) );
    ButtonGroup3_2->setColumnLayout(0, Qt::Vertical );
    ButtonGroup3_2->layout()->setSpacing( 6 );
    ButtonGroup3_2->layout()->setMargin( 11 );
    ButtonGroup3_2Layout = new QGridLayout( ButtonGroup3_2->layout() );
    ButtonGroup3_2Layout->setAlignment( Qt::AlignTop );

    splitOutChk = new QCheckBox( ButtonGroup3_2, "splitOutChk" );
    splitOutChk->setText( trUtf8( "Split outpu&t" ) );
    splitOutChk->setChecked( TRUE );
    QToolTip::add( splitOutChk, trUtf8( "This option splits output into multiple files. If unused, multiple tracks will appear as one on new CD.<b></b>" ) );

    ButtonGroup3_2Layout->addWidget( splitOutChk, 1, 0 );

    TextLabel1_4 = new QLabel( ButtonGroup3_2, "TextLabel1_4" );
    TextLabel1_4->setText( trUtf8( "CD-Rom read speed:" ) );

    ButtonGroup3_2Layout->addWidget( TextLabel1_4, 0, 0 );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    ButtonGroup3_2Layout->addItem( spacer, 0, 2 );

    cdromSpeedSpn = new QSpinBox( ButtonGroup3_2, "cdromSpeedSpn" );
    cdromSpeedSpn->setMaxValue( 99 );
    cdromSpeedSpn->setSuffix( "x" );
    cdromSpeedSpn->setLineStep( 4 );
    cdromSpeedSpn->setSpecialValueText( trUtf8( "Default" ) );
    QToolTip::add( cdromSpeedSpn, trUtf8( "CD-Rom read speed" ) );

    ButtonGroup3_2Layout->addWidget( cdromSpeedSpn, 0, 1 );

    outputIndSpn = new QComboBox( FALSE, ButtonGroup3_2, "outputIndSpn" );
    outputIndSpn->insertItem( trUtf8( "Output Endianess" ) );
    outputIndSpn->insertItem( trUtf8( "Output Raw-big-indian" ) );
    outputIndSpn->insertItem( trUtf8( "Output Raw-little-indian" ) );
    QToolTip::add( outputIndSpn, trUtf8( "Sets endianess of the output samples to 'little' or 'big'." ) );

    ButtonGroup3_2Layout->addMultiCellWidget( outputIndSpn, 4, 4, 0, 2 );

    cdromIndSpn = new QComboBox( FALSE, ButtonGroup3_2, "cdromIndSpn" );
    cdromIndSpn->insertItem( trUtf8( "Input Endianess" ) );
    cdromIndSpn->insertItem( trUtf8( "CDRom Raw-big-indian" ) );
    cdromIndSpn->insertItem( trUtf8( "CDRom Raw-little-indian" ) );
    QToolTip::add( cdromIndSpn, trUtf8( "Sets endianess of the input samples to'little' or 'big'." ) );

    ButtonGroup3_2Layout->addMultiCellWidget( cdromIndSpn, 3, 3, 0, 2 );

    cddbLookupChk = new QCheckBox( ButtonGroup3_2, "cddbLookupChk" );
    cddbLookupChk->setText( trUtf8( "Perform titles lookup" ) );
    cddbLookupChk->setChecked( TRUE );
    QToolTip::add( cddbLookupChk, trUtf8( "Try <b></b>to retrieve performer, album-, and track titles from a cddbp server. The default server right now is 'freedb.freedb.org'. It is planned to have more control over the server handling later." ) );

    ButtonGroup3_2Layout->addMultiCellWidget( cddbLookupChk, 2, 2, 0, 2 );

    Frame5Layout->addWidget( ButtonGroup3_2, 1, 0 );

    ButtonGroup9_2 = new QButtonGroup( Frame5, "ButtonGroup9_2" );
    ButtonGroup9_2->setTitle( trUtf8( "Default Audio CD Reading Utility" ) );
    ButtonGroup9_2->setExclusive( TRUE );
    QToolTip::add( ButtonGroup9_2, trUtf8( "Choose default audio CD reading utility." ) );
    ButtonGroup9_2->setColumnLayout(0, Qt::Vertical );
    ButtonGroup9_2->layout()->setSpacing( 6 );
    ButtonGroup9_2->layout()->setMargin( 11 );
    ButtonGroup9_2Layout = new QHBoxLayout( ButtonGroup9_2->layout() );
    ButtonGroup9_2Layout->setAlignment( Qt::AlignTop );

    cdda2wavRBtn = new QRadioButton( ButtonGroup9_2, "cdda2wavRBtn" );
    cdda2wavRBtn->setText( trUtf8( "cdda&2wav" ) );
    cdda2wavRBtn->setChecked( TRUE );
    QToolTip::add( cdda2wavRBtn, trUtf8( "Use cdda2wav as audio reading utility." ) );
    ButtonGroup9_2Layout->addWidget( cdda2wavRBtn );

    cdparanoiaRBtn = new QRadioButton( ButtonGroup9_2, "cdparanoiaRBtn" );
    cdparanoiaRBtn->setText( trUtf8( "cd&paranoia" ) );
    QToolTip::add( cdparanoiaRBtn, trUtf8( "Use cdparanoia as audio reading utility." ) );
    ButtonGroup9_2Layout->addWidget( cdparanoiaRBtn );

    Frame5Layout->addWidget( ButtonGroup9_2, 0, 0 );

    cdparanoiaPnl = new QButtonGroup( Frame5, "cdparanoiaPnl" );
    cdparanoiaPnl->setTitle( trUtf8( "'cdparanoia'  Specific Options" ) );
    cdparanoiaPnl->setColumnLayout(0, Qt::Vertical );
    cdparanoiaPnl->layout()->setSpacing( 6 );
    cdparanoiaPnl->layout()->setMargin( 11 );
    cdparanoiaPnlLayout = new QGridLayout( cdparanoiaPnl->layout() );
    cdparanoiaPnlLayout->setAlignment( Qt::AlignTop );

    abortOnSkpChk = new QCheckBox( cdparanoiaPnl, "abortOnSkpChk" );
    abortOnSkpChk->setText( trUtf8( "Enable error correction" ) );
    QToolTip::add( abortOnSkpChk, trUtf8( "If the read skips due to imperfect<br>data, a scratch, etc. - abort reading this track." ) );

    cdparanoiaPnlLayout->addWidget( abortOnSkpChk, 0, 0 );

    Frame5Layout->addWidget( cdparanoiaPnl, 0, 1 );

    cdda2wavPnl = new QButtonGroup( Frame5, "cdda2wavPnl" );
    cdda2wavPnl->setTitle( trUtf8( "'cdda2wav' Specific Options" ) );
    cdda2wavPnl->setColumnLayout(0, Qt::Vertical );
    cdda2wavPnl->layout()->setSpacing( 6 );
    cdda2wavPnl->layout()->setMargin( 11 );
    cdda2wavPnlLayout = new QGridLayout( cdda2wavPnl->layout() );
    cdda2wavPnlLayout->setAlignment( Qt::AlignTop );

    maxQRBtn = new QRadioButton( cdda2wavPnl, "maxQRBtn" );
    maxQRBtn->setText( trUtf8( "Ma&ximum quality" ) );
    maxQRBtn->setChecked( TRUE );
    QToolTip::add( maxQRBtn, trUtf8( "Sets maximum (CD) quality." ) );

    cdda2wavPnlLayout->addWidget( maxQRBtn, 0, 0 );

    stereoRBtn = new QRadioButton( cdda2wavPnl, "stereoRBtn" );
    stereoRBtn->setText( trUtf8( "&Stereo" ) );
    QToolTip::add( stereoRBtn, trUtf8( "Sets to stereo recording." ) );

    cdda2wavPnlLayout->addWidget( stereoRBtn, 1, 0 );

    monoRBtn = new QRadioButton( cdda2wavPnl, "monoRBtn" );
    monoRBtn->setText( trUtf8( "&Mono" ) );
    QToolTip::add( monoRBtn, trUtf8( "Sets to mono recording." ) );

    cdda2wavPnlLayout->addWidget( monoRBtn, 2, 0 );

    stereoCSRBtn = new QRadioButton( cdda2wavPnl, "stereoCSRBtn" );
    stereoCSRBtn->setText( trUtf8( "Ste&reo (channels swapped)" ) );
    QToolTip::add( stereoCSRBtn, trUtf8( "Sets to stereo recording with both channels swapped." ) );

    cdda2wavPnlLayout->addWidget( stereoCSRBtn, 3, 0 );

    Line6 = new QFrame( cdda2wavPnl, "Line6" );
    Line6->setProperty( "frameShape", (int)QFrame::HLine );
    Line6->setFrameShadow( QFrame::Sunken );
    Line6->setFrameShape( QFrame::HLine );

    cdda2wavPnlLayout->addWidget( Line6, 4, 0 );

    echoChk = new QCheckBox( cdda2wavPnl, "echoChk" );
    echoChk->setText( trUtf8( "Echo (p&lay tracks during read)" ) );
    QToolTip::add( echoChk, trUtf8( "Play track during CD read." ) );

    cdda2wavPnlLayout->addWidget( echoChk, 5, 0 );

    Frame5Layout->addWidget( cdda2wavPnl, 1, 1 );
    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    Frame5Layout->addItem( spacer_2, 2, 1 );
    CdboAudioOptBaseLayout->addWidget( Frame5 );

    // signals and slots connections
    connect( cdparanoiaRBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( cdparanoiaRBtn, SIGNAL( clicked() ), this, SLOT( cdparanoiaSlot() ) );
    connect( cdda2wavRBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( cdda2wavRBtn, SIGNAL( clicked() ), this, SLOT( cdda2wavSlot() ) );
    connect( abortOnSkpChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( maxQRBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( stereoRBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( monoRBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( stereoCSRBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( echoChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( splitOutChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( cdromSpeedSpn, SIGNAL( valueChanged(int) ), this, SLOT( slotChanged() ) );
    connect( cdromIndSpn, SIGNAL( activated(int) ), this, SLOT( slotChanged() ) );
    connect( outputIndSpn, SIGNAL( activated(int) ), this, SLOT( slotChanged() ) );
    connect( cddbLookupChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
}

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

void CdboAudioOptBase::cdda2wavSlot()
{
    qWarning( "CdboAudioOptBase::cdda2wavSlot(): Not implemented yet!" );
}

void CdboAudioOptBase::cdparanoiaSlot()
{
    qWarning( "CdboAudioOptBase::cdparanoiaSlot(): Not implemented yet!" );
}

void CdboAudioOptBase::slotChanged()
{
    emit changed(true);
}

