Ginga  0.13.6.1771-df200
The iTV middleware.
Context.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 CONTEXT_H
19 #define CONTEXT_H
20 
21 #include "Composition.h"
22 #include "Event.h"
23 
25 
26 class Context: public Composition
27 {
28 public:
29  Context (const string &);
30  virtual ~Context ();
31 
32  // Object:
33  string getObjectTypeAsString () override;
34  string toString () override;
35  string getProperty (const string &) override;
36  void setProperty (const string &, const string &,
37  Time dur=0) override;
38  void sendKeyEvent (const string &, bool) override;
39  void sendTickEvent (Time, Time, Time) override;
40  bool startTransition (Event *, Event::Transition) override;
41  void endTransition (Event *, Event::Transition) override;
42 
43  // Context:
44  const list<Event *> *getPorts ();
45  void addPort (Event *);
46 
47  const list<pair<list<Action>,list<Action>>> *getLinks ();
48  void addLink (list<Action>, list<Action>);
49 
50  bool getLinksStatus ();
51  void setLinksStatus (bool);
52 
53 private:
54  list<Event *> _ports;
55  list<pair<list<Action>,list<Action>>> _links;
56  bool _status; // whether links are active
57 };
58 
60 
61 #endif // CONTEXT_H
bool _status
Definition: Context.h:56
void endTransition(Event *, Event::Transition) override
Definition: Context.cpp:188
Definition: Context.h:26
Definition: Composition.h:25
string toString() override
Definition: Context.cpp:47
virtual ~Context()
Definition: Context.cpp:33
const list< Event * > * getPorts()
Definition: Context.cpp:222
#define GINGA_NAMESPACE_END
Definition: aux-ginga.h:62
string getObjectTypeAsString() override
Definition: Context.cpp:41
const list< pair< list< Action >, list< Action > > > * getLinks()
Definition: Context.cpp:235
void sendTickEvent(Time, Time, Time) override
Definition: Context.cpp:135
list< pair< list< Action >, list< Action > > > _links
Definition: Context.h:55
void sendKeyEvent(const string &, bool) override
Definition: Context.cpp:129
#define GINGA_NAMESPACE_BEGIN
Definition: aux-ginga.h:61
Transition
Definition: Event.h:44
list< Event * > _ports
Definition: Context.h:54
void addPort(Event *)
Definition: Context.cpp:228
bool startTransition(Event *, Event::Transition) override
Definition: Context.cpp:149
Context(const string &)
Definition: Context.cpp:28
string getProperty(const string &) override
Definition: Context.cpp:117
Definition: Event.h:27
void setProperty(const string &, const string &, Time dur=0) override
Definition: Context.cpp:123
bool getLinksStatus()
Definition: Context.cpp:249
GstClockTime Time
Definition: aux-ginga.h:115
void setLinksStatus(bool)
Definition: Context.cpp:255
void addLink(list< Action >, list< Action >)
Definition: Context.cpp:241