aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomasz Moń2009-09-25 15:06:14 +0000
committerGravatar Tomasz Moń2009-09-25 15:06:14 +0000
commit7a977b316bd81669bcd99ac8eb7e197840dd7fc0 (patch)
treea2bc3acbff5a5db58201ba0d35efb3d14467685a
parentmore fixes to pytho module. now it is able to correctly run python code :) (diff)
downloadKVIrc-7a977b316bd81669bcd99ac8eb7e197840dd7fc0.tar.gz
KVIrc-7a977b316bd81669bcd99ac8eb7e197840dd7fc0.tar.bz2
KVIrc-7a977b316bd81669bcd99ac8eb7e197840dd7fc0.zip
Merge xmms2interface into mp_mprisinterface as it's simply an inheritance of KviMPRISInterface
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3526 17fca916-40b9-46aa-a4ea-0a15b648b75c
-rw-r--r--src/modules/mediaplayer/CMakeLists.txt1
-rw-r--r--src/modules/mediaplayer/libkvimediaplayer.cpp1
-rw-r--r--src/modules/mediaplayer/mp_mprisinterface.cpp22
-rw-r--r--src/modules/mediaplayer/mp_mprisinterface.h7
-rw-r--r--src/modules/mediaplayer/mp_xmms2interface.cpp45
-rw-r--r--src/modules/mediaplayer/mp_xmms2interface.h43
6 files changed, 29 insertions, 90 deletions
diff --git a/src/modules/mediaplayer/CMakeLists.txt b/src/modules/mediaplayer/CMakeLists.txt
index 6849a5182..115b71a66 100644
--- a/src/modules/mediaplayer/CMakeLists.txt
+++ b/src/modules/mediaplayer/CMakeLists.txt
@@ -8,7 +8,6 @@ SET(kvimediaplayer_SRCS
mp_xmmsinterface.cpp
mp_amipinterface.cpp
mp_mprisinterface.cpp
- mp_xmms2interface.cpp
)
# After this call, files will be moc'ed to moc_kvi_*.cpp
diff --git a/src/modules/mediaplayer/libkvimediaplayer.cpp b/src/modules/mediaplayer/libkvimediaplayer.cpp
index b43c5bb9c..bd6848255 100644
--- a/src/modules/mediaplayer/libkvimediaplayer.cpp
+++ b/src/modules/mediaplayer/libkvimediaplayer.cpp
@@ -29,7 +29,6 @@
#include "mp_mprisinterface.h"
#include "mp_winampinterface.h"
#include "mp_xmmsinterface.h"
-#include "mp_xmms2interface.h"
#include "kvi_module.h"
#include "kvi_options.h"
diff --git a/src/modules/mediaplayer/mp_mprisinterface.cpp b/src/modules/mediaplayer/mp_mprisinterface.cpp
index a4447bf62..08c9c0b1c 100644
--- a/src/modules/mediaplayer/mp_mprisinterface.cpp
+++ b/src/modules/mediaplayer/mp_mprisinterface.cpp
@@ -396,6 +396,11 @@ KviMediaPlayerInterface::PlayerStatus KviAudaciousInterface::status()
int KviAudaciousInterface::length()
{
+ int length = KviMPRISInterface::length();
+ if (length != -1)
+ return length;
+
+ /* compability with older versions */
MPRIS_CALL_METHOD("GetMetadata", -1)
foreach (QVariant v, reply.arguments()) {
@@ -493,4 +498,21 @@ KviQmmpInterface::KviQmmpInterface()
m_szServiceName = "org.mpris.qmmp";
}
+/* xmms2 interface */
+MP_IMPLEMENT_DESCRIPTOR(
+ KviXmms2Interface,
+ "xmms2",
+ __tr2qs_ctx(
+ "An interface to the xmms2 media player.\n" \
+ "Download it from http://wiki.xmms2.xmms.se/index.php/Main_Page\n",
+ "mediaplayer"
+ )
+)
+
+KviXmms2Interface::KviXmms2Interface()
+: KviMPRISInterface()
+{
+ m_szServiceName = "org.mpris.xmms2";
+}
+
#endif //!COMPILE_ON_WINDOWS
diff --git a/src/modules/mediaplayer/mp_mprisinterface.h b/src/modules/mediaplayer/mp_mprisinterface.h
index 7e1315c0f..67d82dff5 100644
--- a/src/modules/mediaplayer/mp_mprisinterface.h
+++ b/src/modules/mediaplayer/mp_mprisinterface.h
@@ -96,10 +96,17 @@
KviQmmpInterface();
};
+ class KviXmms2Interface : public KviMPRISInterface
+ {
+ public:
+ KviXmms2Interface();
+ };
+
MP_DECLARE_DESCRIPTOR(KviAudaciousInterface)
MP_DECLARE_DESCRIPTOR(KviBmpxInterface)
MP_DECLARE_DESCRIPTOR(KviAmarok2Interface)
MP_DECLARE_DESCRIPTOR(KviQmmpInterface)
+ MP_DECLARE_DESCRIPTOR(KviXmms2Interface)
#endif //!COMPILE_ON_WINDOWS
diff --git a/src/modules/mediaplayer/mp_xmms2interface.cpp b/src/modules/mediaplayer/mp_xmms2interface.cpp
deleted file mode 100644
index 92dcd9153..000000000
--- a/src/modules/mediaplayer/mp_xmms2interface.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//=============================================================================
-//
-// File : mp_xmms2interface.cpp
-// Creation date : Thu 06 Dec 2007 14:20:02 by Elvio Basello
-//
-// This file is part of the KVIrc IRC client distribution
-// Copyright (C) 2008 Elvio Basello <hellvis69 at netsons dot org>
-//
-// This program is FREE software. You can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your opinion) any later version.
-//
-// This program is distributed in the HOPE that it will be USEFUL,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-// See the GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-//=============================================================================
-
-#include "mp_xmms2interface.h"
-#if (!defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MAC) && !defined(COMPILE_ON_MINGW))
-#include "kvi_locale.h"
-
-MP_IMPLEMENT_DESCRIPTOR(
- KviXmms2Interface,
- "xmms2",
- __tr2qs_ctx(
- "An interface to the xmms2 media player.\n" \
- "Download it from http://wiki.xmms2.xmms.se/index.php/Main_Page\n",
- "mediaplayer"
- )
-)
-
-KviXmms2Interface::KviXmms2Interface()
-: KviMPRISInterface()
-{
- m_szServiceName = "org.mpris.xmms2";
-}
-
-#endif //!COMPILE_ON_WINDOWS
diff --git a/src/modules/mediaplayer/mp_xmms2interface.h b/src/modules/mediaplayer/mp_xmms2interface.h
deleted file mode 100644
index 9f9334920..000000000
--- a/src/modules/mediaplayer/mp_xmms2interface.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef _MP_XMMS2INTERFACE_H_
-#define _MP_XMMS2INTERFACE_H_
-//=============================================================================
-//
-// File : mp_xmms2interface.h
-// Creation date : Thu 06 Dec 2007 14:20:02 by Elvio Basello
-//
-// This file is part of the KVIrc IRC client distribution
-// Copyright (C) 2008 Elvio Basello <hellvis69 at netsons dot org>
-//
-// This program is FREE software. You can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your opinion) any later version.
-//
-// This program is distributed in the HOPE that it will be USEFUL,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-// See the GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-//=============================================================================
-
-#include "kvi_settings.h"
-#include "mp_mprisinterface.h"
-
-#if (!defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MAC) && !defined(COMPILE_ON_MINGW))
- #include <QtDBus/QtDBus>
-
- class KviXmms2Interface : public KviMPRISInterface
- {
- public:
- KviXmms2Interface();
- };
-
- MP_DECLARE_DESCRIPTOR(KviXmms2Interface)
-
-#endif //!COMPILE_ON_WINDOWS
-
-#endif //!_MP_XMMS2INTERFACE_H_