diff options
Diffstat (limited to 'src/modules/mediaplayer')
-rw-r--r-- | src/modules/mediaplayer/libkvimediaplayer.cpp | 58 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_amarokinterface.cpp | 28 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_amarokinterface.h | 20 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_amipinterface.cpp | 58 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_amipinterface.h | 22 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_dcopinterface.cpp | 96 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_dcopinterface.h | 28 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_interface.cpp | 78 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_interface.h | 52 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_jukinterface.cpp | 32 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_jukinterface.h | 20 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_mp3.cpp | 10 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_mp3.h | 6 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_winampinterface.cpp | 52 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_winampinterface.h | 8 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_xmmsinterface.cpp | 30 | ||||
-rw-r--r-- | src/modules/mediaplayer/mp_xmmsinterface.h | 10 |
17 files changed, 304 insertions, 304 deletions
diff --git a/src/modules/mediaplayer/libkvimediaplayer.cpp b/src/modules/mediaplayer/libkvimediaplayer.cpp index bd8a144f..8b99165e 100644 --- a/src/modules/mediaplayer/libkvimediaplayer.cpp +++ b/src/modules/mediaplayer/libkvimediaplayer.cpp @@ -61,9 +61,9 @@ static KviMediaPlayerInterface * auto_detect_player(KviWindow * pOut = 0) } if(pOut) { - QString szOut; - QString szNam = d->name(); - KviQString::sprintf(szOut,__tr2qs_ctx("Trying media player interface \"%Q\": score %d","mediaplayer"),&(szNam),iScore); + TQString szOut; + TQString szNam = d->name(); + KviTQString::sprintf(szOut,__tr2qs_ctx("Trying media player interface \"%Q\": score %d","mediaplayer"),&(szNam),iScore); pOut->output(KVI_OUT_MULTIMEDIA,szOut); } } @@ -87,9 +87,9 @@ static KviMediaPlayerInterface * auto_detect_player(KviWindow * pOut = 0) } if(pOut) { - QString szOut; - QString szNam = d->name(); - KviQString::sprintf(szOut,__tr2qs_ctx("Trying media player interface \"%Q\": score %d","mediaplayer"),&(szNam),iScore); + TQString szOut; + TQString szNam = d->name(); + KviTQString::sprintf(szOut,__tr2qs_ctx("Trying media player interface \"%Q\": score %d","mediaplayer"),&(szNam),iScore); pOut->output(KVI_OUT_MULTIMEDIA,szOut); } } @@ -132,7 +132,7 @@ static KviMediaPlayerInterface * auto_detect_player(KviWindow * pOut = 0) if(!c->hasSwitch('q',"quiet")) \ { \ c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); \ - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); \ + TQString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); \ tmp += g_pMPInterface->lastError(); \ c->warning(tmp); \ } \ @@ -144,7 +144,7 @@ static KviMediaPlayerInterface * auto_detect_player(KviWindow * pOut = 0) MP_KVS_FUNCTION(__name) \ { \ MP_KVS_FAIL_ON_NO_INTERFACE \ - QString szRet = g_pMPInterface->__ifacecommand(); \ + TQString szRet = g_pMPInterface->__ifacecommand(); \ c->returnValue()->setString(szRet); \ return true; \ } @@ -455,7 +455,7 @@ MP_KVS_COMMAND(detect) MP_KVS_COMMAND(setPlayer) { - QString szPlayer; + TQString szPlayer; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("player",KVS_PT_STRING,0,szPlayer) @@ -557,7 +557,7 @@ MP_KVS_FUNCTION(playerList) MP_KVS_COMMAND(playMrl) { - QString szMrl; + TQString szMrl; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("player",KVS_PT_STRING,0,szMrl) @@ -569,7 +569,7 @@ MP_KVS_COMMAND(playMrl) if(!c->hasSwitch('q',"quiet")) { c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + TQString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -580,7 +580,7 @@ MP_KVS_COMMAND(playMrl) MP_KVS_COMMAND(amipExec) { - QString szMrl; + TQString szMrl; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("player",KVS_PT_STRING,0,szMrl) @@ -592,7 +592,7 @@ MP_KVS_COMMAND(amipExec) if(!c->hasSwitch('q',"quiet")) { c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + TQString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -634,7 +634,7 @@ MP_KVS_COMMAND(jumpTo) if(!c->hasSwitch('q',"quiet")) { c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + TQString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -673,7 +673,7 @@ MP_KVS_COMMAND(setVol) if(!c->hasSwitch('q',"quiet")) { c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + TQString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1181,7 +1181,7 @@ MP_KVS_COMMAND(setPlayListPos) if(!c->hasSwitch('q',"quiet")) { c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + TQString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1301,7 +1301,7 @@ MP_KVS_SIMPLE_BOOL_FUNCTION(getShuffle,getShuffle) MP_KVS_FUNCTION(getEqData) { int iValue; - QString szOptions; + TQString szOptions; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("item",KVS_PT_INT,0,iValue) @@ -1310,14 +1310,14 @@ MP_KVS_FUNCTION(getEqData) MP_KVS_FAIL_ON_NO_INTERFACE - bool bQuiet = szOptions.find('q',false) != -1; + bool bQuiet = szOptions.tqfind('q',false) != -1; int ret = g_pMPInterface->getEqData(iValue); if(!ret && !bQuiet) { c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + TQString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1361,7 +1361,7 @@ MP_KVS_COMMAND(setEqData) if(!c->hasSwitch('q',"quiet")) { c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + TQString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1399,9 +1399,9 @@ MP_KVS_FUNCTION(localFile) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE - QString szRet = g_pMPInterface->mrl(); + TQString szRet = g_pMPInterface->mrl(); if(szRet.isEmpty())return true; - if(szRet.startsWith("file://",false)) + if(szRet.tqstartsWith("file://",false)) { szRet.remove(0,7); c->returnValue()->setString(szRet); @@ -1411,14 +1411,14 @@ MP_KVS_FUNCTION(localFile) MP_KVS_FUNCTION(amipEval) { - QString szMrl; + TQString szMrl; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("player",KVS_PT_STRING,0,szMrl) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE - QString szRet = g_pMPInterface->amipEval(szMrl); + TQString szRet = g_pMPInterface->amipEval(szMrl); if(szRet.isEmpty())return true; c->returnValue()->setString(szRet); @@ -1453,7 +1453,7 @@ MP_KVS_FUNCTION(status) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE - KviMediaPlayerInterface::PlayerStatus eStat = g_pMPInterface->status(); + KviMediaPlayerInterface::PlayertqStatus eStat = g_pMPInterface->status(); switch(eStat) { case KviMediaPlayerInterface::Stopped: @@ -1549,7 +1549,7 @@ MP_KVS_COMMAND(setRepeat) if(!c->hasSwitch('q',"quiet")) { c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + TQString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1592,7 +1592,7 @@ MP_KVS_COMMAND(setShuffle) if(!c->hasSwitch('q',"quiet")) { c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + TQString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1716,8 +1716,8 @@ static bool mediaplayer_module_ctrl(KviModule * m,const char * operation,void * { if(kvi_strEqualCI(operation,"getAvailableMediaPlayers")) { - // we expect param to be a pointer to QStringList - QStringList * l = (QStringList *)param; + // we expect param to be a pointer to TQStringList + TQStringList * l = (TQStringList *)param; for(KviMediaPlayerInterfaceDescriptor * d = g_pDescriptorList->first();d;d = g_pDescriptorList->next()) { l->append(d->name()); diff --git a/src/modules/mediaplayer/mp_amarokinterface.cpp b/src/modules/mediaplayer/mp_amarokinterface.cpp index 5c941d4f..6cb20e2c 100644 --- a/src/modules/mediaplayer/mp_amarokinterface.cpp +++ b/src/modules/mediaplayer/mp_amarokinterface.cpp @@ -31,8 +31,8 @@ #include "dcopclient.h" #include "kurl.h" -#include <qdatastream.h> -#include <qvaluelist.h> +#include <tqdatastream.h> +#include <tqvaluelist.h> #include "kvi_locale.h" @@ -76,9 +76,9 @@ bool KviAmarokInterface::setVol(kvs_int_t &iVol) } #define MP_DCOP_STRING_CALL(_fncname,_iface,_fnc) \ -QString KviAmarokInterface::_fncname() \ +TQString KviAmarokInterface::_fncname() \ { \ - QString ret; \ + TQString ret; \ if(!stringRetVoidDCOPCall(_iface,_fnc,ret))return false; \ return ret; \ } @@ -122,14 +122,14 @@ int KviAmarokInterface::position() bool KviAmarokInterface::getRepeat() { bool ret; - if(!boolRetVoidDCOPCall("player","repeatTrackStatus()",ret))return false; + if(!boolRetVoidDCOPCall("player","repeatTracktqStatus()",ret))return false; return ret; } bool KviAmarokInterface::getShuffle() { bool ret; - if(!boolRetVoidDCOPCall("player","randomModeStatus()",ret))return false; + if(!boolRetVoidDCOPCall("player","randomModetqStatus()",ret))return false; return ret; } @@ -143,7 +143,7 @@ bool KviAmarokInterface::setShuffle(bool &bVal) return voidRetBoolDCOPCall("player","enableRandomMode(bool)",bVal); } -KviMediaPlayerInterface::PlayerStatus KviAmarokInterface::status() +KviMediaPlayerInterface::PlayertqStatus KviAmarokInterface::status() { int ret; if(!intRetVoidDCOPCall("player","status()",ret))return KviMediaPlayerInterface::Unknown; @@ -165,20 +165,20 @@ KviMediaPlayerInterface::PlayerStatus KviAmarokInterface::status() return KviMediaPlayerInterface::Unknown; } -QString KviAmarokInterface::mrl() +TQString KviAmarokInterface::mrl() { - QString ret; + TQString ret; if(!stringRetVoidDCOPCall("player","encodedURL()",ret))return false; KURL url(ret); return url.prettyURL(); } -bool KviAmarokInterface::playMrl(const QString &mrl) +bool KviAmarokInterface::playMrl(const TQString &mrl) { - QString title; - QByteArray data, replyData; - KviQCString replyType; - QDataStream arg(data,IO_WriteOnly); + TQString title; + TQByteArray data, replyData; + KviTQCString replyType; + TQDataStream arg(data,IO_WriteOnly); arg << KURL(mrl); if(!g_pApp->dcopClient()->call(m_szAppId,"playlist","playMedia(KURL)",data,replyType,replyData)) return false; diff --git a/src/modules/mediaplayer/mp_amarokinterface.h b/src/modules/mediaplayer/mp_amarokinterface.h index ac856219..f0169bb0 100644 --- a/src/modules/mediaplayer/mp_amarokinterface.h +++ b/src/modules/mediaplayer/mp_amarokinterface.h @@ -49,20 +49,20 @@ virtual bool mute(); virtual int getVol(); virtual bool quit(); - virtual QString nowPlaying(); - virtual QString mrl(); - virtual QString title(); - virtual QString artist(); - virtual QString genre(); - virtual QString comment(); - virtual QString year(); - virtual QString album(); + virtual TQString nowPlaying(); + virtual TQString mrl(); + virtual TQString title(); + virtual TQString artist(); + virtual TQString genre(); + virtual TQString comment(); + virtual TQString year(); + virtual TQString album(); virtual int position(); virtual int length(); //virtual int bitRate(); unsupported virtual int sampleRate(); - virtual bool playMrl(const QString &mrl); - virtual KviMediaPlayerInterface::PlayerStatus status(); + virtual bool playMrl(const TQString &mrl); + virtual KviMediaPlayerInterface::PlayertqStatus status(); virtual bool getRepeat(); virtual bool getShuffle(); virtual bool setRepeat(bool &bVal); diff --git a/src/modules/mediaplayer/mp_amipinterface.cpp b/src/modules/mediaplayer/mp_amipinterface.cpp index 3a7094bc..3a363ed5 100644 --- a/src/modules/mediaplayer/mp_amipinterface.cpp +++ b/src/modules/mediaplayer/mp_amipinterface.cpp @@ -3,7 +3,7 @@ #ifdef COMPILE_ON_WINDOWS -#include <qtextcodec.h> +#include <tqtextcodec.h> #include "kvi_locale.h" #include "kvi_module.h" @@ -69,10 +69,10 @@ static bool loadAmipDll() return true; }; -static QTextCodec * mediaplayer_get_codec() +static TQTextCodec * mediaplayer_get_codec() { - QTextCodec * c= QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding)); - if(!c)c = QTextCodec::codecForLocale(); + TQTextCodec * c= TQTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding)); + if(!c)c = TQTextCodec::codecForLocale(); return c; } @@ -147,9 +147,9 @@ int eval_int(const char *var) return res; } -QString eval_str(const char *var) +TQString eval_str(const char *var) { - QString res; + TQString res; if(!amip_dll) return res; char buff[AC_BUFFER_SIZE]; if (AC_ERR_NOERROR == ac_eval(var, buff)) { @@ -189,7 +189,7 @@ int KviAmipInterface::channels() return ret; } -KviMediaPlayerInterface::PlayerStatus KviAmipInterface::status() +KviMediaPlayerInterface::PlayertqStatus KviAmipInterface::status() { int ret = eval_int("var_stat"); switch(ret) @@ -210,11 +210,11 @@ KviMediaPlayerInterface::PlayerStatus KviAmipInterface::status() return KviMediaPlayerInterface::Unknown; } -QString KviAmipInterface::mrl() +TQString KviAmipInterface::mrl() { - QString ret; - QString fn = eval_str("var_fn"); - QTextCodec *c=mediaplayer_get_codec(); + TQString ret; + TQString fn = eval_str("var_fn"); + TQTextCodec *c=mediaplayer_get_codec(); if (c) ret = c->toUnicode(fn); else ret=fn; if(!ret.startsWith("http://",false)) @@ -223,46 +223,46 @@ QString KviAmipInterface::mrl() return ret; } -QString getAmipString(const char * var) { - QString ret; - QString s = eval_str(var); - QTextCodec *c=mediaplayer_get_codec(); +TQString getAmipString(const char * var) { + TQString ret; + TQString s = eval_str(var); + TQTextCodec *c=mediaplayer_get_codec(); if (c) ret = c->toUnicode(s); else ret=s; return ret; } -QString KviAmipInterface::nowPlaying() +TQString KviAmipInterface::nowPlaying() { return getAmipString("var_s"); } -QString KviAmipInterface::artist() +TQString KviAmipInterface::artist() { return getAmipString("var_1"); } -QString KviAmipInterface::title() +TQString KviAmipInterface::title() { return getAmipString("var_2"); } -QString KviAmipInterface::album() +TQString KviAmipInterface::album() { return getAmipString("var_4"); } -QString KviAmipInterface::year() +TQString KviAmipInterface::year() { return getAmipString("var_5"); } -QString KviAmipInterface::comment() +TQString KviAmipInterface::comment() { return getAmipString("var_6"); } -QString KviAmipInterface::genre() +TQString KviAmipInterface::genre() { return getAmipString("var_7"); } @@ -373,24 +373,24 @@ bool KviAmipInterface::setRepeat(bool &bVal) return res; } -bool KviAmipInterface::amipExec(const QString &cmd) +bool KviAmipInterface::amipExec(const TQString &cmd) { if(!amip_dll) return false; - QTextCodec *c=mediaplayer_get_codec(); + TQTextCodec *c=mediaplayer_get_codec(); KviStr szCmd = c ? c->fromUnicode(cmd) : cmd.utf8(); return (ac_exec(szCmd) == AC_ERR_NOERROR); } -QString KviAmipInterface::amipEval(const QString &cmd) +TQString KviAmipInterface::amipEval(const TQString &cmd) { - QString ret; + TQString ret; if(!amip_dll) return ret; - QTextCodec *c=mediaplayer_get_codec(); + TQTextCodec *c=mediaplayer_get_codec(); KviStr szCmd = c ? c->fromUnicode(cmd) : cmd.utf8(); char buff[AC_BUFFER_SIZE]; if((ac_eval(szCmd, buff) == AC_ERR_NOERROR)) { - QString s = buff; - QTextCodec *c=mediaplayer_get_codec(); + TQString s = buff; + TQTextCodec *c=mediaplayer_get_codec(); if (c) ret = c->toUnicode(s); else ret=s; } diff --git a/src/modules/mediaplayer/mp_amipinterface.h b/src/modules/mediaplayer/mp_amipinterface.h index 22bbf9d5..392d854f 100644 --- a/src/modules/mediaplayer/mp_amipinterface.h +++ b/src/modules/mediaplayer/mp_amipinterface.h @@ -20,14 +20,14 @@ virtual bool stop(); virtual bool pause(); virtual bool quit(); - virtual QString nowPlaying(); - virtual QString artist(); - virtual QString title(); - virtual QString genre(); - virtual QString comment(); - virtual QString album(); - virtual QString year(); - virtual QString mrl(); + virtual TQString nowPlaying(); + virtual TQString artist(); + virtual TQString title(); + virtual TQString genre(); + virtual TQString comment(); + virtual TQString album(); + virtual TQString year(); + virtual TQString mrl(); virtual int position(); virtual int length(); virtual bool setVol(kvs_int_t &iVol); @@ -46,9 +46,9 @@ virtual bool getShuffle(); virtual bool setRepeat(bool &bVal); virtual bool setShuffle(bool &bVal); - virtual bool amipExec(const QString &cmd); - virtual QString amipEval(const QString &cmd); - virtual KviMediaPlayerInterface::PlayerStatus status(); + virtual bool amipExec(const TQString &cmd); + virtual TQString amipEval(const TQString &cmd); + virtual KviMediaPlayerInterface::PlayertqStatus status(); }; MP_DECLARE_DESCRIPTOR(KviAmipInterface) diff --git a/src/modules/mediaplayer/mp_dcopinterface.cpp b/src/modules/mediaplayer/mp_dcopinterface.cpp index 7c86e420..1f18b3af 100644 --- a/src/modules/mediaplayer/mp_dcopinterface.cpp +++ b/src/modules/mediaplayer/mp_dcopinterface.cpp @@ -28,13 +28,13 @@ #include "dcopclient.h" -#include <qdatastream.h> -#include <qvaluelist.h> +#include <tqdatastream.h> +#include <tqvaluelist.h> #include "kvi_app.h" #include "kvi_thread.h" -KviMediaPlayerDCOPInterface::KviMediaPlayerDCOPInterface(const KviQCString &szAppId) +KviMediaPlayerDCOPInterface::KviMediaPlayerDCOPInterface(const KviTQCString &szAppId) : KviMediaPlayerInterface() { m_szAppId = szAppId; @@ -44,66 +44,66 @@ KviMediaPlayerDCOPInterface::~KviMediaPlayerDCOPInterface() { } -bool KviMediaPlayerDCOPInterface::ensureAppRunning(const QString &szApp) +bool KviMediaPlayerDCOPInterface::ensureAppRunning(const TQString &szApp) { if(findRunningApp(m_szAppId))return true; return startApp(m_szAppId,400); } -bool KviMediaPlayerDCOPInterface::simpleDCOPCall(const KviQCString &szObj,const KviQCString &szFunc) +bool KviMediaPlayerDCOPInterface::simpleDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; + TQByteArray data; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviMediaPlayerDCOPInterface::boolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool bVal) +bool KviMediaPlayerDCOPInterface::boolDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool bVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << bVal; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviMediaPlayerDCOPInterface::intDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal) +bool KviMediaPlayerDCOPInterface::intDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << iVal; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviMediaPlayerDCOPInterface::floatDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,float fVal) +bool KviMediaPlayerDCOPInterface::floatDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,float fVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << fVal; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviMediaPlayerDCOPInterface::stringDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString szVal) +bool KviMediaPlayerDCOPInterface::stringDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString szVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << szVal; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviMediaPlayerDCOPInterface::stringRetDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &ret) +bool KviMediaPlayerDCOPInterface::stringRetDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString &ret) { if(!ensureAppRunning(m_szAppId))return false; - QString title; - QByteArray data, replyData; - KviQCString replyType; + TQString title; + TQByteArray data, replyData; + KviTQCString replyType; if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) return false; - QDataStream reply( replyData, IO_ReadOnly ); - if(replyType == "QString") + TQDataStream reply( replyData, IO_ReadOnly ); + if(replyType == TQSTRING_OBJECT_NAME_STRING) { reply >> ret; return true; @@ -111,15 +111,15 @@ bool KviMediaPlayerDCOPInterface::stringRetDCOPCall(const KviQCString &szObj,con return false; } -bool KviMediaPlayerDCOPInterface::intRetDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret) +bool KviMediaPlayerDCOPInterface::intRetDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int &ret) { if(!ensureAppRunning(m_szAppId))return false; - QString title; - QByteArray data, replyData; - KviQCString replyType; + TQString title; + TQByteArray data, replyData; + KviTQCString replyType; if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) return false; - QDataStream reply( replyData, IO_ReadOnly ); + TQDataStream reply( replyData, IO_ReadOnly ); if(replyType == "int") { reply >> ret; @@ -128,15 +128,15 @@ bool KviMediaPlayerDCOPInterface::intRetDCOPCall(const KviQCString &szObj,const return false; } -bool KviMediaPlayerDCOPInterface::boolRetDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool &ret) +bool KviMediaPlayerDCOPInterface::boolRetDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool &ret) { if(!ensureAppRunning(m_szAppId))return false; - QString title; - QByteArray data, replyData; - KviQCString replyType; + TQString title; + TQByteArray data, replyData; + KviTQCString replyType; if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) return false; - QDataStream reply( replyData, IO_ReadOnly ); + TQDataStream reply( replyData, IO_ReadOnly ); if(replyType == "bool") { reply >> ret; @@ -146,11 +146,11 @@ bool KviMediaPlayerDCOPInterface::boolRetDCOPCall(const KviQCString &szObj,const } -bool KviMediaPlayerDCOPInterface::findRunningApp(const QString &szApp) +bool KviMediaPlayerDCOPInterface::findRunningApp(const TQString &szApp) { - QValueList<KviQCString> allApps = g_pApp->dcopClient() ->registeredApplications(); - QValueList<KviQCString>::iterator iterator; - KviQCString sz = szApp.local8Bit(); + TQValueList<KviTQCString> allApps = g_pApp->dcopClient() ->registeredApplications(); + TQValueList<KviTQCString>::iterator iterator; + KviTQCString sz = szApp.local8Bit(); for(iterator = allApps.begin();iterator != allApps.end();iterator++) { if(*iterator == sz)return true; @@ -158,7 +158,7 @@ bool KviMediaPlayerDCOPInterface::findRunningApp(const QString &szApp) return false; } -int KviMediaPlayerDCOPInterface::detectApp(const QString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted) +int KviMediaPlayerDCOPInterface::detectApp(const TQString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted) { // lookup the amarok interface if(!g_pApp->dcopClient())return 0; @@ -176,30 +176,30 @@ int KviMediaPlayerDCOPInterface::detectApp(const QString &szApp,bool bStart,int } -bool KviMediaPlayerDCOPInterface::startApp(const QString &szApp,int iWaitMSecs) +bool KviMediaPlayerDCOPInterface::startApp(const TQString &szApp,int iWaitMSecs) { // we could use KApplication::startServiceByDesktopName here // but we want to be able to wait a defined amount of time - QStringList tmp; - QByteArray data, replyData; - KviQCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQStringList tmp; + TQByteArray data, replyData; + KviTQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << szApp << tmp; if(!g_pApp->dcopClient()->call( "klauncher", "klauncher", - "start_service_by_desktop_name(QString,QStringList)", + "start_service_by_desktop_name(TQString,TQStringList)", data, replyType, replyData)) { return false; } else { - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); if(replyType != "serviceResult")return false; int result; - KviQCString dcopName; - QString error; + KviTQCString dcopName; + TQString error; reply >> result >> dcopName >> error; if(result != 0)return false; } diff --git a/src/modules/mediaplayer/mp_dcopinterface.h b/src/modules/mediaplayer/mp_dcopinterface.h index 6ce8594d..449f385c 100644 --- a/src/modules/mediaplayer/mp_dcopinterface.h +++ b/src/modules/mediaplayer/mp_dcopinterface.h @@ -33,23 +33,23 @@ class KviMediaPlayerDCOPInterface : public KviMediaPlayerInterface { public: - KviMediaPlayerDCOPInterface(const KviQCString &szAppId); + KviMediaPlayerDCOPInterface(const KviTQCString &szAppId); ~KviMediaPlayerDCOPInterface(); protected: - KviQCString m_szAppId; + KviTQCString m_szAppId; protected: - bool ensureAppRunning(const QString &szApp); - bool findRunningApp(const QString &szApp); - bool startApp(const QString &szApp,int iWaitMSecs = 0); - int detectApp(const QString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted); - bool simpleDCOPCall(const KviQCString &szObj,const KviQCString &szFunc); - bool intDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal); - bool boolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool bVal); - bool stringDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString szVal); - bool floatDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,float fVal); - bool stringRetDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &ret); - bool intRetDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret); - bool boolRetDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool &ret); + bool ensureAppRunning(const TQString &szApp); + bool findRunningApp(const TQString &szApp); + bool startApp(const TQString &szApp,int iWaitMSecs = 0); + int detectApp(const TQString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted); + bool simpleDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc); + bool intDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal); + bool boolDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool bVal); + bool stringDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString szVal); + bool floatDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,float fVal); + bool stringRetDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString &ret); + bool intRetDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int &ret); + bool boolRetDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool &ret); }; #endif //COMPILE_KDE_SUPPORT diff --git a/src/modules/mediaplayer/mp_interface.cpp b/src/modules/mediaplayer/mp_interface.cpp index 0894de05..0c0a97a0 100644 --- a/src/modules/mediaplayer/mp_interface.cpp +++ b/src/modules/mediaplayer/mp_interface.cpp @@ -26,12 +26,12 @@ #include "mp_mp3.h" #include "kvi_options.h" #include "kvi_locale.h" -#include <qtextcodec.h> +#include <tqtextcodec.h> -static QTextCodec * mediaplayer_get_codec() +static TQTextCodec * mediaplayer_get_codec() { - QTextCodec * c= QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding)); - if(!c)c = QTextCodec::codecForLocale(); + TQTextCodec * c= TQTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding)); + if(!c)c = TQTextCodec::codecForLocale(); return c; } @@ -78,82 +78,82 @@ bool KviMediaPlayerInterface::minimize() return false; } -QString KviMediaPlayerInterface::getLocalFile() +TQString KviMediaPlayerInterface::getLocalFile() { - QString ret = mrl(); + TQString ret = mrl(); if(ret.isEmpty())return ret; - if(ret.startsWith("file://",false)) + if(ret.tqstartsWith("file://",false)) { ret.remove(0,7); return ret; } - return QString::null; + return TQString(); } -QString KviMediaPlayerInterface::amipEval(const QString &cmd) +TQString KviMediaPlayerInterface::amipEval(const TQString &cmd) { - return QString::null; + return TQString(); } #define SCAN_MP3_FILE \ - QString f = getLocalFile(); \ - if(f.isEmpty())return QString::null; \ + TQString f = getLocalFile(); \ + if(f.isEmpty())return TQString(); \ mp3info mp3; \ - if(!scan_mp3_file(f,&mp3))return QString::null; \ - QTextCodec *pCodec; \ + if(!scan_mp3_file(f,&mp3))return TQString(); \ + TQTextCodec *pCodec; \ pCodec=mediaplayer_get_codec(); #define SCAN_MP3_FILE_RET_INT \ - QString f = getLocalFile(); \ + TQString f = getLocalFile(); \ if(f.isEmpty())return -1; \ mp3info mp3; \ if(!scan_mp3_file(f,&mp3))return -1; -QString KviMediaPlayerInterface::artist() +TQString KviMediaPlayerInterface::artist() { SCAN_MP3_FILE - return pCodec->toUnicode(KviQCString(mp3.id3.artist)); + return pCodec->toUnicode(KviTQCString(mp3.id3.artist)); } -QString KviMediaPlayerInterface::title() +TQString KviMediaPlayerInterface::title() { SCAN_MP3_FILE - return pCodec->toUnicode(KviQCString(mp3.id3.title)); + return pCodec->toUnicode(KviTQCString(mp3.id3.title)); } -QString KviMediaPlayerInterface::genre() +TQString KviMediaPlayerInterface::genre() { SCAN_MP3_FILE - return pCodec->toUnicode(KviQCString(get_typegenre(mp3.id3.genre[0]))); + return pCodec->toUnicode(KviTQCString(get_typegenre(mp3.id3.genre[0]))); } -QString KviMediaPlayerInterface::comment() +TQString KviMediaPlayerInterface::comment() { SCAN_MP3_FILE - return pCodec->toUnicode(KviQCString(mp3.id3.comment)); + return pCodec->toUnicode(KviTQCString(mp3.id3.comment)); } -QString KviMediaPlayerInterface::year() +TQString KviMediaPlayerInterface::year() { SCAN_MP3_FILE - return QString(mp3.id3.year); + return TQString(mp3.id3.year); } -QString KviMediaPlayerInterface::album() +TQString KviMediaPlayerInterface::album() { SCAN_MP3_FILE - return pCodec->toUnicode(KviQCString(mp3.id3.album)); + return pCodec->toUnicode(KviTQCString(mp3.id3.album)); } -bool KviMediaPlayerInterface::playMrl(const QString &mrl) +bool KviMediaPlayerInterface::playMrl(const TQString &mrl) { notImplemented(); return false; } -bool KviMediaPlayerInterface::amipExec(const QString &cmd) +bool KviMediaPlayerInterface::amipExec(const TQString &cmd) { notImplemented(); return false; @@ -183,7 +183,7 @@ bool KviMediaPlayerInterface::jumpTo(int &iPos) return false; } -KviMediaPlayerInterface::PlayerStatus KviMediaPlayerInterface::status() +KviMediaPlayerInterface::PlayertqStatus KviMediaPlayerInterface::status() { notImplemented(); return KviMediaPlayerInterface::Unknown; @@ -262,16 +262,16 @@ bool KviMediaPlayerInterface::setShuffle(bool &bVal) return false; } -QString KviMediaPlayerInterface::mediaType() +TQString KviMediaPlayerInterface::mediaType() { - QString ret = mrl(); - if(ret.endsWith(".mp3",false))ret = "MPEG Layer 3"; - else if(ret.endsWith(".ogg",false))ret = "OGG Vorbis"; - else if(ret.endsWith(".avi",false))ret = "Audio Video Interleave"; - else if(ret.endsWith(".mpeg",false))ret = "MPEG Video"; - else if(ret.endsWith(".mpg",false))ret = "MPEG Video"; - else if(ret.startsWith("http://",false))ret = "HTTP Audio Stream"; - else ret = QString::null; + TQString ret = mrl(); + if(ret.tqendsWith(".mp3",false))ret = "MPEG Layer 3"; + else if(ret.tqendsWith(".ogg",false))ret = "OGG Vorbis"; + else if(ret.tqendsWith(".avi",false))ret = "Audio Video Interleave"; + else if(ret.tqendsWith(".mpeg",false))ret = "MPEG Video"; + else if(ret.tqendsWith(".mpg",false))ret = "MPEG Video"; + else if(ret.tqstartsWith("http://",false))ret = "HTTP Audio Stream"; + else ret = TQString(); return ret; } diff --git a/src/modules/mediaplayer/mp_interface.h b/src/modules/mediaplayer/mp_interface.h index 44667309..593a2490 100644 --- a/src/modules/mediaplayer/mp_interface.h +++ b/src/modules/mediaplayer/mp_interface.h @@ -36,9 +36,9 @@ public: KviMediaPlayerInterface(){}; virtual ~KviMediaPlayerInterface(){}; protected: - QString m_szLastError; + TQString m_szLastError; public: - const QString & lastError(){ return m_szLastError; }; + const TQString & lastError(){ return m_szLastError; }; // // mandatory interface @@ -76,13 +76,13 @@ public: // this string MUST be non-empty when the player is playing something. // If it is empty then either the player is not playing or there are // communication errors. - virtual QString nowPlaying() = 0; + virtual TQString nowPlaying() = 0; // currently played media resource locator // file://<filepath> for local files, dvb:// for dvb media , dvd:// for dvd's // http:// for audio streams etc... // empty if player is not playing (or in the tragic case that the player // can't determine the url). - virtual QString mrl() = 0; + virtual TQString mrl() = 0; // optional interface @@ -90,10 +90,10 @@ public: // the mrl may be (or may be not) added to the player's playlist // the function should return false if the player doesn't support // this function or there is a communication error - virtual bool playMrl(const QString &mrl); + virtual bool playMrl(const TQString &mrl); // what is this ? :D - virtual bool amipExec(const QString &cmd); - virtual QString amipEval(const QString &cmd); + virtual bool amipExec(const TQString &cmd); + virtual TQString amipEval(const TQString &cmd); // this is functions to hide,show and minimize the player interface virtual bool hide(); virtual bool show(); @@ -108,8 +108,8 @@ public: // return false only on communication failure virtual bool quit(); // return the current player status - enum PlayerStatus { Unknown, Stopped, Playing, Paused }; - virtual KviMediaPlayerInterface::PlayerStatus status(); + enum PlayertqStatus { Unknown, Stopped, Playing, Paused }; + virtual KviMediaPlayerInterface::PlayertqStatus status(); // current position in the media (msecs) // 0 if the player isn't playing anything and -1 if unknown virtual int position(); @@ -125,25 +125,25 @@ public: // is to be derived from the media file name or from the informations // stored inside the file like the ID3 tag...) // If the player is not playing, the returned string should be empty - virtual QString title(); + virtual TQString title(); // currently played media artist's name // If the player is not playing, the returned string should be empty // If the player can't guess the artist it should return the string "unknown" - virtual QString artist(); + virtual TQString artist(); // currently plaued media genre // If the player is not playing, the returned string should be empty // If the player can't guess the genre it should return the string "unknown" - virtual QString genre(); + virtual TQString genre(); // currently played media comment. // Empty string if the player isn't playing anything or there is no comment - virtual QString comment(); + virtual TQString comment(); // currently played media year // Empty string if the player isn't playing anything or the year is unknown - virtual QString year(); + virtual TQString year(); // currently played media album // Empty string if the player isn't playing anything // If the player can't guess the album/collection then this string should be "unknown" - virtual QString album(); + virtual TQString album(); // bit rate in bits/sec, 0 if unknown virtual int bitRate(); // sample rate in samples/sec (Hz), 0 if unknown @@ -152,7 +152,7 @@ public: virtual int channels(); // frequency // the type of the media (MPEG Layer 3, MPEG Layer 4, OGG Vorbis, AVI Stream etc..) - virtual QString mediaType(); + virtual TQString mediaType(); // get the position in the playlist virtual int getPlayListPos(); // set the position in the playlist @@ -171,10 +171,10 @@ public: virtual bool setRepeat(bool &bVal); // set the shuffle bool value virtual bool setShuffle(bool &bVal); - void setLastError(const QString &szLastError){ m_szLastError = szLastError; }; + void setLastError(const TQString &szLastError){ m_szLastError = szLastError; }; protected: void notImplemented(); - QString getLocalFile(); + TQString getLocalFile(); }; @@ -184,8 +184,8 @@ public: KviMediaPlayerInterfaceDescriptor(){}; virtual ~KviMediaPlayerInterfaceDescriptor(){}; public: - virtual const QString & name() = 0; - virtual const QString & description() = 0; + virtual const TQString & name() = 0; + virtual const TQString & description() = 0; virtual KviMediaPlayerInterface * instance() = 0; }; @@ -198,11 +198,11 @@ public: virtual ~_interfaceclass ## Descriptor(); \ protected: \ _interfaceclass * m_pInstance; \ - QString m_szName; \ - QString m_szDescription; \ + TQString m_szName; \ + TQString m_szDescription; \ public: \ - virtual const QString & name(); \ - virtual const QString & description(); \ + virtual const TQString & name(); \ + virtual const TQString & description(); \ virtual KviMediaPlayerInterface * instance(); \ }; @@ -218,11 +218,11 @@ public: { \ if(m_pInstance)delete m_pInstance; \ } \ - const QString & _interfaceclass ## Descriptor::name() \ + const TQString & _interfaceclass ## Descriptor::name() \ { \ return m_szName; \ } \ - const QString & _interfaceclass ## Descriptor::description() \ + const TQString & _interfaceclass ## Descriptor::description() \ { \ return m_szDescription; \ } \ diff --git a/src/modules/mediaplayer/mp_jukinterface.cpp b/src/modules/mediaplayer/mp_jukinterface.cpp index d5a69a77..5b50a046 100644 --- a/src/modules/mediaplayer/mp_jukinterface.cpp +++ b/src/modules/mediaplayer/mp_jukinterface.cpp @@ -31,8 +31,8 @@ #include "dcopclient.h" #include "kurl.h" -#include <qdatastream.h> -#include <qvaluelist.h> +#include <tqdatastream.h> +#include <tqvaluelist.h> #include "kvi_locale.h" @@ -79,29 +79,29 @@ bool KviJukInterface::jumpTo(kvs_int_t &iPos) bool KviJukInterface::getShuffle() { - QString szMode; + TQString szMode; if(!stringRetVoidDCOPCall("player","randomPlayMode()",szMode))return false; return (szMode != "NoRandom"); } bool KviJukInterface::setShuffle(bool &bVal) { - QString szMode; + TQString szMode; if(bVal) { szMode = "Random"; } else { szMode = "NoRandom"; } - if(!voidRetStringDCOPCall("player","setRandomPlayMode(QString)",szMode))return false; + if(!voidRetStringDCOPCall("player","setRandomPlayMode(TQString)",szMode))return false; return true; } #define MP_DCOP_STRING_CALL(_fncname,_iface,_fnc) \ -QString KviJukInterface::_fncname() \ +TQString KviJukInterface::_fncname() \ { \ - QString ret; \ + TQString ret; \ if(!stringRetVoidDCOPCall(_iface,_fnc,ret))return false; \ return ret; \ } @@ -140,7 +140,7 @@ int KviJukInterface::position() return ret * 1000; } -KviMediaPlayerInterface::PlayerStatus KviJukInterface::status() +KviMediaPlayerInterface::PlayertqStatus KviJukInterface::status() { int ret; if(!intRetVoidDCOPCall("player","status()",ret))return KviMediaPlayerInterface::Unknown; @@ -162,21 +162,21 @@ KviMediaPlayerInterface::PlayerStatus KviJukInterface::status() return KviMediaPlayerInterface::Unknown; } -QString KviJukInterface::mrl() +TQString KviJukInterface::mrl() { // ugh :/ - QString ret; + TQString ret; return ret; } -bool KviJukInterface::playMrl(const QString &mrl) +bool KviJukInterface::playMrl(const TQString &mrl) { - QString title; - QByteArray data, replyData; - KviQCString replyType; - QDataStream arg(data,IO_WriteOnly); + TQString title; + TQByteArray data, replyData; + KviTQCString replyType; + TQDataStream arg(data,IO_WriteOnly); arg << mrl; - if(!g_pApp->dcopClient()->call(m_szAppId,"playlist","play(QString)",data,replyType,replyData)) + if(!g_pApp->dcopClient()->call(m_szAppId,"playlist","play(TQString)",data,replyType,replyData)) return false; return true; } diff --git a/src/modules/mediaplayer/mp_jukinterface.h b/src/modules/mediaplayer/mp_jukinterface.h index 478a3c16..c2b7fd16 100644 --- a/src/modules/mediaplayer/mp_jukinterface.h +++ b/src/modules/mediaplayer/mp_jukinterface.h @@ -47,15 +47,15 @@ virtual bool quit(); virtual bool jumpTo(kvs_int_t &iPos); virtual bool setVol(kvs_int_t &iVol); - virtual QString nowPlaying(); - virtual QString mrl(); + virtual TQString nowPlaying(); + virtual TQString mrl(); /* - virtual QString title(); - virtual QString artist(); - virtual QString genre(); - virtual QString comment(); - virtual QString year(); - virtual QString album(); + virtual TQString title(); + virtual TQString artist(); + virtual TQString genre(); + virtual TQString comment(); + virtual TQString year(); + virtual TQString album(); */ virtual int position(); virtual int length(); @@ -66,8 +66,8 @@ virtual bool getShuffle(); virtual bool setShuffle(bool &bVal); - virtual bool playMrl(const QString &mrl); - virtual KviMediaPlayerInterface::PlayerStatus status(); + virtual bool playMrl(const TQString &mrl); + virtual KviMediaPlayerInterface::PlayertqStatus status(); }; MP_DECLARE_DESCRIPTOR(KviJukInterface) diff --git a/src/modules/mediaplayer/mp_mp3.cpp b/src/modules/mediaplayer/mp_mp3.cpp index 6e27fa5f..4942ee50 100644 --- a/src/modules/mediaplayer/mp_mp3.cpp +++ b/src/modules/mediaplayer/mp_mp3.cpp @@ -40,8 +40,8 @@ #include "mp_mp3.h" #include "kvi_options.h" -#include <qfileinfo.h> -#include <qtextcodec.h> +#include <tqfileinfo.h> +#include <tqtextcodec.h> #define MAXGENRE 147 #define GENREROWS 50 @@ -207,7 +207,7 @@ int get_mp3_info(mp3info *mp3) int sample_pos,data_start=0; - QFile fi(mp3->filename); + TQFile fi(mp3->filename); mp3->datasize=fi.size();//filestat.st_size; get_id3(mp3); @@ -449,14 +449,14 @@ char *unpad(char *string) return string; } -bool scan_mp3_file(QString& szFileName,mp3info * i) +bool scan_mp3_file(TQString& szFileName,mp3info * i) { //memset(i,0,sizeof(mp3info)); resetmp3infoStruct(i); i->filename = "text"; - i->file = fopen(QTextCodec::codecForLocale()->fromUnicode(i->filename).data(),"rb"); + i->file = fopen(TQTextCodec::codecForLocale()->fromUnicode(i->filename).data(),"rb"); if(!i->file)return false; get_mp3_info(i); diff --git a/src/modules/mediaplayer/mp_mp3.h b/src/modules/mediaplayer/mp_mp3.h index d42c5ef7..51e544f4 100644 --- a/src/modules/mediaplayer/mp_mp3.h +++ b/src/modules/mediaplayer/mp_mp3.h @@ -51,7 +51,7 @@ #include <stdio.h> #include <stdlib.h> -#include <qstring.h> +#include <tqstring.h> #ifdef COMPILE_ON_WINDOWS #include <windows.h> @@ -92,7 +92,7 @@ typedef struct { } id3tag; typedef struct { - QString filename; + TQString filename; FILE *file; unsigned int datasize; int header_isvalid; @@ -112,7 +112,7 @@ typedef struct { // 10 - Dual channel (2 mono channels) // 11 - Single channel (Mono) -bool scan_mp3_file(QString& szFileName,mp3info * i); +bool scan_mp3_file(TQString& szFileName,mp3info * i); void resetmp3infoStruct(mp3info *i); diff --git a/src/modules/mediaplayer/mp_winampinterface.cpp b/src/modules/mediaplayer/mp_winampinterface.cpp index ae157782..6bc3e24b 100644 --- a/src/modules/mediaplayer/mp_winampinterface.cpp +++ b/src/modules/mediaplayer/mp_winampinterface.cpp @@ -27,7 +27,7 @@ #ifdef COMPILE_ON_WINDOWS -#include <qtextcodec.h> +#include <tqtextcodec.h> #include "kvi_locale.h" #include "kvi_module.h" @@ -62,9 +62,9 @@ // ** IPC_GETLISTLENGTH returns the length of the current playlist, in // ** tracks. -#define IPC_GETEQDATA 127 -// ** int data=SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA); -// ** IPC_GETEQDATA queries the status of the EQ. +#define IPC_GETETQDATA 127 +// ** int data=SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETETQDATA); +// ** IPC_GETETQDATA queries the status of the EQ. // ** The value returned depends on what 'pos' is set to: // ** Value Meaning // ** ------------------ @@ -73,11 +73,11 @@ // ** 11 Enabled. zero if disabled, nonzero if enabled. // ** 12 Autoload. zero if disabled, nonzero if enabled. -#define IPC_SETEQDATA 128 -// ** SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA); -// ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SETEQDATA); -// ** IPC_SETEQDATA sets the value of the last position retrieved -// ** by IPC_GETEQDATA. This is pretty lame, and we should provide +#define IPC_SETETQDATA 128 +// ** SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETETQDATA); +// ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SETETQDATA); +// ** IPC_SETETQDATA sets the value of the last position retrieved +// ** by IPC_GETETQDATA. This is pretty lame, and we should provide // ** an extended version that lets you do a MAKELPARAM(pos,value). // ** someday... @@ -156,7 +156,7 @@ #define WINAMP_CMD_STOP WINAMP_BUTTON4 #define WINAMP_CMD_NEXT WINAMP_BUTTON5 -#define WINAMP_CMD_QUIT 40001 +#define WINAMP_CMD_TQUIT 40001 #define KVIRC_WM_USER 63112 @@ -167,10 +167,10 @@ #define KVIRC_WM_USER_TRANSFER 15000 -static QTextCodec * mediaplayer_get_codec() +static TQTextCodec * mediaplayer_get_codec() { - QTextCodec * c= QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding)); - if(!c)c = QTextCodec::codecForLocale(); + TQTextCodec * c= TQTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding)); + if(!c)c = TQTextCodec::codecForLocale(); return c; } @@ -237,7 +237,7 @@ MP_WINAMP_WM_COMMAND(stop,WINAMP_CMD_STOP) MP_WINAMP_WM_COMMAND(next,WINAMP_CMD_NEXT) MP_WINAMP_WM_COMMAND(prev,WINAMP_CMD_PREV) MP_WINAMP_WM_COMMAND(pause,WINAMP_CMD_PAUSE) -MP_WINAMP_WM_COMMAND(quit,WINAMP_CMD_QUIT) +MP_WINAMP_WM_COMMAND(quit,WINAMP_CMD_TQUIT) int KviWinampInterface::length() @@ -280,7 +280,7 @@ int KviWinampInterface::channels() return ret; } -KviMediaPlayerInterface::PlayerStatus KviWinampInterface::status() +KviMediaPlayerInterface::PlayertqStatus KviWinampInterface::status() { HWND hWinamp = find_winamp(this); int ret = 1000; @@ -303,9 +303,9 @@ KviMediaPlayerInterface::PlayerStatus KviWinampInterface::status() return KviMediaPlayerInterface::Unknown; } -QString KviWinampInterface::mrl() +TQString KviWinampInterface::mrl() { - QString ret; + TQString ret; HWND hWinamp = find_winamp(this); if(hWinamp) { @@ -328,7 +328,7 @@ QString KviWinampInterface::mrl() szBuffer[i] = SendMessage(hWinamp,WM_USER,KVIRC_WM_USER,KVIRC_WM_USER_TRANSFER + i); } szBuffer[len] = '\0'; - QTextCodec *c=mediaplayer_get_codec(); + TQTextCodec *c=mediaplayer_get_codec(); if (c) ret = c->toUnicode(szBuffer); else ret=szBuffer; if(!ret.startsWith("http://",false)) @@ -338,9 +338,9 @@ QString KviWinampInterface::mrl() return ret; } -QString KviWinampInterface::nowPlaying() +TQString KviWinampInterface::nowPlaying() { - QString ret; + TQString ret; HWND hWinamp = find_winamp(this); if(hWinamp) { @@ -363,7 +363,7 @@ QString KviWinampInterface::nowPlaying() } szBuffer[ len ] = '\0'; - QTextCodec *c=mediaplayer_get_codec(); + TQTextCodec *c=mediaplayer_get_codec(); if (c) ret = c->toUnicode(szBuffer); else ret=szBuffer; } @@ -371,12 +371,12 @@ QString KviWinampInterface::nowPlaying() return ret; } -bool KviWinampInterface::playMrl(const QString &mrl) +bool KviWinampInterface::playMrl(const TQString &mrl) { HWND hWinamp = find_winamp(this); if(hWinamp) { - QTextCodec *c=mediaplayer_get_codec(); + TQTextCodec *c=mediaplayer_get_codec(); KviStr szMrl = c ? c->fromUnicode(mrl) : mrl.utf8(); COPYDATASTRUCT cds; cds.dwData = IPC_PLAYFILE; @@ -501,8 +501,8 @@ bool KviWinampInterface::setEqData(int &iPos, int &iVal) HWND hWinamp = find_winamp(this); if(hWinamp) { - SendMessage(hWinamp,WM_USER,iPos,IPC_GETEQDATA); - SendMessage(hWinamp,WM_USER,iVal,IPC_SETEQDATA); + SendMessage(hWinamp,WM_USER,iPos,IPC_GETETQDATA); + SendMessage(hWinamp,WM_USER,iVal,IPC_SETETQDATA); return true; } return false; @@ -514,7 +514,7 @@ int KviWinampInterface::getEqData(int &ival) int ret = -1; if(hWinamp) { - ret = SendMessage(hWinamp,WM_USER,ival,IPC_GETEQDATA); + ret = SendMessage(hWinamp,WM_USER,ival,IPC_GETETQDATA); return ret; } return ret; diff --git a/src/modules/mediaplayer/mp_winampinterface.h b/src/modules/mediaplayer/mp_winampinterface.h index ed2068db..3f2a62c2 100644 --- a/src/modules/mediaplayer/mp_winampinterface.h +++ b/src/modules/mediaplayer/mp_winampinterface.h @@ -43,11 +43,11 @@ virtual bool stop(); virtual bool pause(); virtual bool quit(); - virtual QString nowPlaying(); - virtual QString mrl(); + virtual TQString nowPlaying(); + virtual TQString mrl(); virtual int position(); virtual int length(); - virtual bool playMrl(const QString &mrl); + virtual bool playMrl(const TQString &mrl); virtual bool setVol(kvs_int_t &iVol); virtual int getVol(); virtual bool jumpTo(kvs_int_t &iPos); @@ -66,7 +66,7 @@ virtual bool getShuffle(); virtual bool setRepeat(bool &bVal); virtual bool setShuffle(bool &bVal); - virtual KviMediaPlayerInterface::PlayerStatus status(); + virtual KviMediaPlayerInterface::PlayertqStatus status(); }; MP_DECLARE_DESCRIPTOR(KviWinampInterface) diff --git a/src/modules/mediaplayer/mp_xmmsinterface.cpp b/src/modules/mediaplayer/mp_xmmsinterface.cpp index 532327af..730b4fe6 100644 --- a/src/modules/mediaplayer/mp_xmmsinterface.cpp +++ b/src/modules/mediaplayer/mp_xmmsinterface.cpp @@ -129,8 +129,8 @@ void * KviXmmsInterface::lookupSymbol(const char * szSymbolName) { if(!loadPlayerLibrary()) { - QString tmp; - KviQString::sprintf(tmp,__tr2qs_ctx("Can't load the player library (%Q)","mediaplayer"),&m_szPlayerLibraryName); + TQString tmp; + KviTQString::sprintf(tmp,__tr2qs_ctx("Can't load the player library (%Q)","mediaplayer"),&m_szPlayerLibraryName); setLastError(tmp); return 0; } @@ -138,8 +138,8 @@ void * KviXmmsInterface::lookupSymbol(const char * szSymbolName) void * symptr = kvi_library_symbol(m_hPlayerLibrary,szSymbolName); if(!symptr) { - QString tmp; - KviQString::sprintf(tmp,__tr2qs_ctx("Can't find symbol %s in %Q","mediaplayer"),szSymbolName,&m_szPlayerLibraryName); + TQString tmp; + KviTQString::sprintf(tmp,__tr2qs_ctx("Can't find symbol %s in %Q","mediaplayer"),szSymbolName,&m_szPlayerLibraryName); setLastError(tmp); } return symptr; @@ -256,7 +256,7 @@ bool KviXmmsInterface::setShuffle(bool &bVal) return true; } -KviMediaPlayerInterface::PlayerStatus KviXmmsInterface::status() +KviMediaPlayerInterface::PlayertqStatus KviXmmsInterface::status() { bool (*sym1)(int) = (bool (*)(int))lookupSymbol("xmms_remote_is_paused"); if(sym1) @@ -273,10 +273,10 @@ KviMediaPlayerInterface::PlayerStatus KviXmmsInterface::status() return KviMediaPlayerInterface::Unknown; } -bool KviXmmsInterface::playMrl(const QString &mrl) +bool KviXmmsInterface::playMrl(const TQString &mrl) { void (*sym)(int,char *) = (void (*)(int,char *))lookupSymbol("xmms_remote_playlist_add_url_string"); - KviQCString tmp = mrl.local8Bit(); + KviTQCString tmp = mrl.local8Bit(); if(!tmp.isEmpty()) { if(sym) @@ -300,24 +300,24 @@ bool KviXmmsInterface::playMrl(const QString &mrl) return true; } -QString KviXmmsInterface::nowPlaying() +TQString KviXmmsInterface::nowPlaying() { int (*sym)(int) = (int (*)(int))lookupSymbol("xmms_remote_get_playlist_pos"); - if(!sym)return QString::null; + if(!sym)return TQString(); int pos = sym(0); char * (*sym2)(int,int) = (char * (*)(int,int))lookupSymbol("xmms_remote_get_playlist_title"); - if(!sym2)return QString::null; - return QString::fromLocal8Bit(sym2(0,pos)); + if(!sym2)return TQString(); + return TQString::fromLocal8Bit(sym2(0,pos)); } -QString KviXmmsInterface::mrl() +TQString KviXmmsInterface::mrl() { int (*sym)(int) = (int (*)(int))lookupSymbol("xmms_remote_get_playlist_pos"); - if(!sym)return QString::null; + if(!sym)return TQString(); int pos = sym(0); char * (*sym2)(int,int) = (char * (*)(int,int))lookupSymbol("xmms_remote_get_playlist_file"); - if(!sym2)return QString::null; - QString ret = QString::fromLocal8Bit(sym2(0,pos)); + if(!sym2)return TQString(); + TQString ret = TQString::fromLocal8Bit(sym2(0,pos)); if(ret.length() > 1) if(ret[0] == '/')ret.prepend("file://"); return ret; diff --git a/src/modules/mediaplayer/mp_xmmsinterface.h b/src/modules/mediaplayer/mp_xmmsinterface.h index 15f81811..e2b2c38f 100644 --- a/src/modules/mediaplayer/mp_xmmsinterface.h +++ b/src/modules/mediaplayer/mp_xmmsinterface.h @@ -39,7 +39,7 @@ virtual ~KviXmmsInterface(); protected: kvi_library_t m_hPlayerLibrary; - QString m_szPlayerLibraryName; + TQString m_szPlayerLibraryName; const char ** m_pLibraryPaths; public: virtual int detect(bool bStart); @@ -52,10 +52,10 @@ virtual bool jumpTo(kvs_int_t &iPos); virtual bool setVol(kvs_int_t &iVol); virtual int getVol(); - virtual KviMediaPlayerInterface::PlayerStatus status(); - virtual QString nowPlaying(); - virtual bool playMrl(const QString &mrl); - virtual QString mrl(); + virtual KviMediaPlayerInterface::PlayertqStatus status(); + virtual TQString nowPlaying(); + virtual bool playMrl(const TQString &mrl); + virtual TQString mrl(); virtual int getPlayListPos(); virtual int position(); virtual int length(); |