[beast: 6/9] BST: adjust to use Bse.Source.set_pos()



commit 49a640a5d54d1dc671d7026906e19ecadca9af5c
Author: Tim Janik <timj gnu org>
Date:   Wed Jul 26 20:54:11 2017 +0200

    BST: adjust to use Bse.Source.set_pos()
    
    Signed-off-by: Tim Janik <timj gnu org>

 beast-gtk/bstcanvassource.cc |   11 ++---------
 beast-gtk/bstsnetrouter.cc   |    5 ++---
 2 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/beast-gtk/bstcanvassource.cc b/beast-gtk/bstcanvassource.cc
index 1cc4bd1..781215c 100644
--- a/beast-gtk/bstcanvassource.cc
+++ b/beast-gtk/bstcanvassource.cc
@@ -209,14 +209,6 @@ bst_canvas_source_destroy (GtkObject *object)
 
 #define EPSILON 1e-6
 
-static void
-bse_source_set_module_coords (SfiProxy proxy, SfiReal x, SfiReal y)
-{
-  bse_source_set_pos (proxy,
-                      x / BST_CANVAS_SOURCE_PIXEL_SCALE,
-                      y / -BST_CANVAS_SOURCE_PIXEL_SCALE);
-}
-
 GnomeCanvasItem*
 bst_canvas_source_new (GnomeCanvasGroup *group,
                       SfiProxy          source)
@@ -914,7 +906,8 @@ bst_canvas_source_changed (BstCanvasSource *csource)
       GnomeCanvasItem *item = GNOME_CANVAS_ITEM (csource);
       gdouble x = 0, y = 0;
       gnome_canvas_item_i2w (item, &x, &y);
-      bse_source_set_module_coords (csource->source, x, y);
+      Bse::SourceH csource_source = Bse::SourceH::down_cast (bse_server.from_proxy (csource->source));
+      csource_source.set_pos (x / BST_CANVAS_SOURCE_PIXEL_SCALE, y / -BST_CANVAS_SOURCE_PIXEL_SCALE);
     }
 }
 
diff --git a/beast-gtk/bstsnetrouter.cc b/beast-gtk/bstsnetrouter.cc
index a1430d2..ad3b4e7 100644
--- a/beast-gtk/bstsnetrouter.cc
+++ b/beast-gtk/bstsnetrouter.cc
@@ -772,9 +772,8 @@ bst_snet_router_event (GtkWidget *widget,
             {
               bse_item_group_undo (self->snet.proxy_id(), "Create Module");
               SfiProxy module = self->snet.create_source (ad.entity).proxy_id();
-              bse_source_set_pos (module,
-                                  self->world_x / BST_CANVAS_SOURCE_PIXEL_SCALE,
-                                  self->world_y / -BST_CANVAS_SOURCE_PIXEL_SCALE);
+              Bse::SourceH sourceh = Bse::SourceH::down_cast (bse_server.from_proxy (module));
+              sourceh.set_pos (self->world_x / BST_CANVAS_SOURCE_PIXEL_SCALE, self->world_y / 
-BST_CANVAS_SOURCE_PIXEL_SCALE);
               bse_item_ungroup_undo (self->snet.proxy_id());
             }
           if (BST_SNET_EDIT_FALLBACK)


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