[totem/wip/hadess/glsink: 81/89] spinner WIP




commit 9f1119cf2a20d215f542e65d972e65819ad744a3
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 931fa6ebe..9fe8b9cb9 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -2215,16 +2215,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;
@@ -4299,10 +4289,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_GTK_GL_ROTATE_METHOD_AUTO,
                 NULL);
@@ -5973,15 +5960,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 c52527191..b2d815630 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -2487,7 +2487,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]