KVIrc  4.9.2
DeveloperAPIs
Macros | Functions | Variables
libkvimediaplayer.cpp File Reference
#include "MpInterface.h"
#include "MpAmipInterface.h"
#include "MpMprisInterface.h"
#include "MpWinampInterface.h"
#include "MpXmmsInterface.h"
#include "KviModule.h"
#include "KviOptions.h"
#include "KviLocale.h"
#include "kvi_out.h"
#include <QUrl>

Macros

#define MP_KVS_COMMAND(__name)   static bool mediaplayer_kvs_cmd_##__name(KviKvsModuleCommandCall * c)
 
#define MP_KVS_FAIL_ON_NO_INTERFACE
 
#define MP_KVS_FUNCTION(__name)   static bool mediaplayer_kvs_fnc_##__name(KviKvsModuleFunctionCall * c)
 
#define MP_KVS_REGCMD(__name, __stringname)   KVSM_REGISTER_SIMPLE_COMMAND(m, __stringname, mediaplayer_kvs_cmd_##__name)
 
#define MP_KVS_REGFNC(__name, __stringname)   KVSM_REGISTER_FUNCTION(m, __stringname, mediaplayer_kvs_fnc_##__name)
 
#define MP_KVS_SIMPLE_BOOL_FUNCTION(__name, __ifacecommand)
 
#define MP_KVS_SIMPLE_COMMAND(__name, __ifacecommand)
 
#define MP_KVS_SIMPLE_INT_FUNCTION(__name, __ifacecommand)
 
#define MP_KVS_SIMPLE_STRING_FUNCTION(__name, __ifacecommand)
 

Functions

static MpInterfaceauto_detect_player (KviWindow *pOut=nullptr)
 
static bool mediaplayer_module_can_unload (KviModule *)
 
static bool mediaplayer_module_cleanup (KviModule *)
 
static bool mediaplayer_module_ctrl (KviModule *, const char *operation, void *param)
 
static bool mediaplayer_module_init (KviModule *m)
 
 MP_KVS_COMMAND (detect)
 
 MP_KVS_COMMAND (setPlayer)
 
 MP_KVS_COMMAND (playMrl)
 
 MP_KVS_COMMAND (amipExec)
 
 MP_KVS_COMMAND (jumpTo)
 
 MP_KVS_COMMAND (setVol)
 
 MP_KVS_COMMAND (setPlayListPos)
 
 MP_KVS_COMMAND (setEqData)
 
 MP_KVS_COMMAND (setRepeat)
 
 MP_KVS_COMMAND (setShuffle)
 
 MP_KVS_FUNCTION (player)
 
 MP_KVS_FUNCTION (playerList)
 
 MP_KVS_FUNCTION (getEqData)
 
 MP_KVS_FUNCTION (localFile)
 
 MP_KVS_FUNCTION (amipEval)
 
 MP_KVS_FUNCTION (status)
 

Variables

static KviPointerList
< MpInterfaceDescriptor > * 
g_pDescriptorList = nullptr
 
static MpInterfaceg_pMPInterface = nullptr
 

Macro Definition Documentation

#define MP_KVS_COMMAND (   __name)    static bool mediaplayer_kvs_cmd_##__name(KviKvsModuleCommandCall * c)
#define MP_KVS_FAIL_ON_NO_INTERFACE
Value:
{ \
c->warning(__tr2qs_ctx("No mediaplayer interface selected. Try /mediaplayer.detect", "mediaplayer")); \
return true; \
}
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
static MpInterface * g_pMPInterface
Definition: libkvimediaplayer.cpp:41
audacious __tr2qs_ctx("An interface for the UNIX Audacious media player.\n""Download it from http://audacious-media-player.org\n","mediaplayer")) static const char *xmms_lib_names[]

Referenced by MP_KVS_COMMAND(), and MP_KVS_FUNCTION().

