[beast: 3/10] BEAST: make use of init_server_instance() and init_server_connection()



commit 7af79da3feb9ae71732163c4e834401989eccd98
Author: Tim Janik <timj gnu org>
Date:   Tue Jan 19 23:16:19 2016 +0100

    BEAST: make use of init_server_instance() and init_server_connection()
    
    Signed-off-by: Tim Janik <timj gnu org>

 beast-gtk/bstmain.cc |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/beast-gtk/bstmain.cc b/beast-gtk/bstmain.cc
index df20da7..ec2ec37 100644
--- a/beast-gtk/bstmain.cc
+++ b/beast-gtk/bstmain.cc
@@ -618,19 +618,15 @@ echo_test_handler (const std::string &msg)
 static void
 bst_init_aida_idl()
 {
+  using namespace Rapicorn::Aida;
   assert (bse_server == NULL);
   // connect to BSE thread and fetch server handle
-  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 ("%s: failed to connect to BSE internally: %s", __func__, g_strerror (errno));
+  ClientConnectionP connection = Bse::init_server_connection();
+  assert (connection != NULL);
+  bse_server = Bse::init_server_instance();
+  assert (bse_server != NULL);
   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 (connection.get());
   g_source_set_priority (source, G_PRIORITY_DEFAULT);


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