not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / plasma / dataengines / nowplaying / playerinterface / mpris / mpris_p.h
blob0fc9471dcd40be31bcbddd755269885f62c843c9
1 /*
2 * Copyright 2008 Alex Merry <alex.merry@kdemail.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef MPRIS_P_H
18 #define MPRIS_P_H
20 #include "mpris.h"
21 #include "mprisdbustypes.h"
22 #include "../player.h"
24 #include <QVariantMap>
26 class MprisPlayer;
28 class Mpris : public QObject, public Player
30 Q_OBJECT
32 public:
33 /**
34 * @param name the media player name.
36 explicit Mpris(const QString& name,
37 PlayerFactory* factory = 0);
38 ~Mpris();
40 bool isRunning();
41 State state();
42 QString artist();
43 QString album();
44 QString title();
45 int trackNumber();
46 QString comment();
47 QString genre();
48 int length();
49 int position();
50 float volume();
51 QPixmap artwork();
53 bool canPlay();
54 void play();
55 bool canPause();
56 void pause();
57 bool canStop();
58 void stop();
59 bool canGoPrevious();
60 void previous();
61 bool canGoNext();
62 void next();
64 bool canSetVolume();
65 void setVolume(qreal volume);
67 bool canSeek();
68 void seek(int time);
70 private Q_SLOTS:
71 void trackChanged(const QVariantMap& metadata);
72 void stateChanged(MprisDBusStatus state);
73 void capsChanged(int caps);
75 private:
76 void setup();
77 MprisPlayer* m_player;
79 QString m_playerName;
80 QVariantMap m_metadata;
81 State m_state;
82 DBusCaps m_caps;
83 QMap<QString,QString> m_artfiles;
86 #endif // MPRIS_P_H