[beast: 11/39] BSE: use bse_installpath() and bse_version(), get rid of topconfig.h



commit 0aaaf408de5821be9762f16f2a0e94a173edb4a3
Author: Tim Janik <timj gnu org>
Date:   Fri Sep 11 23:57:53 2015 +0200

    BSE: use bse_installpath() and bse_version(), get rid of topconfig.h

 bse/bsegconfig.cc        |    4 ++--
 bse/bseladspa.cc         |    4 +---
 bse/bseloader-mad.cc     |    2 +-
 bse/bsemain.cc           |    9 +++++----
 bse/bseplugin.cc         |   12 +++++-------
 bse/bsescripthelper.cc   |    5 ++---
 bse/bseserver.cc         |   19 +++++++++----------
 bse/bsewave.cc           |    3 +--
 bse/gsldatahandle-mad.cc |    2 +-
 9 files changed, 27 insertions(+), 33 deletions(-)
---
diff --git a/bse/bsegconfig.cc b/bse/bsegconfig.cc
index 346416f..276c053 100644
--- a/bse/bsegconfig.cc
+++ b/bse/bsegconfig.cc
@@ -2,7 +2,7 @@
 #include "bsegconfig.hh"
 #include "bseserver.hh"
 #include "bsepcmdevice.hh"     /* for frequency alignment */
-#include "data/config-paths.h"
+#include "../configure.h"
 #include <sys/types.h>
 #include <regex.h>
 
@@ -45,7 +45,7 @@ _bse_gconfig_init (void)
 static const char*
 intern_path_user_data ()
 {
-  return g_intern_strconcat (BSE_PATH_USER_DATA ("/"), "", NULL);
+  return g_intern_strconcat (bse_installpath (BSE_INSTALLPATH_USER_DATA).c_str(), "", NULL);
 }
 
 static const char*
diff --git a/bse/bseladspa.cc b/bse/bseladspa.cc
index b410b94..5687ddc 100644
--- a/bse/bseladspa.cc
+++ b/bse/bseladspa.cc
@@ -634,15 +634,13 @@ bse_ladspa_plugin_check_load (const gchar *file_name)
   return error;
 }
 
