Ginga  0.13.6.1771-df200
The iTV middleware.
PlayerAnimator.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_ANIMATOR_H
19 #define PLAYER_ANIMATOR_H
20 
21 #include "Formatter.h"
22 
24 
25 // Entry in scheduled animations list.
26 class AnimInfo
27 {
28 public:
29  AnimInfo (const string &, double, double, Time);
30  ~AnimInfo ();
31 
32  string getName ();
33  double getCurrent ();
34  double getTarget ();
35  Time getDuration ();
36  double getSpeed ();
37  bool isDone ();
38  bool isInit ();
39 
40  void init (double current);
41  void update ();
42 
43 private:
44  string _name; // property name
45  double _current; // current value
46  double _target; // target value
47  Time _duration; // animation duration
48  Time _last_update; // time of the last update
49  double _speed; // animation speed
50  bool _done; // true if animation is done
51  bool _init; // true if animation is initialized
52 };
53 
55 {
56 public:
58  ~PlayerAnimator ();
59  void clear ();
60  void schedule (const string &, const string &, const string &, Time);
61  void update (Rect *, Color *, guint8 *);
62 
63 private:
64  Formatter *_formatter; // formatter handle
65  list <AnimInfo *> _scheduled; // scheduled animations
66 
67  void doSchedule (const string &, const string &,
68  const string &, Time);
69 };
70 
72 
73 #endif // PLAYER_ANIMATOR_H
bool isInit()
Definition: PlayerAnimator.cpp:286
GdkRGBA Color
Definition: aux-ginga.h:113
string getName()
Definition: PlayerAnimator.cpp:256
Time getDuration()
Definition: PlayerAnimator.cpp:274
double _speed
Definition: PlayerAnimator.h:49
Definition: PlayerAnimator.h:54
Time _duration
Definition: PlayerAnimator.h:47
list< AnimInfo * > _scheduled
Definition: PlayerAnimator.h:65
#define GINGA_NAMESPACE_END
Definition: aux-ginga.h:62
Formatter * _formatter
Definition: PlayerAnimator.h:64
Definition: Formatter.h:35
string _name
Definition: PlayerAnimator.h:44
double _current
Definition: PlayerAnimator.h:45
~AnimInfo()
Definition: PlayerAnimator.cpp:251
void update()
Definition: PlayerAnimator.cpp:305
#define GINGA_NAMESPACE_BEGIN
Definition: aux-ginga.h:61
Time _last_update
Definition: PlayerAnimator.h:48
Definition: PlayerAnimator.h:26
bool isDone()
Definition: PlayerAnimator.cpp:280
double getSpeed()
double getCurrent()
Definition: PlayerAnimator.cpp:262
void init(double current)
Definition: PlayerAnimator.cpp:292
bool _init
Definition: PlayerAnimator.h:51
AnimInfo(const string &, double, double, Time)
Definition: PlayerAnimator.cpp:240
double getTarget()
Definition: PlayerAnimator.cpp:268
double _target
Definition: PlayerAnimator.h:46
GdkRectangle Rect
Definition: aux-ginga.h:114
GstClockTime Time
Definition: aux-ginga.h:115
bool _done
Definition: PlayerAnimator.h:50