Ginga  0.13.6.1771-df200
The iTV middleware.
PlayerLua.h
Go to the documentation of this file.
1 /* Copyright (C) 2006-2017 PUC-Rio/Laboratorio TeleMidia
2 
3 This file is part of Ginga (Ginga-NCL).
4 
5 Ginga is free software: you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 
10 Ginga is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13 License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with Ginga. If not, see <http://www.gnu.org/licenses/>. */
17 
18 #ifndef PLAYER_LUA_H
19 #define PLAYER_LUA_H
20 
21 #include "Player.h"
22 
23 #if defined WITH_NCLUA && WITH_NCLUA
24 # include <ncluaw.h>
25 #endif
26 
28 
29 class PlayerLua: public Player
30 {
31 public:
32  PlayerLua (Formatter *, const string &, const string &);
33  ~PlayerLua ();
34  void start () override;
35  void stop () override;
36  void pause () override;
37  void resume () override;
38  void redraw (cairo_t *) override;
39  void sendKeyEvent (const string &, bool) override;
40 
41 protected:
42  virtual bool doSetProperty (PlayerProperty, const string &,
43  const string &) override;
44 private:
45  ncluaw_t *_nw; // the NCLua state
46  Rect _init_rect; // initial output rectangle
47  string _pwd; // script's working dir
48  string _saved_pwd; // saved working dir
49 
50  void pwdSave (const string &);
51  void pwdSave ();
52  void pwdRestore ();
53 };
54 
56 
57 #endif // PLAYER_LUA_H
void pause() override
Definition: PlayerLua.cpp:97
void pwdSave()
Definition: PlayerLua.cpp:203
ncluaw_t * _nw
Definition: PlayerLua.h:45
void redraw(cairo_t *) override
Definition: PlayerLua.cpp:118
string _pwd
Definition: PlayerLua.h:47
#define GINGA_NAMESPACE_END
Definition: aux-ginga.h:62
Definition: Formatter.h:35
void start() override
Definition: PlayerLua.cpp:54
virtual bool doSetProperty(PlayerProperty, const string &, const string &) override
Definition: PlayerLua.cpp:159
#define GINGA_NAMESPACE_BEGIN
Definition: aux-ginga.h:61
string _saved_pwd
Definition: PlayerLua.h:48
void pwdRestore()
Definition: PlayerLua.cpp:209
Definition: PlayerLua.h:29
void resume() override
Definition: PlayerLua.cpp:104
PlayerLua(Formatter *, const string &, const string &)
Definition: PlayerLua.cpp:41
void sendKeyEvent(const string &, bool) override
Definition: PlayerLua.cpp:111
Definition: Player.h:27
PlayerProperty
Definition: Player.h:37
GdkRectangle Rect
Definition: aux-ginga.h:114
~PlayerLua()
Definition: PlayerLua.cpp:49
Rect _init_rect
Definition: PlayerLua.h:46
void stop() override
Definition: PlayerLua.cpp:75