[timeline] Expose the msec advancement

The method of ClutterTimeline that advances the timeline by a
delta (in millisecond) is going to be useful for testing the
timeline's behaviour -- and unbreak the timeline test suite that
was broken by the MasterClock merge.
This commit is contained in:
Emmanuele Bassi 2009-05-01 15:05:51 +01:00
parent d7a1a168ba
commit 5be29cf9bc
4 changed files with 12 additions and 13 deletions

View File

@ -356,7 +356,7 @@ _clutter_master_clock_advance (ClutterMasterClock *master_clock)
ClutterTimeline *timeline = l->data;
if (clutter_timeline_is_playing (timeline))
_clutter_timeline_set_delta (timeline, msecs);
clutter_timeline_advance_delta (timeline, msecs);
}
master_clock->msecs_delta = msecs;

View File

@ -207,9 +207,6 @@ guint _clutter_pixel_to_id (guchar pixel[4]);
void _clutter_id_to_color (guint id, ClutterColor *col);
void _clutter_timeline_set_delta (ClutterTimeline *timeline,
guint msecs);
/* use this function as the accumulator if you have a signal with
* a G_TYPE_BOOLEAN return value; this will stop the emission as
* soon as one handler returns TRUE

View File

@ -1022,21 +1022,19 @@ clutter_timeline_set_speed (ClutterTimeline *timeline,
if (priv->fps != fps)
{
g_object_ref (timeline);
g_object_freeze_notify (G_OBJECT (timeline));
priv->fps = fps;
priv->frame_interval = 1000 / priv->fps;
/* FIXME if the timeline is playing restart */
g_object_freeze_notify (G_OBJECT (timeline));
/* if the timeline is playing restart */
if (priv->is_playing)
clutter_timeline_rewind (timeline);
g_object_notify (G_OBJECT (timeline), "duration");
g_object_notify (G_OBJECT (timeline), "fps");
g_object_thaw_notify (G_OBJECT (timeline));
g_object_unref (timeline);
}
}
@ -1372,7 +1370,7 @@ clutter_timeline_get_delta (ClutterTimeline *timeline,
}
/*
* clutter_timeline_set_delta:
* clutter_timeline_advance_delta:
* @timeline: a #ClutterTimeline
* @msecs: advance in milliseconds
*
@ -1383,7 +1381,7 @@ clutter_timeline_get_delta (ClutterTimeline *timeline,
* skip frames.
*/
void
_clutter_timeline_set_delta (ClutterTimeline *timeline,
clutter_timeline_advance_delta (ClutterTimeline *timeline,
guint msecs)
{
ClutterTimelinePrivate *priv;

View File

@ -166,6 +166,10 @@ gboolean clutter_timeline_has_marker (ClutterTimeline *timeli
void clutter_timeline_advance_to_marker (ClutterTimeline *timeline,
const gchar *marker_name);
/*< private >*/
void clutter_timeline_advance_delta (ClutterTimeline *timeline,
guint msecs);
G_END_DECLS
#endif /* _CLUTTER_TIMELINE_H__ */