[beast: 4/12] BEAST: use SnetH methods



commit 754426f661c89f3406ad001224c0a808912783a1
Author: Tim Janik <timj gnu org>
Date:   Tue Sep 22 18:25:36 2015 +0200

    BEAST: use SnetH methods

 beast-gtk/bstplayback.cc   |   13 +++++++------
 beast-gtk/bstplayback.hh   |    2 +-
 beast-gtk/bstsnetrouter.cc |   10 ++++++----
 3 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/beast-gtk/bstplayback.cc b/beast-gtk/bstplayback.cc
index 9582ac2..d31e6c4 100644
--- a/beast-gtk/bstplayback.cc
+++ b/beast-gtk/bstplayback.cc
@@ -22,15 +22,16 @@ bst_play_back_handle_new (void)
   if (BST_DBG_EXT)
     gxk_idle_show_widget (GTK_WIDGET (bst_app_new (handle->project)));
 
-  handle->snet = bse_project_create_csynth (handle->project.proxy_id(), NULL);
-  bse_proxy_set (handle->snet, "auto_activate", TRUE, NULL);
-  handle->speaker = bse_snet_create_source (handle->snet, "BsePcmOutput");
-  handle->wosc1 = bse_snet_create_source (handle->snet, "BseWaveOsc");
-  handle->wosc2 = bse_snet_create_source (handle->snet, "BseWaveOsc");
+  SfiProxy snet_proxy = bse_project_create_csynth (handle->project.proxy_id(), NULL);
+  handle->snet = Bse::SNetH::down_cast (bse_server.from_proxy (snet_proxy));
+  bse_proxy_set (handle->snet.proxy_id(), "auto_activate", TRUE, NULL);
+  handle->speaker = handle->snet.create_source ("BsePcmOutput").proxy_id();
+  handle->wosc1 = handle->snet.create_source ("BseWaveOsc").proxy_id();
+  handle->wosc2 = handle->snet.create_source ("BseWaveOsc").proxy_id();
   bse_proxy_set (handle->wosc2, "channel", 2, NULL);
   bse_source_set_input_by_id (handle->speaker, 0, handle->wosc1, 0);
   bse_source_set_input_by_id (handle->speaker, 1, handle->wosc2, 0);
-  handle->constant = bse_snet_create_source (handle->snet, "BseConstant");
+  handle->constant = handle->snet.create_source ("BseConstant").proxy_id();
   bse_source_set_input_by_id (handle->wosc1, 0, handle->constant, 0);
   bse_source_set_input_by_id (handle->wosc2, 0, handle->constant, 0);
   bse_proxy_connect (handle->wosc1,
diff --git a/beast-gtk/bstplayback.hh b/beast-gtk/bstplayback.hh
index 20dc7d3..d576933 100644
--- a/beast-gtk/bstplayback.hh
+++ b/beast-gtk/bstplayback.hh
@@ -16,7 +16,7 @@ typedef void (*BstPlayBackNotify)     (gpointer       data,
 typedef struct
 {
   Bse::ProjectH project;
-  SfiProxy snet;
+  Bse::SNetH    snet;
   SfiProxy speaker;
   SfiProxy wosc1, wosc2;
   SfiProxy constant;
diff --git a/beast-gtk/bstsnetrouter.cc b/beast-gtk/bstsnetrouter.cc
index 4c62786..03108f6 100644
--- a/beast-gtk/bstsnetrouter.cc
+++ b/beast-gtk/bstsnetrouter.cc
@@ -709,7 +709,10 @@ bst_snet_router_root_event (BstSNetRouter   *self,
                   bst_canvas_source_popup_info (csource);
                   break;
                 case 1:
-                  error = bse_snet_remove_source (self->snet.proxy_id(), csource->source);
+                  {
+                    Bse::SourceH source = Bse::SourceH::down_cast (bse_server.from_proxy (csource->source));
+                    error = self->snet.remove_source (source);
+                  }
                   bst_status_eprintf (error, _("Remove Module"));
                   break;
                 case 0: break;
@@ -781,12 +784,11 @@ bst_snet_router_event (GtkWidget *widget,
                                         event->button.x, event->button.y,
                                         &self->world_x, &self->world_y);
 
-          error = bse_snet_can_create_source (self->snet.proxy_id(), cat->type);
+          error = self->snet.can_create_source (cat->type);
           if (!error)
             {
-              SfiProxy module;
               bse_item_group_undo (self->snet.proxy_id(), "Create Module");
-              module = bse_snet_create_source (self->snet.proxy_id(), cat->type);
+              SfiProxy module = self->snet.create_source (cat->type).proxy_id();
               bse_source_set_pos (module,
                                   self->world_x / BST_CANVAS_SOURCE_PIXEL_SCALE,
                                   self->world_y / -BST_CANVAS_SOURCE_PIXEL_SCALE);


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