[snappy] ui: renaming ui->playback_position



commit 6c91a6c9b369da520f4ed03d4ca447d559c3c993
Author: Luis de Bethencourt <luis debethencourt com>
Date:   Tue Apr 9 12:01:35 2013 -0400

    ui: renaming ui->playback_position

 src/user_interface.c |   20 +++++++++-----------
 src/user_interface.h |    2 +-
 2 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/src/user_interface.c b/src/user_interface.c
index ad365f9..9d5745a 100644
--- a/src/user_interface.c
+++ b/src/user_interface.c
@@ -153,7 +153,7 @@ draw_progressbar (ClutterCanvas * canvas, cairo_t * cr, int surface_width,
 
   if (canvas == ui->seek_canvas) {
     // if called for seek canvas, update playback position
-    position = ui->progress;
+    position = ui->playback_position;
   } else {
     // if called for volume canvas, update volume level
     position = ui->volume;
@@ -441,7 +441,7 @@ event_cb (ClutterStage * stage, ClutterEvent * event, UserInterface * ui)
 
         } else if (actor == ui->control_seekbar) {
           gfloat x, y, dist;
-          gint64 progress;
+          gint64 pos;
 
           clutter_actor_get_transformed_position (ui->control_seekbar, &x, &y);
           dist = bev->x - x;
@@ -451,10 +451,10 @@ event_cb (ClutterStage * stage, ClutterEvent * event, UserInterface * ui)
             update_media_duration (ui->engine);
           }
 
-          progress = ui->engine->media_duration * (dist / ui->seek_width);
-          engine_seek (ui->engine, progress, FALSE);
+          pos = ui->engine->media_duration * (dist / ui->seek_width);
+          engine_seek (ui->engine, pos, FALSE);
 
-          ui->progress = (float)progress / ui->engine->media_duration;
+          ui->playback_position = (float)pos / ui->engine->media_duration;
           // Invalidate calls a redraw of the canvas
           clutter_content_invalidate (ui->seek_canvas);
 
@@ -950,12 +950,10 @@ progress_update_seekbar (gpointer data)
 
   if (ui->controls_showing && !engine->queries_blocked) {
     if (engine->media_duration != -1) {
-      gint64 pos;
-      gfloat progress = 0.0;
+      gfloat pos;
 
-      pos = query_position (engine);
-      progress = (float) pos / engine->media_duration;
-      ui->progress = progress;
+      pos = (float) query_position (engine) / engine->media_duration;
+      ui->playback_position = pos;
 
       // Invalidate calls a redraw of the canvas
       clutter_content_invalidate (ui->seek_canvas);
@@ -1256,7 +1254,7 @@ interface_init (UserInterface * ui)
   ui->engine = NULL;
   ui->screensaver = NULL;
 
-  ui->progress = 0;
+  ui->playback_position = 0.0;
 }
 
 gboolean
diff --git a/src/user_interface.h b/src/user_interface.h
index d955d85..6b19112 100644
--- a/src/user_interface.h
+++ b/src/user_interface.h
@@ -88,7 +88,7 @@ struct _UserInterface
   guint media_width, media_height;
   guint stage_width, stage_height;
   gint64 media_duration;
-  gfloat progress, volume;
+  gfloat playback_position, volume;
   gfloat seek_width, seek_height;
   gfloat volume_width, volume_height;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]