#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** Form implementation generated from reading ui file 'base_k3bmanualbitratesettingswidget.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "base_k3bmanualbitratesettingswidget.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqframe.h>
#include <ntqcheckbox.h>
#include <ntqspinbox.h>
#include <ntqgroupbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a base_K3bManualBitrateSettingsWidget as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
base_K3bManualBitrateSettingsWidget::base_K3bManualBitrateSettingsWidget( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "base_K3bManualBitrateSettingsWidget" );
    base_K3bManualBitrateSettingsWidgetLayout = new TQVBoxLayout( this, 11, 6, "base_K3bManualBitrateSettingsWidgetLayout"); 

    buttonGroup2 = new TQButtonGroup( this, "buttonGroup2" );
    buttonGroup2->setCheckable( false );
    buttonGroup2->setColumnLayout(0, TQt::Vertical );
    buttonGroup2->layout()->setSpacing( 6 );
    buttonGroup2->layout()->setMargin( 11 );
    buttonGroup2Layout = new TQVBoxLayout( buttonGroup2->layout() );
    buttonGroup2Layout->setAlignment( TQt::AlignTop );

    m_radioConstantBitrate = new TQRadioButton( buttonGroup2, "m_radioConstantBitrate" );
    m_radioConstantBitrate->setChecked( true );
    buttonGroup2Layout->addWidget( m_radioConstantBitrate );

    layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); 
    spacer2_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout3->addItem( spacer2_2 );

    m_comboConstantBitrate = new KComboBox( false, buttonGroup2, "m_comboConstantBitrate" );
    layout3->addWidget( m_comboConstantBitrate );
    buttonGroup2Layout->addLayout( layout3 );

    m_radioVariableBitrate = new TQRadioButton( buttonGroup2, "m_radioVariableBitrate" );
    buttonGroup2Layout->addWidget( m_radioVariableBitrate );

    frame5 = new TQFrame( buttonGroup2, "frame5" );
    frame5->setEnabled( false );
    frame5->setFrameShape( TQFrame::NoFrame );
    frame5->setFrameShadow( TQFrame::Plain );
    frame5Layout = new TQGridLayout( frame5, 1, 1, 0, 6, "frame5Layout"); 

    m_comboMinimumBitrate = new KComboBox( false, frame5, "m_comboMinimumBitrate" );
    m_comboMinimumBitrate->setEnabled( false );

    frame5Layout->addWidget( m_comboMinimumBitrate, 2, 2 );
    spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    frame5Layout->addMultiCell( spacer2, 0, 2, 0, 0 );

    m_comboMaximumBitrate = new KComboBox( false, frame5, "m_comboMaximumBitrate" );
    m_comboMaximumBitrate->setEnabled( false );

    frame5Layout->addWidget( m_comboMaximumBitrate, 0, 2 );

    m_checkBitrateMaximum = new TQCheckBox( frame5, "m_checkBitrateMaximum" );

    frame5Layout->addWidget( m_checkBitrateMaximum, 0, 1 );

    m_checkBitrateMinimum = new TQCheckBox( frame5, "m_checkBitrateMinimum" );

    frame5Layout->addWidget( m_checkBitrateMinimum, 2, 1 );

    m_checkBitrateAverage = new TQCheckBox( frame5, "m_checkBitrateAverage" );
    m_checkBitrateAverage->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 1, 0, m_checkBitrateAverage->sizePolicy().hasHeightForWidth() ) );

    frame5Layout->addWidget( m_checkBitrateAverage, 1, 1 );

    m_spinAverageBitrate = new TQSpinBox( frame5, "m_spinAverageBitrate" );
    m_spinAverageBitrate->setEnabled( false );
    m_spinAverageBitrate->setButtonSymbols( TQSpinBox::UpDownArrows );
    m_spinAverageBitrate->setMaxValue( 310 );
    m_spinAverageBitrate->setMinValue( 8 );

    frame5Layout->addWidget( m_spinAverageBitrate, 1, 2 );
    buttonGroup2Layout->addWidget( frame5 );
    base_K3bManualBitrateSettingsWidgetLayout->addWidget( buttonGroup2 );

    groupBox2 = new TQGroupBox( this, "groupBox2" );
    groupBox2->setColumnLayout(0, TQt::Vertical );
    groupBox2->layout()->setSpacing( 6 );
    groupBox2->layout()->setMargin( 11 );
    groupBox2Layout = new TQHBoxLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( TQt::AlignTop );

    m_comboMode = new KComboBox( false, groupBox2, "m_comboMode" );
    groupBox2Layout->addWidget( m_comboMode );
    base_K3bManualBitrateSettingsWidgetLayout->addWidget( groupBox2 );
    languageChange();
    resize( TQSize(283, 298).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_radioVariableBitrate, TQ_SIGNAL( toggled(bool) ), frame5, TQ_SLOT( setEnabled(bool) ) );
    connect( m_radioConstantBitrate, TQ_SIGNAL( toggled(bool) ), m_comboConstantBitrate, TQ_SLOT( setEnabled(bool) ) );
    connect( m_checkBitrateMaximum, TQ_SIGNAL( toggled(bool) ), m_comboMaximumBitrate, TQ_SLOT( setEnabled(bool) ) );
    connect( m_checkBitrateAverage, TQ_SIGNAL( toggled(bool) ), m_spinAverageBitrate, TQ_SLOT( setEnabled(bool) ) );
    connect( m_checkBitrateMinimum, TQ_SIGNAL( toggled(bool) ), m_comboMinimumBitrate, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void base_K3bManualBitrateSettingsWidget::languageChange()
{
    buttonGroup2->setTitle( tr2i18n( "Quality" ) );
    m_radioConstantBitrate->setText( tr2i18n( "Constant Bitrate" ) );
    m_radioVariableBitrate->setText( tr2i18n( "Variable Bitrate" ) );
    m_checkBitrateMaximum->setText( tr2i18n( "Maximum bitrate:" ) );
    m_checkBitrateMinimum->setText( tr2i18n( "Minimum bitrate:" ) );
    m_checkBitrateAverage->setText( tr2i18n( "Average bitrate:" ) );
    m_spinAverageBitrate->setSuffix( tr2i18n( " kbps" ) );
    groupBox2->setTitle( tr2i18n( "Channel Mode" ) );
    m_comboMode->clear();
    m_comboMode->insertItem( tr2i18n( "Stereo" ) );
    m_comboMode->insertItem( tr2i18n( "Joint Stereo" ) );
    m_comboMode->insertItem( tr2i18n( "Mono" ) );
    TQToolTip::add( m_comboMode, tr2i18n( "Select the channel mode." ) );
    TQWhatsThis::add( m_comboMode, tr2i18n( "<p>Select the channel mode of the resulting Mp3 file:\n"
"<p><b>Stereo</b><br>\n"
"In this mode, the encoder makes no use of potential correlations between the two input channels; it can, however, negotiate the bit demand between both channel, i.e. give one channel more bits if the other contains silence or needs fewer bits because of a lower complexity.\n"
"<p><b>Joint-Stereo</b><br>\n"
"In this mode, the encoder will make use of correlations between both channels. The signal will be matrixed into a sum (\"mid\"), computed by L+R, and difference (\"side\") signal, computed by L-R, and more bits are allocated to the mid channel. This will effectively increase the bandwidth if the signal does not have too much stereo separation, thus giving a significant gain in encoding quality.\n"
"<p><b>Mono</b><br>\n"
"The input will be encoded as a mono signal. If it was a stereo signal, it will be downsampled to mono. The downmix is calculated as the sum of the left and right channel, attenuated by 6 dB." ) );
}

/****************************************************************************
** base_K3bManualBitrateSettingsWidget meta object code from reading C++ file 'base_k3bmanualbitratesettingswidget.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "base_k3bmanualbitratesettingswidget.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *base_K3bManualBitrateSettingsWidget::className() const
{
    return "base_K3bManualBitrateSettingsWidget";
}

TQMetaObject *base_K3bManualBitrateSettingsWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_base_K3bManualBitrateSettingsWidget( "base_K3bManualBitrateSettingsWidget", &base_K3bManualBitrateSettingsWidget::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString base_K3bManualBitrateSettingsWidget::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "base_K3bManualBitrateSettingsWidget", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString base_K3bManualBitrateSettingsWidget::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "base_K3bManualBitrateSettingsWidget", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* base_K3bManualBitrateSettingsWidget::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"base_K3bManualBitrateSettingsWidget", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_base_K3bManualBitrateSettingsWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* base_K3bManualBitrateSettingsWidget::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "base_K3bManualBitrateSettingsWidget" ) )
	return this;
    return TQWidget::tqt_cast( clname );
}

bool base_K3bManualBitrateSettingsWidget::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool base_K3bManualBitrateSettingsWidget::tqt_emit( int _id, TQUObject* _o )
{
    return TQWidget::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool base_K3bManualBitrateSettingsWidget::tqt_property( int id, int f, TQVariant* v)
{
    return TQWidget::tqt_property( id, f, v);
}

bool base_K3bManualBitrateSettingsWidget::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
