0

the timeline functionality in moblin clutter is used to do a callback every given milliseconds.although it is emitting signals lot faster(every 1ms or so). Why does this happen?

ClutterTimeline * clutter_timeline_new(guint msecs);
genpfault
  • 51,148
  • 11
  • 85
  • 139
Atul Vinayak
  • 466
  • 3
  • 15
  • 1
    @genpfault: I was considering to remove the 'opengl' tag myself, but was unsure, as clutter is a widget toolkit based entirely on OpenGL. I agree that the question at hand is completely unrelated to OpenGL though. – datenwolf Feb 13 '13 at 14:31
  • this problem has bugged me for some time. i searched extensively for a solution.does anyone know implementing a timeline? it works nothing like the API says. – Atul Vinayak Feb 13 '13 at 15:11
  • can anyone help? this is the final piece of a project i'm currently doing. – Atul Vinayak Feb 13 '13 at 17:47

1 Answers1

1

you should not be using a Timeline to get a notification (and execute code) that N amount of milliseconds have elapsed. ClutterTimeline is a object that is tied to the redraw cycle of the UI. timelines are advanced every time Clutter redraws a frame, to let the application code know that it has to update its state.

if you just need to have your code called after an interval, use g_timeout_add() instead; this function is tied only to the main loop, and not to the redraw cycle. there are other considerations to be taken care of when using a timeout, so you should read the documentation:

http://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-timeout-add

strictly speaking, if you're using Moblin, you're probably using a very old version of Clutter, so there may be bugs as well; not that I know of bugs where the ClutterTimeline::new-frame signal is called every millisecond, mind you.

ebassi
  • 8,648
  • 27
  • 29