[beast: 6/8] BSE: remove all remaining janitor and script related code
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 6/8] BSE: remove all remaining janitor and script related code
- Date: Mon, 9 Oct 2017 19:21:59 +0000 (UTC)
commit ac6ca819bd33f594367d6e212c08f1c704ecfebf
Author: Tim Janik <timj gnu org>
Date: Tue Oct 3 01:36:24 2017 +0200
BSE: remove all remaining janitor and script related code
Signed-off-by: Tim Janik <timj gnu org>
bse/Makefile.am | 4 +-
bse/bseapi.idl | 13 --
bse/bsedefs.hh | 2 -
bse/bseglue.hh | 4 -
bse/bsejanitor.cc | 562 -----------------------------------------------------
bse/bsejanitor.hh | 63 ------
bse/bsemain.cc | 24 +---
bse/bsemain.hh | 4 +-
bse/bseserver.cc | 133 -------------
bse/bseserver.hh | 15 --
10 files changed, 4 insertions(+), 820 deletions(-)
---
diff --git a/bse/Makefile.am b/bse/Makefile.am
index 0e1bf3b..194b397 100644
--- a/bse/Makefile.am
+++ b/bse/Makefile.am
@@ -30,7 +30,7 @@ bse_public_headers = $(strip \
bseconstant.hh bseconstvalues.hh bsecontainer.hh bsecontextmerger.hh \
effectbase.hh \
bseeditablesample.hh bseenums.hh bsegconfig.hh \
- bseglobals.hh bseglue.hh bseitem.hh bsejanitor.hh \
+ bseglobals.hh bseglue.hh bseitem.hh \
bsemain.hh bsemath.hh bsemathsignal.hh bseladspa.hh \
bsemidicontroller.hh bsemididevice.hh bsedevice.hh \
bsemididevice-null.hh bsemididevice-oss.hh bsemidievent.hh bsemidinotifier.hh \
@@ -65,7 +65,7 @@ bse_sources = $(strip \
bsefilter.cc bsebiquadfilter.cc bsefilter-ellf.cc \
bseconstant.cc bseconstvalues.cc bsecontainer.cc bsecontextmerger.cc \
bseeditablesample.cc bseenums.cc bsegconfig.cc \
- bseglobals.cc bseglue.cc bseitem.cc bsejanitor.cc \
+ bseglobals.cc bseglue.cc bseitem.cc \
bsemain.cc bsemath.cc bsemathsignal.cc bseladspa.cc \
bsemidicontroller.cc bsemididevice.cc bsedevice.cc \
bsemididevice-null.cc bsemididevice-oss.cc bsemidievent.cc bsemidinotifier.cc \
diff --git a/bse/bseapi.idl b/bse/bseapi.idl
index 27dfdac..32bf447 100644
--- a/bse/bseapi.idl
+++ b/bse/bseapi.idl
@@ -1194,7 +1194,6 @@ interface Server : Container {
String get_vorbis_version (); ///< Retrieve BSE Vorbis handler version.
String get_ladspa_path (); ///< Retrieve ladspa search path.
String get_plugin_path (); ///< Retrieve plugin search path.
- String get_script_path (); ///< Retrieve script search path.
String get_instrument_path (); ///< Retrieve instrument search path.
String get_sample_path (); ///< Retrieve sample search path.
String get_effect_path (); ///< Retrieve effect search path.
@@ -1205,10 +1204,8 @@ interface Server : Container {
void save_preferences (); ///< Save the bse-preferences property to disk.
void register_ladspa_plugins(); ///< Register LADSPA (Linux Audio Developer's Simple Plugin
API) plugins asynchronously, DEPRECATED.
void register_core_plugins(); ///< Register core plugins asynchronously, DEPRECATED.
- void register_scripts(); ///< Register external scripts asynchronously, DEPRECATED.
void load_assets(); ///< Register plugins and scripts immediately.
bool preferences_locked(); ///< Returns whether the bse-preferences property is currently
locked against modifications or not.
- int32 n_scripts(); ///< Return the number of scripts currently running on this
server.
bool can_load (String file_name); ///< Check whether a loader can be found for a wave file.
void start_recording (String wave_file, float64 n_seconds); ///< Start recording to a WAV file.
Project create_project (String project_name); ///< Create a new project (name is modified to be
unique if necessary.
@@ -1236,16 +1233,6 @@ interface Server : Container {
/// Helper for Wave PCM positioning.
int64 tick_stamp_from_systime (int64 systime_usecs);
-
- // *** Old Janitor ***
- // void trigger_action (String action); ///< Trigger an installed user action of this janitor.
- // String get_script_name (); ///< Retrieve the script name of this janitor.
- // String get_proc_name (); ///< Retrieve the procedure name of this janitor.
- // int32 n_actions (); ///< Retrieve number of user actions of this janitor.
- // String get_action (int32 nth_action); ///< Retrieve an action of this janitor.
- // String get_action_name (int32 nth_action); ///< Retrieve the name of an action of this janitor.
- // String get_action_blurb (int32 nth_action); ///< Retrieve the help string of an action of this janitor.
- // void kill (); ///< Kill a currently running janitor.
};
} // Bse
diff --git a/bse/bsedefs.hh b/bse/bsedefs.hh
index 975ac86..d287466 100644
--- a/bse/bsedefs.hh
+++ b/bse/bsedefs.hh
@@ -34,8 +34,6 @@ struct BseEditableSample;
struct BseEditableSampleClass;
struct BseItem;
struct BseItemClass;
-struct BseJanitor;
-struct BseJanitorClass;
struct BseMidiDecoder;
struct BseMidiNotifier;
struct BseMidiNotifierClass;
diff --git a/bse/bseglue.hh b/bse/bseglue.hh
index 8c6420a..64dbf2e 100644
--- a/bse/bseglue.hh
+++ b/bse/bseglue.hh
@@ -4,10 +4,6 @@
#include <bse/bsetype.hh>
-/* FIXME: creation of a new context source should be done
- * by a janitor constructor
- */
-
SfiGlueContext* bse_glue_context_intern (const gchar *user);
/* Construct a new #SfiRec from a boxed value. */
diff --git a/bse/bsemain.cc b/bse/bsemain.cc
index 5e383ae..1081c53 100644
--- a/bse/bsemain.cc
+++ b/bse/bsemain.cc
@@ -3,7 +3,6 @@
#include "bsestartup.hh"
#include "bseserver.hh"
#include "bsesequencer.hh"
-#include "bsejanitor.hh"
#include "bseplugin.hh"
#include "bsecategories.hh"
#include "bsemidireceiver.hh"
@@ -42,7 +41,6 @@ static BseMainArgs default_main_args = {
NULL, // path_binaries
NULL, // bse_rcfile
NULL, // override_plugin_globs
- NULL, // override_script_path
NULL, // override_sample_path
false, // stand_alone
true, // allow_randomization
@@ -130,9 +128,7 @@ bse_init_intern()
bse_device_dump_list (BSE_TYPE_MIDI_DEVICE, " ", TRUE, NULL, NULL);
}
- // initialize core plugins & scripts
- if (bse_main_args->load_core_plugins || bse_main_args->load_core_scripts)
- g_object_connect (bse_server_get(), "signal::registration", server_registration, NULL, NULL);
+ // initialize core plugins
if (bse_main_args->load_core_plugins)
{
g_object_connect (bse_server_get(), "signal::registration", server_registration, NULL, NULL);
@@ -146,15 +142,6 @@ bse_init_intern()
g_free (name);
}
}
- if (bse_main_args->load_core_scripts)
- {
- Bse::ServerImpl::instance().register_scripts();
- while (!single_thread_registration_done)
- {
- g_main_context_iteration (bse_main_context, TRUE);
- // sfi_glue_gc_run ();
- }
- }
// allow aida IDL remoting
Bse::init_aida_idl();
@@ -276,7 +263,6 @@ async_create_context (gpointer data)
sfi_com_port_create_linked ("Client", adata->caller_wakeup, &port1,
"Server", bse_main_wakeup, &port2);
SfiGlueContext *context = sfi_glue_encoder_context (port1);
- bse_janitor_new (port2);
adata->result_queue.push (context);
return false; // run-once
}
@@ -455,12 +441,6 @@ init_parse_args (int *argc_p, char **argv_p, BseMainArgs *margs, const Bse::Stri
margs->override_plugin_globs = argv[i];
argv[i] = NULL;
}
- else if (strcmp ("--bse-override-script-path", argv[i]) == 0 && i + 1 < argc)
- {
- argv[i++] = NULL;
- margs->override_script_path = argv[i];
- argv[i] = NULL;
- }
else if (strcmp ("--bse-override-sample-path", argv[i]) == 0 && i + 1 < argc)
{
argv[i++] = NULL;
@@ -522,8 +502,6 @@ init_parse_args (int *argc_p, char **argv_p, BseMainArgs *margs, const Bse::Stri
margs->force_fpu |= b;
else if (parse_bool_option (arg, "load-core-plugins", &b))
margs->load_core_plugins |= b;
- else if (parse_bool_option (arg, "load-core-scripts", &b))
- margs->load_core_scripts |= b;
else if (parse_bool_option (arg, "debug-extensions", &b))
margs->debug_extensions |= b;
else if (parse_int_option (arg, "wave-chunk-padding", &i))
diff --git a/bse/bsemain.hh b/bse/bsemain.hh
index 9a235bb..0a08793 100644
--- a/bse/bsemain.hh
+++ b/bse/bsemain.hh
@@ -32,13 +32,11 @@ struct BseMainArgs {
const char *path_binaries;
const char *bse_rcfile;
const char *override_plugin_globs;
- const char *override_script_path;
const char *override_sample_path;
- bool stand_alone; ///< Initialization argument "stand-alone" - no rcfiles,
boot scripts, etc.
+ bool stand_alone; ///< Initialization argument "stand-alone" - no rcfiles, etc.
bool allow_randomization; ///< Initialization argument "allow-randomization" - enables
non-deterministic behavior
bool force_fpu; ///< Initialization argument "force-fpu" - avoid vectorized
optimizations
bool load_core_plugins; ///< Initialization argument "load-core-plugins" - enable
core plugin bootup
- bool load_core_scripts; ///< Initialization argument "load-core-scripts" - enable
core script bootup
bool debug_extensions; ///< Initialization argument "debug-extensions" - enable
debugging extensions
bool load_drivers_early;
bool dump_driver_list;
diff --git a/bse/bseserver.cc b/bse/bseserver.cc
index 0b2b0f4..3bfa12c 100644
--- a/bse/bseserver.cc
+++ b/bse/bseserver.cc
@@ -9,7 +9,6 @@
#include "bsemain.hh" /* threads enter/leave */
#include "bsepcmwriter.hh"
#include "bsemididevice-null.hh"
-#include "bsejanitor.hh"
#include "bsecxxplugin.hh"
#include "bsepcmmodule.cc"
#include "gsldatahandle-mad.hh"
@@ -70,8 +69,6 @@ static void engine_shutdown (BseServer *server);
/* --- variables --- */
static GTypeClass *parent_class = NULL;
static guint signal_registration = 0;
-static guint signal_script_start = 0;
-static guint signal_script_error = 0;
/* --- functions --- */
BSE_BUILTIN_TYPE (BseServer)
{
@@ -131,12 +128,6 @@ bse_server_class_init (BseServerClass *klass)
BSE_TYPE_REGISTRATION_TYPE,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
- signal_script_start = bse_object_class_add_signal (object_class, "script-start",
- G_TYPE_NONE, 1,
- BSE_TYPE_JANITOR);
- signal_script_error = bse_object_class_add_signal (object_class, "script-error",
- G_TYPE_NONE, 3,
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
}
static GTokenType
@@ -690,21 +681,6 @@ bse_server_discard_pcm_input_module (BseServer *self,
bse_server_close_devices (self);
}
-/**
- * @param script_control associated script control object
- *
- * Signal script invocation start.
- */
-void
-bse_server_script_start (BseServer *server,
- BseJanitor *janitor)
-{
- assert_return (BSE_IS_SERVER (server));
- assert_return (BSE_IS_JANITOR (janitor));
-
- g_signal_emit (server, signal_script_start, 0, janitor);
-}
-
void
bse_server_registration (BseServer *server,
BseRegistrationType rtype,
@@ -716,27 +692,6 @@ bse_server_registration (BseServer *server,
g_signal_emit (server, signal_registration, 0, rtype, what, error);
}
-/**
- * @param script_name name of the executed script
- * @param proc_name procedure name to execute
- * @param reason error condition
- *
- * Signal script invocation error.
- */
-void
-bse_server_script_error (BseServer *server,
- const gchar *script_name,
- const gchar *proc_name,
- const gchar *reason)
-{
- assert_return (BSE_IS_SERVER (server));
- assert_return (script_name != NULL);
- assert_return (proc_name != NULL);
- assert_return (reason != NULL);
- g_signal_emit (server, signal_script_error, 0,
- script_name, proc_name, reason);
-}
-
void
bse_server_add_io_watch (BseServer *server,
gint fd,
@@ -762,69 +717,6 @@ bse_server_remove_io_watch (BseServer *server,
Bse::warning (G_STRLOC ": no such io watch installed %p(%p)", watch_func, data);
}
-Bse::Error
-bse_server_run_remote (BseServer *server,
- const gchar *process_name,
- SfiRing *params,
- const gchar *script_name,
- const gchar *proc_name,
- BseJanitor **janitor_p)
-{
- gint child_pid, command_input, command_output;
- BseJanitor *janitor = NULL;
-
- assert_return (BSE_IS_SERVER (server), Bse::Error::INTERNAL);
- assert_return (process_name != NULL, Bse::Error::INTERNAL);
- assert_return (script_name != NULL, Bse::Error::INTERNAL);
- assert_return (proc_name != NULL, Bse::Error::INTERNAL);
-
- child_pid = command_input = command_output = -1;
- const char *reason = sfi_com_spawn_async (process_name,
- &child_pid,
- NULL, /* &standard_input, */
- NULL, /* &standard_output, */
- NULL, /* &standard_error, */
- "--bse-pipe",
- &command_input,
- &command_output,
- params);
- char *freeme = NULL;
- if (!reason)
- {
- gchar *ident = g_strdup_format ("%s::%s", script_name, proc_name);
- SfiComPort *port = sfi_com_port_from_child (ident,
- command_output,
- command_input,
- child_pid);
- g_free (ident);
- if (!port->connected) /* bad, bad */
- {
- sfi_com_port_unref (port);
- reason = freeme = g_strdup ("failed to establish connection");
- }
- else
- {
- janitor = bse_janitor_new (port);
- bse_janitor_set_procedure (janitor, script_name, proc_name);
- sfi_com_port_unref (port);
- /* already owned by server */
- g_object_unref (janitor);
- }
- }
- if (janitor_p)
- *janitor_p = janitor;
- if (reason)
- {
- bse_server_script_error (server, script_name, proc_name, reason);
- g_free (freeme);
- return Bse::Error::SPAWN;
- }
- g_free (freeme);
- bse_server_script_start (server, janitor);
- return Bse::Error::NONE;
-}
-
-
/* --- GSL Main Thread Source --- */
typedef struct {
GSource source;
@@ -1167,12 +1059,6 @@ ServerImpl::get_plugin_path ()
}
String
-ServerImpl::get_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));
@@ -1258,13 +1144,6 @@ ServerImpl::register_core_plugins ()
}
void
-ServerImpl::register_scripts ()
-{
- load_assets();
- bse_server_registration (as<BseServer*>(), BSE_REGISTER_DONE, NULL, NULL);
-}
-
-void
ServerImpl::load_assets ()
{
static bool done_once = false;
@@ -1306,18 +1185,6 @@ ServerImpl::preferences_locked ()
return bse_gconfig_locked();
}
-int
-ServerImpl::n_scripts()
-{
- BseServer *server = as<BseServer*>();
- // count script controls
- uint n_scripts = 0;
- for (GSList *slist = server->children; slist; slist = slist->next)
- if (BSE_IS_JANITOR (slist->data))
- n_scripts++;
- return n_scripts;
-}
-
bool
ServerImpl::can_load (const String &file_name)
{
diff --git a/bse/bseserver.hh b/bse/bseserver.hh
index 488770d..cb27547 100644
--- a/bse/bseserver.hh
+++ b/bse/bseserver.hh
@@ -74,18 +74,6 @@ void bse_server_registration (BseServer *server,
BseRegistrationType rtype,
const gchar *what,
const gchar *error);
-void bse_server_script_start (BseServer *server,
- BseJanitor *janitor);
-void bse_server_script_error (BseServer *server,
- const gchar *script_name,
- const gchar *proc_name,
- const gchar *reason);
-Bse::Error bse_server_run_remote (BseServer *server,
- const gchar *process_name,
- SfiRing *params,
- const gchar *script_name,
- const gchar *proc_name,
- BseJanitor **janitor_p);
void bse_server_queue_kill_wire (BseServer *server,
SfiComWire *wire);
void bse_server_notify_gconfig (BseServer *server);
@@ -106,7 +94,6 @@ public:
virtual String get_vorbis_version () override;
virtual String get_ladspa_path () override;
virtual String get_plugin_path () override;
- virtual String get_script_path () override;
virtual String get_instrument_path () override;
virtual String get_sample_path () override;
virtual String get_effect_path () override;
@@ -118,10 +105,8 @@ public:
virtual void register_ladspa_plugins () override;
virtual void register_core_plugins () override;
virtual void start_recording (const String &wave_file, double n_seconds) override;
- virtual void register_scripts () override;
virtual void load_assets () override;
virtual bool preferences_locked () override;
- virtual int n_scripts () override;
virtual bool can_load (const String &file_name) override;
virtual ProjectIfaceP create_project (const String &project_name) override;
virtual void destroy_project (ProjectIface &project) override;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]