summaryrefslogtreecommitdiffstats
path: root/kioslave/audiocd/plugins/lame/encoderlame.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kioslave/audiocd/plugins/lame/encoderlame.cpp')
-rw-r--r--kioslave/audiocd/plugins/lame/encoderlame.cpp84
1 files changed, 42 insertions, 42 deletions
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;
}