diff options
Diffstat (limited to 'amarok/src/engine/xine/xine-engine.cpp')
-rw-r--r-- | amarok/src/engine/xine/xine-engine.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/amarok/src/engine/xine/xine-engine.cpp b/amarok/src/engine/xine/xine-engine.cpp index 05412aca..1d80f746 100644 --- a/amarok/src/engine/xine/xine-engine.cpp +++ b/amarok/src/engine/xine/xine-engine.cpp @@ -34,8 +34,8 @@ AMAROK_EXPORT_PLUGIN( XineEngine ) #include <kmessagebox.h> #include <kstandarddirs.h> -#include <qapplication.h> -#include <qdir.h> +#include <tqapplication.h> +#include <tqdir.h> extern "C" { @@ -61,8 +61,8 @@ namespace Log } ///returns the configuration we will use. there is no KInstance, so using this hacked up method. -//static inline QCString configPath() { return QFile::encodeName(KStandardDirs().localkdedir() + KStandardDirs::kde_default("data") + "amarok/xine-config"); } -static inline QCString configPath() { return QFile::encodeName(locate( "data", "amarok/") + "xine-config" ); } +//static inline TQCString configPath() { return TQFile::encodeName(KStandardDirs().localkdedir() + KStandardDirs::kde_default("data") + "amarok/xine-config"); } +static inline TQCString configPath() { return TQFile::encodeName(locate( "data", "amarok/") + "xine-config" ); } static Fader *s_fader = 0; static OutFader *s_outfader = 0; @@ -248,7 +248,7 @@ XineEngine::load( const KURL &url, bool isStream ) debug() << "Before xine_open() *****" << endl; - if( xine_open( m_stream, QFile::encodeName( url.url() ) ) ) + if( xine_open( m_stream, TQFile::encodeName( url.url() ) ) ) { debug() << "After xine_open() *****" << endl; @@ -294,7 +294,7 @@ XineEngine::play( uint offset ) if (has_audio && audio_handled && xine_play( m_stream, 0, offset )) { if( s_fader ) - s_fader->start( QThread::LowestPriority ); + s_fader->start( TQThread::LowestPriority ); emit stateChanged( Engine::Playing ); @@ -320,7 +320,7 @@ XineEngine::determineAndShowErrorMessage() { DEBUG_BLOCK - QString body; + TQString body; debug() << "xine_get_error()\n"; switch (xine_get_error( m_stream )) { @@ -354,7 +354,7 @@ XineEngine::determineAndShowErrorMessage() // xine can read the plugin but it didn't find any codec // THUS xine=daft for telling us it could handle the format in canDecode! body = i18n("There is no available decoder."); - QString const ext = Amarok::extension( m_url.url() ).lower(); + TQString const ext = Amarok::extension( m_url.url() ).lower(); if (ext == "mp3" && EngineController::installDistroCodec( "xine-engine" )) return; } @@ -550,7 +550,7 @@ XineEngine::fadeOut( uint fadeLength, bool* terminate, bool exiting ) uint stepSizeUs = (int)( 1000.0 * (float)length / (float)stepsCount ); ::usleep( stepSizeUs ); - QTime t; + TQTime t; t.start(); float mix = 0.0; while ( mix < 1.0 ) @@ -585,7 +585,7 @@ XineEngine::setEqualizerEnabled( bool enable ) m_equalizerEnabled = enable; if( !enable ) { - QValueList<int> gains; + TQValueList<int> gains; for( uint x = 0; x < 10; x++ ) gains << -101; // sets eq gains to zero. @@ -605,14 +605,14 @@ XineEngine::setEqualizerEnabled( bool enable ) post: (1..200) - (1 = down, 100 = middle, 200 = up, 0 = off) */ void -XineEngine::setEqualizerParameters( int preamp, const QValueList<int> &gains ) +XineEngine::setEqualizerParameters( int preamp, const TQValueList<int> &gains ) { if ( !m_stream ) return; m_equalizerGains = gains; m_intPreamp = preamp; - QValueList<int>::ConstIterator it = gains.begin(); + TQValueList<int>::ConstIterator it = gains.begin(); xine_set_param( m_stream, XINE_PARAM_EQ_30HZ, int( (*it )*0.995 + 100 ) ); xine_set_param( m_stream, XINE_PARAM_EQ_60HZ, int( (*++it)*0.995 + 100 ) ); @@ -632,11 +632,11 @@ XineEngine::setEqualizerParameters( int preamp, const QValueList<int> &gains ) bool XineEngine::canDecode( const KURL &url ) const { - static QStringList list; + static TQStringList list; if(list.isEmpty()) { char* exts = xine_get_file_extensions( m_xine ); - list = QStringList::split( ' ', exts ); + list = TQStringList::split( ' ', exts ); free( exts ); exts = NULL; //images list.remove("png"); @@ -662,14 +662,14 @@ XineEngine::canDecode( const KURL &url ) const // play audio CDs pls return true; - QString path = url.path(); + TQString path = url.path(); // partial downloads from Konqi and other browsers // tend to have a .part extension if (path.endsWith( ".part" )) path = path.left( path.length() - 5 ); - const QString ext = path.mid( path.findRev( '.' ) + 1 ).lower(); + const TQString ext = path.mid( path.findRev( '.' ) + 1 ).lower(); return list.contains( ext ); } @@ -743,7 +743,7 @@ XineEngine::scope() } void -XineEngine::timerEvent( QTimerEvent* ) +XineEngine::timerEvent( TQTimerEvent* ) { if ( !m_stream ) return; @@ -784,15 +784,15 @@ Amarok::PluginConfig* XineEngine::configure() const { XineConfigDialog* xcf = new XineConfigDialog( m_xine ); - connect(xcf, SIGNAL( settingsSaved() ), this, SLOT( configChanged() )); - connect(this, SIGNAL( resetConfig(xine_t*) ), xcf, SLOT( reset(xine_t*) )); + connect(xcf, TQT_SIGNAL( settingsSaved() ), this, TQT_SLOT( configChanged() )); + connect(this, TQT_SIGNAL( resetConfig(xine_t*) ), xcf, TQT_SLOT( reset(xine_t*) )); return xcf; } void -XineEngine::customEvent( QCustomEvent *e ) +XineEngine::customEvent( TQCustomEvent *e ) { - #define message static_cast<QString*>(e->data()) + #define message static_cast<TQString*>(e->data()) switch( e->type() ) { @@ -899,7 +899,7 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) debug() << "XINE_EVENT_UI_SET_TITLE\n"; - QApplication::postEvent( xe, new QCustomEvent( 3003 ) ); + TQApplication::postEvent( xe, new TQCustomEvent( 3003 ) ); break; @@ -915,7 +915,7 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) xine_set_param( xe->m_stream, XINE_PARAM_GAPLESS_SWITCH, 1); #endif //emit signal from GUI thread - QApplication::postEvent( xe, new QCustomEvent(3000) ); + TQApplication::postEvent( xe, new TQCustomEvent(3000) ); break; case XINE_EVENT_PROGRESS: { @@ -923,13 +923,13 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) QString msg = "%1 %2%"; - msg = msg.arg( QString::fromUtf8( pd->description ) ) + msg = msg.arg( TQString::fromUtf8( pd->description ) ) .arg( KGlobal::locale()->formatNumber( pd->percent, 0 ) ); - QCustomEvent *e = new QCustomEvent( 3002 ); - e->setData( new QString( msg ) ); + TQCustomEvent *e = new TQCustomEvent( 3002 ); + e->setData( new TQString( msg ) ); - QApplication::postEvent( xe, e ); + TQApplication::postEvent( xe, e ); } break; @@ -937,11 +937,11 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) /// xine has read the stream and found it actually links to something else /// so we need to play that instead - QString message = QString::fromUtf8( static_cast<xine_mrl_reference_data_t*>(xineEvent->data)->mrl ); - QCustomEvent *e = new QCustomEvent( 3004 ); - e->setData( new QString( message ) ); + TQString message = TQString::fromUtf8( static_cast<xine_mrl_reference_data_t*>(xineEvent->data)->mrl ); + TQCustomEvent *e = new TQCustomEvent( 3004 ); + e->setData( new TQString( message ) ); - QApplication::postEvent( xe, e ); + TQApplication::postEvent( xe, e ); } break; @@ -950,7 +950,7 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) debug() << "message received from xine\n"; xine_ui_message_data_t *data = (xine_ui_message_data_t *)xineEvent->data; - QString message; + TQString message; switch( data->type ) { @@ -1014,7 +1014,7 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) { message.prepend( "<b>" ); message += "</b>:<p>"; - message += QString::fromUtf8( (char*)data + data->explanation ); + message += TQString::fromUtf8( (char*)data + data->explanation ); } else break; //if no explanation then why bother! @@ -1038,17 +1038,17 @@ XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent ) if(data->explanation) { message += "xine parameters: <i>"; - message += QString::fromUtf8( (char*)data + data->parameters ); + message += TQString::fromUtf8( (char*)data + data->parameters ); message += "</i>"; } else message += i18n("Sorry, no additional information is available."); - QApplication::postEvent( xe, new QCustomEvent(QEvent::Type(3001), new QString(message)) ); + TQApplication::postEvent( xe, new TQCustomEvent(TQEvent::Type(3001), new TQString(message)) ); } } //case case XINE_EVENT_UI_CHANNELS_CHANGED: //Flameeyes used this for last.fm track changes - QApplication::postEvent( xe, new QCustomEvent(QEvent::Type(3005) ) ); + TQApplication::postEvent( xe, new TQCustomEvent(TQEvent::Type(3005) ) ); break; } //switch @@ -1059,15 +1059,15 @@ Engine::SimpleMetaBundle XineEngine::fetchMetaData() const { Engine::SimpleMetaBundle bundle; - bundle.title = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_TITLE ) ); - bundle.artist = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_ARTIST ) ); - bundle.album = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_ALBUM ) ); - bundle.comment = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_COMMENT ) ); - bundle.genre = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_GENRE ) ); - bundle.bitrate = QString::number( xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_BITRATE ) / 1000 ); - bundle.samplerate = QString::number( xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE ) ); - bundle.year = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_YEAR ) ); - bundle.tracknr = QString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_TRACK_NUMBER ) ); + bundle.title = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_TITLE ) ); + bundle.artist = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_ARTIST ) ); + bundle.album = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_ALBUM ) ); + bundle.comment = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_COMMENT ) ); + bundle.genre = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_GENRE ) ); + bundle.bitrate = TQString::number( xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_BITRATE ) / 1000 ); + bundle.samplerate = TQString::number( xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE ) ); + bundle.year = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_YEAR ) ); + bundle.tracknr = TQString::fromUtf8( xine_get_meta_info( m_stream, XINE_META_INFO_TRACK_NUMBER ) ); return bundle; } @@ -1076,33 +1076,33 @@ bool XineEngine::metaDataForUrl(const KURL &url, Engine::SimpleMetaBundle &b) { bool result = false; xine_stream_t* tmpstream = xine_stream_new(m_xine, NULL, NULL); - if (xine_open(tmpstream, QFile::encodeName(url.url()))) { - QString audioCodec = QString::fromUtf8(xine_get_meta_info(tmpstream, XINE_META_INFO_SYSTEMLAYER)); + if (xine_open(tmpstream, TQFile::encodeName(url.url()))) { + TQString audioCodec = TQString::fromUtf8(xine_get_meta_info(tmpstream, XINE_META_INFO_SYSTEMLAYER)); if (audioCodec == "CDDA") { - QString title = QString::fromUtf8( + TQString title = TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_TITLE)); if ((!title.isNull()) && (!title.isEmpty())) { //no meta info b.title = title; b.artist = - QString::fromUtf8( + TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_ARTIST)); b.album = - QString::fromUtf8( + TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_ALBUM)); b.genre = - QString::fromUtf8( + TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_GENRE)); b.year = - QString::fromUtf8( + TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_YEAR)); b.tracknr = - QString::fromUtf8( + TQString::fromUtf8( xine_get_meta_info(tmpstream, XINE_META_INFO_TRACK_NUMBER)); if( b.tracknr.isEmpty() ) b.tracknr = url.filename(); } else { - b.title = QString(i18n("Track %1")).arg(url.filename()); + b.title = TQString(i18n("Track %1")).arg(url.filename()); b.album = i18n("AudioCD"); } } @@ -1117,11 +1117,11 @@ bool XineEngine::metaDataForUrl(const KURL &url, Engine::SimpleMetaBundle &b) int nbrChannels = xine_get_stream_info( tmpstream, XINE_STREAM_INFO_AUDIO_CHANNELS ); int bitrate = (samplerate * bitsPerSample * nbrChannels) / 1000; - b.bitrate = QString::number(bitrate); - b.samplerate = QString::number(samplerate); + b.bitrate = TQString::number(bitrate); + b.samplerate = TQString::number(samplerate); int pos, time, length = 0; xine_get_pos_length(tmpstream, &pos, &time, &length); - b.length = QString::number(length / 1000); + b.length = TQString::number(length / 1000); } xine_close(tmpstream); } @@ -1129,7 +1129,7 @@ bool XineEngine::metaDataForUrl(const KURL &url, Engine::SimpleMetaBundle &b) return result; } -bool XineEngine::getAudioCDContents(const QString &device, KURL::List &urls) +bool XineEngine::getAudioCDContents(const TQString &device, KURL::List &urls) { char **xine_urls = NULL; int num; @@ -1176,8 +1176,8 @@ bool XineEngine::lastFmProxyRequired() ////////////////////////////////////////////////////////////////////////////// Fader::Fader( XineEngine *engine, uint fadeMs ) - : QObject( engine ) - , QThread() + : TQObject( engine ) + , TQThread() , m_engine( engine ) , m_xine( engine->m_xine ) , m_decrease( engine->m_stream ) @@ -1236,7 +1236,7 @@ Fader::run() if ( m_terminated ) break; // sleep a constant amount of time - QThread::usleep( stepSizeUs ); + TQThread::usleep( stepSizeUs ); if ( m_paused ) continue; @@ -1300,8 +1300,8 @@ Fader::finish() ////////////////////////////////////////////////////////////////////////////// OutFader::OutFader( XineEngine *engine, uint fadeLength ) - : QObject( engine ) - , QThread() + : TQObject( engine ) + , TQThread() , m_engine( engine ) , m_terminated( false ) , m_fadeLength( fadeLength ) |