From d8cc8bdfa7fa624a526d5aa1626974e1444cb799 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 27 May 2011 19:21:21 +0000 Subject: TQt4 port k3b This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k3b@1233803 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../lame/base_k3blameencodersettingswidget.ui | 82 +++++++++--------- .../lame/base_k3bmanualbitratesettingswidget.ui | 32 +++---- plugins/encoder/lame/k3blameencoder.cpp | 98 +++++++++++----------- plugins/encoder/lame/k3blameencoder.h | 24 +++--- 4 files changed, 119 insertions(+), 117 deletions(-) (limited to 'plugins/encoder/lame') diff --git a/plugins/encoder/lame/base_k3blameencodersettingswidget.ui b/plugins/encoder/lame/base_k3blameencodersettingswidget.ui index 199895e..81cb521 100644 --- a/plugins/encoder/lame/base_k3blameencodersettingswidget.ui +++ b/plugins/encoder/lame/base_k3blameencodersettingswidget.ui @@ -1,11 +1,11 @@ base_K3bLameEncoderSettingsWidget Sebastian Trueg - + Form1 - + 0 0 @@ -20,11 +20,11 @@ 0 - + m_mainTab - + tab @@ -35,7 +35,7 @@ unnamed - + m_groupVariableBitrate @@ -46,15 +46,15 @@ unnamed - + - layout10 + tqlayout10 unnamed - + m_radioQualityLevel @@ -65,7 +65,7 @@ true - + m_labelQualityLevel @@ -77,13 +77,13 @@ textLabel1 - + AlignVCenter|AlignRight - + m_qualityLevelFrame @@ -116,22 +116,22 @@ Fixed - + 20 20 - + - layout8 + tqlayout8 unnamed - + textLabel4 @@ -143,11 +143,11 @@ high quality - + AlignVCenter|AlignRight - + textLabel3 @@ -160,7 +160,7 @@ small file - + m_sliderQuality @@ -191,22 +191,22 @@ Fixed - + 20 20 - + - layout12 + tqlayout12 unnamed - + m_radioManual @@ -214,7 +214,7 @@ Manual settings: - + m_labelManualSettings @@ -229,15 +229,15 @@ textLabel2 - + AlignVCenter|AlignRight - + - layout11 + tqlayout11 @@ -259,14 +259,14 @@ Expanding - + 20 5 - + m_buttonManualSettings @@ -283,7 +283,7 @@ - + tab @@ -294,7 +294,7 @@ unnamed - + groupBox1 @@ -324,9 +324,9 @@ <p><b>This setting has no influence on the size of the resulting file.</b> - + - layout2 + tqlayout2 @@ -335,7 +335,7 @@ 0 - + textLabel1 @@ -348,7 +348,7 @@ fast encoding - + textLabel2 @@ -360,7 +360,7 @@ high quality - + AlignVCenter|AlignRight @@ -368,7 +368,7 @@ - + groupBox3 @@ -387,7 +387,7 @@ unnamed - + m_checkCopyright @@ -398,7 +398,7 @@ Mark the encoded file as being copyrighted. - + m_checkOriginal @@ -409,7 +409,7 @@ Mark the encoded file as being a copy. - + m_checkISO @@ -424,7 +424,7 @@ This results in many wasted bits for high bitrate encodings but will ensure strict ISO compatibility. This compatibility might be important for hardware players. - + m_checkError @@ -473,7 +473,7 @@ This results in many wasted bits for high bitrate encodings but will ensure setEnabled(bool) - + knuminput.h diff --git a/plugins/encoder/lame/base_k3bmanualbitratesettingswidget.ui b/plugins/encoder/lame/base_k3bmanualbitratesettingswidget.ui index a3bff90..e0ac569 100644 --- a/plugins/encoder/lame/base_k3bmanualbitratesettingswidget.ui +++ b/plugins/encoder/lame/base_k3bmanualbitratesettingswidget.ui @@ -1,10 +1,10 @@ base_K3bManualBitrateSettingsWidget - + base_K3bManualBitrateSettingsWidget - + 0 0 @@ -16,7 +16,7 @@ unnamed - + buttonGroup2 @@ -30,7 +30,7 @@ unnamed - + m_radioConstantBitrate @@ -41,9 +41,9 @@ true - + - layout3 + tqlayout3 @@ -59,7 +59,7 @@ Fixed - + 20 20 @@ -73,7 +73,7 @@ - + m_radioVariableBitrate @@ -81,7 +81,7 @@ Variable Bitrate - + frame5 @@ -119,7 +119,7 @@ Fixed - + 20 20 @@ -134,7 +134,7 @@ false - + m_checkBitrateMaximum @@ -142,7 +142,7 @@ Maximum bitrate: - + m_checkBitrateMinimum @@ -150,7 +150,7 @@ Minimum bitrate: - + m_checkBitrateAverage @@ -166,7 +166,7 @@ Average bitrate: - + m_spinAverageBitrate @@ -190,7 +190,7 @@ - + groupBox2 @@ -269,5 +269,5 @@ The input will be encoded as a mono signal. If it was a stereo signal, it will b setEnabled(bool) - + diff --git a/plugins/encoder/lame/k3blameencoder.cpp b/plugins/encoder/lame/k3blameencoder.cpp index 089c7d0..19cbf16 100644 --- a/plugins/encoder/lame/k3blameencoder.cpp +++ b/plugins/encoder/lame/k3blameencoder.cpp @@ -28,18 +28,18 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -135,15 +135,15 @@ public: char buffer[8000]; - QString filename; + TQString filename; FILE* fid; }; -K3bLameEncoder::K3bLameEncoder( QObject* parent, const char* name ) - : K3bAudioEncoder( parent, name ) +K3bLameEncoder::K3bLameEncoder( TQObject* tqparent, const char* name ) + : K3bAudioEncoder( tqparent, name ) { d = new Private(); } @@ -157,12 +157,12 @@ K3bLameEncoder::~K3bLameEncoder() } -bool K3bLameEncoder::openFile( const QString& extension, const QString& filename, const K3b::Msf& length ) +bool K3bLameEncoder::openFile( const TQString& extension, const TQString& filename, const K3b::Msf& length ) { closeFile(); d->filename = filename; - d->fid = ::fopen( QFile::encodeName( filename ), "w+" ); + d->fid = ::fopen( TQFile::encodeName( filename ), "w+" ); if( d->fid ) return initEncoder( extension, length ); else @@ -187,13 +187,13 @@ void K3bLameEncoder::closeFile() } -const QString& K3bLameEncoder::filename() const +const TQString& K3bLameEncoder::filename() const { return d->filename; } -bool K3bLameEncoder::initEncoderInternal( const QString&, const K3b::Msf& length ) +bool K3bLameEncoder::initEncoderInternal( const TQString&, const K3b::Msf& length ) { KConfig* c = k3bcore->config(); c->setGroup( "K3bLameEncoderPlugin" ); @@ -226,7 +226,7 @@ bool K3bLameEncoder::initEncoderInternal( const QString&, const K3b::Msf& length // // Mode // - QString mode = c->readEntry( "Mode", "stereo" ); + TQString mode = c->readEntry( "Mode", "stereo" ); if( mode == "stereo" ) lame_set_mode( d->flags, STEREO ); else if( mode == "joint" ) @@ -323,7 +323,7 @@ bool K3bLameEncoder::initEncoderInternal( const QString&, const K3b::Msf& length } -long K3bLameEncoder::encodeInternal( const char* data, Q_ULONG len ) +long K3bLameEncoder::encodeInternal( const char* data, TQ_ULONG len ) { // FIXME: we may have to swap data here int size = lame_encode_buffer_interleaved( d->flags, @@ -355,11 +355,11 @@ void K3bLameEncoder::finishEncoderInternal() } -void K3bLameEncoder::setMetaDataInternal( K3bAudioEncoder::MetaDataField f, const QString& value ) +void K3bLameEncoder::setMetaDataInternal( K3bAudioEncoder::MetaDataField f, const TQString& value ) { // let's not use UTF-8 here since I don't know how to tell lame... // FIXME: when we use the codec we only get garbage. Why? - QTextCodec* codec = 0;//QTextCodec::codecForName( "ISO8859-1" ); + TQTextCodec* codec = 0;//TQTextCodec::codecForName( "ISO8859-1" ); // if( !codec ) // kdDebug() << "(K3bLameEncoder) could not find codec ISO8859-1." << endl; @@ -398,8 +398,8 @@ void K3bLameEncoder::setMetaDataInternal( K3bAudioEncoder::MetaDataField f, cons -K3bLameEncoderSettingsWidget::K3bLameEncoderSettingsWidget( QWidget* parent, const char* name ) - : K3bPluginConfigWidget( parent, name ) +K3bLameEncoderSettingsWidget::K3bLameEncoderSettingsWidget( TQWidget* tqparent, const char* name ) + : K3bPluginConfigWidget( tqparent, name ) { m_w = new base_K3bLameEncoderSettingsWidget( this ); m_w->m_sliderQuality->setRange( 0, 9 ); @@ -411,26 +411,26 @@ K3bLameEncoderSettingsWidget::K3bLameEncoderSettingsWidget( QWidget* parent, con m_manualSettingsDlg->setMainWidget( m_brW ); for( int i = 0; s_lame_bitrates[i]; ++i ) - m_brW->m_comboMaximumBitrate->insertItem( i18n("%1 kbps" ).arg(s_lame_bitrates[i]) ); + m_brW->m_comboMaximumBitrate->insertItem( i18n("%1 kbps" ).tqarg(s_lame_bitrates[i]) ); for( int i = 0; s_lame_bitrates[i]; ++i ) - m_brW->m_comboMinimumBitrate->insertItem( i18n("%1 kbps" ).arg(s_lame_bitrates[i]) ); + m_brW->m_comboMinimumBitrate->insertItem( i18n("%1 kbps" ).tqarg(s_lame_bitrates[i]) ); for( int i = 0; s_lame_bitrates[i]; ++i ) - m_brW->m_comboConstantBitrate->insertItem( i18n("%1 kbps" ).arg(s_lame_bitrates[i]) ); + m_brW->m_comboConstantBitrate->insertItem( i18n("%1 kbps" ).tqarg(s_lame_bitrates[i]) ); - QHBoxLayout* lay = new QHBoxLayout( this ); + TQHBoxLayout* lay = new TQHBoxLayout( this ); lay->setMargin( 0 ); lay->addWidget( m_w ); // TODO: add whatsthis help for the quality level. - // QString qualityLevelWhatsThis = i18n("

"); + // TQString qualityLevelWhatsThis = i18n("

"); - connect( m_w->m_buttonManualSettings, SIGNAL(clicked()), - this, SLOT(slotShowManualSettings()) ); - connect( m_w->m_sliderQuality, SIGNAL(valueChanged(int)), - this, SLOT(slotQualityLevelChanged(int)) ); + connect( m_w->m_buttonManualSettings, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotShowManualSettings()) ); + connect( m_w->m_sliderQuality, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotQualityLevelChanged(int)) ); updateManualSettingsLabel(); slotQualityLevelChanged( 5 ); @@ -452,7 +452,7 @@ void K3bLameEncoderSettingsWidget::slotShowManualSettings() int av = m_brW->m_spinAverageBitrate->value(); int mode = m_brW->m_comboMode->currentItem(); - if( m_manualSettingsDlg->exec() == QDialog::Rejected ) { + if( m_manualSettingsDlg->exec() == TQDialog::Rejected ) { m_brW->m_radioConstantBitrate->setChecked( constant ); m_brW->m_comboConstantBitrate->setCurrentItem( constBitrate ); m_brW->m_comboMaximumBitrate->setCurrentItem( max ); @@ -469,11 +469,11 @@ void K3bLameEncoderSettingsWidget::updateManualSettingsLabel() { if( m_brW->m_radioConstantBitrate->isChecked() ) m_w->m_labelManualSettings->setText( i18n("Constant Bitrate: %1 kbps (%2)") - .arg(s_lame_bitrates[m_brW->m_comboConstantBitrate->currentItem()]) - .arg(i18n(s_lame_mode_strings[m_brW->m_comboMode->currentItem()])) ); + .tqarg(s_lame_bitrates[m_brW->m_comboConstantBitrate->currentItem()]) + .tqarg(i18n(s_lame_mode_strings[m_brW->m_comboMode->currentItem()])) ); else m_w->m_labelManualSettings->setText( i18n("Variable Bitrate (%1)") - .arg(i18n(s_lame_mode_strings[m_brW->m_comboMode->currentItem()])) ); + .tqarg(i18n(s_lame_mode_strings[m_brW->m_comboMode->currentItem()])) ); } @@ -488,7 +488,7 @@ void K3bLameEncoderSettingsWidget::loadConfig() KConfig* c = k3bcore->config(); c->setGroup( "K3bLameEncoderPlugin" ); - QString mode = c->readEntry( "Mode", "stereo" ); + TQString mode = c->readEntry( "Mode", "stereo" ); if( mode == "stereo" ) m_brW->m_comboMode->setCurrentItem( 0 ); else if( mode == "joint" ) @@ -507,9 +507,9 @@ void K3bLameEncoderSettingsWidget::loadConfig() else m_brW->m_radioConstantBitrate->setChecked( true ); - m_brW->m_comboConstantBitrate->setCurrentItem( i18n("%1 kbps").arg(c->readNumEntry( "Constant Bitrate", 128 )) ); - m_brW->m_comboMaximumBitrate->setCurrentItem( i18n("%1 kbps").arg(c->readNumEntry( "Maximum Bitrate", 224 )) ); - m_brW->m_comboMinimumBitrate->setCurrentItem( i18n("%1 kbps").arg(c->readNumEntry( "Minimum Bitrate", 32 )) ); + m_brW->m_comboConstantBitrate->setCurrentItem( i18n("%1 kbps").tqarg(c->readNumEntry( "Constant Bitrate", 128 )) ); + m_brW->m_comboMaximumBitrate->setCurrentItem( i18n("%1 kbps").tqarg(c->readNumEntry( "Maximum Bitrate", 224 )) ); + m_brW->m_comboMinimumBitrate->setCurrentItem( i18n("%1 kbps").tqarg(c->readNumEntry( "Minimum Bitrate", 32 )) ); m_brW->m_spinAverageBitrate->setValue( c->readNumEntry( "Average Bitrate", 128) ); m_brW->m_checkBitrateMaximum->setChecked( c->readBoolEntry( "Use Maximum Bitrate", false ) ); @@ -535,7 +535,7 @@ void K3bLameEncoderSettingsWidget::saveConfig() KConfig* c = k3bcore->config(); c->setGroup( "K3bLameEncoderPlugin" ); - QString mode; + TQString mode; switch( m_brW->m_comboMode->currentItem() ) { case 0: mode = "stereo"; @@ -574,19 +574,19 @@ void K3bLameEncoderSettingsWidget::saveConfig() -QStringList K3bLameEncoder::extensions() const +TQStringList K3bLameEncoder::extensions() const { - return QStringList( "mp3" ); + return TQStringList( "mp3" ); } -QString K3bLameEncoder::fileTypeComment( const QString& ) const +TQString K3bLameEncoder::fileTypeComment( const TQString& ) const { return "MPEG1 Layer III (mp3)"; } -long long K3bLameEncoder::fileSize( const QString&, const K3b::Msf& msf ) const +long long K3bLameEncoder::fileSize( const TQString&, const K3b::Msf& msf ) const { KConfig* c = k3bcore->config(); c->setGroup( "K3bLameEncoderPlugin" ); @@ -617,10 +617,10 @@ long long K3bLameEncoder::fileSize( const QString&, const K3b::Msf& msf ) const } -K3bPluginConfigWidget* K3bLameEncoder::createConfigWidget( QWidget* parent, +K3bPluginConfigWidget* K3bLameEncoder::createConfigWidget( TQWidget* tqparent, const char* name ) const { - return new K3bLameEncoderSettingsWidget( parent, name ); + return new K3bLameEncoderSettingsWidget( tqparent, name ); } diff --git a/plugins/encoder/lame/k3blameencoder.h b/plugins/encoder/lame/k3blameencoder.h index 424ea64..25f5975 100644 --- a/plugins/encoder/lame/k3blameencoder.h +++ b/plugins/encoder/lame/k3blameencoder.h @@ -30,32 +30,33 @@ class KDialogBase; class K3bLameEncoder : public K3bAudioEncoder { Q_OBJECT + TQ_OBJECT public: - K3bLameEncoder( QObject* parent = 0, const char* name = 0 ); + K3bLameEncoder( TQObject* tqparent = 0, const char* name = 0 ); ~K3bLameEncoder(); - bool openFile( const QString& extension, const QString& filename, const K3b::Msf& length ); + bool openFile( const TQString& extension, const TQString& filename, const K3b::Msf& length ); bool isOpen() const; void closeFile(); - const QString& filename() const; + const TQString& filename() const; - QStringList extensions() const; + TQStringList extensions() const; - QString fileTypeComment( const QString& ) const; + TQString fileTypeComment( const TQString& ) const; - long long fileSize( const QString&, const K3b::Msf& msf ) const; + long long fileSize( const TQString&, const K3b::Msf& msf ) const; int pluginSystemVersion() const { return 3; } - K3bPluginConfigWidget* createConfigWidget( QWidget* parent = 0, + K3bPluginConfigWidget* createConfigWidget( TQWidget* tqparent = 0, const char* name = 0 ) const; private: void finishEncoderInternal(); - bool initEncoderInternal( const QString& extension, const K3b::Msf& length ); - long encodeInternal( const char* data, Q_ULONG len ); - void setMetaDataInternal( MetaDataField, const QString& ); + bool initEncoderInternal( const TQString& extension, const K3b::Msf& length ); + long encodeInternal( const char* data, TQ_ULONG len ); + void setMetaDataInternal( MetaDataField, const TQString& ); class Private; Private* d; @@ -65,9 +66,10 @@ class K3bLameEncoder : public K3bAudioEncoder class K3bLameEncoderSettingsWidget : public K3bPluginConfigWidget { Q_OBJECT + TQ_OBJECT public: - K3bLameEncoderSettingsWidget( QWidget* parent = 0, const char* name = 0 ); + K3bLameEncoderSettingsWidget( TQWidget* tqparent = 0, const char* name = 0 ); ~K3bLameEncoderSettingsWidget(); public slots: -- cgit v1.2.3