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 --- libk3b/plugin/k3baudiodecoder.cpp | 52 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'libk3b/plugin/k3baudiodecoder.cpp') diff --git a/libk3b/plugin/k3baudiodecoder.cpp b/libk3b/plugin/k3baudiodecoder.cpp index 82f4adb..54fe8ad 100644 --- a/libk3b/plugin/k3baudiodecoder.cpp +++ b/libk3b/plugin/k3baudiodecoder.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include @@ -98,16 +98,16 @@ public: char* decodingBufferPos; int decodingBufferFill; - QMap technicalInfoMap; - QMap metaInfoMap; + TQMap technicalInfoMap; + TQMap metaInfoMap; bool valid; }; -K3bAudioDecoder::K3bAudioDecoder( QObject* parent, const char* name ) - : QObject( parent, name ) +K3bAudioDecoder::K3bAudioDecoder( TQObject* tqparent, const char* name ) + : TQObject( tqparent, name ) { d = new Private(); } @@ -129,7 +129,7 @@ K3bAudioDecoder::~K3bAudioDecoder() } -void K3bAudioDecoder::setFilename( const QString& filename ) +void K3bAudioDecoder::setFilename( const TQString& filename ) { m_fileName = filename; delete d->metaInfo; @@ -302,7 +302,7 @@ int K3bAudioDecoder::decode( char* _data, int maxLen ) // clear out the decoding buffer - read = QMIN( maxLen, d->decodingBufferFill ); + read = TQMIN( maxLen, d->decodingBufferFill ); ::memcpy( _data, d->decodingBufferPos, read ); d->decodingBufferPos += read; d->decodingBufferFill -= read; @@ -321,7 +321,7 @@ int K3bAudioDecoder::decode( char* _data, int maxLen ) int K3bAudioDecoder::resample( char* data, int maxLen ) { if( !d->resampleState ) { - d->resampleState = src_new( SRC_SINC_MEDIUM_QUALITY, d->channels, 0 ); + d->resampleState = src_new( SRC_SINC_MEDIUM_TQUALITY, d->channels, 0 ); if( !d->resampleState ) { kdDebug() << "(K3bAudioDecoder) unable to initialize resampler." << endl; return -1; @@ -375,7 +375,7 @@ void K3bAudioDecoder::from16bitBeSignedToFloat( char* src, float* dest, int samp { while( samples ) { samples--; - dest[samples] = static_cast( Q_INT16(((src[2*samples]<<8)&0xff00)|(src[2*samples+1]&0x00ff)) / 32768.0 ); + dest[samples] = static_cast( TQ_INT16(((src[2*samples]<<8)&0xff00)|(src[2*samples+1]&0x00ff)) / 32768.0 ); } } @@ -386,7 +386,7 @@ void K3bAudioDecoder::fromFloatTo16BitBeSigned( float* src, char* dest, int samp samples--; float scaled = src[samples] * 32768.0; - Q_INT16 val = 0; + TQ_INT16 val = 0; // clipping if( scaled >= ( 1.0 * 0x7FFF ) ) @@ -407,8 +407,8 @@ void K3bAudioDecoder::from8BitTo16BitBeSigned( char* src, char* dest, int sample while( samples ) { samples--; - float scaled = static_cast(Q_UINT8(src[samples])-128) / 128.0 * 32768.0; - Q_INT16 val = 0; + float scaled = static_cast(TQ_UINT8(src[samples])-128) / 128.0 * 32768.0; + TQ_INT16 val = 0; // clipping if( scaled >= ( 1.0 * 0x7FFF ) ) @@ -462,7 +462,7 @@ bool K3bAudioDecoder::seek( const K3b::Msf& pos ) kdDebug() << "(K3bAudioDecoder) seeking " << bytesToDecode << " bytes." << endl; char buffi[10*2352]; while( bytesToDecode > 0 ) { - int read = decode( buffi, QMIN(10*2352, bytesToDecode) ); + int read = decode( buffi, TQMIN(10*2352, bytesToDecode) ); if( read <= 0 ) return false; @@ -502,9 +502,9 @@ void K3bAudioDecoder::cleanup() } -QString K3bAudioDecoder::metaInfo( MetaDataField f ) +TQString K3bAudioDecoder::metaInfo( MetaDataField f ) { - if( d->metaInfoMap.contains( f ) ) + if( d->metaInfoMap.tqcontains( f ) ) return d->metaInfoMap[f]; // fall back to KFileMetaInfo @@ -512,7 +512,7 @@ QString K3bAudioDecoder::metaInfo( MetaDataField f ) d->metaInfo = new KFileMetaInfo( filename() ); if( d->metaInfo->isValid() ) { - QString tag; + TQString tag; switch( f ) { case META_TITLE: tag = "Title"; @@ -536,11 +536,11 @@ QString K3bAudioDecoder::metaInfo( MetaDataField f ) return item.string(); } - return QString::null; + return TQString(); } -void K3bAudioDecoder::addMetaInfo( MetaDataField f, const QString& value ) +void K3bAudioDecoder::addMetaInfo( MetaDataField f, const TQString& value ) { if( !value.isEmpty() ) d->metaInfoMap[f] = value; @@ -549,23 +549,23 @@ void K3bAudioDecoder::addMetaInfo( MetaDataField f, const QString& value ) } -QStringList K3bAudioDecoder::supportedTechnicalInfos() const +TQStringList K3bAudioDecoder::supportedTechnicalInfos() const { - QStringList l; - for( QMap::const_iterator it = d->technicalInfoMap.begin(); + TQStringList l; + for( TQMap::const_iterator it = d->technicalInfoMap.begin(); it != d->technicalInfoMap.end(); ++it ) l.append( it.key() ); return l; } -QString K3bAudioDecoder::technicalInfo( const QString& key ) const +TQString K3bAudioDecoder::technicalInfo( const TQString& key ) const { return d->technicalInfoMap[key]; } -void K3bAudioDecoder::addTechnicalInfo( const QString& key, const QString& value ) +void K3bAudioDecoder::addTechnicalInfo( const TQString& key, const TQString& value ) { d->technicalInfoMap[key] = value; } @@ -574,17 +574,17 @@ void K3bAudioDecoder::addTechnicalInfo( const QString& key, const QString& value K3bAudioDecoder* K3bAudioDecoderFactory::createDecoder( const KURL& url ) { kdDebug() << "(K3bAudioDecoderFactory::createDecoder( " << url.path() << " )" << endl; - QPtrList fl = k3bcore->pluginManager()->plugins( "AudioDecoder" ); + TQPtrList fl = k3bcore->pluginManager()->plugins( "AudioDecoder" ); // first search for a single format decoder - for( QPtrListIterator it( fl ); it.current(); ++it ) { + for( TQPtrListIterator it( fl ); it.current(); ++it ) { K3bAudioDecoderFactory* f = dynamic_cast( it.current() ); if( f && !f->multiFormatDecoder() && f->canDecode( url ) ) { kdDebug() << "1" << endl; return f->createDecoder();} } // no single format decoder. Search for a multi format decoder - for( QPtrListIterator it( fl ); it.current(); ++it ) { + for( TQPtrListIterator it( fl ); it.current(); ++it ) { K3bAudioDecoderFactory* f = dynamic_cast( it.current() ); if( f && f->multiFormatDecoder() && f->canDecode( url ) ) { kdDebug() << "2" << endl; return f->createDecoder();} -- cgit v1.2.1