[beast: 3/10] BST: throw away unused procedure execution code
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 3/10] BST: throw away unused procedure execution code
- Date: Mon, 9 Oct 2017 23:45:35 +0000 (UTC)
commit 2da31fb49d3ef40a262e0a610f32178d0761cc11
Author: Tim Janik <timj gnu org>
Date: Sun Oct 8 00:51:40 2017 +0200
BST: throw away unused procedure execution code
Signed-off-by: Tim Janik <timj gnu org>
beast-gtk/bstapp.cc | 56 +------------
beast-gtk/bstparam-automation.cc | 2 -
beast-gtk/bstpartdialog.cc | 22 -----
beast-gtk/bstprocedure.cc | 171 --------------------------------------
beast-gtk/bstprocedure.hh | 10 --
beast-gtk/bstsampleeditor.cc | 1 -
beast-gtk/bstsnetrouter.cc | 24 +-----
beast-gtk/bstutils.cc | 28 ------
beast-gtk/bstutils.hh | 15 ----
beast-gtk/bstwaveeditor.cc | 1 -
beast-gtk/bstwaveview.cc | 1 -
11 files changed, 2 insertions(+), 329 deletions(-)
---
diff --git a/beast-gtk/bstapp.cc b/beast-gtk/bstapp.cc
index 163ee71..11c0147 100644
--- a/beast-gtk/bstapp.cc
+++ b/beast-gtk/bstapp.cc
@@ -8,7 +8,6 @@
#include "bstpreferences.hh"
#include "bstservermonitor.hh"
#include "bstmenus.hh"
-#include "bstprocedure.hh"
#include "bstprojectctrl.hh"
#include "bstprofiler.hh"
#include "bstusermessage.hh"
@@ -17,7 +16,6 @@
/* --- prototypes --- */
-static void bst_app_run_script_proc (gpointer data, size_t action_id);
static GxkActionList* demo_entries_create (BstApp *app);
static GxkActionList* skin_entries_create (BstApp *app);
static void app_action_exec (gpointer data,
@@ -200,7 +198,7 @@ bst_app_init (BstApp *self)
{
new (&self->project) Bse::ProjectH();
GtkWidget *widget = GTK_WIDGET (self);
- GxkActionList *al1, *al2;
+ GxkActionList *al1;
g_object_set (self,
"name", "BEAST-Application",
@@ -247,30 +245,6 @@ bst_app_init (BstApp *self)
if (BST_DVL_HINTS)
gxk_widget_publish_actions (self, "demo-dialogs", G_N_ELEMENTS (demo_dialogs), demo_dialogs,
NULL, app_action_check, app_action_exec);
- /* Project utilities */
- Bse::CategorySeq cseq = bse_server.category_match ("/Project/*");
- al1 = bst_action_list_from_cats (cseq, 1, BST_STOCK_EXECUTE, NULL, bst_app_run_script_proc, self);
- gxk_action_list_sort (al1);
- gxk_widget_publish_action_list (widget, "tools-project", al1);
- /* Song scripts */
- cseq = bse_server.category_match ("/Song/*");
- al1 = bst_action_list_from_cats (cseq, 1, BST_STOCK_EXECUTE, NULL, bst_app_run_script_proc, self);
- gxk_action_list_sort (al1);
- gxk_widget_publish_action_list (widget, "tools-song", al1);
- /* CSynth & SNet utilities */
- cseq = bse_server.category_match ("/CSynth/*");
- al1 = bst_action_list_from_cats (cseq, 1, BST_STOCK_EXECUTE, NULL, bst_app_run_script_proc, self);
- gxk_action_list_sort (al1);
- cseq = bse_server.category_match ("/SNet/*");
- al2 = bst_action_list_from_cats (cseq, 1, BST_STOCK_EXECUTE, NULL, bst_app_run_script_proc, self);
- gxk_action_list_sort (al2);
- al1 = gxk_action_list_merge (al1, al2);
- gxk_widget_publish_action_list (widget, "tools-synth", al1);
- /* WaveRepo utilities */
- cseq = bse_server.category_match ("/WaveRepo/*");
- al1 = bst_action_list_from_cats (cseq, 1, BST_STOCK_EXECUTE, NULL, bst_app_run_script_proc, self);
- gxk_action_list_sort (al1);
- gxk_widget_publish_action_list (widget, "tools-wave-repo", al1);
/* add demo songs */
al1 = demo_entries_create (self);
gxk_widget_publish_action_list (widget, "demo-songs", al1);
@@ -783,34 +757,6 @@ skin_entries_create (BstApp *app)
return alist;
}
-static void
-bst_app_run_script_proc (gpointer data, size_t action_id)
-{
- BstApp *self = BST_APP (data);
- Bse::Category cat = bst_category_find (g_quark_to_string (action_id));
- SfiProxy super = bst_app_get_current_super (self);
- const gchar *song = "", *wave_repo = "", *snet = "", *csynth = "";
-
- if (BSE_IS_SONG (super))
- song = "song";
- else if (BSE_IS_WAVE_REPO (super))
- wave_repo = "wave-repo";
- else if (BSE_IS_SNET (super))
- {
- snet = "synth-net";
- if (BSE_IS_CSYNTH (super))
- csynth = "custom-synth";
- }
-
- bst_procedure_exec_auto (cat.otype.c_str(),
- "project", SFI_TYPE_PROXY, self->project.proxy_id(),
- song, SFI_TYPE_PROXY, super,
- wave_repo, SFI_TYPE_PROXY, super,
- snet, SFI_TYPE_PROXY, super,
- csynth, SFI_TYPE_PROXY, super,
- NULL);
-}
-
void
bst_app_show_release_notes (BstApp *app)
{
diff --git a/beast-gtk/bstparam-automation.cc b/beast-gtk/bstparam-automation.cc
index 54b81e7..52e2298 100644
--- a/beast-gtk/bstparam-automation.cc
+++ b/beast-gtk/bstparam-automation.cc
@@ -2,8 +2,6 @@
/* --- automation setup editor --- */
-#include "bstprocedure.hh"
-
static GParamSpec*
param_automation_pspec_midi_channel()
{
diff --git a/beast-gtk/bstpartdialog.cc b/beast-gtk/bstpartdialog.cc
index 2c0eedc..4472e85 100644
--- a/beast-gtk/bstpartdialog.cc
+++ b/beast-gtk/bstpartdialog.cc
@@ -1,6 +1,5 @@
// Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
#include "bstpartdialog.hh"
-#include "bstprocedure.hh"
#include "bstmenus.hh"
#include "bstparam.hh"
#include "bstgrowbar.hh"
@@ -27,7 +26,6 @@ static gboolean part_dialog_action_check (gpointer data,
guint64 action_stamp);
static void part_dialog_action_exec (gpointer data,
size_t action);
-static void part_dialog_run_script_proc (gpointer data, size_t action_id);
/* --- track actions --- */
@@ -104,7 +102,6 @@ bst_part_dialog_init (BstPartDialog *self)
{
new (&self->project) Bse::ProjectH();
GtkRange *srange;
- GxkActionList *al1;
GtkObject *adjustment;
GtkAdjustment *adj;
GxkRadget *radget;
@@ -131,12 +128,6 @@ bst_part_dialog_init (BstPartDialog *self)
gxk_widget_publish_actions (self, "piano-clear-undo", G_N_ELEMENTS (piano_clear_undo), piano_clear_undo,
NULL, part_dialog_action_check, part_dialog_action_exec);
- /* publish /Part/ scripts */
- Bse::CategorySeq cseq = bse_server.category_match ("/Part/*");
- al1 = bst_action_list_from_cats (cseq, 1, BST_STOCK_EXECUTE, NULL, part_dialog_run_script_proc, self);
- gxk_action_list_sort (al1);
- gxk_widget_publish_action_list (self, "part-scripts", al1);
-
BstGrowBar *grow_bar = (BstGrowBar*) gxk_radget_find (radget, "piano-roll-hgrow-bar");
/* piano roll */
@@ -318,19 +309,6 @@ event_canvas_clicked (BstEventRoll *eroll,
event->button.button, event->button.time);
}
-static void
-part_dialog_run_script_proc (gpointer data, size_t action_id)
-{
- BstPartDialog *self = BST_PART_DIALOG (data);
- Bse::Category cat = bst_category_find (g_quark_to_string (action_id));
- Bse::PartH part = self->proll->part;
-
- bst_procedure_exec_auto (cat.otype.c_str(),
- "project", SFI_TYPE_PROXY, part.get_project().proxy_id(),
- "part", SFI_TYPE_PROXY, part.proxy_id(),
- NULL);
-}
-
static gboolean
part_dialog_action_check (gpointer data,
size_t action,
diff --git a/beast-gtk/bstprocedure.cc b/beast-gtk/bstprocedure.cc
index 443b7d4..735952b 100644
--- a/beast-gtk/bstprocedure.cc
+++ b/beast-gtk/bstprocedure.cc
@@ -242,53 +242,6 @@ shell_find_param (BstProcedureShell *self,
}
void
-bst_procedure_shell_execute (BstProcedureShell *self)
-{
- GtkWidget *widget;
- SfiRing *ring;
-
- assert_return (BST_IS_PROCEDURE_SHELL (self));
- assert_return (self->proc != NULL);
- assert_return (self->in_execution == FALSE);
-
- widget = GTK_WIDGET (self);
- gtk_widget_ref (widget);
-
- /* update parameter record */
- for (ring = self->params; ring; ring = sfi_ring_walk (ring, self->params))
- gxk_param_apply_value ((GxkParam*) ring->data);
-
- if (widget)
- {
- SfiGlueProc *proc = self->proc;
- Bse::Error error = Bse::Error::NONE;
- SfiSeq *pseq = sfi_seq_new ();
- GValue *rvalue;
- guint i;
-
- for (i = 0; i < proc->n_params; i++)
- sfi_seq_append (pseq, sfi_rec_get (self->prec, proc->params[i]->name));
-
- self->in_execution = TRUE;
- rvalue = sfi_glue_call_seq (self->proc->name, pseq);
- self->in_execution = FALSE;
-
- bst_status_eprintf (error, _("Executing '%s'"), self->proc->name);
-
- sfi_seq_unref (pseq);
- if (rvalue && proc->ret_param)
- {
- GxkParam *param = shell_find_param (self, proc->ret_param->name);
- sfi_rec_set (self->prec, proc->ret_param->name, rvalue);
- if (param)
- gxk_param_update (param);
- }
- }
-
- gtk_widget_unref (widget);
-}
-
-void
bst_procedure_shell_reset (BstProcedureShell *self)
{
SfiGlueProc *proc;
@@ -430,135 +383,11 @@ bst_procedure_shell_global (void)
gtk_container_add (GTK_CONTAINER (GXK_DIALOG (dialog)->vbox), GTK_WIDGET (global_proc_shell));
gtk_widget_show (GTK_WIDGET (global_proc_shell));
- /* actions */
- gxk_dialog_default_action_swapped (GXK_DIALOG (dialog),
- BST_STOCK_EXECUTE, (void*) bst_procedure_shell_execute,
global_proc_shell);
gxk_dialog_action (GXK_DIALOG (dialog), BST_STOCK_CLOSE, (void*) gxk_toplevel_delete, NULL);
}
return global_proc_shell;
}
-static void
-bst_procedure_exec_internal (const gchar *procedure_name,
- const gchar *preset_param,
- gboolean modal,
- gboolean auto_start,
- gboolean main_loop_recurse,
- va_list var_args)
-{
- BstProcedureShell *shell;
- SfiGlueProc *proc;
- GtkWidget *dialog;
-
- /* structure setup */
- proc = sfi_glue_describe_proc (procedure_name);
- if (!proc)
- {
- Bse::warning ("no such procedure \"%s\"", procedure_name);
- return;
- }
- proc = sfi_glue_proc_ref (proc);
- shell = bst_procedure_shell_global ();
- dialog = gtk_widget_get_toplevel (GTK_WIDGET (shell));
- bst_procedure_shell_set_proc (shell, proc);
-
- /* set preset parameters */
- bst_procedure_shell_unpreset (shell);
- while (preset_param)
- {
- GType vtype = va_arg (var_args, GType);
- gchar *error = NULL;
- GValue value = { 0, };
-
- g_value_init (&value, vtype);
- G_VALUE_COLLECT (&value, var_args, 0, &error);
- if (error)
- {
- Bse::warning ("%s: %s", G_STRLOC, error);
- g_free (error);
- break;
- }
- if (preset_param[0])
- bst_procedure_shell_preset (shell, preset_param, &value, TRUE);
- g_value_unset (&value);
- preset_param = va_arg (var_args, const gchar*);
- }
-
- if (modal)
- gxk_dialog_add_flags (GXK_DIALOG (dialog), GXK_DIALOG_MODAL);
- else
- gxk_dialog_clear_flags (GXK_DIALOG (dialog), GXK_DIALOG_MODAL);
-
- /* execution */
- gxk_status_window_push (dialog);
- g_object_ref (dialog);
- if (auto_start && shell->n_preset_params >= shell->proc->n_params && shell->proc->ret_param == NULL)
- bst_procedure_shell_execute (shell);
- else
- {
- /* hand control over to user
- */
- gtk_widget_show_now (dialog);
- gdk_window_raise (dialog->window);
- if (main_loop_recurse)
- {
- do
- {
- GDK_THREADS_LEAVE ();
- g_main_iteration (TRUE);
- GDK_THREADS_ENTER ();
- }
- while (GTK_WIDGET_DRAWABLE (dialog));
- }
- }
- gxk_status_window_pop ();
- g_object_unref (dialog);
-
- sfi_glue_proc_unref (proc);
-}
-
-void
-bst_procedure_exec_modal (const gchar *procedure_name,
- const gchar *preset_param,
- ...)
-{
- va_list var_args;
-
- assert_return (procedure_name != NULL);
-
- va_start (var_args, preset_param);
- bst_procedure_exec_internal (procedure_name, preset_param, TRUE, TRUE, TRUE, var_args);
- va_end (var_args);
-}
-
-void
-bst_procedure_exec (const gchar *procedure_name,
- const gchar *preset_param,
- ...)
-{
- va_list var_args;
-
- assert_return (procedure_name != NULL);
-
- va_start (var_args, preset_param);
- bst_procedure_exec_internal (procedure_name, preset_param, FALSE, FALSE, FALSE, var_args);
- va_end (var_args);
-}
-
-void
-bst_procedure_exec_auto (const gchar *procedure_name,
- const gchar *preset_param,
- ...)
-{
- va_list var_args;
-
- assert_return (procedure_name != NULL);
-
- va_start (var_args, preset_param);
- bst_procedure_exec_internal (procedure_name, preset_param, FALSE, TRUE, FALSE, var_args);
- va_end (var_args);
-}
-
GParamSpec*
bst_procedure_ref_pspec (const gchar *procedure_name,
const gchar *parameter)
diff --git a/beast-gtk/bstprocedure.hh b/beast-gtk/bstprocedure.hh
index d76d595..ba75676 100644
--- a/beast-gtk/bstprocedure.hh
+++ b/beast-gtk/bstprocedure.hh
@@ -41,7 +41,6 @@ GtkType bst_procedure_shell_get_type (void);
GtkWidget* bst_procedure_shell_new (SfiGlueProc *proc);
void bst_procedure_shell_update (BstProcedureShell *procedure_shell);
void bst_procedure_shell_rebuild (BstProcedureShell *procedure_shell);
-void bst_procedure_shell_execute (BstProcedureShell *procedure_shell);
void bst_procedure_shell_set_proc (BstProcedureShell *procedure_shell,
SfiGlueProc *proc);
void bst_procedure_shell_reset (BstProcedureShell *procedure_shell);
@@ -54,15 +53,6 @@ gboolean bst_procedure_shell_preset (BstProcedureShell *procedure_shell,
/* --- convenience --- */
BstProcedureShell* bst_procedure_shell_global (void);
-void bst_procedure_exec (const gchar *procedure_name,
- const gchar *preset_param,
- ...) G_GNUC_NULL_TERMINATED;
-void bst_procedure_exec_auto (const gchar *procedure_name,
- const gchar *preset_param,
- ...) G_GNUC_NULL_TERMINATED;
-void bst_procedure_exec_modal (const gchar *procedure_name,
- const gchar *preset_param,
- ...) G_GNUC_NULL_TERMINATED;
GParamSpec* bst_procedure_ref_pspec (const gchar *procedure_name,
const gchar *parameter);
diff --git a/beast-gtk/bstsampleeditor.cc b/beast-gtk/bstsampleeditor.cc
index 17ca430..b377d86 100644
--- a/beast-gtk/bstsampleeditor.cc
+++ b/beast-gtk/bstsampleeditor.cc
@@ -1,7 +1,6 @@
// Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
#include "bstsampleeditor.hh"
-#include "bstprocedure.hh"
#include "bstmenus.hh"
#include <gdk/gdkkeysyms.h>
diff --git a/beast-gtk/bstsnetrouter.cc b/beast-gtk/bstsnetrouter.cc
index 96d1dc4..504cbfc 100644
--- a/beast-gtk/bstsnetrouter.cc
+++ b/beast-gtk/bstsnetrouter.cc
@@ -6,7 +6,6 @@
#include "bstcanvaslink.hh"
#include "bstmenus.hh"
#include "bstgconfig.hh"
-#include "bstprocedure.hh"
#include "bstscrollgraph.hh"
#include <gdk/gdkkeysyms.h>
@@ -316,17 +315,6 @@ bst_router_popup_select (gpointer user_data, size_t action_id)
gxk_action_group_select (self->canvas_tool, action_id);
}
-static void
-bst_router_run_method (gpointer user_data, size_t action_id)
-{
- BstSNetRouter *self = BST_SNET_ROUTER (user_data);
- Bse::Category cat = bst_category_find (g_quark_to_string (action_id));
- bst_procedure_exec_auto (cat.otype.c_str(),
- "synth-net", SFI_TYPE_PROXY, self->snet.proxy_id(),
- BSE_IS_CSYNTH (self->snet.proxy_id()) ? "custom-synth" : "", SFI_TYPE_PROXY,
self->snet.proxy_id(),
- NULL);
-}
-
void
bst_snet_router_update (BstSNetRouter *self)
{
@@ -980,7 +968,7 @@ bst_snet_router_init (BstSNetRouter *self)
{
new (&self->snet) Bse::SNetH();
GnomeCanvas *canvas = GNOME_CANVAS (self);
- GxkActionList *al1, *al2, *canvas_modules, *toolbar_modules, *palette_modules;
+ GxkActionList *canvas_modules, *toolbar_modules, *palette_modules;
uint i, n;
self->palette = NULL;
@@ -1010,16 +998,6 @@ bst_snet_router_init (BstSNetRouter *self)
"swapped_signal::destroy", g_nullify_pointer, &self->adjustment,
NULL);
- /* CSynth & SNet utilities */
- Bse::CategorySeq cseq = bse_server.category_match ("/CSynth/*");
- al1 = bst_action_list_from_cats (cseq, 1, BST_STOCK_EXECUTE, NULL, bst_router_run_method, self);
- gxk_action_list_sort (al1);
- cseq = bse_server.category_match ("/SNet/*");
- al2 = bst_action_list_from_cats (cseq, 1, BST_STOCK_EXECUTE, NULL, bst_router_run_method, self);
- gxk_action_list_sort (al2);
- al1 = gxk_action_list_merge (al1, al2);
- gxk_widget_publish_action_list (GTK_WIDGET (self), "router-util-actions", al1);
-
/* publish canvas toolbar tools & actions */
gxk_widget_publish_actions_grouped (self, self->canvas_tool, "router-canvas-tools",
G_N_ELEMENTS (router_canvas_tools), router_canvas_tools,
diff --git a/beast-gtk/bstutils.cc b/beast-gtk/bstutils.cc
index c14ba43..5dcd58f 100644
--- a/beast-gtk/bstutils.cc
+++ b/beast-gtk/bstutils.cc
@@ -535,34 +535,6 @@ bst_action_list_add_module (GxkActionList *alist, const Bse::AuxData &ad, const
acheck, aexec, user_data);
}
-GxkActionList*
-bst_action_list_from_cats_pred (const Bse::CategorySeq &cseq,
- guint skip_levels,
- const gchar *stock_fallback,
- GxkActionCheck acheck,
- GxkActionExec aexec,
- gpointer user_data,
- BstActionListCategoryP predicate,
- gpointer predicate_data)
-{
- GxkActionList *alist = gxk_action_list_create ();
- for (size_t i = 0; i < cseq.size(); i++)
- if (!predicate || predicate (predicate_data, cseq[i]))
- bst_action_list_add_cat (alist, cseq[i], skip_levels, stock_fallback, acheck, aexec, user_data);
- return alist;
-}
-
-GxkActionList*
-bst_action_list_from_cats (const Bse::CategorySeq &cseq,
- guint skip_levels,
- const gchar *stock_fallback,
- GxkActionCheck acheck,
- GxkActionExec aexec,
- gpointer user_data)
-{
- return bst_action_list_from_cats_pred (cseq, skip_levels, stock_fallback, acheck, aexec, user_data, NULL,
NULL);
-}
-
/* --- field mask --- */
static GQuark gmask_quark = 0;
diff --git a/beast-gtk/bstutils.hh b/beast-gtk/bstutils.hh
index 452603c..bbc3c0a 100644
--- a/beast-gtk/bstutils.hh
+++ b/beast-gtk/bstutils.hh
@@ -46,21 +46,6 @@ void bst_action_list_add_cat (GxkActionList *alist, const Bse::Category &cat,
GxkActionCheck acheck, GxkActionExec aexec, gpointer user_data);
void bst_action_list_add_module (GxkActionList *alist, const Bse::AuxData &ad, const Bse::Icon &icon, const
char *stock_fallback,
GxkActionCheck acheck, GxkActionExec aexec, gpointer user_data);
-GxkActionList* bst_action_list_from_cats (const Bse::CategorySeq &cseq,
- guint skip_levels,
- const gchar *stock_fallback,
- GxkActionCheck acheck,
- GxkActionExec aexec,
- gpointer user_data);
-typedef gboolean (*BstActionListCategoryP) (gpointer predicate_data, const Bse::Category &cat);
-GxkActionList* bst_action_list_from_cats_pred (const Bse::CategorySeq &cseq,
- guint skip_levels,
- const gchar *stock_fallback,
- GxkActionCheck acheck,
- GxkActionExec aexec,
- gpointer user_data,
- BstActionListCategoryP predicate,
- gpointer predicate_data);
void bst_background_handler1_add (gboolean (*handler) (gpointer data),
gpointer data,
void (*free_func) (gpointer data));
diff --git a/beast-gtk/bstwaveeditor.cc b/beast-gtk/bstwaveeditor.cc
index 3f8024c..b2e24af 100644
--- a/beast-gtk/bstwaveeditor.cc
+++ b/beast-gtk/bstwaveeditor.cc
@@ -2,7 +2,6 @@
#include "bstwaveeditor.hh"
#include "bstplayback.hh"
-#include "bstprocedure.hh"
#include "bstmenus.hh"
#include <gdk/gdkkeysyms.h>
diff --git a/beast-gtk/bstwaveview.cc b/beast-gtk/bstwaveview.cc
index dd3a75c..b307235 100644
--- a/beast-gtk/bstwaveview.cc
+++ b/beast-gtk/bstwaveview.cc
@@ -1,6 +1,5 @@
// Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
#include "bstwaveview.hh"
-#include "bstprocedure.hh"
#include "bstwaveeditor.hh"
#include "bstfiledialog.hh"
#include "bstsampleeditor.hh"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]