#define MP_KVS_FUNCTION (   __name)    static bool mediaplayer_kvs_fnc_##__name(KviKvsModuleFunctionCall * c)
#define MP_KVS_REGCMD (   __name,
  __stringname 
)    KVSM_REGISTER_SIMPLE_COMMAND(m, __stringname, mediaplayer_kvs_cmd_##__name)

Referenced by mediaplayer_module_init().

#define MP_KVS_REGFNC (   __name,
  __stringname 
)    KVSM_REGISTER_FUNCTION(m, __stringname, mediaplayer_kvs_fnc_##__name)

Referenced by mediaplayer_module_init().

#define MP_KVS_SIMPLE_BOOL_FUNCTION (   __name,
  __ifacecommand 
)
Value:
MP_KVS_FUNCTION(__name) \
{ \
MP_KVS_FAIL_ON_NO_INTERFACE \
bool bRet = g_pMPInterface->__ifacecommand(); \
c->returnValue()->setBoolean(bRet); \
return true; \
}
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
static MpInterface * g_pMPInterface
Definition: libkvimediaplayer.cpp:41
#define MP_KVS_FUNCTION(__name)
Definition: libkvimediaplayer.cpp:119
#define MP_KVS_SIMPLE_COMMAND (   __name,
  __ifacecommand 
)
Value:
MP_KVS_COMMAND(__name) \
{ \
if(!g_pMPInterface->__ifacecommand()) \
{ \
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"); \
c->warning(tmp); \
} \
} \
return true; \
}
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
#define KVSM_PARAMETERS_BEGIN(pCall)
Definition: KviKvsModuleInterface.h:236
if(m_pFile) delete m_pFile
static MpInterface * g_pMPInterface
Definition: libkvimediaplayer.cpp:41
audacious __tr2qs_ctx("An interface for the UNIX Audacious media player.\n""Download it from http://audacious-media-player.org\n","mediaplayer")) static const char *xmms_lib_names[]
#define KVSM_PARAMETERS_END(pCall)
Definition: KviKvsModuleInterface.h:239
const QString & lastError() const
Definition: MpInterface.h:43
#define MP_KVS_COMMAND(__name)
Definition: libkvimediaplayer.cpp:118
#define MP_KVS_SIMPLE_INT_FUNCTION (   __name,
  __ifacecommand 
)
Value:
MP_KVS_FUNCTION(__name) \
{ \
MP_KVS_FAIL_ON_NO_INTERFACE \
int iRet = g_pMPInterface->__ifacecommand(); \
c->returnValue()->setInteger(iRet); \
return true; \
}
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
static MpInterface * g_pMPInterface
Definition: libkvimediaplayer.cpp:41
#define MP_KVS_FUNCTION(__name)
Definition: libkvimediaplayer.cpp:119
#define MP_KVS_SIMPLE_STRING_FUNCTION (   __name,
  __ifacecommand 
)
Value:
MP_KVS_FUNCTION(__name) \
{ \
MP_KVS_FAIL_ON_NO_INTERFACE \
QString szRet = g_pMPInterface->__ifacecommand(); \
c->returnValue()->setString(szRet); \
return true; \
}
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
static MpInterface * g_pMPInterface
Definition: libkvimediaplayer.cpp:41
#define MP_KVS_FUNCTION(__name)
Definition: libkvimediaplayer.cpp:119

Function Documentation

static MpInterface* auto_detect_player ( KviWindow pOut = nullptr)
static
static bool mediaplayer_module_can_unload ( KviModule )
static
static bool mediaplayer_module_cleanup ( KviModule )
static

References g_pDescriptorList.

static bool mediaplayer_module_ctrl ( KviModule ,
const char *  operation,
void *  param 
)
static
static bool mediaplayer_module_init ( KviModule m)
static
MP_KVS_COMMAND ( detect  )

References auto_detect_player(), and c.

MP_KVS_COMMAND ( setPlayer  )
MP_KVS_COMMAND ( playMrl  )
MP_KVS_COMMAND ( amipExec  )
MP_KVS_COMMAND ( jumpTo  )
MP_KVS_COMMAND ( setVol  )
MP_KVS_COMMAND ( setPlayListPos  )
MP_KVS_COMMAND ( setEqData  )
MP_KVS_COMMAND ( setRepeat  )
MP_KVS_COMMAND ( setShuffle  )
MP_KVS_FUNCTION ( player  )
MP_KVS_FUNCTION ( playerList  )
MP_KVS_FUNCTION ( getEqData  )
MP_KVS_FUNCTION ( localFile  )
MP_KVS_FUNCTION ( amipEval  )
MP_KVS_FUNCTION ( status  )

Variable Documentation

KviPointerList<MpInterfaceDescriptor>* g_pDescriptorList = nullptr
static
MpInterface* g_pMPInterface = nullptr
static