2 * SomePlayer - An alternate music player for Maemo 5
3 * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@gmail.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #include <QtCore/QObject>
24 #include <QtDBus/QtDBus>
27 #define _DBUS_ACTION_TIMEOUT_ (500)
30 template<class T> class QList;
31 template<class Key, class Value> class QMap;
37 * Adaptor class for interface ru.somebody.someplayer
39 class DBusAdaptop: public QDBusAbstractAdaptor
42 Q_CLASSINFO("D-Bus Interface", "ru.somebody.someplayer")
43 Q_CLASSINFO("D-Bus Introspection", ""
44 " <interface name=\"ru.somebody.someplayer\">\n"
45 " <method name=\"prev\">\n"
46 " <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
48 " <method name=\"next\">\n"
49 " <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
51 " <method name=\"toggle\">\n"
52 " <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
54 " <method name=\"stop\">\n"
55 " <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
57 " <method name=\"artist\">\n"
58 " <arg direction=\"out\" type=\"s\"/>\n"
60 " <method name=\"album\">\n"
61 " <arg direction=\"out\" type=\"s\"/>\n"
63 " <method name=\"title\">\n"
64 " <arg direction=\"out\" type=\"s\"/>\n"
69 DBusAdaptop(QObject *parent);
70 virtual ~DBusAdaptop();
73 public Q_SLOTS: // METHODS
76 Q_NOREPLY void next();
77 Q_NOREPLY void prev();
78 Q_NOREPLY void stop();
80 Q_NOREPLY void toggle();
81 Q_NOREPLY void pause();
82 Q_NOREPLY void playIfPaused();
84 void processBTSignal(QString, QString);