[beast: 48/57] BST: use Bse namespace elements instead of Rapicorn
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 48/57] BST: use Bse namespace elements instead of Rapicorn
- Date: Sun, 23 Jul 2017 10:01:49 +0000 (UTC)
commit ade2b48efc03a8a4d68314406c400dd6081887b3
Author: Tim Janik <timj gnu org>
Date: Tue Jul 18 00:54:12 2017 +0200
BST: use Bse namespace elements instead of Rapicorn
Signed-off-by: Tim Janik <timj gnu org>
beast-gtk/bstfiledialog.cc | 2 +-
beast-gtk/bstmain.cc | 33 ++++++++++++++++-----------------
beast-gtk/bstparam-searchpath.cc | 2 +-
beast-gtk/bstparam.cc | 2 +-
beast-gtk/bstprofiler.cc | 16 +++++++---------
beast-gtk/bstsnetrouter.cc | 14 +++++++-------
beast-gtk/bstusermessage.cc | 4 ++--
beast-gtk/bstusermessage.hh | 2 +-
beast-gtk/bstutils.cc | 12 ++++++------
beast-gtk/bstutils.hh | 2 +-
10 files changed, 43 insertions(+), 46 deletions(-)
---
diff --git a/beast-gtk/bstfiledialog.cc b/beast-gtk/bstfiledialog.cc
index 38ff9b2..844fbf0 100644
--- a/beast-gtk/bstfiledialog.cc
+++ b/beast-gtk/bstfiledialog.cc
@@ -499,7 +499,7 @@ store_bse_file (Bse::ProjectH project, SfiProxy super_proxy, const String &file_
{
Bse::SuperH super = Bse::SuperH::down_cast (bse_server.from_proxy (super_proxy));
Bse::Error error = project.store_bse (super, file_name, self_contained);
- const String title = Rapicorn::string_format (saving_message_format.c_str(), bse_item_get_name
(super_proxy ? super_proxy : project.proxy_id()));
+ const String title = Bse::string_format (saving_message_format.c_str(), bse_item_get_name (super_proxy ?
super_proxy : project.proxy_id()));
gboolean handled = TRUE;
gchar *msg = NULL;
/* handle file exists cases */
diff --git a/beast-gtk/bstmain.cc b/beast-gtk/bstmain.cc
index ecfed9f..ac42e57 100644
--- a/beast-gtk/bstmain.cc
+++ b/beast-gtk/bstmain.cc
@@ -103,8 +103,8 @@ main (int argc, char *argv[])
Py_Initialize();
// initialize threading and GLib types
- Rapicorn::ThreadInfo::self().name ("Beast GUI");
- Bse::TaskRegistry::add (Rapicorn::ThreadInfo::self().name(), Rapicorn::ThisThread::process_pid(),
Rapicorn::ThisThread::thread_pid());
+ Bse::ThreadInfo::self().name ("Beast GUI");
+ Bse::TaskRegistry::add (Bse::ThreadInfo::self().name(), Bse::ThisThread::process_pid(),
Bse::ThisThread::thread_pid());
/* initialize Birnet/Sfi */
sfi_init (&argc, argv);
@@ -116,7 +116,7 @@ main (int argc, char *argv[])
// startup Gtk+ *lightly*
if (!gtk_parse_args (&argc, &argv))
{
- printerr ("%s: failed to setup Gtk+\n", Rapicorn::program_argv0());
+ printerr ("%s: failed to setup Gtk+\n", Bse::executable_name());
exit (7);
}
@@ -162,7 +162,6 @@ static void
main_init_argv0_installpaths (const char *argv0)
{
// Rapicorn and Python both need accurate argv0 excutable names
- Rapicorn::program_argv0_init (argv0);
Py_SetProgramName (const_cast<char*> (argv0));
// check for a libtool-linked, uninstalled executable (name)
const char *const exe = argv0;
@@ -215,10 +214,10 @@ main_init_gxk()
bst_splash_set_title (beast_splash, _("BEAST Startup"));
gtk_object_set_user_data (GTK_OBJECT (beast_splash), NULL); /* fix for broken user_data in 2.2 */
bst_splash_set_text (beast_splash,
- Rapicorn::string_format ("<b><big>BEAST</big></b>\n"
- "<b>The BSE Equipped Audio Synthesizer and Tracker</b>\n"
- "<b>Version %s</b>\n",
- Internal::buildid()));
+ Bse::string_format ("<b><big>BEAST</big></b>\n"
+ "<b>The BSE Equipped Audio Synthesizer and Tracker</b>\n"
+ "<b>Version %s</b>\n",
+ Internal::buildid()));
bst_splash_update_entity (beast_splash, _("Startup"));
bst_splash_show_grab (beast_splash);
}
@@ -406,17 +405,17 @@ main_open_files (int filesc, char **filesv)
Bse::Error error = bst_project_restore_from_file (project, filesv[i], TRUE, TRUE);
if (rewrite_bse_file)
{
- Rapicorn::printerr ("%s: loading: %s\n", filesv[i], Bse::error_blurb (error));
+ Bse::printerr ("%s: loading: %s\n", filesv[i], Bse::error_blurb (error));
if (error != 0)
exit (1);
if (unlink (filesv[i]) < 0)
{
- perror (Rapicorn::string_format ("%s: failed to remove", filesv[i]).c_str());
+ perror (Bse::string_format ("%s: failed to remove", filesv[i]).c_str());
exit (2);
}
Bse::SuperH any_super; // FIXME: bad API here
error = project.store_bse (any_super, filesv[i], TRUE);
- Rapicorn::printerr ("%s: writing: %s\n", filesv[i], Bse::error_blurb (error));
+ Bse::printerr ("%s: writing: %s\n", filesv[i], Bse::error_blurb (error));
if (error != 0)
exit (3);
exit (0);
@@ -487,7 +486,7 @@ main_show_release_notes ()
"<newline/>"
"<span tag=\"mono\"> </span><span tag=\"hyperlink\"><xlink
ref=\"http://beast.testbit.eu/\">http://beast.testbit.eu</xlink></span>"
"</tag-span-markup>";
- const String release_notes_contents = Rapicorn::string_replace (release_notes_contents_tmpl,
"__BEAST_INTERNAL_BUILDID__", Internal::buildid());
+ const String release_notes_contents = Bse::string_replace (release_notes_contents_tmpl,
"__BEAST_INTERNAL_BUILDID__", Internal::buildid());
GtkWidget *sctext = gxk_scroll_text_create (GXK_SCROLL_TEXT_WRAP | GXK_SCROLL_TEXT_SANS |
GXK_SCROLL_TEXT_CENTER, NULL);
gxk_scroll_text_set_tsm (sctext, release_notes_contents.c_str());
GtkWidget *rndialog = (GtkWidget*) gxk_dialog_new (NULL, NULL, GXK_DIALOG_DELETE_BUTTON,
release_notes_title, sctext);
@@ -547,7 +546,7 @@ main_run_event_loop ()
FILE *fp = fopen (pyfile.c_str(), "r");
if (!fp)
{
- perror (string_format ("%s: failed to open file %s", Rapicorn::program_argv0(),
Rapicorn::string_to_cquote (pyfile)).c_str());
+ perror (string_format ("%s: failed to open file %s", Bse::executable_name(), Bse::string_to_cquote
(pyfile)).c_str());
exit (7);
}
const int pyexitcode = PyRun_AnyFileExFlags (fp, pyfile.c_str(), false, NULL);
@@ -602,7 +601,7 @@ main_cleanup ()
// misc cleanups
Bse::objects_debug_leaks();
- Bse::TaskRegistry::remove (Rapicorn::ThisThread::thread_pid());
+ Bse::TaskRegistry::remove (Bse::ThisThread::thread_pid());
}
@@ -638,7 +637,7 @@ bst_init_aida_idl()
// perform Bse Aida tests
if (0)
{
- Rapicorn::printerr ("bse_server: %s\n", bse_server.debug_name());
+ Bse::printerr ("bse_server: %s\n", bse_server.debug_name());
Bse::TestObjectH test = bse_server.get_test_object();
test.sig_echo_reply() += echo_test_handler;
const int test_result = test.echo_test ("foo");
@@ -887,7 +886,7 @@ bst_exit_print_version (void)
printout ("\n");
printout ("Compiled for %s %s SSE plugins.\n", BST_ARCH_NAME, BSE_WITH_MMX_SSE ? "with" : "without");
printout ("Intrinsic code selected according to runtime CPU detection:\n");
- printout ("%s", Rapicorn::cpu_info().c_str());
+ printout ("%s", Bse::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());
@@ -1054,7 +1053,7 @@ beast_show_about_box (void)
if (!GTK_WIDGET_VISIBLE (beast_splash))
{
bst_splash_set_title (beast_splash, _("BEAST About"));
- bst_splash_update_entity (beast_splash, Rapicorn::string_format (_("BEAST Version %s"),
Internal::buildid()));
+ bst_splash_update_entity (beast_splash, Bse::string_format (_("BEAST Version %s"),
Internal::buildid()));
bst_splash_update_item (beast_splash, _("Contributions made by:"));
bst_splash_animate_strings (beast_splash, contributors);
}
diff --git a/beast-gtk/bstparam-searchpath.cc b/beast-gtk/bstparam-searchpath.cc
index 0feb167..181f66f 100644
--- a/beast-gtk/bstparam-searchpath.cc
+++ b/beast-gtk/bstparam-searchpath.cc
@@ -54,7 +54,7 @@ param_searchpath_add (GtkWidget *dialog,
{
GtkWidget *widget = (GtkWidget*) user_data;
const char *path = gtk_entry_get_text (GTK_ENTRY (widget));
- String spath = Rapicorn::Path::searchpath_join (path, file);
+ String spath = Bse::Path::searchpath_join (path, file);
gtk_entry_set_text (GTK_ENTRY (widget), spath.c_str());
param_searchpath_change_value (widget);
}
diff --git a/beast-gtk/bstparam.cc b/beast-gtk/bstparam.cc
index 8087d8d..26e98e9 100644
--- a/beast-gtk/bstparam.cc
+++ b/beast-gtk/bstparam.cc
@@ -498,7 +498,7 @@ bst_param_new_aida_parameter (GParamSpec *pspec, const Aida::Parameter &aparamet
bool match = what == param->pspec->name;
if (!match && what.size() == strlen (param->pspec->name))
{
- const String pname = Rapicorn::string_canonify (Rapicorn::string_tolower (param->pspec->name),
"abcdefghijklmnopqrstuvwxyz0123456789", "_");
+ const String pname = Bse::string_canonify (Bse::string_tolower (param->pspec->name),
"abcdefghijklmnopqrstuvwxyz0123456789", "_");
match = what == pname;
}
if (match)
diff --git a/beast-gtk/bstprofiler.cc b/beast-gtk/bstprofiler.cc
index e961883..6913958 100644
--- a/beast-gtk/bstprofiler.cc
+++ b/beast-gtk/bstprofiler.cc
@@ -3,8 +3,6 @@
#include "bse/bse.hh"
#include <string.h>
-using Rapicorn::TaskStatus; // FIXME
-
/* --- thread view --- */
enum {
TCOL_NAME,
@@ -21,7 +19,7 @@ enum {
static GtkWidget *profiler_dialog = NULL;
static GxkRadget *profiler = NULL;
static guint timer_id = 0;
-static std::vector<TaskStatus> cached_task_list;
+static std::vector<Bse::TaskStatus> cached_task_list;
/* --- funtions --- */
static void
@@ -31,7 +29,7 @@ thread_info_cell_fill_value (GtkWidget *profiler,
GValue *value)
{
assert_return (row < cached_task_list.size());
- TaskStatus *info = &cached_task_list[row];
+ Bse::TaskStatus *info = &cached_task_list[row];
switch (column)
{
case TCOL_NAME:
@@ -64,9 +62,9 @@ profiler_update (void)
GxkListWrapper *lwrapper = (GxkListWrapper*) g_object_get_data ((GObject*) profiler_dialog,
"list-wrapper");
// update and fetch stats
Bse::TaskRegistry::update();
- std::vector<TaskStatus> tasks = Bse::TaskRegistry::list();
+ std::vector<Bse::TaskStatus> tasks = Bse::TaskRegistry::list();
cached_task_list = tasks; // keep local copy for list wrapper updates
- cached_task_list.push_back (TaskStatus (0, 0)); // add one spare for Totals
+ cached_task_list.push_back (Bse::TaskStatus (0, 0)); // add one spare for Totals
// update stats in list
if (cached_task_list.size() != lwrapper->n_rows)
{
@@ -75,14 +73,14 @@ profiler_update (void)
if (cached_task_list.size() > lwrapper->n_rows)
gxk_list_wrapper_notify_append (lwrapper, cached_task_list.size() - lwrapper->n_rows);
}
- TaskStatus &totals = cached_task_list[cached_task_list.size() - 1];
+ Bse::TaskStatus &totals = cached_task_list[cached_task_list.size() - 1];
totals.name = _("Totals");
totals.priority = G_MAXINT;
- totals.state = TaskStatus::RUNNING;
+ totals.state = Bse::TaskStatus::RUNNING;
totals.processor = 0;
for (size_t i = 0; i < tasks.size(); i++)
{
- const TaskStatus &ninfo = tasks[i];
+ const Bse::TaskStatus &ninfo = tasks[i];
gxk_list_wrapper_notify_change (lwrapper, i);
totals.utime += ninfo.utime;
totals.stime += ninfo.stime;
diff --git a/beast-gtk/bstsnetrouter.cc b/beast-gtk/bstsnetrouter.cc
index 6097ae7..b6d5997 100644
--- a/beast-gtk/bstsnetrouter.cc
+++ b/beast-gtk/bstsnetrouter.cc
@@ -48,10 +48,10 @@ G_DEFINE_TYPE (BstSNetRouter, bst_snet_router, GNOME_TYPE_CANVAS);
static bool
filter_popup_modules (const Bse::AuxData &ad)
{
- String ahints = Rapicorn::string_vector_find_value (ad.attributes, "hints=");
- if (Rapicorn::string_option_check (ahints, "deprecated") && !BST_DVL_HINTS)
+ String ahints = Bse::string_vector_find_value (ad.attributes, "hints=");
+ if (Bse::string_option_check (ahints, "deprecated") && !BST_DVL_HINTS)
return false;
- if (Rapicorn::string_option_check (ahints, "unstable") && !BST_DVL_HINTS)
+ if (Bse::string_option_check (ahints, "unstable") && !BST_DVL_HINTS)
return false;
return true;
}
@@ -834,10 +834,10 @@ snet_router_tool2text (BstSNetRouter *self)
if (!router_tool_name)
router_tool_name = "";
const Bse::AuxData &ad = bse_server.find_module_type (router_tool_name);
- const String authors = Rapicorn::string_vector_find_value (ad.attributes, "authors=");
- const String license = Rapicorn::string_vector_find_value (ad.attributes, "license=");
- String blurb = Rapicorn::string_vector_find_value (ad.attributes, "blurb=");
- String title = Rapicorn::string_vector_find_value (ad.attributes, "title=");
+ const String authors = Bse::string_vector_find_value (ad.attributes, "authors=");
+ const String license = Bse::string_vector_find_value (ad.attributes, "license=");
+ String blurb = Bse::string_vector_find_value (ad.attributes, "blurb=");
+ String title = Bse::string_vector_find_value (ad.attributes, "title=");
if (title.empty())
title = ad.entity;
if (blurb.empty())
diff --git a/beast-gtk/bstusermessage.cc b/beast-gtk/bstusermessage.cc
index f7f4be6..8a5547e 100644
--- a/beast-gtk/bstusermessage.cc
+++ b/beast-gtk/bstusermessage.cc
@@ -663,8 +663,8 @@ bst_message_dialog_display (const char *log_domain,
msg.ident = bst_msg_type_ident (mtype);
msg.label = bst_msg_type_ident (mtype);
// msg.janitor = bse_script_janitor();
- msg.process = g_strdup (Rapicorn::ThisThread::name().c_str());
- msg.pid = Rapicorn::ThisThread::thread_pid();
+ msg.process = g_strdup (Bse::ThisThread::name().c_str());
+ msg.pid = Bse::ThisThread::thread_pid();
msg.n_msg_bits = 0;
msg.msg_bits = NULL;
/* collect msg bits */
diff --git a/beast-gtk/bstusermessage.hh b/beast-gtk/bstusermessage.hh
index c270ad7..2dcd858 100644
--- a/beast-gtk/bstusermessage.hh
+++ b/beast-gtk/bstusermessage.hh
@@ -50,7 +50,7 @@ guint bst_message_dialog_display (const char *log_dom
guint n_bits,
BstMsgBit **bits);
void bst_msg_bit_free (BstMsgBit *mbit);
-#define bst_msg_bit_printf(msg_part_id, ...) bst_msg_bit_create (msg_part_id,
Rapicorn::string_format (__VA_ARGS__))
+#define bst_msg_bit_printf(msg_part_id, ...) bst_msg_bit_create (msg_part_id, Bse::string_format
(__VA_ARGS__))
BstMsgBit* bst_msg_bit_create (guint8 msg_part_id, const std::string &text);
BstMsgBit* bst_msg_bit_create_choice (guint id,
const gchar *name,
diff --git a/beast-gtk/bstutils.cc b/beast-gtk/bstutils.cc
index cad4584..ee8d3c2 100644
--- a/beast-gtk/bstutils.cc
+++ b/beast-gtk/bstutils.cc
@@ -113,10 +113,10 @@ _bst_init_radgets (void)
gxk_radget_define_widget_type (BST_TYPE_SCROLLGRAPH);
gxk_radget_define_widget_type (BST_TYPE_PATTERN_VIEW);
gxk_radget_define_widget_type (BST_TYPE_ZOOMED_WINDOW);
- Rapicorn::Blob blob;
- blob = Rapicorn::Res ("@res radgets-standard.xml");
+ Bse::Blob blob;
+ blob = Bse::Res ("@res radgets-standard.xml");
gxk_radget_parse_text ("beast", blob.data(), blob.size(), NULL, NULL);
- blob = Rapicorn::Res ("@res radgets-beast.xml");
+ blob = Bse::Res ("@res radgets-beast.xml");
gxk_radget_parse_text ("beast", blob.data(), blob.size(), NULL, NULL);
}
@@ -522,14 +522,14 @@ bst_action_list_add_module (GxkActionList *alist, const Bse::AuxData &ad, const
else
stock_id = stock_fallback;
- String title = Rapicorn::string_vector_find_value (ad.attributes, "title=");
+ String title = Bse::string_vector_find_value (ad.attributes, "title=");
if (title.empty())
title = ad.entity;
- Rapicorn::StringVector tags = Rapicorn::string_split_any (Rapicorn::string_vector_find_value
(ad.attributes, "tags="), ";:");
+ Bse::StringVector tags = Bse::string_split_any (Bse::string_vector_find_value (ad.attributes, "tags="),
";:");
if (tags.size())
{
tags.push_back (title);
- title = Rapicorn::string_join ("/", tags);
+ title = Bse::string_join ("/", tags);
}
gxk_action_list_add_translated (alist, NULL, title.c_str(), NULL,
ad.entity.c_str(), // tooltip
diff --git a/beast-gtk/bstutils.hh b/beast-gtk/bstutils.hh
index d77d290..452603c 100644
--- a/beast-gtk/bstutils.hh
+++ b/beast-gtk/bstutils.hh
@@ -22,7 +22,7 @@ extern Bse::ServerH bse_server;
/* --- GUI utilities --- */
void bst_status_set_error (Bse::Error error, const String &message);
-#define bst_status_eprintf(error, ...) bst_status_set_error (error, Rapicorn::string_format
(__VA_ARGS__))
+#define bst_status_eprintf(error, ...) bst_status_set_error (error, Bse::string_format (__VA_ARGS__))
void bst_gui_error_bell (gpointer widget);
void bst_window_sync_title_to_proxy (gpointer window,
SfiProxy proxy,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]