diff options
Diffstat (limited to 'kioslave/audiocd/plugins/lame')
-rw-r--r-- | kioslave/audiocd/plugins/lame/collectingprocess.cpp | 44 | ||||
-rw-r--r-- | kioslave/audiocd/plugins/lame/collectingprocess.h | 6 | ||||
-rw-r--r-- | kioslave/audiocd/plugins/lame/encoderlame.cpp | 84 | ||||
-rw-r--r-- | kioslave/audiocd/plugins/lame/encoderlame.h | 14 |
4 files changed, 74 insertions, 74 deletions
diff --git a/kioslave/audiocd/plugins/lame/collectingprocess.cpp b/kioslave/audiocd/plugins/lame/collectingprocess.cpp index b3a13755..42bdf206 100644 --- a/kioslave/audiocd/plugins/lame/collectingprocess.cpp +++ b/kioslave/audiocd/plugins/lame/collectingprocess.cpp @@ -32,7 +32,7 @@ #include "collectingprocess.h" -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <string.h> @@ -41,13 +41,13 @@ struct CollectingProcess::Private { {} uint stdoutSize; - QValueList<QByteArray> stdoutBuffer; + TQValueList<TQByteArray> stdoutBuffer; uint stderrSize; - QValueList<QByteArray> stderrBuffer; + TQValueList<TQByteArray> stderrBuffer; }; -CollectingProcess::CollectingProcess( QObject * parent, const char * name ) +CollectingProcess::CollectingProcess( TQObject * parent, const char * name ) : KProcess( parent, name ) { d = new Private(); @@ -59,25 +59,25 @@ CollectingProcess::~CollectingProcess() { bool CollectingProcess::start( RunMode runmode, Communication comm ) { // prevent duplicate connection - disconnect( this, SIGNAL( receivedStdout( KProcess *, char *, int ) ), - this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) ); + disconnect( this, TQT_SIGNAL( receivedStdout( KProcess *, char *, int ) ), + this, TQT_SLOT( slotReceivedStdout( KProcess *, char *, int ) ) ); if ( comm & Stdout ) { - connect( this, SIGNAL( receivedStdout( KProcess *, char *, int ) ), - this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) ); + connect( this, TQT_SIGNAL( receivedStdout( KProcess *, char *, int ) ), + this, TQT_SLOT( slotReceivedStdout( KProcess *, char *, int ) ) ); } // prevent duplicate connection - disconnect( this, SIGNAL( receivedStderr( KProcess *, char *, int ) ), - this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) ); + disconnect( this, TQT_SIGNAL( receivedStderr( KProcess *, char *, int ) ), + this, TQT_SLOT( slotReceivedStderr( KProcess *, char *, int ) ) ); if ( comm & Stderr ) { - connect( this, SIGNAL( receivedStderr( KProcess *, char *, int ) ), - this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) ); + connect( this, TQT_SIGNAL( receivedStderr( KProcess *, char *, int ) ), + this, TQT_SLOT( slotReceivedStderr( KProcess *, char *, int ) ) ); } return KProcess::start( runmode, comm ); } void CollectingProcess::slotReceivedStdout( KProcess *, char *buf, int len ) { - QByteArray b; + TQByteArray b; b.duplicate( buf, len ); d->stdoutBuffer.append( b ); d->stdoutSize += len; @@ -85,21 +85,21 @@ void CollectingProcess::slotReceivedStdout( KProcess *, char *buf, int len ) void CollectingProcess::slotReceivedStderr( KProcess *, char *buf, int len ) { - QByteArray b; + TQByteArray b; b.duplicate( buf, len ); d->stderrBuffer.append( b ); d->stderrSize += len; } -QByteArray CollectingProcess::collectedStdout() +TQByteArray CollectingProcess::collectedStdout() { if ( d->stdoutSize == 0 ) { - return QByteArray(); + return TQByteArray(); } uint offset = 0; - QByteArray b( d->stdoutSize ); - for ( QValueList<QByteArray>::const_iterator it = d->stdoutBuffer.begin(); + TQByteArray b( d->stdoutSize ); + for ( TQValueList<TQByteArray>::const_iterator it = d->stdoutBuffer.begin(); it != d->stdoutBuffer.end(); ++it ) { memcpy( b.data() + offset, (*it).data(), (*it).size() ); @@ -111,15 +111,15 @@ QByteArray CollectingProcess::collectedStdout() return b; } -QByteArray CollectingProcess::collectedStderr() +TQByteArray CollectingProcess::collectedStderr() { if ( d->stderrSize == 0 ) { - return QByteArray(); + return TQByteArray(); } uint offset = 0; - QByteArray b( d->stderrSize ); - for ( QValueList<QByteArray>::const_iterator it = d->stderrBuffer.begin(); + TQByteArray b( d->stderrSize ); + for ( TQValueList<TQByteArray>::const_iterator it = d->stderrBuffer.begin(); it != d->stderrBuffer.end(); ++it ) { memcpy( b.data() + offset, (*it).data(), (*it).size() ); diff --git a/kioslave/audiocd/plugins/lame/collectingprocess.h b/kioslave/audiocd/plugins/lame/collectingprocess.h index 7549fee3..e9f0def4 100644 --- a/kioslave/audiocd/plugins/lame/collectingprocess.h +++ b/kioslave/audiocd/plugins/lame/collectingprocess.h @@ -46,7 +46,7 @@ class CollectingProcess : public KProcess { Q_OBJECT public: - CollectingProcess( QObject * parent = 0, const char * name = 0 ); + CollectingProcess( TQObject * parent = 0, const char * name = 0 ); ~CollectingProcess(); /** Starts the process in NotifyOnExit mode and writes in to stdin of @@ -55,9 +55,9 @@ public: bool start( RunMode runmode, Communication comm ); /** Returns the contents of the stdout buffer and clears it afterwards. */ - QByteArray collectedStdout(); + TQByteArray collectedStdout(); /** Returns the contents of the stderr buffer and clears it afterwards. */ - QByteArray collectedStderr(); + TQByteArray collectedStderr(); private slots: void slotReceivedStdout( KProcess *, char *, int ); diff --git a/kioslave/audiocd/plugins/lame/encoderlame.cpp b/kioslave/audiocd/plugins/lame/encoderlame.cpp index 16cf2bee..5e59c6a4 100644 --- a/kioslave/audiocd/plugins/lame/encoderlame.cpp +++ b/kioslave/audiocd/plugins/lame/encoderlame.cpp @@ -23,21 +23,21 @@ #include "audiocd_lame_encoder.h" #include <kdebug.h> -#include <qgroupbox.h> +#include <tqgroupbox.h> #include <kprocess.h> #include <kdebug.h> #include <kglobal.h> #include <klocale.h> #include <kapplication.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> #include <ktempfile.h> #include <kstandarddirs.h> #include "collectingprocess.h" extern "C" { - KDE_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QPtrList<AudioCDEncoder> &encoders) { + KDE_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, TQPtrList<AudioCDEncoder> &encoders) { encoders.append(new EncoderLame(slave)); } } @@ -50,14 +50,14 @@ public: int bitrate; bool waitingForWrite; bool processHasExited; - QString lastErrorMessage; - QStringList genreList; + TQString lastErrorMessage; + TQStringList genreList; uint lastSize; KProcess *currentEncodeProcess; KTempFile *tempFile; }; -EncoderLame::EncoderLame(KIO::SlaveBase *slave) : QObject(), AudioCDEncoder(slave) { +EncoderLame::EncoderLame(KIO::SlaveBase *slave) : TQObject(), AudioCDEncoder(slave) { d = new Private(); d->waitingForWrite = false; d->processHasExited = false; @@ -69,7 +69,7 @@ EncoderLame::~EncoderLame(){ delete d; } -QWidget* EncoderLame::getConfigureWidget(KConfigSkeleton** manager) const { +TQWidget* EncoderLame::getConfigureWidget(KConfigSkeleton** manager) const { (*manager) = Settings::self(); KGlobal::locale()->insertCatalogue("audiocd_encoder_lame"); EncoderLameConfig *config = new EncoderLameConfig(); @@ -91,15 +91,15 @@ bool EncoderLame::init(){ if(proc.exitStatus() != 0) return false; - const QByteArray data = proc.collectedStdout(); - QString str; + const TQByteArray data = proc.collectedStdout(); + TQString str; if ( !data.isEmpty() ) - str = QString::fromLocal8Bit( data, data.size() ); + str = TQString::fromLocal8Bit( data, data.size() ); - d->genreList = QStringList::split( '\n', str ); + d->genreList = TQStringList::split( '\n', str ); // Remove the numbers in front of every genre - for( QStringList::Iterator it = d->genreList.begin(); it != d->genreList.end(); ++it ) { - QString& genre = *it; + for( TQStringList::Iterator it = d->genreList.begin(); it != d->genreList.end(); ++it ) { + TQString& genre = *it; uint i = 0; while ( i < genre.length() && ( genre[i].isSpace() || genre[i].isDigit() ) ) ++i; @@ -126,31 +126,31 @@ void EncoderLame::loadSettings(){ if (method == 0) { // Constant Bitrate Encoding args.append("-b"); - args.append(QString("%1").arg(bitrates[settings->cbr_bitrate()])); + args.append(TQString("%1").arg(bitrates[settings->cbr_bitrate()])); d->bitrate = bitrates[settings->cbr_bitrate()]; args.append("-q"); - args.append(QString("%1").arg(quality)); + args.append(TQString("%1").arg(quality)); } else { // Variable Bitrate Encoding if (settings->vbr_average_br()) { args.append("--abr"); - args.append(QString("%1").arg(bitrates[settings->vbr_mean_brate()])); + args.append(TQString("%1").arg(bitrates[settings->vbr_mean_brate()])); d->bitrate = bitrates[settings->vbr_mean_brate()]; if (settings->vbr_min_br()){ args.append("-b"); - args.append(QString("%1").arg(bitrates[settings->vbr_min_brate()])); + args.append(TQString("%1").arg(bitrates[settings->vbr_min_brate()])); } if (settings->vbr_min_hard()) args.append("-F"); if (settings->vbr_max_br()){ args.append("-B"); - args.append(QString("%1").arg(bitrates[settings->vbr_max_brate()])); + args.append(TQString("%1").arg(bitrates[settings->vbr_max_brate()])); } } else { d->bitrate = 128; args.append("-V"); - args.append(QString("%1").arg(quality)); + args.append(TQString("%1").arg(quality)); } if ( !settings->vbr_xing_tag() ) args.append("-t"); @@ -186,21 +186,21 @@ void EncoderLame::loadSettings(){ if ( settings->enable_lowpass() ) { args.append("--lowpass"); - args.append(QString("%1").arg(settings->lowfilterfreq())); + args.append(TQString("%1").arg(settings->lowfilterfreq())); if (settings->set_lpf_width()){ args.append("--lowpass-width"); - args.append(QString("%1").arg(settings->lowfilterwidth())); + args.append(TQString("%1").arg(settings->lowfilterwidth())); } } if ( settings->enable_highpass()) { args.append("--hipass"); - args.append(QString("%1").arg(settings->highfilterfreq())); + args.append(TQString("%1").arg(settings->highfilterfreq())); if (settings->set_hpf_width()){ args.append("--hipass-width"); - args.append(QString("%1").arg(settings->highfilterwidth())); + args.append(TQString("%1").arg(settings->highfilterwidth())); } } } @@ -212,10 +212,10 @@ unsigned long EncoderLame::size(long time_secs) const { long EncoderLame::readInit(long /*size*/){ // Create KProcess d->currentEncodeProcess = new KProcess(0); - QString prefix = locateLocal("tmp", ""); + TQString prefix = locateLocal("tmp", ""); d->tempFile = new KTempFile(prefix, ".mp3"); d->tempFile->setAutoDelete(true); - d->lastErrorMessage = QString::null; + d->lastErrorMessage = TQString::null; d->processHasExited = false; // -x bitswap @@ -237,15 +237,15 @@ long EncoderLame::readInit(long /*size*/){ //kdDebug(7117) << d->currentEncodeProcess->args() << endl; - connect(d->currentEncodeProcess, SIGNAL(receivedStdout(KProcess *, char *, int)), - this, SLOT(receivedStdout(KProcess *, char *, int))); - connect(d->currentEncodeProcess, SIGNAL(receivedStderr(KProcess *, char *, int)), - this, SLOT(receivedStderr(KProcess *, char *, int))); - connect(d->currentEncodeProcess, SIGNAL(wroteStdin(KProcess *)), - this, SLOT(wroteStdin(KProcess *))); + connect(d->currentEncodeProcess, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), + this, TQT_SLOT(receivedStdout(KProcess *, char *, int))); + connect(d->currentEncodeProcess, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), + this, TQT_SLOT(receivedStderr(KProcess *, char *, int))); + connect(d->currentEncodeProcess, TQT_SIGNAL(wroteStdin(KProcess *)), + this, TQT_SLOT(wroteStdin(KProcess *))); - connect(d->currentEncodeProcess, SIGNAL(processExited(KProcess *)), - this, SLOT(processExited(KProcess *))); + connect(d->currentEncodeProcess, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT(processExited(KProcess *))); // Launch! d->currentEncodeProcess->start(KProcess::NotifyOnExit, KShellProcess::All); @@ -261,7 +261,7 @@ void EncoderLame::receivedStderr( KProcess * /*process*/, char *buffer, int /*bu kdDebug(7117) << "Lame stderr: " << buffer << endl; if ( !d->lastErrorMessage.isEmpty() ) d->lastErrorMessage += '\t'; - d->lastErrorMessage += QString::fromLocal8Bit( buffer ); + d->lastErrorMessage += TQString::fromLocal8Bit( buffer ); } void EncoderLame::receivedStdout( KProcess * /*process*/, char *buffer, int /*length*/ ){ @@ -290,7 +290,7 @@ long EncoderLame::read(int16_t *buf, int frames){ } // Determine the file size increase - QFileInfo file(d->tempFile->name()); + TQFileInfo file(d->tempFile->name()); uint change = file.size() - d->lastSize; d->lastSize = file.size(); return change; @@ -308,9 +308,9 @@ long EncoderLame::readCleanup(){ } // Now copy the file out of the temp into kio - QFile file( d->tempFile->name() ); + TQFile file( d->tempFile->name() ); if ( file.open( IO_ReadOnly ) ) { - QByteArray output; + TQByteArray output; char data[1024]; while ( !file.atEnd() ) { uint read = file.readBlock(data, 1024); @@ -329,7 +329,7 @@ long EncoderLame::readCleanup(){ return 0; } -void EncoderLame::fillSongInfo( KCDDB::CDInfo info, int track, const QString &comment ){ +void EncoderLame::fillSongInfo( KCDDB::CDInfo info, int track, const TQString &comment ){ trackInfo.clear(); trackInfo.append("--tt"); trackInfo.append(info.trackInfoList[track].get("title").toString()); @@ -341,15 +341,15 @@ void EncoderLame::fillSongInfo( KCDDB::CDInfo info, int track, const QString &co trackInfo.append(info.get("title").toString()); trackInfo.append("--ty"); - trackInfo.append(QString("%1").arg(info.get("year").toString())); + trackInfo.append(TQString("%1").arg(info.get("year").toString())); trackInfo.append("--tc"); trackInfo.append(comment); trackInfo.append("--tn"); - trackInfo.append(QString("%1").arg(track+1)); + trackInfo.append(TQString("%1").arg(track+1)); - const QString genre = info.get( "genre" ).toString(); + const TQString genre = info.get( "genre" ).toString(); if ( d->genreList.find( genre ) != d->genreList.end() ) { trackInfo.append("--tg"); @@ -358,7 +358,7 @@ void EncoderLame::fillSongInfo( KCDDB::CDInfo info, int track, const QString &co } -QString EncoderLame::lastErrorMessage() const +TQString EncoderLame::lastErrorMessage() const { return d->lastErrorMessage; } diff --git a/kioslave/audiocd/plugins/lame/encoderlame.h b/kioslave/audiocd/plugins/lame/encoderlame.h index b1b2b702..ba02cf4f 100644 --- a/kioslave/audiocd/plugins/lame/encoderlame.h +++ b/kioslave/audiocd/plugins/lame/encoderlame.h @@ -27,7 +27,7 @@ class KProcess; * MP3 encoder using the LAME encoder. * Go to http://lame.sourceforge.net/ for lots of information. */ -class EncoderLame : public QObject, public AudioCDEncoder { +class EncoderLame : public TQObject, public AudioCDEncoder { Q_OBJECT @@ -35,19 +35,19 @@ public: EncoderLame(KIO::SlaveBase *slave); ~EncoderLame(); - virtual QString type() const { return "MP3"; }; + virtual TQString type() const { return "MP3"; }; virtual bool init(); virtual void loadSettings(); virtual unsigned long size(long time_secs) const; virtual const char * fileType() const { return "mp3"; }; virtual const char * mimeType() const { return "audio/x-mp3"; }; - virtual void fillSongInfo( KCDDB::CDInfo info, int track, const QString &comment ); + virtual void fillSongInfo( KCDDB::CDInfo info, int track, const TQString &comment ); virtual long readInit(long size); virtual long read(int16_t * buf, int frames); virtual long readCleanup(); - virtual QString lastErrorMessage() const; + virtual TQString lastErrorMessage() const; - virtual QWidget* getConfigureWidget(KConfigSkeleton** manager) const; + virtual TQWidget* getConfigureWidget(KConfigSkeleton** manager) const; protected slots: void wroteStdin(KProcess *proc); @@ -59,8 +59,8 @@ private: class Private; Private * d; - QStringList args; - QStringList trackInfo; + TQStringList args; + TQStringList trackInfo; }; #endif // ENCODER_LAME_H |