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

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

#include "encodervorbisconfig.h"

#include <ntqvariant.h>
#include <knuminput.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqgroupbox.h>
#include <ntqcombobox.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    kcfg_vorbis_enc_method = new TQButtonGroup( this, "kcfg_vorbis_enc_method" );
    kcfg_vorbis_enc_method->setColumnLayout(0, TQt::Vertical );
    kcfg_vorbis_enc_method->layout()->setSpacing( 6 );
    kcfg_vorbis_enc_method->layout()->setMargin( 11 );
    kcfg_vorbis_enc_methodLayout = new TQHBoxLayout( kcfg_vorbis_enc_method->layout() );
    kcfg_vorbis_enc_methodLayout->setAlignment( TQt::AlignTop );

    vorbis_enc_quality = new TQRadioButton( kcfg_vorbis_enc_method, "vorbis_enc_quality" );
    vorbis_enc_quality->setChecked( true );
    kcfg_vorbis_enc_methodLayout->addWidget( vorbis_enc_quality );

    vorbis_enc_bitrate = new TQRadioButton( kcfg_vorbis_enc_method, "vorbis_enc_bitrate" );
    kcfg_vorbis_enc_methodLayout->addWidget( vorbis_enc_bitrate );
    VorbisConfigLayout->addWidget( kcfg_vorbis_enc_method );

    vorbis_bitrate_settings = new TQGroupBox( this, "vorbis_bitrate_settings" );
    vorbis_bitrate_settings->setEnabled( true );
    vorbis_bitrate_settings->setColumnLayout(0, TQt::Vertical );
    vorbis_bitrate_settings->layout()->setSpacing( 6 );
    vorbis_bitrate_settings->layout()->setMargin( 11 );
    vorbis_bitrate_settingsLayout = new TQGridLayout( vorbis_bitrate_settings->layout() );
    vorbis_bitrate_settingsLayout->setAlignment( TQt::AlignTop );

    kcfg_vorbis_min_br = new TQComboBox( false, vorbis_bitrate_settings, "kcfg_vorbis_min_br" );
    kcfg_vorbis_min_br->setEnabled( false );

    vorbis_bitrate_settingsLayout->addWidget( kcfg_vorbis_min_br, 0, 1 );

    kcfg_vorbis_max_br = new TQComboBox( false, vorbis_bitrate_settings, "kcfg_vorbis_max_br" );
    kcfg_vorbis_max_br->setEnabled( false );

    vorbis_bitrate_settingsLayout->addWidget( kcfg_vorbis_max_br, 1, 1 );

    kcfg_set_vorbis_min_br = new TQCheckBox( vorbis_bitrate_settings, "kcfg_set_vorbis_min_br" );
    kcfg_set_vorbis_min_br->setEnabled( true );

    vorbis_bitrate_settingsLayout->addWidget( kcfg_set_vorbis_min_br, 0, 0 );

    kcfg_set_vorbis_max_br = new TQCheckBox( vorbis_bitrate_settings, "kcfg_set_vorbis_max_br" );
    kcfg_set_vorbis_max_br->setEnabled( true );

    vorbis_bitrate_settingsLayout->addWidget( kcfg_set_vorbis_max_br, 1, 0 );

    kcfg_vorbis_nominal_br = new TQComboBox( false, vorbis_bitrate_settings, "kcfg_vorbis_nominal_br" );

    vorbis_bitrate_settingsLayout->addWidget( kcfg_vorbis_nominal_br, 2, 1 );

    kcfg_set_vorbis_nominal_br = new TQCheckBox( vorbis_bitrate_settings, "kcfg_set_vorbis_nominal_br" );
    kcfg_set_vorbis_nominal_br->setChecked( true );

    vorbis_bitrate_settingsLayout->addWidget( kcfg_set_vorbis_nominal_br, 2, 0 );
    VorbisConfigLayout->addWidget( vorbis_bitrate_settings );

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

    kcfg_vorbis_quality = new KDoubleNumInput( vorbis_quality_settings, "kcfg_vorbis_quality" );
    kcfg_vorbis_quality->setValue( 0 );
    kcfg_vorbis_quality->setMinValue( 0 );
    kcfg_vorbis_quality->setMaxValue( 10000 );
    kcfg_vorbis_quality->setPrecision( 1 );
    vorbis_quality_settingsLayout->addWidget( kcfg_vorbis_quality );
    VorbisConfigLayout->addWidget( vorbis_quality_settings );

    GroupBox193 = new TQGroupBox( this, "GroupBox193" );
    GroupBox193->setColumnLayout(0, TQt::Vertical );
    GroupBox193->layout()->setSpacing( 6 );
    GroupBox193->layout()->setMargin( 11 );
    GroupBox193Layout = new TQVBoxLayout( GroupBox193->layout() );
    GroupBox193Layout->setAlignment( TQt::AlignTop );

    kcfg_vorbis_comments = new TQCheckBox( GroupBox193, "kcfg_vorbis_comments" );
    kcfg_vorbis_comments->setEnabled( true );
    GroupBox193Layout->addWidget( kcfg_vorbis_comments );
    VorbisConfigLayout->addWidget( GroupBox193 );
    spacer9 = new TQSpacerItem( 20, 51, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    VorbisConfigLayout->addItem( spacer9 );
    languageChange();
    resize( TQSize(375, 408).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( vorbis_enc_bitrate, TQ_SIGNAL( toggled(bool) ), vorbis_bitrate_settings, TQ_SLOT( setShown(bool) ) );
    connect( vorbis_enc_quality, TQ_SIGNAL( toggled(bool) ), vorbis_quality_settings, TQ_SLOT( setShown(bool) ) );

    // tab order
    setTabOrder( vorbis_enc_quality, kcfg_set_vorbis_min_br );
    setTabOrder( kcfg_set_vorbis_min_br, kcfg_set_vorbis_max_br );
    setTabOrder( kcfg_set_vorbis_max_br, kcfg_set_vorbis_nominal_br );
    setTabOrder( kcfg_set_vorbis_nominal_br, kcfg_vorbis_min_br );
    setTabOrder( kcfg_vorbis_min_br, kcfg_vorbis_max_br );
    setTabOrder( kcfg_vorbis_max_br, kcfg_vorbis_nominal_br );
    setTabOrder( kcfg_vorbis_nominal_br, kcfg_vorbis_quality );
    setTabOrder( kcfg_vorbis_quality, kcfg_vorbis_comments );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void EncoderVorbisConfig::languageChange()
{
    kcfg_vorbis_enc_method->setTitle( tr2i18n( "&Encoding Method" ) );
    vorbis_enc_quality->setText( tr2i18n( "Quality based" ) );
    vorbis_enc_bitrate->setText( tr2i18n( "Bitrate based" ) );
    vorbis_bitrate_settings->setTitle( tr2i18n( "Vorbis Bitrate Settings" ) );
    kcfg_vorbis_min_br->clear();
    kcfg_vorbis_min_br->insertItem( tr2i18n( "32 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "40 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "48 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "56 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "64 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "80 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "96 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "112 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "128 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "160 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "192 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "224 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "256 kbs" ) );
    kcfg_vorbis_min_br->insertItem( tr2i18n( "350 kbs" ) );
    kcfg_vorbis_min_br->setCurrentItem( 1 );
    kcfg_vorbis_max_br->clear();
    kcfg_vorbis_max_br->insertItem( tr2i18n( "32 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "40 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "48 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "56 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "64 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "80 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "96 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "112 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "128 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "160 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "192 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "224 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "256 kbs" ) );
    kcfg_vorbis_max_br->insertItem( tr2i18n( "350 kbs" ) );
    kcfg_vorbis_max_br->setCurrentItem( 13 );
    kcfg_set_vorbis_min_br->setText( tr2i18n( "M&inimal bitrate:" ) );
    kcfg_set_vorbis_max_br->setText( tr2i18n( "Ma&ximal bitrate:" ) );
    kcfg_vorbis_nominal_br->clear();
    kcfg_vorbis_nominal_br->insertItem( tr2i18n( "128 kbs" ) );
    kcfg_vorbis_nominal_br->insertItem( tr2i18n( "160 kbs" ) );
    kcfg_vorbis_nominal_br->insertItem( tr2i18n( "192 kbs" ) );
    kcfg_vorbis_nominal_br->insertItem( tr2i18n( "256 kbs" ) );
    kcfg_vorbis_nominal_br->insertItem( tr2i18n( "350 kbs" ) );
    kcfg_vorbis_nominal_br->setCurrentItem( 1 );
    kcfg_set_vorbis_nominal_br->setText( tr2i18n( "A&verage bitrate:" ) );
    vorbis_quality_settings->setTitle( tr2i18n( "Vorbis &Quality Setting" ) );
    TQWhatsThis::add( vorbis_quality_settings, tr2i18n( "You can set the quality of the encoded stream here. A higher value implies a higher quality but encodes slower." ) );
    TQWhatsThis::add( kcfg_vorbis_quality, tr2i18n( "Higher is better but slower" ) );
    GroupBox193->setTitle( tr2i18n( "Options" ) );
    kcfg_vorbis_comments->setText( tr2i18n( "Add &track information" ) );
    TQWhatsThis::add( kcfg_vorbis_comments, tr2i18n( "Add a description of the song to the file header. This makes it easy for the user to get advanced song information shown by their media player. You can get this information automatically via the Internet. Look at the <i>\"CDDB Retrieval\"</i> control module for details." ) );
}

/****************************************************************************
** EncoderVorbisConfig meta object code from reading C++ file 'encodervorbisconfig.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 "encodervorbisconfig.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 *EncoderVorbisConfig::className() const
{
    return "EncoderVorbisConfig";
}

TQMetaObject *EncoderVorbisConfig::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_EncoderVorbisConfig( "EncoderVorbisConfig", &EncoderVorbisConfig::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* EncoderVorbisConfig::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(
	"EncoderVorbisConfig", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_EncoderVorbisConfig.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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