summaryrefslogtreecommitdiffstats
path: root/plugins/decoder/mp3
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/decoder/mp3')
-rw-r--r--plugins/decoder/mp3/k3bmad.cpp14
-rw-r--r--plugins/decoder/mp3/k3bmad.h12
-rw-r--r--plugins/decoder/mp3/k3bmaddecoder.cpp50
-rw-r--r--plugins/decoder/mp3/k3bmaddecoder.h16
4 files changed, 47 insertions, 45 deletions
diff --git a/plugins/decoder/mp3/k3bmad.cpp b/plugins/decoder/mp3/k3bmad.cpp
index cb4cf6c..74aeee3 100644
--- a/plugins/decoder/mp3/k3bmad.cpp
+++ b/plugins/decoder/mp3/k3bmad.cpp
@@ -15,7 +15,7 @@
#include "k3bmad.h"
-#include <qfile.h>
+#include <tqfile.h>
#include <kdebug.h>
@@ -52,7 +52,7 @@ K3bMad::~K3bMad()
}
-bool K3bMad::open( const QString& filename )
+bool K3bMad::open( const TQString& filename )
{
cleanup();
@@ -105,7 +105,7 @@ bool K3bMad::fillStreamBuffer()
}
// Fill-in the buffer.
- Q_LONG result = m_inputFile.readBlock( (char*)readStart, readSize );
+ TQ_LONG result = m_inputFile.readBlock( (char*)readStart, readSize );
if( result < 0 ) {
kdDebug() << "(K3bMad) read error on bitstream)" << endl;
m_bInputError = true;
@@ -192,7 +192,7 @@ bool K3bMad::seekFirstHeader()
// take way to long for non-mp3 files.
//
bool headerFound = findNextHeader();
- QIODevice::Offset inputPos = streamPos();
+ TQIODevice::Offset inputPos = streamPos();
while( !headerFound &&
!m_inputFile.atEnd() &&
streamPos() <= inputPos+1024 ) {
@@ -222,19 +222,19 @@ bool K3bMad::eof() const
}
-QIODevice::Offset K3bMad::inputPos() const
+TQIODevice::Offset K3bMad::inputPos() const
{
return m_inputFile.at();
}
-QIODevice::Offset K3bMad::streamPos() const
+TQIODevice::Offset K3bMad::streamPos() const
{
return inputPos() - (madStream->bufend - madStream->this_frame + 1);
}
-bool K3bMad::inputSeek( QIODevice::Offset pos )
+bool K3bMad::inputSeek( TQIODevice::Offset pos )
{
return m_inputFile.at( pos );
}
diff --git a/plugins/decoder/mp3/k3bmad.h b/plugins/decoder/mp3/k3bmad.h
index a4d9aae..d526c1d 100644
--- a/plugins/decoder/mp3/k3bmad.h
+++ b/plugins/decoder/mp3/k3bmad.h
@@ -20,7 +20,7 @@ extern "C" {
#include <mad.h>
}
-#include <qfile.h>
+#include <tqfile.h>
class K3bMad
@@ -29,7 +29,7 @@ public:
K3bMad();
~K3bMad();
- bool open( const QString& filename );
+ bool open( const TQString& filename );
/**
* @return true if the mad stream contains data
@@ -59,13 +59,13 @@ public:
* care about the status of the mad stream. Use streamPos()
* in that case.
*/
- QIODevice::Offset inputPos() const;
+ TQIODevice::Offset inputPos() const;
/**
* Current absolut position of the decoder stream.
*/
- QIODevice::Offset streamPos() const;
- bool inputSeek( QIODevice::Offset pos );
+ TQIODevice::Offset streamPos() const;
+ bool inputSeek( TQIODevice::Offset pos );
void initMad();
void cleanup();
@@ -80,7 +80,7 @@ public:
mad_timer_t* madTimer;
private:
- QFile m_inputFile;
+ TQFile m_inputFile;
bool m_madStructuresInitialized;
unsigned char* m_inputBuffer;
bool m_bInputError;
diff --git a/plugins/decoder/mp3/k3bmaddecoder.cpp b/plugins/decoder/mp3/k3bmaddecoder.cpp
index e3aef56..6f606c8 100644
--- a/plugins/decoder/mp3/k3bmaddecoder.cpp
+++ b/plugins/decoder/mp3/k3bmaddecoder.cpp
@@ -35,9 +35,9 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qstring.h>
-#include <qfile.h>
-#include <qvaluevector.h>
+#include <tqstring.h>
+#include <tqfile.h>
+#include <tqvaluevector.h>
#include <stdlib.h>
#include <cmath>
@@ -70,7 +70,7 @@ public:
K3bMad* handle;
- QValueVector<unsigned long long> seekPositions;
+ TQValueVector<unsigned long long> seekPositions;
bool bOutputFinished;
@@ -86,8 +86,8 @@ public:
-K3bMadDecoder::K3bMadDecoder( QObject* parent, const char* name )
- : K3bAudioDecoder( parent, name )
+K3bMadDecoder::K3bMadDecoder( TQObject* tqparent, const char* name )
+ : K3bAudioDecoder( tqparent, name )
{
d = new MadDecoderPrivate();
d->handle = new K3bMad();
@@ -102,10 +102,10 @@ K3bMadDecoder::~K3bMadDecoder()
}
-QString K3bMadDecoder::metaInfo( MetaDataField f )
+TQString K3bMadDecoder::metaInfo( MetaDataField f )
{
#ifdef HAVE_TAGLIB
- TagLib::MPEG::File file( QFile::encodeName( filename() ).data() );
+ TagLib::MPEG::File file( TQFile::encodeName( filename() ).data() );
if ( file.tag() ) {
switch( f ) {
@@ -116,11 +116,11 @@ QString K3bMadDecoder::metaInfo( MetaDataField f )
case META_COMMENT:
return TStringToQString( file.tag()->comment() );
default:
- return QString::null;
+ return TQString();
}
}
else {
- return QString::null;
+ return TQString();
}
#else
@@ -370,7 +370,7 @@ bool K3bMadDecoder::seekInternal( const K3b::Msf& pos )
}
-QString K3bMadDecoder::fileType() const
+TQString K3bMadDecoder::fileType() const
{
switch( d->firstHeader.layer ) {
case MAD_LAYER_I:
@@ -384,9 +384,9 @@ QString K3bMadDecoder::fileType() const
}
}
-QStringList K3bMadDecoder::supportedTechnicalInfos() const
+TQStringList K3bMadDecoder::supportedTechnicalInfos() const
{
- return QStringList::split( ";",
+ return TQStringList::split( ";",
i18n("Channels") + ";" +
i18n("Sampling Rate") + ";" +
i18n("Bitrate") + ";" +
@@ -398,7 +398,7 @@ QStringList K3bMadDecoder::supportedTechnicalInfos() const
}
-QString K3bMadDecoder::technicalInfo( const QString& name ) const
+TQString K3bMadDecoder::technicalInfo( const TQString& name ) const
{
if( name == i18n("Channels") ) {
switch( d->firstHeader.mode ) {
@@ -415,12 +415,12 @@ QString K3bMadDecoder::technicalInfo( const QString& name ) const
}
}
else if( name == i18n("Sampling Rate") )
- return i18n("%1 Hz").arg(d->firstHeader.samplerate);
+ return i18n("%1 Hz").tqarg(d->firstHeader.samplerate);
else if( name == i18n("Bitrate") ) {
if( d->vbr )
return i18n("VBR");
else
- return i18n("%1 bps").arg(d->firstHeader.bitrate);
+ return i18n("%1 bps").tqarg(d->firstHeader.bitrate);
}
else if( name == i18n("Layer") ){
switch( d->firstHeader.layer ) {
@@ -453,12 +453,12 @@ QString K3bMadDecoder::technicalInfo( const QString& name ) const
else if( name == i18n("CRC") )
return ( d->firstHeader.flags & MAD_FLAG_PROTECTION ? i18n("Yes") : i18n("No") );
else
- return QString::null;
+ return TQString();
}
-K3bMadDecoderFactory::K3bMadDecoderFactory( QObject* parent, const char* name )
- : K3bAudioDecoderFactory( parent, name )
+K3bMadDecoderFactory::K3bMadDecoderFactory( TQObject* tqparent, const char* name )
+ : K3bAudioDecoderFactory( tqparent, name )
{
}
@@ -468,10 +468,10 @@ K3bMadDecoderFactory::~K3bMadDecoderFactory()
}
-K3bAudioDecoder* K3bMadDecoderFactory::createDecoder( QObject* parent,
+K3bAudioDecoder* K3bMadDecoderFactory::createDecoder( TQObject* tqparent,
const char* name ) const
{
- return new K3bMadDecoder( parent, name );
+ return new K3bMadDecoder( tqparent, name );
}
@@ -484,14 +484,14 @@ bool K3bMadDecoderFactory::canDecode( const KURL& url )
// It always takes waves for mp3 files so we introduce this hack to
// filter out wave files. :(
//
- QFile f( url.path() );
+ TQFile f( url.path() );
if( !f.open( IO_ReadOnly ) )
return false;
char buffer[12];
if( f.readBlock( buffer, 12 ) != 12 )
return false;
- if( !qstrncmp( buffer, "RIFF", 4 ) &&
- !qstrncmp( buffer + 8, "WAVE", 4 ) )
+ if( !tqstrncmp( buffer, "RIFF", 4 ) &&
+ !tqstrncmp( buffer + 8, "WAVE", 4 ) )
return false;
f.close();
@@ -510,7 +510,7 @@ bool K3bMadDecoderFactory::canDecode( const KURL& url )
unsigned int s = handle.madFrame->header.samplerate;
//
- // find 4 more mp3 headers (random value since 2 was not enough)
+ // tqfind 4 more mp3 headers (random value since 2 was not enough)
// This way we get most of the mp3 files while sorting out
// for example wave files.
//
diff --git a/plugins/decoder/mp3/k3bmaddecoder.h b/plugins/decoder/mp3/k3bmaddecoder.h
index 91e0f6c..8eef755 100644
--- a/plugins/decoder/mp3/k3bmaddecoder.h
+++ b/plugins/decoder/mp3/k3bmaddecoder.h
@@ -27,16 +27,17 @@ extern "C" {
class K3bMadDecoderFactory : public K3bAudioDecoderFactory
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bMadDecoderFactory( QObject* parent = 0, const char* name = 0 );
+ K3bMadDecoderFactory( TQObject* tqparent = 0, const char* name = 0 );
~K3bMadDecoderFactory();
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;
};
@@ -44,20 +45,21 @@ class K3bMadDecoderFactory : public K3bAudioDecoderFactory
class K3bMadDecoder : public K3bAudioDecoder
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bMadDecoder( QObject* parent = 0, const char* name = 0 );
+ K3bMadDecoder( TQObject* tqparent = 0, const char* name = 0 );
~K3bMadDecoder();
- QString metaInfo( MetaDataField );
+ TQString metaInfo( MetaDataField );
void cleanup();
bool seekInternal( const K3b::Msf& );
- QString fileType() const;
- QStringList supportedTechnicalInfos() const;
- QString technicalInfo( const QString& ) const;
+ TQString fileType() const;
+ TQStringList supportedTechnicalInfos() const;
+ TQString technicalInfo( const TQString& ) const;
protected:
bool analyseFileInternal( K3b::Msf& frames, int& samplerate, int& ch );