This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmms2connector.h
76 lines (60 loc) · 1.5 KB
/
xmms2connector.h
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
#ifndef XMMS2CONNECTOR_H
#define XMMS2CONNECTOR_H
#include <QtCore>
typedef struct xmmsc_connection_St xmmsc_connection_t;
typedef struct xmmsv_St xmmsv_t;
/*
typedef struct
{
const char *artist;
const char *album;
const char *title;
const char *url;
const char *mime;
const char *comment;
int32_t duration;
int32_t isvbr;
int32_t bitrate;
int32_t size;
int _currentStatus;
bool isNothingPlaying;
} SongData;
*/
\
typedef struct
{
QString artist, album, title;
bool isNothingPlaying;
} SongData;
class Xmms2Connector : public QObject
{
Q_OBJECT
xmmsc_connection_t *connection;
SongData _currentSongData;
int _currentStatus;
SongData extractSongData(int id);
static int on_playback_track_loaded(xmmsv_t* value, void* user_data);
static int on_playback_status_changed(xmmsv_t *value, void *user_data);
static int on_playback_cur_track_changed(xmmsv_t* value, void* user_data);
public:
enum Status { Playing, Paused, Stopped };
explicit Xmms2Connector(QObject *parent);
~Xmms2Connector();
SongData currentSong();
Status currentStatus();
public slots:
bool xmms2Connect();
void refresh();
void startPlayback();
void pausePlayback();
void stopPlayback();
void jumpToNextSong();
void jumpToPreviousSong();
signals:
void currentSongChanged(SongData song);
void statusChanged(Status status);
void started();
void paused();
void stopped();
};
#endif // XMMS2CONNECTOR_H