ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
PlayerRemote.h
1/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia
2
3This file is part of Ginga (Ginga-NCL).
4
5Ginga is free software: you can redistribute it and/or modify it
6under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10Ginga is distributed in the hope that it will be useful, but WITHOUT
11ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Ginga. If not, see <https://www.gnu.org/licenses/>. */
17
18#ifndef MEDIA_REMOTE_H
19#define MEDIA_REMOTE_H
20
21#include "Player.h"
22#include <libsoup/soup.h>
23
24namespace ginga {
25
26class WebServices;
27
28#define REMOTE_PLAYER_JSON_ACT \
29 "{\
30 \"action\": \"%s\",\
31 \"delay\": \"%d\"\
32 }"
33
34#define REMOTE_PLAYER_JSON_ACT_WITH_PROPS \
35 "{\
36 \"action\": \"%s\",\
37 \"delay\": \"%d\",\
38 \"properties\": \
39 {\
40 \"bounds\": {\"top\": \"%s\",\"left\": \"%s\",\"width\": \"%s\",\"height\": \"%s\"},\
41 \"zIndex\" : \"%s\",\
42 \"transparency\" : \"%s\"\
43 }\
44 }"
45
46#define REMOTE_PLAYER_JSON_MEDIA \
47 "{\
48 \"appId\": \"%s\",\
49 \"documentId\": \"%s\",\
50 \"sceneNode\": \"%s\",\
51 \"sceneURL\": \"%s\",\
52 \"notifyEvents\": %s\
53 }"
54
55#define REMOTE_PLAYER_ROUTE_NODES "/scene/nodes/"
56
57#define REMOTE_PLAYER_MIME_NCL360 "application/x-ncl360"
58
59class PlayerRemote : public Player
60{
61public:
62 explicit PlayerRemote (Formatter *, Media *);
64 void start ();
65 void startPreparation ();
66 void stop ();
67 void pause ();
68 void resume ();
69 void reload ();
70 void redraw (cairo_t *);
71
72 static bool usesPlayerRemote (Media *);
73 void sendPresentationEvent (const string &, const string &);
74
75protected:
76 void sendAction (const string &, const string &);
77 bool _sessionStarted;
78 WebServices *_ws;
79 SoupSession *_session;
80};
81
82}
83
84#endif // MEDIA_REMOTE_H
Interface between libginga and the external world.
Definition Formatter.h:39
Definition Media.h:27
Definition PlayerRemote.h:60
PlayerRemote(Formatter *, Media *)
Creates PlayerRemote.
Definition PlayerRemote.cpp:34
static bool usesPlayerRemote(Media *)
Evaluates if Media uses PlayerRemote.
Definition PlayerRemote.cpp:44
Definition Player.h:29
WebSercices.
Definition WebServices.h:103