-#include "topconfig.h"
-
 extern "C" SfiRing*
 bse_ladspa_plugin_path_list_files (void)
 {
   SfiRing *ring1, *ring2 = NULL, *ring3 = NULL;
   const gchar *paths;
 
-  ring1 = sfi_file_crawler_list_files (BSE_PATH_LADSPA, "*.so", GFileTest (0));
+  ring1 = sfi_file_crawler_list_files (bse_installpath (BSE_INSTALLPATH_LADSPA).c_str(), "*.so", GFileTest 
(0));
   ring1 = sfi_ring_sort (ring1, (SfiCompareFunc) strcmp, NULL);
 
   paths = g_getenv ("LADSPA_PATH");
diff --git a/bse/bseloader-mad.cc b/bse/bseloader-mad.cc
index 3ab3c20..35852b0 100644
--- a/bse/bseloader-mad.cc
+++ b/bse/bseloader-mad.cc
@@ -1,5 +1,5 @@
 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
-#include "topconfig.h"
+#include "../configure.h"
 #include "bse/bseloader.hh"
 #include "gsldatahandle-mad.hh"
 
diff --git a/bse/bsemain.cc b/bse/bsemain.cc
index e26619b..35b5934 100644
--- a/bse/bsemain.cc
+++ b/bse/bsemain.cc
@@ -1,7 +1,6 @@
 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
 #include "bsemain.hh"
 #include "bsestartup.hh"
-#include "topconfig.h"
 #include "bseserver.hh"
 #include "bsesequencer.hh"
 #include "bsejanitor.hh"
@@ -39,7 +38,7 @@ static BseMainArgs       default_main_args = {
   10 * 1024 * 1024,     // dcache_cache_memory
   BSE_KAMMER_NOTE,      // midi_kammer_note (69)
   BSE_KAMMER_FREQUENCY, // kammer_freq (440Hz, historically 435Hz)
-  BSE_PATH_BINARIES,    // path_binaries
+  NULL,                 // path_binaries
   NULL,                 // bse_rcfile
   NULL,                 // override_plugin_globs
   NULL,                 // override_script_path
@@ -58,7 +57,7 @@ void
 bse_bindtextdomain()
 {
   assert_return (bindtextdomain_initialized == false);
-  bindtextdomain (BSE_GETTEXT_DOMAIN, BST_PATH_LOCALE);
+  bindtextdomain (BSE_GETTEXT_DOMAIN, bse_installpath (BSE_INSTALLPATH_LOCALEBASE).c_str());
   bind_textdomain_codeset (BSE_GETTEXT_DOMAIN, "UTF-8");
   bindtextdomain_initialized = true;
 }
@@ -206,6 +205,8 @@ initialize_with_argv (int *argc, char **argv, const char *app_name, const Bse::S
     g_set_prgname (*argv);
 
   // argument handling
+  if (!default_main_args.path_binaries)
+    default_main_args.path_binaries = g_strdup (bse_installpath (BSE_INSTALLPATH_BINDIR).c_str());
   bse_main_args = &default_main_args;
   if (argc && argv)
     init_parse_args (argc, argv, bse_main_args, args);
@@ -568,7 +569,7 @@ init_aida_idl ()
 {
   // setup Aida server connection, so ServerIface::__aida_connection__() yields non-NULL
   Aida::ServerConnectionP scon =
-    Aida::ServerConnection::bind<Bse::ServerIface> ("inproc://BSE-" BST_VERSION,
+    Aida::ServerConnection::bind<Bse::ServerIface> (string_format ("inproc://BSE-%s", bse_version()),
                                                     shared_ptr_cast<Bse::ServerIface> 
(&Bse::ServerImpl::instance()));
   if (!scon)
     sfi_error ("%s: failed to create BSE connection: %s", __func__, g_strerror (errno));
diff --git a/bse/bseplugin.cc b/bse/bseplugin.cc
index 2d07440..67a9a8d 100644
--- a/bse/bseplugin.cc
+++ b/bse/bseplugin.cc
@@ -1,6 +1,6 @@
 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
 #include "bseplugin.hh"
-
+#include "../configure.h"
 #include "bsecategories.hh"
 #include "bseprocedure.hh"
 #include "bseobject.hh"
@@ -694,8 +694,6 @@ bse_plugin_check_load (const gchar *const_file_name)
   return error;
 }
 
-#include "topconfig.h"
-
 static bool
 plugin_extension_filter (const char  *fname,
                          guint        n,
@@ -735,16 +733,16 @@ bse_plugin_path_list_files (gboolean include_drivers,
     {
       if (include_drivers)
         {
-          files = sfi_file_crawler_list_files (BSE_PATH_DRIVERS, "*" PLUGIN_EXTENSION, 
G_FILE_TEST_IS_REGULAR);
+          files = sfi_file_crawler_list_files (bse_installpath (BSE_INSTALLPATH_PKGLIBDIR_DRIVERS).c_str(), 
"*" PLUGIN_EXTENSION, G_FILE_TEST_IS_REGULAR);
           ring = sfi_ring_concat (ring, sfi_ring_sort (files, (SfiCompareFunc) strcmp, NULL));
-          files = sfi_file_crawler_list_files (BSE_PATH_DRIVERS, "*.o", G_FILE_TEST_IS_REGULAR);
+          files = sfi_file_crawler_list_files (bse_installpath (BSE_INSTALLPATH_PKGLIBDIR_DRIVERS).c_str(), 
"*.o", G_FILE_TEST_IS_REGULAR);
           ring = sfi_ring_concat (ring, sfi_ring_sort (files, (SfiCompareFunc) strcmp, NULL));
         }
       if (include_plugins)
         {
-          files = sfi_file_crawler_list_files (BSE_PATH_PLUGINS, "*" PLUGIN_EXTENSION, 
G_FILE_TEST_IS_REGULAR);
+          files = sfi_file_crawler_list_files (bse_installpath (BSE_INSTALLPATH_PKGLIBDIR_PLUGINS).c_str(), 
"*" PLUGIN_EXTENSION, G_FILE_TEST_IS_REGULAR);
           ring = sfi_ring_concat (ring, sfi_ring_sort (files, (SfiCompareFunc) strcmp, NULL));
-          files = sfi_file_crawler_list_files (BSE_PATH_PLUGINS, "*.o", G_FILE_TEST_IS_REGULAR);
+          files = sfi_file_crawler_list_files (bse_installpath (BSE_INSTALLPATH_PKGLIBDIR_PLUGINS).c_str(), 
"*.o", G_FILE_TEST_IS_REGULAR);
           ring = sfi_ring_concat (ring, sfi_ring_sort (files, (SfiCompareFunc) strcmp, NULL));
         }
       if (include_plugins && BSE_GCONFIG (plugin_path) && BSE_GCONFIG (plugin_path)[0])
diff --git a/bse/bsescripthelper.cc b/bse/bsescripthelper.cc
index 3ae4b24..40602f8 100644
--- a/bse/bsescripthelper.cc
+++ b/bse/bsescripthelper.cc
@@ -1,7 +1,6 @@
 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
 #include "bsescripthelper.hh"
-
-#include "topconfig.h"
+#include "../configure.h"
 #include "bsecategories.hh"
 #include "bsejanitor.hh"
 #include "bseserver.hh"
@@ -232,7 +231,7 @@ bse_script_path_list_files (void)
     }
   if (1)
     {
-      files = sfi_file_crawler_list_files (BSE_PATH_SCRIPTS, "*.scm", G_FILE_TEST_IS_REGULAR);
+      files = sfi_file_crawler_list_files (bse_installpath (BSE_INSTALLPATH_PKGDATADIR_SCRIPTS).c_str(), 
"*.scm", G_FILE_TEST_IS_REGULAR);
       ring = sfi_ring_concat (ring, sfi_ring_sort (files, (SfiCompareFunc) strcmp, NULL));
     }
   if (BSE_GCONFIG (script_path) && BSE_GCONFIG (script_path)[0])
diff --git a/bse/bseserver.cc b/bse/bseserver.cc
index 7b92243..d8b39d0 100644
--- a/bse/bseserver.cc
+++ b/bse/bseserver.cc
@@ -12,7 +12,6 @@
 #include "bsejanitor.hh"
 #include "bsecxxplugin.hh"
 #include "bsepcmmodule.cc"
-#include "topconfig.h"
 #include "gsldatahandle-mad.hh"
 #include "gslvorbis-enc.hh"
 #include "bsescripthelper.hh"
@@ -1158,49 +1157,49 @@ ServerImpl::get_vorbis_version ()
 String
 ServerImpl::get_ladspa_path ()
 {
-  return Path::searchpath_join (BSE_PATH_LADSPA, BSE_GCONFIG (ladspa_path));
+  return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_LADSPA), BSE_GCONFIG (ladspa_path));
 }
 
 String
 ServerImpl::get_plugin_path ()
 {
-  return Path::searchpath_join (BSE_PATH_PLUGINS, BSE_GCONFIG (plugin_path));
+  return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_PKGLIBDIR_PLUGINS), BSE_GCONFIG 
(plugin_path));
 }
 
 String
 ServerImpl::get_script_path ()
 {
-  return Path::searchpath_join (BSE_PATH_SCRIPTS, BSE_GCONFIG (script_path));
+  return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_PKGDATADIR_SCRIPTS), BSE_GCONFIG 
(script_path));
 }
 
 String
 ServerImpl::get_instrument_path ()
 {
-  return Path::searchpath_join (BSE_PATH_INSTRUMENTS, BSE_GCONFIG (instrument_path));
+  return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_PKGDATADIR_INSTRUMENTS), BSE_GCONFIG 
(instrument_path));
 }
 
 String
 ServerImpl::get_sample_path ()
 {
-  return Path::searchpath_join (BSE_PATH_SAMPLES, BSE_GCONFIG (sample_path));
+  return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_PKGDATADIR_SAMPLES), BSE_GCONFIG 
(sample_path));
 }
 
 String
 ServerImpl::get_effect_path ()
 {
-  return Path::searchpath_join (BSE_PATH_EFFECTS, BSE_GCONFIG (effect_path));
+  return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_PKGDATADIR_EFFECTS), BSE_GCONFIG 
(effect_path));
 }
 
 String
 ServerImpl::get_demo_path ()
 {
-  return BSE_PATH_DEMOS;
+  return bse_installpath (BSE_INSTALLPATH_PKGDATADIR_DEMO);
 }
 
 String
 ServerImpl::get_version ()
 {
-  return BST_VERSION;
+  return bse_version();
 }
 
 String
