summaryrefslogtreecommitdiffstats
path: root/plugins/decoder/wave
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 19:21:21 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 19:21:21 +0000
commitd8cc8bdfa7fa624a526d5aa1626974e1444cb799 (patch)
treef295f1c545b319963d5357af79fe08991d8141d9 /plugins/decoder/wave
parent2a39a080579fb52a2599c02b2939795385b89093 (diff)
downloadk3b-d8cc8bdfa7fa624a526d5aa1626974e1444cb799.tar.gz
k3b-d8cc8bdfa7fa624a526d5aa1626974e1444cb799.zip
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
Diffstat (limited to 'plugins/decoder/wave')
-rw-r--r--plugins/decoder/wave/k3bwavedecoder.cpp52
-rw-r--r--plugins/decoder/wave/k3bwavedecoder.h18
2 files changed, 36 insertions, 34 deletions
diff --git a/plugins/decoder/wave/k3bwavedecoder.cpp b/plugins/decoder/wave/k3bwavedecoder.cpp
index 6494e5c..21f385e 100644
--- a/plugins/decoder/wave/k3bwavedecoder.cpp
+++ b/plugins/decoder/wave/k3bwavedecoder.cpp
@@ -19,8 +19,8 @@
#include <k3bpluginfactory.h>
-#include <qfile.h>
-#include <qcstring.h>
+#include <tqfile.h>
+#include <tqcstring.h>
#include <kdebug.h>
#include <klocale.h>
@@ -50,7 +50,7 @@ static unsigned long le_a_to_u_long( unsigned char* a ) {
* Otherwise 0 is returned.
* leave file seek pointer past WAV header.
*/
-static unsigned long identifyWaveFile( QFile* f, int* samplerate = 0, int* channels = 0, int* samplesize = 0 )
+static unsigned long identifyWaveFile( TQFile* f, int* samplerate = 0, int* channels = 0, int* samplesize = 0 )
{
typedef struct {
unsigned char ckid[4];
@@ -85,7 +85,7 @@ static unsigned long identifyWaveFile( QFile* f, int* samplerate = 0, int* chann
kdDebug() << "(K3bWaveDecoder) unable to read from " << f->name() << endl;
return 0;
}
- if( qstrncmp( (char*)chunk.ckid, WAV_RIFF_MAGIC, 4 ) ) {
+ if( tqstrncmp( (char*)chunk.ckid, WAV_RIFF_MAGIC, 4 ) ) {
kdDebug() << "(K3bWaveDecoder) " << f->name() << ": not a RIFF file." << endl;
return 0;
}
@@ -95,7 +95,7 @@ static unsigned long identifyWaveFile( QFile* f, int* samplerate = 0, int* chann
kdDebug() << "(K3bWaveDecoder) unable to read from " << f->name() << endl;
return 0;
}
- if( qstrncmp( (char*)riff.wave, WAV_WAVE_MAGIC, 4 ) ) {
+ if( tqstrncmp( (char*)riff.wave, WAV_WAVE_MAGIC, 4 ) ) {
kdDebug() << "(K3bWaveDecoder) " << f->name() << ": not a WAVE file." << endl;
return 0;
}
@@ -106,7 +106,7 @@ static unsigned long identifyWaveFile( QFile* f, int* samplerate = 0, int* chann
kdDebug() << "(K3bWaveDecoder) unable to read from " << f->name() << endl;
return 0;
}
- if( qstrncmp( (char*)chunk.ckid, WAV_FMT_MAGIC, 4 ) ) {
+ if( tqstrncmp( (char*)chunk.ckid, WAV_FMT_MAGIC, 4 ) ) {
kdDebug() << "(K3bWaveDecoder) " << f->name() << ": could not find format chunk." << endl;
return 0;
}
@@ -152,7 +152,7 @@ static unsigned long identifyWaveFile( QFile* f, int* samplerate = 0, int* chann
}
// skip chunk data of unknown chunk
- if( qstrncmp( (char*)chunk.ckid, WAV_DATA_MAGIC, 4 ) ) {
+ if( tqstrncmp( (char*)chunk.ckid, WAV_DATA_MAGIC, 4 ) ) {
kdDebug() << "(K3bWaveDecoder) skipping chunk: " << (char*)chunk.ckid << endl;
if( !f->at( f->at() + le_a_to_u_long(chunk.cksize) ) ) {
kdDebug() << "(K3bWaveDecoder) " << f->name() << ": could not seek in file." << endl;
@@ -183,7 +183,7 @@ public:
bufferSize(0) {
}
- QFile* file;
+ TQFile* file;
long headerLength;
int sampleRate;
@@ -197,11 +197,11 @@ public:
};
-K3bWaveDecoder::K3bWaveDecoder( QObject* parent, const char* name )
- : K3bAudioDecoder( parent, name )
+K3bWaveDecoder::K3bWaveDecoder( TQObject* tqparent, const char* name )
+ : K3bAudioDecoder( tqparent, name )
{
d = new Private();
- d->file = new QFile();
+ d->file = new TQFile();
}
@@ -216,7 +216,7 @@ int K3bWaveDecoder::decodeInternal( char* _data, int maxLen )
{
int read = 0;
- maxLen = QMIN( maxLen, (int)(d->size - d->alreadyRead) );
+ maxLen = TQMIN( maxLen, (int)(d->size - d->alreadyRead) );
if( d->sampleSize == 16 ) {
read = d->file->readBlock( _data, maxLen );
@@ -243,7 +243,7 @@ int K3bWaveDecoder::decodeInternal( char* _data, int maxLen )
d->bufferSize = maxLen/2;
}
- read = d->file->readBlock( d->buffer, QMIN(maxLen/2, d->bufferSize) );
+ read = d->file->readBlock( d->buffer, TQMIN(maxLen/2, d->bufferSize) );
d->alreadyRead += read;
// stretch samples to 16 bit
@@ -330,36 +330,36 @@ void K3bWaveDecoder::cleanup()
}
-QString K3bWaveDecoder::fileType() const
+TQString K3bWaveDecoder::fileType() const
{
return i18n("WAVE");
}
-QStringList K3bWaveDecoder::supportedTechnicalInfos() const
+TQStringList K3bWaveDecoder::supportedTechnicalInfos() const
{
- return QStringList::split( ";",
+ return TQStringList::split( ";",
i18n("Channels") + ";" +
i18n("Sampling Rate") + ";" +
i18n("Sample Size") );
}
-QString K3bWaveDecoder::technicalInfo( const QString& name ) const
+TQString K3bWaveDecoder::technicalInfo( const TQString& name ) const
{
if( name == i18n("Channels") )
- return QString::number(d->channels);
+ return TQString::number(d->channels);
else if( name == i18n("Sampling Rate") )
- return i18n("%1 Hz").arg(d->sampleRate);
+ return i18n("%1 Hz").tqarg(d->sampleRate);
else if( name == i18n("Sample Size") )
- return i18n("%1 bits").arg(d->sampleSize);
+ return i18n("%1 bits").tqarg(d->sampleSize);
else
- return QString::null;
+ return TQString();
}
-K3bWaveDecoderFactory::K3bWaveDecoderFactory( QObject* parent, const char* name )
- : K3bAudioDecoderFactory( parent, name )
+K3bWaveDecoderFactory::K3bWaveDecoderFactory( TQObject* tqparent, const char* name )
+ : K3bAudioDecoderFactory( tqparent, name )
{
}
@@ -369,16 +369,16 @@ K3bWaveDecoderFactory::~K3bWaveDecoderFactory()
}
-K3bAudioDecoder* K3bWaveDecoderFactory::createDecoder( QObject* parent,
+K3bAudioDecoder* K3bWaveDecoderFactory::createDecoder( TQObject* tqparent,
const char* name ) const
{
- return new K3bWaveDecoder( parent, name );
+ return new K3bWaveDecoder( tqparent, name );
}
bool K3bWaveDecoderFactory::canDecode( const KURL& url )
{
- QFile f( url.path() );
+ TQFile f( url.path() );
if( !f.open( IO_ReadOnly ) ) {
kdDebug() << "(K3bWaveDecoder) could not open file " << url.path() << endl;
return false;
diff --git a/plugins/decoder/wave/k3bwavedecoder.h b/plugins/decoder/wave/k3bwavedecoder.h
index 3f92e9a..ddef738 100644
--- a/plugins/decoder/wave/k3bwavedecoder.h
+++ b/plugins/decoder/wave/k3bwavedecoder.h
@@ -20,25 +20,26 @@
#include <k3b_export.h>
#include <kurl.h>
-#include <qcstring.h>
+#include <tqcstring.h>
-class QFile;
+class TQFile;
class LIBK3B_EXPORT K3bWaveDecoderFactory : public K3bAudioDecoderFactory
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bWaveDecoderFactory( QObject* parent = 0, const char* name = 0 );
+ K3bWaveDecoderFactory( TQObject* tqparent = 0, const char* name = 0 );
~K3bWaveDecoderFactory();
bool canDecode( const KURL& filename );
int pluginSystemVersion() const { return 3; }
- K3bAudioDecoder* createDecoder( QObject* parent = 0,
+ K3bAudioDecoder* createDecoder( TQObject* tqparent = 0,
const char* name = 0 ) const;
};
@@ -46,20 +47,21 @@ class LIBK3B_EXPORT K3bWaveDecoderFactory : public K3bAudioDecoderFactory
class LIBK3B_EXPORT K3bWaveDecoder : public K3bAudioDecoder
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bWaveDecoder( QObject* parent = 0, const char* name = 0 );
+ K3bWaveDecoder( TQObject* tqparent = 0, const char* name = 0 );
~K3bWaveDecoder();
void cleanup();
bool seekInternal( const K3b::Msf& );
- QString fileType() const;
+ TQString fileType() const;
- QStringList supportedTechnicalInfos() const;
+ TQStringList supportedTechnicalInfos() const;
- QString technicalInfo( const QString& ) const;
+ TQString technicalInfo( const TQString& ) const;
protected:
bool analyseFileInternal( K3b::Msf& frames, int& samplerate, int& channels );