← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~longinus00/xsplash/throbber-frame-rate-control into lp:xsplash

 

Daniel Lee has proposed merging lp:~longinus00/xsplash/throbber-frame-rate-control into lp:xsplash.

    Requested reviews:
    Canonical Desktop Experience Team (canonical-dx-team)


This seems like it could be useful for people who want to make/use custom throbbers. The default frame rate of 50 seems excessive for their purposes.
-- 
https://code.launchpad.net/~longinus00/xsplash/throbber-frame-rate-control/+merge/12657
Your team ayatana-commits is subscribed to branch lp:xsplash.
=== modified file 'src/xsplash.c'
--- src/xsplash.c	2009-09-30 09:57:55 +0000
+++ src/xsplash.c	2009-09-30 13:00:28 +0000
@@ -124,6 +124,7 @@
 static gchar    *logo_image       = NULL;
 static gchar    *throbber_image   = NULL;
 static guint     throbber_frames  = 50;
+static guint     throbber_fps     = 50;
 static gboolean  ping_pong        = FALSE;
 static gboolean  have_xcomposite  = FALSE;
 static gboolean  daemon_mode      = FALSE;
@@ -164,6 +165,11 @@
     "Number of frames for the throbber (default 50)", NULL
   },
   {
+    "fps", 'r', 0,
+    G_OPTION_ARG_INT, &throbber_fps,
+    "Frame rate for the throbber (default 50)", NULL
+  },
+  {
     "pingpong", 'p', 0,
     G_OPTION_ARG_NONE, &ping_pong,
     "Whether to reverse throbber directions", NULL
@@ -661,9 +667,11 @@
 {
   XsplashServerPrivate *priv;
   GtyTimeline *timeline;
+  guint milliseconds;
 
   priv = XSPLASH_SERVER_GET_PRIVATE (server);
-  timeline = gty_timeline_new (1000);
+  milliseconds = (1000 * throbber_frames) / throbber_fps;
+  timeline = gty_timeline_new (milliseconds);
   gty_timeline_set_loop (timeline, TRUE);
 
   g_signal_connect (timeline,
@@ -673,7 +681,7 @@
 
   gty_timeline_start (timeline);
 
-  g_message ("throbber started (%d frames)", throbber_frames);
+  g_message ("throbber started (%d frames, %d frames per second)", throbber_frames, throbber_fps);
 }
 
 static void


Follow ups