@@ -1227,7 +1226,7 @@ ServerImpl::save_preferences ()
     return;
 
   SfiWStore *wstore = sfi_wstore_new ();
-  sfi_wstore_printf (wstore, "; rc-file for BSE v%s\n", BST_VERSION);
+  sfi_wstore_printf (wstore, "; rc-file for BSE v%s\n", bse_version());
 
   /* store BseGConfig */
   sfi_wstore_puts (wstore, "\n; BseGConfig Dump\n");
diff --git a/bse/bsewave.cc b/bse/bsewave.cc
index c898fc2..a9e4b7c 100644
--- a/bse/bsewave.cc
+++ b/bse/bsewave.cc
@@ -7,7 +7,6 @@
 #include "gsldatahandle.hh"
 #include "bseserver.hh"
 #include "bseloader.hh"
-#include "topconfig.h"
 
 #include <string.h>
 
@@ -268,7 +267,7 @@ bse_wave_load_wave_file (BseWave      *self,
       if (bse_main_args->override_sample_path)
        sample_path = bse_main_args->override_sample_path;
       else
-       sample_path = Rapicorn::Path::searchpath_join (BSE_PATH_SAMPLES, BSE_GCONFIG (sample_path));
+       sample_path = Rapicorn::Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_PKGDATADIR_SAMPLES), 
BSE_GCONFIG (sample_path));
       files = sfi_file_crawler_list_files (sample_path.c_str(), file_name, G_FILE_TEST_IS_REGULAR);
 
       for (walk = files; walk; walk = sfi_ring_walk (files, walk))
diff --git a/bse/gsldatahandle-mad.cc b/bse/gsldatahandle-mad.cc
index 71e5b7b..52bd383 100644
--- a/bse/gsldatahandle-mad.cc
+++ b/bse/gsldatahandle-mad.cc
@@ -1,5 +1,5 @@
 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
-#include "topconfig.h"
+#include "../configure.h"
 #include <bse/gsldatahandle-mad.hh>
 #include "gslfilehash.hh"
 #include <bse/gsldatautils.hh>


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