summaryrefslogtreecommitdiffstats
path: root/juk/jukIface.h
blob: e119b25e6862180dbc4c842b495c6e8143ad737a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#ifndef JUKIFACE_H
#define JUKIFACE_H

#include <dcopobject.h>
#include <qstringlist.h>
#include <qpixmap.h>

class CollectionIface : public DCOPObject
{
    K_DCOP
k_dcop:
    void openFile(const QString &file) { open(file); }
    void openFile(const QStringList &files) { open(files); }
    void openFile(const QString &playlist, const QString &file) { open(playlist, file); }
    void openFile(const QString &playlist, const QStringList &files) { open(playlist, files); }

    virtual QStringList playlists() const = 0;
    virtual void createPlaylist(const QString &) = 0;
    virtual void remove() = 0;

    virtual void removeTrack(const QString &playlist, const QString &file) { removeTrack(playlist, QStringList(file)); }
    virtual void removeTrack(const QString &playlist, const QStringList &files) = 0;

    virtual QString playlist() const = 0;
    virtual QString playingPlaylist() const = 0;
    virtual void setPlaylist(const QString &playlist) = 0;

    virtual QStringList playlistTracks(const QString &playlist) const = 0;
    virtual QString trackProperty(const QString &file, const QString &property) const = 0;

    virtual QPixmap trackCover(const QString &file, const QString &size = "Small") const = 0;

protected:
    CollectionIface() : DCOPObject("Collection") {}
    virtual void open(const QStringList &files) = 0;
    virtual void open(const QString &playlist, const QStringList &files) = 0;
};

class PlayerIface : public DCOPObject
{
    K_DCOP
k_dcop:
    virtual bool playing() const = 0;
    virtual bool paused() const = 0;
    virtual float volume() const = 0;
    virtual int status() const = 0;
    
    virtual QStringList trackProperties() = 0;
    virtual QString trackProperty(const QString &property) const = 0;
    virtual QPixmap trackCover(const QString &size = "Small") const = 0;

    virtual QString currentFile() const
    {
        return trackProperty("Path");
    }

    virtual void play() = 0;
    virtual void play(const QString &file) = 0;
    virtual void pause() = 0;
    virtual void stop() = 0;
    virtual void playPause() = 0;

    virtual void back() = 0;
    virtual void forward() = 0;
    virtual void seekBack() = 0;
    virtual void seekForward() = 0;

    virtual void volumeUp() = 0;
    virtual void volumeDown() = 0;
    virtual void mute() = 0;
    virtual void setVolume(float volume) = 0;
    virtual void seek(int time) = 0;

    virtual QString playingString() const = 0;
    virtual int currentTime() const = 0;
    virtual int totalTime() const = 0;

    /**
     * @return The current player mode.
     * @see setRandomPlayMode()
     */
    virtual QString randomPlayMode() const = 0;

    /**
     * Sets the player mode to one of normal, random play, or album
     * random play, depending on @p randomMode.
     * "NoRandom" -> Normal
     * "Random" -> Random
     * "AlbumRandom" -> Album Random
     */
    virtual void setRandomPlayMode(const QString &randomMode) = 0;

protected:
    PlayerIface() : DCOPObject("Player") {}
};

class SearchIface : public DCOPObject
{
    K_DCOP
k_dcop:
    virtual QString searchText() const = 0;
    virtual void setSearchText(const QString &text) = 0;

protected:
    SearchIface() : DCOPObject("Search") {}
};

#endif