ginga
1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
PlayerAnimator.h
1
/* Copyright (C) 2006-2018 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 <https://www.gnu.org/licenses/>. */
17
18
#ifndef PLAYER_ANIMATOR_H
19
#define PLAYER_ANIMATOR_H
20
21
#include "Formatter.h"
22
23
namespace
ginga {
24
28
class
AnimInfo
29
{
30
public
:
31
AnimInfo
(
const
string
&,
double
,
double
, Time);
32
~AnimInfo
();
33
34
string
getName ();
35
double
getCurrent ();
36
double
getTarget ();
37
Time getDuration ();
38
double
getSpeed ();
39
int
getStateNode ();
40
void
setStateNode (
int
);
41
void
update (
const
string
&,
double
,
double
, Time);
42
bool
isDone ();
43
bool
isInit ();
44
45
void
init (
double
current, Time time);
46
void
update (Time time);
47
48
private
:
49
string
_name;
// property name
50
double
_current;
// current value
51
double
_target;
// target value
52
Time _duration;
// animation duration
53
Time _last_update;
// time of the last update
54
double
_speed;
// animation speed
55
bool
_done;
// true if animation is done
56
bool
_init;
// true if animation is initialized
57
int
_stateNode;
// for complex animations
58
};
59
63
struct
TransitionInfo
64
{
65
const
string
type;
66
const
string
subtype;
67
const
Time dur;
68
const
gdouble startProgress;
69
const
gdouble endProgress;
70
const
string
direction;
71
const
Color fadeColor;
72
const
guint32 horzRepeat;
73
const
guint32 vertRepeat;
74
const
guint32 borderWidth;
75
const
Color borderColor;
76
77
TransitionInfo
(
const
string
&,
const
string
&, Time, gdouble, gdouble,
78
const
string
&, Color, guint32, guint32, guint32, Color);
79
};
80
84
class
PlayerAnimator
85
{
86
public
:
87
PlayerAnimator
(
Formatter
*, Time *);
88
~PlayerAnimator
();
89
void
clear ();
90
void
schedule (
const
string
&,
const
string
&,
const
string
&, Time);
91
void
update (Rect *, Color *, guint8 *, list<int> *);
92
void
setTransitionProperties (
const
string
&,
const
string
&);
93
void
scheduleTransition (
const
string
&, Rect *, Color *, guint8 *,
94
list<int> *);
95
96
private
:
97
Formatter
*_formatter;
// formatter handle
98
list<AnimInfo *> _scheduled;
// scheduled animations
99
TransitionInfo
*_transIn;
100
TransitionInfo
*_transOut;
101
Time *_time;
102
103
void
doSchedule (
const
string
&,
const
string
&,
const
string
&, Time);
104
void
updateSchedule (
AnimInfo
*,
const
string
&,
const
string
&,
105
const
string
&, Time);
106
};
107
108
}
109
110
#endif
// PLAYER_ANIMATOR_H
ginga::AnimInfo
The AnimInfo class.
Definition
PlayerAnimator.h:29
ginga::Formatter
Interface between libginga and the external world.
Definition
Formatter.h:39
ginga::PlayerAnimator
The PlayerAnimator class.
Definition
PlayerAnimator.h:85
ginga::TransitionInfo
The TransitionInfo struct.
Definition
PlayerAnimator.h:64
lib
PlayerAnimator.h
Generated by
1.11.0