~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to plasma/generic/dataengines/nowplaying/playerinterface/mpris/mpris_p.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2008  Alex Merry <alex.merry@kdemail.net>
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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/>.
 
16
 */
 
17
#ifndef MPRIS_P_H
 
18
#define MPRIS_P_H
 
19
 
 
20
#include "mpris.h"
 
21
#include "mprisdbustypes.h"
 
22
#include "../player.h"
 
23
 
 
24
#include <QVariantMap>
 
25
 
 
26
class MprisPlayer;
 
27
 
 
28
class Mpris : public QObject, public Player
 
29
{
 
30
    Q_OBJECT
 
31
 
 
32
public:
 
33
    /**
 
34
     * @param name     the media player name.
 
35
     */
 
36
    explicit Mpris(const QString& name,
 
37
                   PlayerFactory* factory = 0);
 
38
    ~Mpris();
 
39
 
 
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
    QString lyrics();
 
49
    int length();
 
50
    int position();
 
51
    float volume();
 
52
    QPixmap artwork();
 
53
 
 
54
    bool canPlay();
 
55
    void play();
 
56
    bool canPause();
 
57
    void pause();
 
58
    bool canStop();
 
59
    void stop();
 
60
    bool canGoPrevious();
 
61
    void previous();
 
62
    bool canGoNext();
 
63
    void next();
 
64
 
 
65
    bool canSetVolume();
 
66
    void setVolume(qreal volume);
 
67
 
 
68
    bool canSeek();
 
69
    void seek(int time);
 
70
 
 
71
private Q_SLOTS:
 
72
    void trackChanged(const QVariantMap& metadata);
 
73
    void stateChanged(MprisDBusStatus state);
 
74
    void capsChanged(int caps);
 
75
 
 
76
private:
 
77
    void setup();
 
78
    MprisPlayer* m_player;
 
79
 
 
80
    QString m_playerName;
 
81
    QVariantMap m_metadata;
 
82
    State m_state;
 
83
    DBusCaps m_caps;
 
84
    QMap<QString,QString> m_artfiles;
 
85
    bool m_artworkLoaded;
 
86
    QPixmap m_artwork;
 
87
};
 
88
 
 
89
#endif // MPRIS_P_H