diff options
| author | 2007-05-15 05:50:03 +0000 | |
|---|---|---|
| committer | 2007-05-15 05:50:03 +0000 | |
| commit | 49e9ae5536b746f3243d46f09235abbd9093d7f6 (patch) | |
| tree | d9cbae7415762934425e8c11622affe939d94bb1 /src | |
| parent | *AUTOMATICALLY* updated KVI_SOURCES_DATE variable (diff) | |
| download | KVIrc-49e9ae5536b746f3243d46f09235abbd9093d7f6.tar.gz KVIrc-49e9ae5536b746f3243d46f09235abbd9093d7f6.tar.bz2 KVIrc-49e9ae5536b746f3243d46f09235abbd9093d7f6.zip | |
amip support for mediaplayer module by Serge Baranov (sbaranov at gmail dot com)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@566 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/mediaplayer/libkvimediaplayer.cpp | 55 | ||||
| -rw-r--r-- | src/modules/mediaplayer/mediaplayer_vc05.vcproj | 8 | ||||
| -rw-r--r-- | src/modules/mediaplayer/mp_interface.cpp | 10 | ||||
| -rw-r--r-- | src/modules/mediaplayer/mp_interface.h | 2 |
4 files changed, 70 insertions, 5 deletions
diff --git a/src/modules/mediaplayer/libkvimediaplayer.cpp b/src/modules/mediaplayer/libkvimediaplayer.cpp index 4eb227f3f..e181233b9 100644 --- a/src/modules/mediaplayer/libkvimediaplayer.cpp +++ b/src/modules/mediaplayer/libkvimediaplayer.cpp @@ -27,6 +27,7 @@ #include "mp_xmmsinterface.h" #include "mp_amarokinterface.h" #include "mp_winampinterface.h" +#include "mp_amipinterface.h" #include "mp_jukinterface.h" #include "kvi_module.h" @@ -542,6 +543,29 @@ MP_KVS_COMMAND(playMrl) return true; } +MP_KVS_COMMAND(amipExec) +{ + QString szMrl; + + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("player",KVS_PT_STRING,0,szMrl) + KVSM_PARAMETERS_END(c) + + MP_KVS_FAIL_ON_NO_INTERFACE + if(!g_pMPInterface->amipExec(szMrl)) + { + 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"); + tmp += g_pMPInterface->lastError(); + c->warning(tmp); + } + } + + return true; +} + /* @doc: mediaplayer.jumpTo @@ -1335,6 +1359,23 @@ MP_KVS_FUNCTION(localFile) return true; } +MP_KVS_FUNCTION(amipEval) +{ + QString 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); + if(szRet.isEmpty())return true; + + c->returnValue()->setString(szRet); + + return true; +} + /* @doc: mediaplayer.status @type: @@ -1520,6 +1561,7 @@ static bool mediaplayer_module_init( KviModule * m ) #endif #ifdef COMPILE_ON_WINDOWS + g_pDescriptorList->append(MP_CREATE_DESCRIPTOR(KviAmipInterface)); g_pDescriptorList->append(MP_CREATE_DESCRIPTOR(KviWinampInterface)); #endif @@ -1557,6 +1599,7 @@ static bool mediaplayer_module_init( KviModule * m ) MP_KVS_REGCMD(pause,"pause"); MP_KVS_REGCMD(detect,"detect"); MP_KVS_REGCMD(playMrl,"playMrl"); + MP_KVS_REGCMD(amipExec,"amipExec"); MP_KVS_REGCMD(hide,"hide"); MP_KVS_REGCMD(show,"show"); MP_KVS_REGCMD(minimize,"minimize"); @@ -1586,6 +1629,7 @@ static bool mediaplayer_module_init( KviModule * m ) MP_KVS_REGFNC(player,"player"); MP_KVS_REGFNC(playerList,"playerList"); MP_KVS_REGFNC(localFile,"localFile"); + MP_KVS_REGFNC(amipEval,"amipEval"); MP_KVS_REGFNC(channels,"channels"); MP_KVS_REGFNC(getListLength,"getListLength"); MP_KVS_REGFNC(getPlayListPos,"getPlayListPos"); @@ -1641,13 +1685,14 @@ static bool mediaplayer_module_ctrl(KviModule * m,const char * operation,void * KVIRC_MODULE( - "mpediaplayer", - "1.0.0", - "Copyright (C) 2001-2005 Szymon Stefanek (pragma at kvirc dot net), " \ + "mediaplayer", + "1.1.0", + "Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net), " \ "Christoph Thielecke (crissi99 at gmx dot de)," \ "Tonino Imbesi (grifisx at barmes dot org)," \ - "Alessandro Carbone (noldor at barmes dot org),", \ - "Alexey Uzhva (wizard at opendoor dot ru)" + "Alessandro Carbone (noldor at barmes dot org)," \ + "Alexey Uzhva (wizard at opendoor dot ru), " \ + "Serge Baranov (sbaranov at gmail dot com)", "Interface to various media players", mediaplayer_module_init, mediaplayer_module_can_unload, diff --git a/src/modules/mediaplayer/mediaplayer_vc05.vcproj b/src/modules/mediaplayer/mediaplayer_vc05.vcproj index 0b5e62c3d..7385cdf9d 100644 --- a/src/modules/mediaplayer/mediaplayer_vc05.vcproj +++ b/src/modules/mediaplayer/mediaplayer_vc05.vcproj @@ -210,6 +210,10 @@ >
</File>
<File
+ RelativePath=".\mp_amipinterface.cpp"
+ >
+ </File>
+ <File
RelativePath=".\mp_dcopinterface.cpp"
>
</File>
@@ -244,6 +248,10 @@ >
</File>
<File
+ RelativePath=".\mp_amipinterface.h"
+ >
+ </File>
+ <File
RelativePath=".\mp_dcopinterface.h"
>
</File>
diff --git a/src/modules/mediaplayer/mp_interface.cpp b/src/modules/mediaplayer/mp_interface.cpp index 2902a68df..ff3d6a406 100644 --- a/src/modules/mediaplayer/mp_interface.cpp +++ b/src/modules/mediaplayer/mp_interface.cpp @@ -76,6 +76,11 @@ QString KviMediaPlayerInterface::getLocalFile() return QString::null;
}
+QString KviMediaPlayerInterface::amipEval(const QString &cmd)
+{
+ return QString::null;
+}
+
#define SCAN_MP3_FILE \
QString f = getLocalFile(); \
if(f.isEmpty())return QString::null; \
@@ -133,6 +138,11 @@ bool KviMediaPlayerInterface::playMrl(const QString &mrl) return false;
}
+bool KviMediaPlayerInterface::amipExec(const QString &cmd)
+{
+ return false;
+}
+
bool KviMediaPlayerInterface::setVol(int &iVol)
{
return false;
diff --git a/src/modules/mediaplayer/mp_interface.h b/src/modules/mediaplayer/mp_interface.h index 14e75caa2..128db216a 100644 --- a/src/modules/mediaplayer/mp_interface.h +++ b/src/modules/mediaplayer/mp_interface.h @@ -90,6 +90,8 @@ public: // 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 amipExec(const QString &cmd); + virtual QString amipEval(const QString &cmd); // this is functions to hide,show and minimize the player interface virtual bool hide(); virtual bool show(); |
