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

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

#include "base_k3bsoxencoderconfigwidget.h"

#include <ntqvariant.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    m_checkManual = new TQCheckBox( this, "m_checkManual" );
    Form1Layout->addWidget( m_checkManual );

    layout2 = new TQHBoxLayout( 0, 0, 6, "layout2"); 
    spacer2 = new TQSpacerItem( 20, 10, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout2->addItem( spacer2 );

    layout1 = new TQGridLayout( 0, 1, 1, 0, 6, "layout1"); 

    textLabel2 = new TQLabel( this, "textLabel2" );

    layout1->addWidget( textLabel2, 1, 0 );

    m_comboEncoding = new TQComboBox( false, this, "m_comboEncoding" );
    m_comboEncoding->setEnabled( false );

    layout1->addWidget( m_comboEncoding, 2, 1 );

    m_editSamplerate = new TQLineEdit( this, "m_editSamplerate" );
    m_editSamplerate->setEnabled( false );

    layout1->addWidget( m_editSamplerate, 1, 1 );

    textLabel4 = new TQLabel( this, "textLabel4" );

    layout1->addWidget( textLabel4, 3, 0 );

    textLabel3 = new TQLabel( this, "textLabel3" );

    layout1->addWidget( textLabel3, 2, 0 );

    textLabel1 = new TQLabel( this, "textLabel1" );

    layout1->addWidget( textLabel1, 0, 0 );

    m_comboChannels = new TQComboBox( false, this, "m_comboChannels" );
    m_comboChannels->setEnabled( false );

    layout1->addWidget( m_comboChannels, 0, 1 );

    m_comboSize = new TQComboBox( false, this, "m_comboSize" );
    m_comboSize->setEnabled( false );

    layout1->addWidget( m_comboSize, 3, 1 );
    layout2->addLayout( layout1 );
    Form1Layout->addLayout( layout2 );
    spacer1 = new TQSpacerItem( 250, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    Form1Layout->addItem( spacer1 );
    languageChange();
    resize( TQSize(419, 201).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_checkManual, TQ_SIGNAL( toggled(bool) ), m_comboChannels, TQ_SLOT( setEnabled(bool) ) );
    connect( m_checkManual, TQ_SIGNAL( toggled(bool) ), m_editSamplerate, TQ_SLOT( setEnabled(bool) ) );
    connect( m_checkManual, TQ_SIGNAL( toggled(bool) ), m_comboEncoding, TQ_SLOT( setEnabled(bool) ) );
    connect( m_checkManual, TQ_SIGNAL( toggled(bool) ), m_comboSize, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void base_K3bSoxEncoderConfigWidget::languageChange()
{
    m_checkManual->setText( tr2i18n( "Manual settings (used for all file types)" ) );
    textLabel2->setText( tr2i18n( "Sample rate:" ) );
    m_comboEncoding->clear();
    m_comboEncoding->insertItem( tr2i18n( "Signed Linear" ) );
    m_comboEncoding->insertItem( tr2i18n( "Unsigned Linear" ) );
    m_comboEncoding->insertItem( tr2i18n( "u-law (logarithmic)" ) );
    m_comboEncoding->insertItem( tr2i18n( "A-law (logarithmic)" ) );
    m_comboEncoding->insertItem( tr2i18n( "ADPCM" ) );
    m_comboEncoding->insertItem( tr2i18n( "IMA_ADPCM" ) );
    m_comboEncoding->insertItem( tr2i18n( "GSM" ) );
    m_comboEncoding->insertItem( tr2i18n( "Floating-Point" ) );
    TQWhatsThis::add( m_comboEncoding, tr2i18n( "<p>The sample data encoding is signed linear (2's complement), unsigned linear, u-law (logarithmic), A-law (logarithmic), ADPCM, IMA_ADPCM, GSM, or Floating-point.</p>\n"
"<p><b>U-law</b> (actually shorthand for mu-law) and <b>A-law</b> are the U.S. and international standards for logarithmic telephone sound compression. When uncompressed u-law has roughly the precision of 14-bit PCM audio and A-law has roughly the precision of 13-bit PCM audio. A-law and u-law data is sometimes encoded using a reversed bit-ordering (i.e. MSB becomes LSB).<br> <b>ADPCM </b> is a form of sound compression that has a good compromise between good sound quality and fast encoding/decoding time. It is used for telephone sound compression and places where full fidelity is not as important. When uncompressed it has roughly the precision of 16-bit PCM audio. Popular versions of ADPCM include G.726, MS ADPCM, and IMA ADPCM. It has different meanings in different file handlers. In .wav files it represents MS ADPCM files, in all others it means G.726 ADPCM. <br> <b>IMA ADPCM</b> is a specific form of ADPCM compression, slightly simpler and slightly lower fidelity than Microsoft's flavor of ADPCM. IMA ADPCM is also called DVI ADPCM.<br> <b>GSM</b> is a standard used for telephone sound compression in European countries and is gaining popularity because of its good quality. It is usually CPU intensive to work with GSM audio data.</p> <p><em>Description based on the SoX manpage</em></p>" ) );
    m_editSamplerate->setText( tr2i18n( "14400" ) );
    TQWhatsThis::add( m_editSamplerate, TQString::null );
    textLabel4->setText( tr2i18n( "Data size:" ) );
    textLabel3->setText( tr2i18n( "Data encoding:" ) );
    textLabel1->setText( tr2i18n( "Channels:" ) );
    m_comboChannels->clear();
    m_comboChannels->insertItem( tr2i18n( "1 (mono)" ) );
    m_comboChannels->insertItem( tr2i18n( "2 (stereo)" ) );
    m_comboChannels->insertItem( tr2i18n( "4 (quad sound)" ) );
    m_comboSize->clear();
    m_comboSize->insertItem( tr2i18n( "Bytes" ) );
    m_comboSize->insertItem( tr2i18n( "16-bit Words" ) );
    m_comboSize->insertItem( tr2i18n( "32-bit Words" ) );
}

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

TQMetaObject *base_K3bSoxEncoderConfigWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_base_K3bSoxEncoderConfigWidget( "base_K3bSoxEncoderConfigWidget", &base_K3bSoxEncoderConfigWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

bool base_K3bSoxEncoderConfigWidget::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_K3bSoxEncoderConfigWidget::tqt_emit( int _id, TQUObject* _o )
{
    return TQWidget::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

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

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