[beast: 2/14] BSE: move version(), installpath() and INSTALLPATH_* into Bse namespace
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 2/14] BSE: move version(), installpath() and INSTALLPATH_* into Bse namespace
- Date: Sat, 19 Mar 2016 13:12:46 +0000 (UTC)
commit f7f5eb39c393df0d37da2343ed9234bb652f8211
Author: Tim Janik <timj gnu org>
Date: Sun Dec 6 16:00:49 2015 +0100
BSE: move version(), installpath() and INSTALLPATH_* into Bse namespace
Signed-off-by: Tim Janik <timj gnu org>
beast-gtk/bstapp.cc | 2 +-
beast-gtk/bstdefs.hh | 2 +-
beast-gtk/bstgconfig.cc | 2 +-
beast-gtk/bstkeybindings.cc | 4 +-
beast-gtk/bstmain.cc | 30 ++++++++++----------
beast-gtk/bstmsgabsorb.cc | 12 ++++----
beast-gtk/bstpreferences.cc | 4 +-
beast-gtk/bstskinconfig.cc | 2 +-
beast-gtk/testgui.cc | 6 ++--
beast-gtk/tsmview.cc | 4 +-
bse/bsegconfig.cc | 2 +-
bse/bseladspa.cc | 2 +-
bse/bsemain.cc | 6 ++--
bse/bseplugin.cc | 8 +++---
bse/bsescripthelper.cc | 2 +-
bse/bseserver.cc | 18 ++++++------
bse/bsewave.cc | 2 +-
configure.ac | 16 +++++-----
sfi/glib-extra.cc | 45 +++++++++++++++++-------------
sfi/glib-extra.hh | 64 ++++++++++++++++++++++++-------------------
sfi/sfidl-options.cc | 4 +-
shell/bsescm.cc | 2 +-
tests/bse/filtertest.cc | 2 +-
tests/testresampler.cc | 2 +-
tools/bsefcompare.cc | 2 +-
tools/bsefextract.cc | 4 +-
26 files changed, 131 insertions(+), 118 deletions(-)
---
diff --git a/beast-gtk/bstapp.cc b/beast-gtk/bstapp.cc
index 828bc0a..89978f2 100644
--- a/beast-gtk/bstapp.cc
+++ b/beast-gtk/bstapp.cc
@@ -1020,7 +1020,7 @@ app_action_exec (gpointer data,
BROWSE_LOCAL_URL:
if (docs_url)
{
- gchar *local_url = g_strconcat ("file://", bse_installpath (BSE_INSTALLPATH_DOCDIR).c_str(), "/",
docs_url, NULL);
+ gchar *local_url = g_strconcat ("file://", Bse::installpath (Bse::INSTALLPATH_DOCDIR).c_str(),
"/", docs_url, NULL);
sfi_url_show (local_url);
g_free (local_url);
}
diff --git a/beast-gtk/bstdefs.hh b/beast-gtk/bstdefs.hh
index a0342f8..d70f403 100644
--- a/beast-gtk/bstdefs.hh
+++ b/beast-gtk/bstdefs.hh
@@ -50,7 +50,7 @@ typedef enum /*< skip >*/
#define BST_TAG_DIAMETER (20)
#define BST_STRDUP_RC_FILE() (g_strconcat (g_get_home_dir (), "/.beast/beastrc", NULL))
#define BST_STRDUP_SKIN_PATH() (g_strconcat ("~/.beast/skins/:~/.beast/skins/*/:", \
- bse_installpath (BSE_INSTALLPATH_DATADIR_SKINS).c_str(),
NULL))
+ Bse::installpath (Bse::INSTALLPATH_DATADIR_SKINS).c_str(),
NULL))
/* --- configuration candidates --- */
/* mouse button numbers and masks for drag operations */
diff --git a/beast-gtk/bstgconfig.cc b/beast-gtk/bstgconfig.cc
index a94bf5c..0cb7a64 100644
--- a/beast-gtk/bstgconfig.cc
+++ b/beast-gtk/bstgconfig.cc
@@ -154,7 +154,7 @@ bst_rc_dump (const gchar *file_name)
wstore = sfi_wstore_new ();
- sfi_wstore_printf (wstore, "; rc-file for BEAST v%s\n", bse_version().c_str());
+ sfi_wstore_printf (wstore, "; rc-file for BEAST v%s\n", Bse::version().c_str());
/* store BstGConfig */
sfi_wstore_puts (wstore, "\n; BstGConfig Dump\n");
diff --git a/beast-gtk/bstkeybindings.cc b/beast-gtk/bstkeybindings.cc
index 544febe..e026187 100644
--- a/beast-gtk/bstkeybindings.cc
+++ b/beast-gtk/bstkeybindings.cc
@@ -216,7 +216,7 @@ key_bindings_exec_action (gpointer data,
static GtkWidget *load_dialog = NULL;
if (!load_dialog)
load_dialog = bst_file_dialog_create();
- bst_file_dialog_setup (load_dialog, self, _("Load Key Binding"), bse_installpath
(BSE_INSTALLPATH_DATADIR_KEYS).c_str());
+ bst_file_dialog_setup (load_dialog, self, _("Load Key Binding"), Bse::installpath
(Bse::INSTALLPATH_DATADIR_KEYS).c_str());
gxk_widget_showraise (load_dialog);
bst_file_dialog_set_handler (BST_FILE_DIALOG (load_dialog), key_bindings_load_file, self, NULL);
}
@@ -612,7 +612,7 @@ bst_key_binding_dump (const gchar *file_name,
wstore = sfi_wstore_new ();
- sfi_wstore_printf (wstore, "; key-binding-file for BEAST v%s\n", bse_version().c_str());
+ sfi_wstore_printf (wstore, "; key-binding-file for BEAST v%s\n", Bse::version().c_str());
/* store BstKeyBinding */
sfi_wstore_puts (wstore, "\n");
diff --git a/beast-gtk/bstmain.cc b/beast-gtk/bstmain.cc
index 9062532..be7b71c 100644
--- a/beast-gtk/bstmain.cc
+++ b/beast-gtk/bstmain.cc
@@ -84,7 +84,7 @@ int
main (int argc, char *argv[])
{
/* initialize i18n */
- bindtextdomain (BST_GETTEXT_DOMAIN, bse_installpath (BSE_INSTALLPATH_LOCALEBASE).c_str());
+ bindtextdomain (BST_GETTEXT_DOMAIN, Bse::installpath (Bse::INSTALLPATH_LOCALEBASE).c_str());
bind_textdomain_codeset (BST_GETTEXT_DOMAIN, "UTF-8");
textdomain (BST_GETTEXT_DOMAIN);
setlocale (LC_ALL, "");
@@ -168,8 +168,8 @@ main_init_gxk (int *argc, char *argv[])
// initialize Gtk+ Extensions
gxk_init ();
// documentation search paths
- gxk_text_add_tsm_path (bse_installpath (BSE_INSTALLPATH_DOCDIR).c_str());
- gxk_text_add_tsm_path (bse_installpath (BSE_INSTALLPATH_DATADIR_IMAGES).c_str());
+ gxk_text_add_tsm_path (Bse::installpath (Bse::INSTALLPATH_DOCDIR).c_str());
+ gxk_text_add_tsm_path (Bse::installpath (Bse::INSTALLPATH_DATADIR_IMAGES).c_str());
gxk_text_add_tsm_path (".");
// now, we can popup the splash screen
beast_splash = bst_splash_new ("BEAST-Splash", BST_SPLASH_WIDTH, BST_SPLASH_HEIGHT, 15);
@@ -207,7 +207,7 @@ main_show_splash_image()
{
/* show splash images */
bst_splash_update_item (beast_splash, _("Splash Image"));
- gchar *string = g_strconcat (bse_installpath (BSE_INSTALLPATH_DATADIR_IMAGES).c_str(), G_DIR_SEPARATOR_S,
BST_SPLASH_IMAGE, NULL);
+ gchar *string = g_strconcat (Bse::installpath (Bse::INSTALLPATH_DATADIR_IMAGES).c_str(),
G_DIR_SEPARATOR_S, BST_SPLASH_IMAGE, NULL);
GdkPixbufAnimation *anim = gdk_pixbuf_animation_new_from_file (string, NULL);
g_free (string);
bst_splash_update ();
@@ -728,19 +728,19 @@ bst_args_process (int *argc_p, char **argv)
const char *arg = argv[i][12 - 1] == '=' ? argv[i] + 12 : (argv[i + 1] ? argv[i + 1] : "");
char *freeme = NULL;
if (strcmp (arg, "docs") == 0)
- printout ("%s\n", bse_installpath (BSE_INSTALLPATH_DOCDIR).c_str());
+ printout ("%s\n", Bse::installpath (Bse::INSTALLPATH_DOCDIR).c_str());
else if (strcmp (arg, "images") == 0)
- printout ("%s\n", bse_installpath (BSE_INSTALLPATH_DATADIR_IMAGES).c_str());
+ printout ("%s\n", Bse::installpath (Bse::INSTALLPATH_DATADIR_IMAGES).c_str());
else if (strcmp (arg, "locale") == 0)
- printout ("%s\n", bse_installpath (BSE_INSTALLPATH_LOCALEBASE).c_str());
+ printout ("%s\n", Bse::installpath (Bse::INSTALLPATH_LOCALEBASE).c_str());
else if (strcmp (arg, "skins") == 0)
printout ("%s\n", freeme = BST_STRDUP_SKIN_PATH ());
else if (strcmp (arg, "keys") == 0)
- printout ("%s\n", bse_installpath (BSE_INSTALLPATH_DATADIR_KEYS).c_str());
+ printout ("%s\n", Bse::installpath (Bse::INSTALLPATH_DATADIR_KEYS).c_str());
else if (strcmp (arg, "ladspa") == 0)
- printout ("%s\n", bse_installpath (BSE_INSTALLPATH_LADSPA).c_str());
+ printout ("%s\n", Bse::installpath (Bse::INSTALLPATH_LADSPA).c_str());
else if (strcmp (arg, "plugins") == 0)
- printout ("%s\n", bse_installpath (BSE_INSTALLPATH_BSELIBDIR_PLUGINS).c_str());
+ printout ("%s\n", Bse::installpath (Bse::INSTALLPATH_BSELIBDIR_PLUGINS).c_str());
else if (strcmp (arg, "samples") == 0)
printout ("%s\n", bse_server.get_sample_path());
else if (strcmp (arg, "effects") == 0)
@@ -812,11 +812,11 @@ bst_exit_print_version (void)
printout ("Intrinsic code selected according to runtime CPU detection:\n");
printout ("%s", Rapicorn::cpu_info().c_str());
printout ("\n");
- printout ("Binaries: %s\n", bse_installpath (BSE_INSTALLPATH_BINDIR).c_str());
- printout ("Doc Path: %s\n", bse_installpath (BSE_INSTALLPATH_DOCDIR).c_str());
- printout ("Image Path: %s\n", bse_installpath (BSE_INSTALLPATH_DATADIR_IMAGES).c_str());
- printout ("Locale Path: %s\n", bse_installpath (BSE_INSTALLPATH_LOCALEBASE).c_str());
- printout ("Keyrc Path: %s\n", bse_installpath (BSE_INSTALLPATH_DATADIR_KEYS).c_str());
+ printout ("Binaries: %s\n", Bse::installpath (Bse::INSTALLPATH_BINDIR).c_str());
+ printout ("Doc Path: %s\n", Bse::installpath (Bse::INSTALLPATH_DOCDIR).c_str());
+ printout ("Image Path: %s\n", Bse::installpath (Bse::INSTALLPATH_DATADIR_IMAGES).c_str());
+ printout ("Locale Path: %s\n", Bse::installpath (Bse::INSTALLPATH_LOCALEBASE).c_str());
+ printout ("Keyrc Path: %s\n", Bse::installpath (Bse::INSTALLPATH_DATADIR_KEYS).c_str());
printout ("Skin Path: %s\n", freeme = BST_STRDUP_SKIN_PATH());
printout ("Sample Path: %s\n", bse_server.get_sample_path());
printout ("Script Path: %s\n", bse_server.get_script_path());
diff --git a/beast-gtk/bstmsgabsorb.cc b/beast-gtk/bstmsgabsorb.cc
index 6a86b68..50d870c 100644
--- a/beast-gtk/bstmsgabsorb.cc
+++ b/beast-gtk/bstmsgabsorb.cc
@@ -96,9 +96,9 @@ bst_msg_absorb_config_update (const gchar *config_blurb)
if (mstrings[i].cstring == config_blurb)
{
Bst::MsgAbsorbString &mas = mstrings[i];
- if (mas.version != bse_version())
+ if (mas.version != Bse::version())
{
- mas.version = bse_version();
+ mas.version = Bse::version();
changed = TRUE;
}
break;
@@ -118,17 +118,17 @@ bst_msg_absorb_config_adjust (const gchar *config_blurb, bool enabled, bool upda
if (i >= mstrings.size())
{
Bst::MsgAbsorbString mas;
- mas.version = bse_version();
+ mas.version = Bse::version();
mas.cstring = config_blurb;
mas.enabled = !enabled; // forces change
i = mstrings.size();
mstrings.push_back (mas);
}
- if (mstrings[i].enabled != enabled || (update_version && bse_version() != mstrings[i].version))
+ if (mstrings[i].enabled != enabled || (update_version && Bse::version() != mstrings[i].version))
{
Bst::MsgAbsorbString &mas = mstrings[i];
if (update_version)
- mas.version = bse_version();
+ mas.version = Bse::version();
mas.enabled = enabled;
return true;
}
@@ -244,7 +244,7 @@ bst_msg_absorb_config_dump (const gchar *file_name)
SfiWStore *wstore = sfi_wstore_new ();
- sfi_wstore_printf (wstore, "; message-absorb-config-file for BEAST v%s\n", bse_version().c_str());
+ sfi_wstore_printf (wstore, "; message-absorb-config-file for BEAST v%s\n", Bse::version().c_str());
/* store config */
sfi_wstore_puts (wstore, "\n");
diff --git a/beast-gtk/bstpreferences.cc b/beast-gtk/bstpreferences.cc
index 790a50f..feb7af6 100644
--- a/beast-gtk/bstpreferences.cc
+++ b/beast-gtk/bstpreferences.cc
@@ -212,7 +212,7 @@ bst_preferences_default_revert (BstPreferences *self)
rec = sfi_rec_new ();
sfi_rec_validate (rec, sfi_pspec_get_rec_fields (bst_gconfig_pspec ()));
- bst_gconfig_set_rec_rc_version (rec, bse_version().c_str());
+ bst_gconfig_set_rec_rc_version (rec, Bse::version().c_str());
sfi_rec_swap_fields (self->rec_gconfig, rec);
sfi_rec_unref (rec);
@@ -291,7 +291,7 @@ bst_preferences_load_rc_files (void)
if (error == Bse::ERROR_FILE_NOT_FOUND)
{
/* try loading fallback table */
- gchar *file = g_strconcat (bse_installpath (BSE_INSTALLPATH_DATADIR_KEYS).c_str(), G_DIR_SEPARATOR_S,
"keyrc.us", NULL);
+ gchar *file = g_strconcat (Bse::installpath (Bse::INSTALLPATH_DATADIR_KEYS).c_str(),
G_DIR_SEPARATOR_S, "keyrc.us", NULL);
error = bst_key_binding_parse (file, slist);
g_free (file);
}
diff --git a/beast-gtk/bstskinconfig.cc b/beast-gtk/bstskinconfig.cc
index 041be2c..0cb32e5 100644
--- a/beast-gtk/bstskinconfig.cc
+++ b/beast-gtk/bstskinconfig.cc
@@ -206,7 +206,7 @@ bst_skin_dump (const gchar *file_name)
wstore = sfi_wstore_new ();
- sfi_wstore_printf (wstore, "; skin-file for BEAST v%s\n", bse_version().c_str());
+ sfi_wstore_printf (wstore, "; skin-file for BEAST v%s\n", Bse::version().c_str());
/* store BstSkinConfig */
sfi_wstore_puts (wstore, "\n");
diff --git a/beast-gtk/testgui.cc b/beast-gtk/testgui.cc
index 3511a6b..68467b3 100644
--- a/beast-gtk/testgui.cc
+++ b/beast-gtk/testgui.cc
@@ -75,7 +75,7 @@ main (int argc,
char *argv[])
{
/* initialize i18n */
- bindtextdomain (BST_GETTEXT_DOMAIN, bse_installpath (BSE_INSTALLPATH_LOCALEBASE).c_str());
+ bindtextdomain (BST_GETTEXT_DOMAIN, Bse::installpath (Bse::INSTALLPATH_LOCALEBASE).c_str());
bind_textdomain_codeset (BST_GETTEXT_DOMAIN, "UTF-8");
textdomain (BST_GETTEXT_DOMAIN);
setlocale (LC_ALL, "");
@@ -90,8 +90,8 @@ main (int argc,
/* initialize Gtk+ Extension Kit */
gxk_init ();
/* add documentation search paths */
- gxk_text_add_tsm_path (bse_installpath (BSE_INSTALLPATH_DOCDIR).c_str());
- gxk_text_add_tsm_path (bse_installpath (BSE_INSTALLPATH_DATADIR_IMAGES).c_str());
+ gxk_text_add_tsm_path (Bse::installpath (Bse::INSTALLPATH_DOCDIR).c_str());
+ gxk_text_add_tsm_path (Bse::installpath (Bse::INSTALLPATH_DATADIR_IMAGES).c_str());
gxk_text_add_tsm_path (".");
/* initialize BEAST GUI components */
_bst_init_utils ();
diff --git a/beast-gtk/tsmview.cc b/beast-gtk/tsmview.cc
index 253e328..3d07548 100644
--- a/beast-gtk/tsmview.cc
+++ b/beast-gtk/tsmview.cc
@@ -50,8 +50,8 @@ main (int argc,
if (!title)
title = g_strdup (".");
gxk_text_add_tsm_path (".");
- gxk_text_add_tsm_path (bse_installpath (BSE_INSTALLPATH_DOCDIR).c_str());
- gxk_text_add_tsm_path (bse_installpath (BSE_INSTALLPATH_DATADIR_IMAGES).c_str());
+ gxk_text_add_tsm_path (Bse::installpath (Bse::INSTALLPATH_DOCDIR).c_str());
+ gxk_text_add_tsm_path (Bse::installpath (Bse::INSTALLPATH_DATADIR_IMAGES).c_str());
sctext = gxk_scroll_text_create (GXK_SCROLL_TEXT_NAVIGATABLE | flags, NULL);
gxk_scroll_text_enter (sctext, title);
for (i = 1; i < uint (argc); i++)
diff --git a/bse/bsegconfig.cc b/bse/bsegconfig.cc
index 6a1bfd9..b3d96cb 100644
--- a/bse/bsegconfig.cc
+++ b/bse/bsegconfig.cc
@@ -45,7 +45,7 @@ _bse_gconfig_init (void)
static const char*
intern_path_user_data ()
{
- return g_intern_strconcat (bse_installpath (BSE_INSTALLPATH_USER_DATA).c_str(), "", 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 bea0cc4..e1dd601 100644
--- a/bse/bseladspa.cc
+++ b/bse/bseladspa.cc
@@ -640,7 +640,7 @@ bse_ladspa_plugin_path_list_files (void)
SfiRing *ring1, *ring2 = NULL, *ring3 = NULL;
const gchar *paths;
- ring1 = sfi_file_crawler_list_files (bse_installpath (BSE_INSTALLPATH_LADSPA).c_str(), "*.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/bsemain.cc b/bse/bsemain.cc
index bc9e071..92f55aa 100644
--- a/bse/bsemain.cc
+++ b/bse/bsemain.cc
@@ -57,7 +57,7 @@ void
bse_bindtextdomain()
{
assert_return (bindtextdomain_initialized == false);
- bindtextdomain (BSE_GETTEXT_DOMAIN, bse_installpath (BSE_INSTALLPATH_LOCALEBASE).c_str());
+ bindtextdomain (BSE_GETTEXT_DOMAIN, Bse::installpath (Bse::INSTALLPATH_LOCALEBASE).c_str());
bind_textdomain_codeset (BSE_GETTEXT_DOMAIN, "UTF-8");
bindtextdomain_initialized = true;
}
@@ -206,7 +206,7 @@ initialize_with_argv (int *argc, char **argv, const char *app_name, const Bse::S
// argument handling
if (!default_main_args.path_binaries)
- default_main_args.path_binaries = g_strdup (bse_installpath (BSE_INSTALLPATH_BINDIR).c_str());
+ 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);
@@ -569,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> (string_format ("inproc://BSE-%s", bse_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 c697de9..d8c48d5 100644
--- a/bse/bseplugin.cc
+++ b/bse/bseplugin.cc
@@ -733,16 +733,16 @@ bse_plugin_path_list_files (gboolean include_drivers,
{
if (include_drivers)
{
- files = sfi_file_crawler_list_files (bse_installpath (BSE_INSTALLPATH_BSELIBDIR_DRIVERS).c_str(),
"*" PLUGIN_EXTENSION, G_FILE_TEST_IS_REGULAR);
+ files = sfi_file_crawler_list_files (Bse::installpath
(Bse::INSTALLPATH_BSELIBDIR_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_installpath (BSE_INSTALLPATH_BSELIBDIR_DRIVERS).c_str(),
"*.o", G_FILE_TEST_IS_REGULAR);
+ files = sfi_file_crawler_list_files (Bse::installpath
(Bse::INSTALLPATH_BSELIBDIR_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_installpath (BSE_INSTALLPATH_BSELIBDIR_PLUGINS).c_str(),
"*" PLUGIN_EXTENSION, G_FILE_TEST_IS_REGULAR);
+ files = sfi_file_crawler_list_files (Bse::installpath
(Bse::INSTALLPATH_BSELIBDIR_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_installpath (BSE_INSTALLPATH_BSELIBDIR_PLUGINS).c_str(),
"*.o", G_FILE_TEST_IS_REGULAR);
+ files = sfi_file_crawler_list_files (Bse::installpath
(Bse::INSTALLPATH_BSELIBDIR_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 9dae243..1d06ba7 100644
--- a/bse/bsescripthelper.cc
+++ b/bse/bsescripthelper.cc
@@ -231,7 +231,7 @@ bse_script_path_list_files (void)
}
if (1)
{
- files = sfi_file_crawler_list_files (bse_installpath (BSE_INSTALLPATH_DATADIR_SCRIPTS).c_str(),
"*.scm", G_FILE_TEST_IS_REGULAR);
+ files = sfi_file_crawler_list_files (Bse::installpath (Bse::INSTALLPATH_DATADIR_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 04cf5ae..6d2a8b5 100644
--- a/bse/bseserver.cc
+++ b/bse/bseserver.cc
@@ -1158,49 +1158,49 @@ ServerImpl::get_vorbis_version ()
String
ServerImpl::get_ladspa_path ()
{
- return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_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_installpath (BSE_INSTALLPATH_BSELIBDIR_PLUGINS), BSE_GCONFIG
(plugin_path));
+ return Path::searchpath_join (Bse::installpath (Bse::INSTALLPATH_BSELIBDIR_PLUGINS), BSE_GCONFIG
(plugin_path));
}
String
ServerImpl::get_script_path ()
{
- return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_DATADIR_SCRIPTS), BSE_GCONFIG
(script_path));
+ return Path::searchpath_join (Bse::installpath (Bse::INSTALLPATH_DATADIR_SCRIPTS), BSE_GCONFIG
(script_path));
}
String
ServerImpl::get_instrument_path ()
{
- return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_DATADIR_INSTRUMENTS), BSE_GCONFIG
(instrument_path));
+ return Path::searchpath_join (Bse::installpath (Bse::INSTALLPATH_DATADIR_INSTRUMENTS), BSE_GCONFIG
(instrument_path));
}
String
ServerImpl::get_sample_path ()
{
- return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_DATADIR_SAMPLES), BSE_GCONFIG
(sample_path));
+ return Path::searchpath_join (Bse::installpath (Bse::INSTALLPATH_DATADIR_SAMPLES), BSE_GCONFIG
(sample_path));
}
String
ServerImpl::get_effect_path ()
{
- return Path::searchpath_join (bse_installpath (BSE_INSTALLPATH_DATADIR_EFFECTS), BSE_GCONFIG
(effect_path));
+ return Path::searchpath_join (Bse::installpath (Bse::INSTALLPATH_DATADIR_EFFECTS), BSE_GCONFIG
(effect_path));
}
String
ServerImpl::get_demo_path ()
{
- return bse_installpath (BSE_INSTALLPATH_DATADIR_DEMO);
+ return Bse::installpath (Bse::INSTALLPATH_DATADIR_DEMO);
}
String
ServerImpl::get_version ()
{
- return bse_version();
+ return Bse::version();
}
String
@@ -1227,7 +1227,7 @@ ServerImpl::save_preferences ()
return;
SfiWStore *wstore = sfi_wstore_new ();
- sfi_wstore_printf (wstore, "; rc-file for BSE v%s\n", bse_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 995e482..03563f6 100644
--- a/bse/bsewave.cc
+++ b/bse/bsewave.cc
@@ -267,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_installpath (BSE_INSTALLPATH_DATADIR_SAMPLES),
BSE_GCONFIG (sample_path));
+ sample_path = Rapicorn::Path::searchpath_join (Bse::installpath (Bse::INSTALLPATH_DATADIR_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/configure.ac b/configure.ac
index 3fae9e6..3f79c62 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,14 +88,14 @@ bak_datarootdir="$datarootdir"; bak_datadir="$datadir"; bak_includedir="$include
test "x$prefix" = xNONE && prefix="$ac_default_prefix" ; test "x$exec_prefix" = xNONE &&
exec_prefix="$prefix"
libdir=`eval echo "${libdir}"` ; datarootdir=`eval echo "${datarootdir}"` ;
datadir=`eval echo "${datadir}"`; bseincludedir=`eval echo "${bseincludedir}"`
-AC_DEFINE_UNQUOTED(INSTALLPATH_BSEINCLUDEDIR, ["`eval echo "${bseincludedir}"`"], [Sfidl standard include
directory])
-AC_DEFINE_UNQUOTED(INSTALLPATH_BINDIR, ["`eval echo "${bindir}"`"], [Directory to install and execute
programs])
-AC_DEFINE_UNQUOTED(INSTALLPATH_LOCALEBASE, ["`eval echo ${localedir}`"], [Base directory for locale specific
message catalogs])
-AC_DEFINE_UNQUOTED(INSTALLPATH_LADSPA, ["`eval echo ${libdir}/ladspa`"], [Searchpath for LADSPA plugins])
-AC_DEFINE_UNQUOTED(INSTALLPATH_BSELIBDIR, ["`eval echo ${bselibdir}`"], [Directory to install plugins and
drivers])
-AC_DEFINE_UNQUOTED(INSTALLPATH_DATADIR, ["`eval echo ${datadir}`"], [Directory to install samples, effects,
scripts, etc])
-AC_DEFINE_UNQUOTED(INSTALLPATH_DOCDIR, ["`eval echo ${docdir}`"], [Directory to install documentation])
-AC_DEFINE_UNQUOTED(INSTALLPATH_USER_DATA, ["~/beast"], [Searchpath for user owned Beast resources])
+AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_BSEINCLUDEDIR, ["`eval echo "${bseincludedir}"`"], [Sfidl standard
include directory])
+AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_BINDIR, ["`eval echo "${bindir}"`"], [Directory to install and
execute programs])
+AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_LOCALEBASE, ["`eval echo ${localedir}`"], [Base directory for
locale specific message catalogs])
+AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_LADSPA, ["`eval echo ${libdir}/ladspa`"], [Searchpath for LADSPA
plugins])
+AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_BSELIBDIR, ["`eval echo ${bselibdir}`"], [Directory to install
plugins and drivers])
+AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_DATADIR, ["`eval echo ${datadir}`"], [Directory to install samples,
effects, scripts, etc])
+AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_DOCDIR, ["`eval echo ${docdir}`"], [Directory to install
documentation])
+AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_USER_DATA, ["~/beast"], [Searchpath for user owned Beast resources])
prefix="$bak_prefix"; exec_prefix="$bak_exec_prefix"; libdir="$bak_libdir"
datarootdir="$bak_datarootdir"; datadir="$bak_datadir"; includedir="$bak_includedir"
diff --git a/sfi/glib-extra.cc b/sfi/glib-extra.cc
index 78e9363..70ad82a 100644
--- a/sfi/glib-extra.cc
+++ b/sfi/glib-extra.cc
@@ -1026,37 +1026,42 @@ g_scanner_new64 (const GScannerConfig *config_templ)
return g_scanner_new (config_templ);
}
+
+namespace Bse {
+
// == BSE_INSTALLPATH ==
#include "../configure.h"
std::string
-bse_installpath (BseInstallpathType installpath_type)
+installpath (InstallpathType installpath_type)
{
switch (installpath_type)
{
- case BSE_INSTALLPATH_BSEINCLUDEDIR: return INSTALLPATH_BSEINCLUDEDIR;
- case BSE_INSTALLPATH_BINDIR: return INSTALLPATH_BINDIR;
- case BSE_INSTALLPATH_LOCALEBASE: return INSTALLPATH_LOCALEBASE;
- case BSE_INSTALLPATH_LADSPA: return INSTALLPATH_LADSPA;
- case BSE_INSTALLPATH_DOCDIR: return INSTALLPATH_DOCDIR;
- case BSE_INSTALLPATH_USER_DATA: return INSTALLPATH_USER_DATA;
- case BSE_INSTALLPATH_BSELIBDIR: return INSTALLPATH_BSELIBDIR;
- case BSE_INSTALLPATH_BSELIBDIR_PLUGINS: return bse_installpath (BSE_INSTALLPATH_BSELIBDIR) +
"/plugins";
- case BSE_INSTALLPATH_BSELIBDIR_DRIVERS: return bse_installpath (BSE_INSTALLPATH_BSELIBDIR) +
"/drivers";
- case BSE_INSTALLPATH_DATADIR: return INSTALLPATH_DATADIR;
- case BSE_INSTALLPATH_DATADIR_DEMO: return bse_installpath (BSE_INSTALLPATH_DATADIR) +
"/demo";
- case BSE_INSTALLPATH_DATADIR_SAMPLES: return bse_installpath (BSE_INSTALLPATH_DATADIR) +
"/samples";
- case BSE_INSTALLPATH_DATADIR_EFFECTS: return bse_installpath (BSE_INSTALLPATH_DATADIR) +
"/effects";
- case BSE_INSTALLPATH_DATADIR_INSTRUMENTS: return bse_installpath (BSE_INSTALLPATH_DATADIR) +
"/instruments";
- case BSE_INSTALLPATH_DATADIR_SCRIPTS: return bse_installpath (BSE_INSTALLPATH_DATADIR) +
"/scripts";
- case BSE_INSTALLPATH_DATADIR_IMAGES: return bse_installpath (BSE_INSTALLPATH_DATADIR) +
"/images";
- case BSE_INSTALLPATH_DATADIR_KEYS: return bse_installpath (BSE_INSTALLPATH_DATADIR) +
"/keys";
- case BSE_INSTALLPATH_DATADIR_SKINS: return bse_installpath (BSE_INSTALLPATH_DATADIR) +
"/skins";
+ case INSTALLPATH_BSEINCLUDEDIR: return CONFIGURE_INSTALLPATH_BSEINCLUDEDIR;
+ case INSTALLPATH_BINDIR: return CONFIGURE_INSTALLPATH_BINDIR;
+ case INSTALLPATH_LOCALEBASE: return CONFIGURE_INSTALLPATH_LOCALEBASE;
+ case INSTALLPATH_LADSPA: return CONFIGURE_INSTALLPATH_LADSPA;
+ case INSTALLPATH_DOCDIR: return CONFIGURE_INSTALLPATH_DOCDIR;
+ case INSTALLPATH_USER_DATA: return CONFIGURE_INSTALLPATH_USER_DATA;
+ case INSTALLPATH_BSELIBDIR: return CONFIGURE_INSTALLPATH_BSELIBDIR;
+ case INSTALLPATH_BSELIBDIR_PLUGINS: return installpath (INSTALLPATH_BSELIBDIR) +
"/plugins";
+ case INSTALLPATH_BSELIBDIR_DRIVERS: return installpath (INSTALLPATH_BSELIBDIR) +
"/drivers";
+ case INSTALLPATH_DATADIR: return CONFIGURE_INSTALLPATH_DATADIR;
+ case INSTALLPATH_DATADIR_DEMO: return installpath (INSTALLPATH_DATADIR) + "/demo";
+ case INSTALLPATH_DATADIR_SAMPLES: return installpath (INSTALLPATH_DATADIR) +
"/samples";
+ case INSTALLPATH_DATADIR_EFFECTS: return installpath (INSTALLPATH_DATADIR) +
"/effects";
+ case INSTALLPATH_DATADIR_INSTRUMENTS: return installpath (INSTALLPATH_DATADIR) +
"/instruments";
+ case INSTALLPATH_DATADIR_SCRIPTS: return installpath (INSTALLPATH_DATADIR) +
"/scripts";
+ case INSTALLPATH_DATADIR_IMAGES: return installpath (INSTALLPATH_DATADIR) + "/images";
+ case INSTALLPATH_DATADIR_KEYS: return installpath (INSTALLPATH_DATADIR) + "/keys";
+ case INSTALLPATH_DATADIR_SKINS: return installpath (INSTALLPATH_DATADIR) + "/skins";
}
return "";
}
std::string
-bse_version ()
+version ()
{
return PACKAGE_VERSION;
}
+
+} // Bse
diff --git a/sfi/glib-extra.hh b/sfi/glib-extra.hh
index 0b23034..a812021 100644
--- a/sfi/glib-extra.hh
+++ b/sfi/glib-extra.hh
@@ -303,34 +303,6 @@ GScanner* g_scanner_new64 (const GScannerConfig *config_templ);
#define g_scanner_thaw_symbol_table(scanner) ((void)0)
#endif /* G_DISABLE_DEPRECATED */
-// == BSE_INSTALLPATH ==
-// See also configure.ac, this function is here because all of sfi, bse and beast include this file.
-enum BseInstallpathType {
- BSE_INSTALLPATH_BSEINCLUDEDIR = 1,
- BSE_INSTALLPATH_BINDIR,
- BSE_INSTALLPATH_LOCALEBASE,
- BSE_INSTALLPATH_LADSPA,
- BSE_INSTALLPATH_DOCDIR,
- BSE_INSTALLPATH_USER_DATA,
- BSE_INSTALLPATH_BSELIBDIR,
- BSE_INSTALLPATH_BSELIBDIR_PLUGINS,
- BSE_INSTALLPATH_BSELIBDIR_DRIVERS,
- BSE_INSTALLPATH_DATADIR,
- BSE_INSTALLPATH_DATADIR_DEMO,
- BSE_INSTALLPATH_DATADIR_SAMPLES,
- BSE_INSTALLPATH_DATADIR_EFFECTS,
- BSE_INSTALLPATH_DATADIR_INSTRUMENTS,
- BSE_INSTALLPATH_DATADIR_SCRIPTS,
- BSE_INSTALLPATH_DATADIR_IMAGES,
- BSE_INSTALLPATH_DATADIR_KEYS,
- BSE_INSTALLPATH_DATADIR_SKINS,
-};
-/// Provide installation directories and searchpaths for various types of data.
-std::string bse_installpath (BseInstallpathType installpath_type);
-
-/// Provide a string containing the BSE library version number.
-std::string bse_version ();
-
G_END_DECLS
// == Flags Enumeration Operators in C++ ==
@@ -356,4 +328,40 @@ constexpr GConnectFlags operator| (GConnectFlags s1, GConnectFlags s2) { retu
inline GConnectFlags& operator|= (GConnectFlags &s1, GConnectFlags s2) { s1 = s1 | s2; return s1; }
constexpr GConnectFlags operator~ (GConnectFlags s1) { return GConnectFlags (~(long long
unsigned) s1); }
#endif // __cplusplus
+
+
+// == Fundamental BSE Utilities ==
+// these definitions need to move into bse/utils or similar
+namespace Bse {
+
+// == INSTALLPATH ==
+// See also configure.ac, this function is here because beast and all libs include this file.
+enum InstallpathType {
+ INSTALLPATH_BSEINCLUDEDIR = 1,
+ INSTALLPATH_BINDIR,
+ INSTALLPATH_LOCALEBASE,
+ INSTALLPATH_LADSPA,
+ INSTALLPATH_DOCDIR,
+ INSTALLPATH_USER_DATA,
+ INSTALLPATH_BSELIBDIR,
+ INSTALLPATH_BSELIBDIR_PLUGINS,
+ INSTALLPATH_BSELIBDIR_DRIVERS,
+ INSTALLPATH_DATADIR,
+ INSTALLPATH_DATADIR_DEMO,
+ INSTALLPATH_DATADIR_SAMPLES,
+ INSTALLPATH_DATADIR_EFFECTS,
+ INSTALLPATH_DATADIR_INSTRUMENTS,
+ INSTALLPATH_DATADIR_SCRIPTS,
+ INSTALLPATH_DATADIR_IMAGES,
+ INSTALLPATH_DATADIR_KEYS,
+ INSTALLPATH_DATADIR_SKINS,
+};
+/// Provide installation directories and searchpaths for various types of data.
+std::string installpath (InstallpathType installpath_type);
+
+/// Provide a string containing the BSE library version number.
+std::string version ();
+
+} // Bse
+
#endif /* __SFI_GLIB_EXTRA_H__ */
diff --git a/sfi/sfidl-options.cc b/sfi/sfidl-options.cc
index fbea1d5..1ec31c8 100644
--- a/sfi/sfidl-options.cc
+++ b/sfi/sfidl-options.cc
@@ -168,7 +168,7 @@ bool Options::parse (int *argc_p, char **argv_p[], const Parser& parser)
/* add std include path */
if (!noStdInc)
{
- const std::string stdinc_path = bse_installpath (BSE_INSTALLPATH_BSEINCLUDEDIR);
+ const std::string stdinc_path = Bse::installpath (Bse::INSTALLPATH_BSEINCLUDEDIR);
char *dir = strtok (const_cast<char*> (stdinc_path.c_str()), G_SEARCHPATH_SEPARATOR_S);
while (dir && dir[0])
{
@@ -199,7 +199,7 @@ bool Options::parse (int *argc_p, char **argv_p[], const Parser& parser)
if (printVersion)
{
- printf ("%s %s\n", SFIDL_PRG_NAME, bse_version().c_str());
+ printf ("%s %s\n", SFIDL_PRG_NAME, Bse::version().c_str());
return true;
}
diff --git a/shell/bsescm.cc b/shell/bsescm.cc
index 572d3e5..f229584 100644
--- a/shell/bsescm.cc
+++ b/shell/bsescm.cc
@@ -26,7 +26,7 @@ static gboolean bse_scm_auto_load = TRUE;
static gboolean bse_scm_auto_play = TRUE;
static SfiComPort *bse_scm_port = NULL;
static SfiGlueContext *bse_scm_context = NULL;
-static std::string boot_script_path = bse_installpath (BSE_INSTALLPATH_DATADIR_SCRIPTS);
+static std::string boot_script_path = Bse::installpath (Bse::INSTALLPATH_DATADIR_SCRIPTS);
/* --- functions --- */
static void
diff --git a/tests/bse/filtertest.cc b/tests/bse/filtertest.cc
index 8725214..bf0ef8e 100644
--- a/tests/bse/filtertest.cc
+++ b/tests/bse/filtertest.cc
@@ -121,7 +121,7 @@ Options::parse (int *argc_p,
else if (strcmp (argv[i], "--version") == 0 ||
strcmp (argv[i], "-v") == 0)
{
- printf ("%s %s\n", program_name.c_str(), bse_version().c_str());
+ printf ("%s %s\n", program_name.c_str(), Bse::version().c_str());
exit (0);
}
else if (check_arg (argc, argv, &i, "--dump-gnuplot-data"))
diff --git a/tests/testresampler.cc b/tests/testresampler.cc
index 76aa118..3d4c334 100644
--- a/tests/testresampler.cc
+++ b/tests/testresampler.cc
@@ -204,7 +204,7 @@ Options::parse (int *argc_p,
else if (strcmp (argv[i], "--version") == 0 ||
strcmp (argv[i], "-v") == 0)
{
- printf ("%s %s\n", program_name.c_str(), bse_version().c_str());
+ printf ("%s %s\n", program_name.c_str(), Bse::version().c_str());
exit (0);
}
else if (check_arg (argc, argv, &i, "--block-size", &opt_arg))
diff --git a/tools/bsefcompare.cc b/tools/bsefcompare.cc
index aabbb90..edb23c0 100644
--- a/tools/bsefcompare.cc
+++ b/tools/bsefcompare.cc
@@ -116,7 +116,7 @@ Options::parse (int *argc_p,
else if (strcmp (argv[i], "--version") == 0 ||
strcmp (argv[i], "-v") == 0)
{
- printf ("%s %s\n", program_name.c_str(), bse_version().c_str());
+ printf ("%s %s\n", program_name.c_str(), Bse::version().c_str());
exit (0);
}
else if (check_arg (argc, argv, &i, "--compact"))
diff --git a/tools/bsefextract.cc b/tools/bsefextract.cc
index 1c2d391..b7b205b 100644
--- a/tools/bsefextract.cc
+++ b/tools/bsefextract.cc
@@ -1362,7 +1362,7 @@ Options::parse (int *argc_p,
else if (strcmp (argv[i], "--version") == 0 ||
strcmp (argv[i], "-v") == 0)
{
- printf ("%s %s\n", program_name.c_str(), bse_version().c_str());
+ printf ("%s %s\n", program_name.c_str(), Bse::version().c_str());
exit (0);
}
else if (strcmp (argv[i], "--verbose") == 0)
@@ -1476,7 +1476,7 @@ static void
print_header (const char *src)
{
fprintf (options.output_file, "# this output was generated by %s %s from channel %d in file %s\n",
- options.program_name.c_str(), bse_version().c_str(), options.channel, src);
+ options.program_name.c_str(), Bse::version().c_str(), options.channel, src);
fprintf (options.output_file, "#\n");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]