[totem/wip/hadess/glsink: 25/33] spinner WIP




commit 187bc6dfad7b2706798e3cf5c50a438e61caee4c
Author: Bastien Nocera <hadess hadess net>
Date:   Thu May 6 14:09:09 2021 +0200

    spinner WIP

 src/backend/bacon-video-widget.c | 24 +-----------------------
 src/totem-object.c               | 12 +++++++++++-
 2 files changed, 12 insertions(+), 24 deletions(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index 190344fff..22692c248 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -2174,16 +2174,6 @@ bvw_handle_buffering_message (GstMessage * message, BaconVideoWidget *bvw)
   gst_message_parse_buffering (message, &percent);
   g_signal_emit (bvw, bvw_signals[SIGNAL_BUFFERING], 0, (gdouble) percent / 100.0);
 
-#if 0
-  if (percent >= 100) {
-    clutter_actor_hide (bvw->spinner);
-    /* Reset */
-    g_object_set (G_OBJECT (bvw->spinner), "percent", 0.0, NULL);
-  } else {
-    clutter_actor_show (bvw->spinner);
-    g_object_set (G_OBJECT (bvw->spinner), "percent", (float) percent, NULL);
-  }
-#endif
   if (percent >= 100) {
     /* a 100% message means buffering is done */
     bvw->buffering = FALSE;
@@ -4258,10 +4248,7 @@ bvw_stop_play_pipeline (BaconVideoWidget * bvw)
   bvw->buffering_left = -1;
   bvw_reconfigure_fill_timeout (bvw, 0);
   bvw->movie_par_n = bvw->movie_par_d = 1;
-#if 0
-  clutter_actor_hide (bvw->spinner);
-  g_object_set (G_OBJECT (bvw->spinner), "percent", 0.0, NULL);
-#endif
+  g_signal_emit (bvw, bvw_signals[SIGNAL_BUFFERING], 0, 100.0);
   g_object_set (bvw->video_sink,
                 "rotate-method", GST_VIDEO_ORIENTATION_AUTO,
                 NULL);
@@ -5932,15 +5919,6 @@ bacon_video_widget_initable_init (GInitable     *initable,
   g_signal_connect (action, "swipe",
                    G_CALLBACK (bacon_video_widget_swipe), bvw);
 
-  /* The spinner */
-  bvw->spinner = bacon_video_spinner_actor_new ();
-  clutter_actor_set_name (bvw->spinner, "spinner");
-  clutter_actor_add_child (bvw->stage, bvw->spinner);
-  clutter_actor_set_child_above_sibling (bvw->stage,
-                                        bvw->spinner,
-                                        bvw->frame);
-  clutter_actor_hide (bvw->spinner);
-
   /* Fullscreen header controls */
   bvw->header_controls = gtk_clutter_actor_new ();
   clutter_actor_set_opacity (bvw->header_controls, OVERLAY_OPACITY);
diff --git a/src/totem-object.c b/src/totem-object.c
index 166ce7070..f6ada5352 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -2489,7 +2489,17 @@ on_error_event (BaconVideoWidget *bvw, char *message,
 static void
 on_buffering_event (BaconVideoWidget *bvw, gdouble percentage, TotemObject *totem)
 {
-       //FIXME show that somehow
+       g_message ("YEAH! spinner! %g", percentage);
+#if 0
+  if (percent >= 100.0) {
+    clutter_actor_hide (bvw->spinner);
+    /* Reset */
+    g_object_set (G_OBJECT (bvw->spinner), "percent", 0.0, NULL);
+  } else {
+    clutter_actor_show (bvw->spinner);
+    g_object_set (G_OBJECT (bvw->spinner), "percent", (float) percent, NULL);
+  }
+#endif
 }
 
 static void


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