[gegl] gegl: rename gegl_update_anim_time to gegl_node_set_time



commit 241d9407154972153fcd987c125cf1d6c620d68f
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Apr 27 10:16:21 2019 +0200

    gegl: rename gegl_update_anim_time to gegl_node_set_time

 bin/ui-core.c         | 12 +++++-------
 gegl/gegl-serialize.c | 27 +++++++++------------------
 gegl/gegl-utils.h     | 11 ++++++-----
 3 files changed, 20 insertions(+), 30 deletions(-)
---
diff --git a/bin/ui-core.c b/bin/ui-core.c
index 0bff68ad8..b8d651ffb 100644
--- a/bin/ui-core.c
+++ b/bin/ui-core.c
@@ -1039,11 +1039,8 @@ int mrg_ui_main (int argc, char **argv, char **ops)
         o->entry_no = no;
     }
     g_free (basename);
-
-
   }
 
-
   mrg_set_ui (mrg, gegl_ui, o);
   on_viewer_motion (NULL, o, NULL);
 
@@ -1083,8 +1080,9 @@ int
 cmd_apos (COMMAND_ARGS)
 {
   GeState *o = global_state;
-  gegl_update_anim_time (o->sink, "output", g_strtod (argv[1], NULL));
-  return 0; 
+  o->pos = g_strtod (argv[1], NULL);
+  gegl_node_set_time (o->sink, o->pos);
+  return 0;
 }
 
 int cmd_thumb (COMMAND_ARGS); /* "thumb", 0, "<>", "generate thumbnail for active image"*/
@@ -4272,7 +4270,7 @@ static void iterate_frame (GeState *o)
 
     if (frame_accum > 1000 / 25) // 25fps
       {
-        gegl_update_anim_time (o->sink, "output", o->pos); 
+        gegl_node_set_time (o->sink, o->pos);
         frame_accum = 0;
       }
    frame_accum += delta;
@@ -5599,7 +5597,7 @@ static void load_path_inner (GeState *o,
       else
         {
           o->gegl = gegl_node_new_from_serialized (meta, containing_path);
-          gegl_update_anim_time (o->gegl, "output", 0.0);
+          gegl_node_set_time (o->gegl, 0.0);
         }
       g_free (containing_path);
       o->sink = o->gegl;
diff --git a/gegl/gegl-serialize.c b/gegl/gegl-serialize.c
index 0571f1685..ce35d6ed1 100644
--- a/gegl/gegl-serialize.c
+++ b/gegl/gegl-serialize.c
@@ -84,33 +84,24 @@ static void each_knot_rel (const GeglPathItem *path_node,
 
 
 void
-gegl_update_anim_time (GeglNode   *node,
-                       const char *output_pad,
-                       gdouble     time)
+gegl_node_set_time (GeglNode   *node,
+                    gdouble     time)
 {
   GeglNode *iter = NULL;
   if (!node)
     return;
-  /* call recursively with producers? */
-  /* brute-force existance of animation quarks set on all relevant properties
- * */
+
   if (gegl_node_has_pad (node, "input"))
   {
-    gchar *pad_name = NULL;
-    iter = gegl_node_get_producer (node, "input", &pad_name);
-    if (iter && pad_name)
-      gegl_update_anim_time (iter, pad_name, time);
-    if (pad_name)
-      g_free (pad_name);
+    iter = gegl_node_get_producer (node, "input", NULL);
+    if (iter)
+      gegl_node_set_time (iter, time);
   }
   if (gegl_node_has_pad (node, "aux"))
   {
-    gchar *pad_name = NULL;
-    iter = gegl_node_get_producer (node, "aux", &pad_name);
-    if (iter && pad_name)
-      gegl_update_anim_time (iter, pad_name, time);
-    if (pad_name)
-      g_free (pad_name);
+    iter = gegl_node_get_producer (node, "aux", NULL);
+    if (iter)
+      gegl_node_set_time (iter, time);
   }
 
   {
diff --git a/gegl/gegl-utils.h b/gegl/gegl-utils.h
index 3551c2e7c..58839011f 100644
--- a/gegl/gegl-utils.h
+++ b/gegl/gegl-utils.h
@@ -94,15 +94,16 @@ GeglNode *gegl_node_new_from_serialized (const gchar *chaindata,
 
 
 /**
- * gegl_update_anim_time:
+ * gegl_node_set_time:
  * @node: a a GeglNode
- * @output_pad: the output pad to render, pass "output" here most of the time.
  * @time: the time to set the properties which have keyfraes attached to
+ *
+ * Sets the right value in animated properties of this node and all its
+ * dependendcies to be the specified time position.
  */
 
-void gegl_update_anim_time (GeglNode   *node,
-                            const char *output_pad,
-                            double      time);
+void gegl_node_set_time (GeglNode   *node,
+                         double      time);
 
 
 /**


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