forked from RJ/musickit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWebkitApi.h
62 lines (46 loc) · 1.14 KB
/
WebkitApi.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
#ifndef WEBKITAPI_H
#define WEBKITAPI_H
#include <qobject.h>
#include <qplaydar.h>
#include <player/playengine.h>
#include <qjson/parser.h>
#include <qjson/serializer.h>
#include <qjson/qobjecthelper.h>
#include <spoon/SpoonCore.h>
class QWebView;
class QWebFrame;
#include <tr1/memory>
class WebkitApi : public QObject
{
Q_OBJECT
public:
WebkitApi( Playdar::Client * client, Playengine * p, QObject * );
void setWebView( QWebView *view );
signals:
void tick(int, int);
void stateChange(QString);
void buffering(int);
void volumeChanged(int);
// QID, result obj json
void result(QString, QString);
public slots:
// player stuff
void togglePause();
void setVolume(int);
void play(QString);
void stop();
void log(QString);
// playdar stuff
void resolve(const QString &str);
private slots:
void attachObject();
void reemitStatusChanged(Playengine::STATUS);
void onResult(Playdar::q_ptr, Playdar::r_ptr);
private:
QWebFrame *frame;
Playdar::Client * pc;
Playengine * player;
QJson::Serializer serializer;
SpoonCore* spoonCore;
};
#endif // WEBKITAPI_H