Other frameworks expose the same functionality as "auto-reverse",
probably to match the cassette tape player. It actually makes sense
for Clutter to follow suit.
GLib 2.28 will deprecate GTimeVal and related API in favour of
standardizing on microseconds granularity for all time-based API.
Clutter should switch too.
All of the current users of GTimeVal convert to milliseconds when
doing time operations, and use GTimeVal only as storage. This can
effectively be replaced by a gint64.
The Master Clock uses a microsecond resolution, except when interacting
with the main loop itself, since the main loop has a millisecond
resolution - at least until Ryan Lortie manages to switch that too to
microseconds on Linux.
The clutter_timeline_do_tick() function was erroneously not privatized,
but it was still assumed to be private; we should just remove it from
the public symbols.
Instead of calculating a delta in the master clock, and passing that
into each timeline, make each timeline individually responsible for
remembering the last time and computing the delta.
This:
- Fixes a problem where we could spin infinitely processing
timeline-only frames with < 1msec differences.
- Makes timelines consistently start timing on the first frame;
instead of doing different things for the first started timeline
and other timelines.
- Improves accuracy of elapsed time computations by avoiding
accumulating microsecond => millisecond truncation errors.
http://bugzilla.openedhand.com/show_bug.cgi?id=1637
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Timelines no longer work in terms of a frame rate and a number of
frames but instead just have a duration in milliseconds. This better
matches the working of the master clock where if any timelines are
running it will redraw as fast as possible rather than limiting to the
lowest rated timeline.
Most applications will just create animations and expect them to
finish in a certain amount of time without caring about how many
frames are drawn. If a frame is going to be drawn it might as well
update all of the animations to some fraction of the total animation
rather than rounding to the nearest whole frame.
The 'frame_num' parameter of the new-frame signal is now 'msecs' which
is a number of milliseconds progressed along the
timeline. Applications should use clutter_timeline_get_progress
instead of the frame number.
Markers can now only be attached at a time value. The position is
stored in milliseconds rather than at a frame number.
test-timeline-smoothness and test-timeline-dup-frames have been
removed because they no longer make sense.
The commit 762873e79e is completely
and utterly wrong and I should have never pushed it.
Serves me well for trying to work on three different branches and
on three different things.
Currently, the clock source spins a redraw every time there is at
least a timeline running. If the timelines were not advanced in
the previous frame, though, because their interval is larger than
the vblanking interval then this will lead to excessive redraws of
the scenegraph even if nothing has changed.
To avoid this a simple guard should be set by the MasterClock::advance
method in case no timeline was effectively advanced, and checked
before dispatching the stage redraws.
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.
Bug#959 - Multiple minor improvements
* configure.ac: pick up GDKPIXBUF_PREFIX from gdk-pixbuf-2.0
module, not pango
* clutter/clutter-keysyms-table.h: cosmetic fix for ifdef guard
name in the comment (leftover from earlier commit)
* tests/test-textures.c: don't depend on GdkPixbuf as we're not
using any actual features from it, just plain pixel buffer
manipulation
* clutter/clutter-timeline.c
* clutter/clutter-timeline.h (clutter_timeline_list_markers): Use
gsize* to return number of items, not guint*
* tests/test-paint-wrapper.c: use correct type (guint*) in call
to clutter_actor_get_size()
* tests/test-depth.c (janus_group): properly take height2 into
account when calculating needed height for the rectangle
* tests/test-cogl-tex-getset.c: use rowstride, not width*4, when
calculating pixel offsets
* tests/test-cogl-tex-getset.c: Don't assume/force RGBA format,
also support ARGB format (needed with quartz imageloader.)
* clutter/clutter-score.[ch]: Remove all the API changes, and
just add a clutter_score_append_at_marker(); the implementation
remains the same, but the marker must be explicitly created by
the developer. The ids are no longer used to create implicit
markers, so they can return to be unsigned integers.
* clutter/clutter-timeline.[ch]:
(clutter_timeline_has_marker): Add a function to query a timeline
for a marker being set.
* tests/test-score.c (main): Update with the API changes.
* clutter.symbols: Update exported symbols.
* clutter/clutter-marshal.list: Add signature for the
::marker-reached signal marshaller.
* clutter/clutter-timeline.[ch]: Add timeline marker API;
using markers it is possible to add a unique identifier to
a particular frame of the timeline, and receive a signal
notification when reaching that particular marker while
playing the timeline. (#641)
* tests/test-timeline.c: Update the test case to check for
the marker-reached signal emission.
* clutter.symbols: Add new symbols.
* clutter/clutter-timeline.h:
* clutter/clutter-timeline.c
(timeline_timeout_func),
(clutter_timeline_get_delta): Add a function for retrieving
the number of frames and the time (in milliseconds) elapsed
since the last timeline ::new-frame signal. This can be useful
for implementing a physics engine or just for knowing how if
and how many frames have been skipped.
* clutter/clutter-timeline.[ch]: Add ClutterTimeline:direction
property, defining the direction (forward or backward) of the
timeline.
* tests/test-timeline.c: Test the direction property.
* clutter.symbols: Update exported symbols
* clutter/clutter-timeline.[ch]: Added ClutterTimeline:duration,
a property for setting the duration of a timeline in milliseconds.
The property comes with accessors and a new constructor. The
frame rate used is the default value.
* clutter/clutter-private.h:
* clutter/clutter-main.[ch]: Add clutter_get_default_frame_rate()
and clutter_set_default_frame_rate(); these two functions control
the default frame rate to be used when creating timelines. Currently
is set to 60 frames-per-second.
This patch adds a "delay" property to the timeline object. If set,
it will delay the start of the timeline of a number of milliseconds.
If the timeline is looping, the delay will be applied just the first
time and not for every loop.
* clutter/clutter-alpha.h:
* clutter/clutter-alpha.c: Add a data parameter to
the ClutterAlphaFunc; add a data+destroy parameter
to clutter_alpha_set_func() and to clutter_alpha_new(),
and turned the latter into clutter_alpha_new_full();
add a simple, empty constructor clutter_alpha_new().
These changes makes writing bindings a tad more easy,
as bindings require passing their own functions in
order to call the real alpha function.
* clutter/clutter-behaviour.h: Clean up the header.
* clutter/clutter-behaviours.[ch]:
* clutter/clutter-behaviour-opacity.[ch]:
* clutter/clutter-behaviour-path.[ch]:
* clutter/clutter-behaviour-scale.[ch]: Split the
ClutterBehaviourPath, ClutterBehaviourOpacity and
ClutterBehaviourScale into their own files as they
have been growing a bit. Fix ClutterBehaviourPath
API.
* clutter/clutter-media.h: Remove the commented
"metadata_available" signal: gtk-doc chokes up on that.
* clutter/clutter-timeline.h:
* clutter/clutter-timeline.c: Remove the useless
ClutterTimelineAlphaFunc signature; add missing accessor
methods for the properties; clean up a bit.
* clutter/clutter-util.h:
* clutter/clutter-util.c: Remove unneeded function
clutter_util_can_create_texture().
* clutter/clutter-feature.h: Sync the name of
clutter_feature_get_all() with the name declared
in clutter-feature.h.
* clutter/Makefile.am:
* clutter/clutter.h: Update.
* examples/behave.c: Update to the new ClutterAlpha
constructor.
* examples/super-oh.c: Use the right pointer and avoid
the compiler making a fuss about it.
* clutter/clutter-timeline.h:
* clutter/clutter-timeline.c: Add a "started" and a "paused"
signals; add more sanity checks on the public functions.
(clutter_timeline_get_loop): Add a getter function for the
loop property.
* clutter/clutter-marshal.list: Add marshallers.
* clutter/clutter-timeline.h:
* clutter/clutter-actor.h: Add padding for future expansion
without breaking ABI.