[beast: 17/28] BEAST: bstmain.cc: extract method main_init_sfi_glue



commit 1e7edd72b4d5483f5ee9a71c839cb476cccaa242
Author: Tim Janik <timj gnu org>
Date:   Wed Dec 2 00:55:20 2015 +0100

    BEAST: bstmain.cc: extract method main_init_sfi_glue
    
    Signed-off-by: Tim Janik <timj gnu org>

 beast-gtk/bstmain.cc |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/beast-gtk/bstmain.cc b/beast-gtk/bstmain.cc
index a64cf88..82fdd5c 100644
--- a/beast-gtk/bstmain.cc
+++ b/beast-gtk/bstmain.cc
@@ -60,6 +60,7 @@ server_registration (SfiProxy     server,
     }
 }
 
+static void     main_init_sfi_glue();
 static void     main_init_gxk (int *argc, char *argv[]);
 static void     main_init_bst_systems();
 static void     main_load_rc_files();
@@ -81,7 +82,6 @@ static void     main_cleanup ();
 int
 main (int argc, char *argv[])
 {
-  GSource *source;
   /* initialize i18n */
   bindtextdomain (BST_GETTEXT_DOMAIN, bse_installpath (BSE_INSTALLPATH_LOCALEBASE).c_str());
   bind_textdomain_codeset (BST_GETTEXT_DOMAIN, "UTF-8");
@@ -111,18 +111,11 @@ main (int argc, char *argv[])
   setpriority (PRIO_PROCESS, getpid(), 0);
   // hook up Bse aida IDL with main loop
   bst_init_aida_idl();
-  // Setup SFI glue context and wakeup
-  sfi_glue_context_push (Bse::init_glue_context ("BEAST", bst_main_loop_wakeup));
-  source = g_source_simple (GDK_PRIORITY_EVENTS, // G_PRIORITY_HIGH - 100,
-                           (GSourcePending) sfi_glue_context_pending,
-                           (GSourceDispatch) sfi_glue_context_dispatch,
-                           NULL, NULL, NULL);
-  g_source_attach (source, NULL);
-  g_source_unref (source);
 
   // arg processing with BSE available, --help, --version
   bst_args_process (&argc, argv);
 
+  main_init_sfi_glue();
   main_init_gxk (&argc, argv);
   main_init_bst_systems();
   main_load_rc_files();
@@ -145,6 +138,19 @@ main (int argc, char *argv[])
 }
 
 static void
+main_init_sfi_glue()
+{
+  // setup SFI glue context and its wakeup
+  sfi_glue_context_push (Bse::init_glue_context ("BEAST", bst_main_loop_wakeup));
+  GSource *source = g_source_simple (GDK_PRIORITY_EVENTS, // G_PRIORITY_HIGH - 100,
+                                     (GSourcePending) sfi_glue_context_pending,
+                                     (GSourceDispatch) sfi_glue_context_dispatch,
+                                     NULL, NULL, NULL);
+  g_source_attach (source, NULL);
+  g_source_unref (source);
+}
+
+static void
 main_init_gxk (int *argc, char *argv[])
 {
   // initialize Gtk+ and go into threading mode


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