ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
Object.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 OBJECT_H
19#define OBJECT_H
20
21#include "Event.h"
22
23namespace ginga {
24
25class Document;
26class Composition;
27class MediaSettings;
28
29class Object
30{
31public:
32 explicit Object (const string &);
33 virtual ~Object ();
34
35 string getId ();
36
37 Document *getDocument ();
38 void initDocument (Document *);
39
40 Composition *getParent ();
41 void initParent (Composition *);
42
43 virtual string getObjectTypeAsString () = 0;
44 virtual string toString ();
45
46 const list<pair<string, Composition *> > *getAliases ();
47 bool hasAlias (const string &);
48 void addAlias (const string &, Composition * = nullptr);
49
50 const set<Event *> *getEvents ();
51 Event *getEvent (Event::Type, const string &);
52 Event *getAttributionEvent (const string &);
53 void addAttributionEvent (const string &);
54 Event *getPresentationEvent (const string &);
55 Event *getPresentationEventByLabel (const string &);
56 void addPresentationEvent (const string &, Time, Time);
57 void addPresentationEvent (const string &, const string &);
58 Event *getSelectionEvent (const string &);
59 void addSelectionEvent (const string &);
60 Event *getLookAtEvent (const string &);
61 void addLookAtEvent (const string &);
62
63 Event *getLambda ();
64 bool isOccurring ();
65 bool isPaused ();
66 bool isSleeping ();
67
68 virtual string getProperty (const string &);
69 virtual void setProperty (const string &, const string &, Time dur = 0);
70
71 const list<pair<Action, Time> > *getDelayedActions ();
72 void addDelayedAction (Event *, Event::Transition,
73 const string &value = "", Time delay = 0);
74
75 virtual void sendKey (const string &, bool);
76 virtual void sendTick (Time, Time, Time);
77
78 Time getTime ();
79
94
109
110protected:
111 string _id; // id
112 Document *_doc; // parent document
113 Composition *_parent; // parent object
114 list<pair<string, Composition *> > _aliases; // aliases
115 Time _time; // playback time
116 map<string, string> _properties; // property map
117 Event *_lambda; // lambda event
118 set<Event *> _events; // all events
119 list<pair<Action, Time> > _delayed; // delayed actions
120
121 virtual void doStart ();
122 virtual void doStop ();
123};
124
125}
126
127#endif // OBJECT_H
Definition Composition.h:26
NCL document.
Definition Document.h:35
Event state machine.
Definition Event.h:32
Transition
Event state transitions.
Definition Event.h:79
Type
Event type.
Definition Event.h:36
Definition MediaSettings.h:26
Definition Object.h:30
virtual bool afterTransition(Event *, Event::Transition)=0
Finishes event transition.
virtual bool beforeTransition(Event *, Event::Transition)=0
Initiates event transition.