[beast: 2/7] BEAST: use the new Rapicorn::Aida::ClientConnection::connect API for startup



commit be7a6a8df1a638d944439fb99ecc3f75efbed02d
Author: Tim Janik <timj gnu org>
Date:   Mon Jul 13 04:22:28 2015 +0200

    BEAST: use the new Rapicorn::Aida::ClientConnection::connect API for startup

 beast-gtk/bstmain.cc |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/beast-gtk/bstmain.cc b/beast-gtk/bstmain.cc
index 35c3494..d0fb6af 100644
--- a/beast-gtk/bstmain.cc
+++ b/beast-gtk/bstmain.cc
@@ -442,14 +442,19 @@ bst_init_aida_idl()
 {
   assert (bse_server == NULL);
   // connect to BSE thread and fetch server handle
-  bse_server = Rapicorn::Aida::ObjectBroker::connect<Bse::ServerH> ("inproc://BSE-" BST_VERSION);
+  Rapicorn::Aida::ClientConnectionP connection =
+    Rapicorn::Aida::ClientConnection::connect ("inproc://BSE-" BST_VERSION);
+  if (connection)
+    bse_server = connection->remote_origin<Bse::ServerH>();
   if (!bse_server)
-    sfi_error ("failed to connect to BSE: %s", g_strerror (errno));
-  assert (bse_server != NULL);
+    sfi_error ("%s: failed to connect to BSE internally: %s", __func__, g_strerror (errno));
   assert (bse_server.proxy_id() == BSE_SERVER);
   assert (bse_server.from_proxy (BSE_SERVER) == bse_server);
+  // keep connection alive for entire runtime
+  static Rapicorn::Aida::ClientConnectionP *static_connection = new Rapicorn::Aida::ClientConnectionP 
(connection);
+  (void) static_connection;
   // hook Aida connection into our main loop
-  Bse::AidaGlibSource *source = Bse::AidaGlibSource::create (Bse::ServerH::__aida_connection__());
+  Bse::AidaGlibSource *source = Bse::AidaGlibSource::create (connection.get());
   g_source_set_priority (source, G_PRIORITY_DEFAULT);
   g_source_attach (source, g_main_context_default());
 


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