diff --git a/clutter/clutter-timeline.c b/clutter/clutter-timeline.c index 1aa23488e..946090de6 100644 --- a/clutter/clutter-timeline.c +++ b/clutter/clutter-timeline.c @@ -1380,9 +1380,13 @@ clutter_timeline_set_duration (ClutterTimeline *timeline, gdouble clutter_timeline_get_progress (ClutterTimeline *timeline) { - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), 0.); + ClutterTimelinePrivate *priv; - return CLUTTER_FIXED_TO_DOUBLE (clutter_timeline_get_progressx (timeline)); + g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), 0.0); + + priv = timeline->priv; + + return (gdouble) priv->current_frame_num / (gdouble) priv->n_frames; } /** @@ -1395,20 +1399,10 @@ clutter_timeline_get_progress (ClutterTimeline *timeline) * * Since: 0.6 */ -ClutterFixed +CoglFixed clutter_timeline_get_progressx (ClutterTimeline *timeline) { - ClutterTimelinePrivate *priv; - ClutterFixed progress; - - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), 0); - - priv = timeline->priv; - - progress = CLUTTER_FIXED_DIV ((float)(priv->current_frame_num), - (float)(priv->n_frames)); - - return progress; + return COGL_FIXED_FROM_DOUBLE (clutter_timeline_get_progress (timeline)); } /** @@ -1425,7 +1419,8 @@ clutter_timeline_get_progressx (ClutterTimeline *timeline) ClutterTimelineDirection clutter_timeline_get_direction (ClutterTimeline *timeline) { - g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), CLUTTER_TIMELINE_FORWARD); + g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), + CLUTTER_TIMELINE_FORWARD); return timeline->priv->direction; } diff --git a/clutter/clutter-timeline.h b/clutter/clutter-timeline.h index 948c64194..6483d7b57 100644 --- a/clutter/clutter-timeline.h +++ b/clutter/clutter-timeline.h @@ -33,27 +33,12 @@ G_BEGIN_DECLS -#define CLUTTER_TYPE_TIMELINE (clutter_timeline_get_type ()) - -#define CLUTTER_TIMELINE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_TIMELINE, ClutterTimeline)) - -#define CLUTTER_TIMELINE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_TIMELINE, ClutterTimelineClass)) - -#define CLUTTER_IS_TIMELINE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_TIMELINE)) - -#define CLUTTER_IS_TIMELINE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_TIMELINE)) - -#define CLUTTER_TIMELINE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_TIMELINE, ClutterTimelineClass)) +#define CLUTTER_TYPE_TIMELINE (clutter_timeline_get_type ()) +#define CLUTTER_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TIMELINE, ClutterTimeline)) +#define CLUTTER_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TIMELINE, ClutterTimelineClass)) +#define CLUTTER_IS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TIMELINE)) +#define CLUTTER_IS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_TIMELINE)) +#define CLUTTER_TIMELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TIMELINE, ClutterTimelineClass)) /** * ClutterTimelineDirection: @@ -134,7 +119,7 @@ void clutter_timeline_advance (ClutterTimeline *timeli guint frame_num); gint clutter_timeline_get_current_frame (ClutterTimeline *timeline); gdouble clutter_timeline_get_progress (ClutterTimeline *timeline); -ClutterFixed clutter_timeline_get_progressx (ClutterTimeline *timeline); +CoglFixed clutter_timeline_get_progressx (ClutterTimeline *timeline); void clutter_timeline_set_n_frames (ClutterTimeline *timeline, guint n_frames); guint clutter_timeline_get_n_frames (ClutterTimeline *timeline);