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>
28 #define _DBUS_ACTION_TIMEOUT_ (500)
31 template<class T> class QList;
32 template<class Key, class Value> class QMap;
38 * Adaptor class for interface ru.somebody.someplayer
40 class DBusAdaptop: public QDBusAbstractAdaptor
43 Q_CLASSINFO("D-Bus Interface", "ru.somebody.someplayer")
44 Q_CLASSINFO("D-Bus Introspection", ""
45 " <interface name=\"ru.somebody.someplayer\">\n"
46 " <method name=\"prev\">\n"
47 " <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
49 " <method name=\"next\">\n"
50 " <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
52 " <method name=\"toggle\">\n"
53 " <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
55 " <method name=\"stop\">\n"
56 " <annotation value=\"true\" name=\"org.freedesktop.DBus.Method.NoReply\"/>\n"
58 " <method name=\"artist\">\n"
59 " <arg direction=\"out\" type=\"s\"/>\n"
61 " <method name=\"album\">\n"
62 " <arg direction=\"out\" type=\"s\"/>\n"
64 " <method name=\"title\">\n"
65 " <arg direction=\"out\" type=\"s\"/>\n"
67 " <method name=\"title_artist_album\">\n"
68 " <arg direction=\"out\" type=\"s\"/>\n"
70 " <method name=\"state\">\n"
71 " <arg direction=\"out\" type=\"s\"/>\n"
73 " <method name=\"albumart\">\n"
74 " <arg direction=\"out\" type=\"s\"/>\n"
79 DBusAdaptop(QObject *parent);
80 virtual ~DBusAdaptop();
83 public Q_SLOTS: // METHODS
86 Q_NOREPLY void next();
87 Q_NOREPLY void prev();
88 Q_NOREPLY void stop();
90 QString title_artist_album();
93 Q_NOREPLY void toggle();
94 Q_NOREPLY void pause();
95 Q_NOREPLY void playIfPaused();
97 void processBTSignal(QString, QString);
98 void processBTConnect(QString, QDBusVariant);
101 void albumArt(QString path);
104 bool _is_bt_conencted;