aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Bullock <postlude@users.sourceforge.net>2010-12-08 09:47:23 +0000
committerJamie Bullock <postlude@users.sourceforge.net>2010-12-08 09:47:23 +0000
commit7dbe531e201e79761b19870c278262f6826985b3 (patch)
tree5ed077d4acb37ee7c4d694cbc001ce98a796495b
parent5b43da5a8491e6bb577b9e508c55c9619a1a850f (diff)
- renamed dssi~ to pluginhost~
svn path=/trunk/externals/postlude/; revision=14576
-rw-r--r--pluginhost~/README27
-rw-r--r--pluginhost~/doc/pluginhost~-help.pd (renamed from pluginhost~/doc/dssi-help.pd)12
-rwxr-xr-xpluginhost~/makefile20
-rw-r--r--pluginhost~/src/pluginhost~.c (renamed from pluginhost~/src/dssi~.c)350
-rw-r--r--pluginhost~/src/pluginhost~.h (renamed from pluginhost~/src/dssi~.h)29
5 files changed, 210 insertions, 228 deletions
diff --git a/pluginhost~/README b/pluginhost~/README
index ab164e8..aab7983 100644
--- a/pluginhost~/README
+++ b/pluginhost~/README
@@ -1,29 +1,24 @@
-dssi~ - a DSSI host for Pure Data
-=================================
+pluginhost~ - a plugin host for Pure Data
+==========================================
-This directory (dssi) contains sourcecode and possibly binaries for a DSSI host for Pure Data. To find out more about DSSI visit http://dssi.sourceforge.net.
-
-The functionality of the external is demonstrated in in the help patch (dssi/doc/help-dssi.pd).
+This directory (pluginhost) contains sourcecode and possibly binaries for a plugin host for Pure Data. It currently supports the following plugin types:
+ LADSPA: http://www.ladspa.org/
+ DSSI: http://dssi.sourceforge.net/
+The functionality of the external is demonstrated in in the help patch (pluginhost/doc/pluginhost~-help.pd).
Requirements
------------
-To compile dssi~ the following are required;
+To compile pluginhost~ the following are required;
-DSSI >= 0.9
-LADSPA SDK >= 1.x
-liblo >= 0.12
-alsa/seq_event.h - included
-pd headers >= 0.37
+pd header (m_pd.h) >= 0.37
The help patch requires:
PD >= 0.39
-
-
Installation
------------
@@ -34,12 +29,10 @@ make install (as root)
Once compiled the binary file and help file should be placed in directories that are included in Pure Data's search path.
-
-
License
-------
-All files included in the dssi/src/ directory, and all binary files (if included) are licensed under the GNU GPL Version 2 (see gpl.txt for details).
+All files included in the pluginhost/src/ directory, and all binary files (if included) are licensed under the GNU GPL Version 2 (see gpl.txt for details).
-All files included in the dssi/include/ directory are licensed under the GNU Lesser General Public License (see lesser.txt for details).
+All files included in the pluginhost/include/ directory are licensed under the GNU Lesser General Public License (see lesser.txt for details).
diff --git a/pluginhost~/doc/dssi-help.pd b/pluginhost~/doc/pluginhost~-help.pd
index b4e5ba3..3b6cd1f 100644
--- a/pluginhost~/doc/dssi-help.pd
+++ b/pluginhost~/doc/pluginhost~-help.pd
@@ -1,8 +1,8 @@
#N canvas 186 66 1411 654 10;
#X obj 1268 524 catch~ mix;
-#X text 602 15 dssi~ - a DSSI host for Pure Data ---------------------------------
+#X text 602 15 pluginhost~ - a DSSI host for Pure Data ---------------------------------
;
-#X obj 7 63 cnv 15 1400 300 empty empty dssi~_instance_1 20 12 0 14
+#X obj 7 63 cnv 15 1400 300 empty empty pluginhost~_instance_1 20 12 0 14
-257472 -66577 0;
#X obj 443 203 line;
#X msg 443 182 \$1 10;
@@ -44,7 +44,7 @@
#X text 585 97 --program change--;
#X text 105 96 -----notes-----;
#X text 718 97 --sysex patch/bank load--;
-#X obj 5 371 cnv 15 600 300 empty empty dssi~_instance_2 20 12 0 14
+#X obj 5 371 cnv 15 600 300 empty empty pluginhost~_instance_2 20 12 0 14
-225280 -66577 0;
#X obj 435 620 throw~ mix;
#X obj 474 122 loadbang;
@@ -74,13 +74,13 @@ program and control data:;
#X text 806 212 LAST ARGUMENT GIVES PLUGIN INSTANCE TO BE CONFIGURED
\, NO LAST ARGUMENT=(ALL INSTANCES);
#X obj 388 620 print;
-#X text 738 458 Usage: [dssi~ <[path to libary:plugin name] or [plugin
+#X text 738 458 Usage: [pluginhost~ <[path to libary:plugin name] or [plugin
name]> <number of plugin instances>];
-#X obj 229 291 dssi~ /usr/local/lib/dssi/hexter.so:hexter 2;
+#X obj 229 291 pluginhost~ hexter.so:hexter 2;
#X msg 193 342 control #1 445;
#X obj 451 394 vsl 15 128 0 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 7900 1;
-#X obj 378 582 dssi~ sine_faaa 6 -------------;
+#X obj 378 582 pluginhost~ sine_faaa 6 -------------;
#X obj 284 438 expr $f1 \; $f1*2 \; $f1*3 \; $f1*4 \; $f1*5 \; $f1*6
;
#X obj 285 397 loadbang;
diff --git a/pluginhost~/makefile b/pluginhost~/makefile
index 6a87da9..b95b51d 100755
--- a/pluginhost~/makefile
+++ b/pluginhost~/makefile
@@ -1,5 +1,5 @@
-NAME=dssi~
-CSYM=dssi~
+NAME=pluginhost~
+CSYM=pluginhost~
LIBDIR=/usr/local/lib
PDDIR=$(LIBDIR)/pd
@@ -30,8 +30,8 @@ LINUXINCLUDE = -I/usr/include -I./include
.c.pd_linux:
$(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/jsearch.c
$(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/jload.c
- $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/dssi~.c
- gcc --export-dynamic -shared -o $(NAME).pd_linux dssi~.o jload.o jsearch.o -lc -lm -llo
+ $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/pluginhost~.c
+ gcc --export-dynamic -shared -o $(NAME).pd_linux pluginhost~.o jload.o jsearch.o -lc -lm -llo
# strip --strip-unneeded $(NAME).pd_linux
cp $(NAME).pd_linux ~/pd-externals/
rm -f *.o
@@ -45,13 +45,13 @@ pd_darwin: src/$(NAME).pd_darwin
DARWINCFLAGS = -DPD -arch $(ARCHITECTURE) -O3 -Wall -W -Wshadow -Wstrict-prototypes \
-Wno-unused -Wno-parentheses -Wno-switch -L/usr/local/lib/ -DDEBUG=$(DEBUG)
-DARWININCLUDE = -I ./ -I ../src -I/usr/local/include/ -I ./include -I/usr/local/include/dssi/
+DARWININCLUDE = -I ./ -I ../src -I/usr/local/include/ -I ./include -I/usr/local/include/pluginhost/
.c.pd_darwin:
$(CC) $(DARWINCFLAGS) $(DARWININCLUDE) -c src/jsearch.c
$(CC) $(DARWINCFLAGS) $(DARWININCLUDE) -c src/jload.c
- $(CC) $(DARWINCFLAGS) $(DARWININCLUDE) -c src/dssi~.c
- $(CC) -arch $(ARCHITECTURE) -bundle -undefined suppress -flat_namespace -llo -o $(NAME).pd_darwin dssi~.o jload.o jsearch.o
+ $(CC) $(DARWINCFLAGS) $(DARWININCLUDE) -c src/pluginhost~.c
+ $(CC) -arch $(ARCHITECTURE) -bundle -undefined suppress -flat_namespace -llo -o $(NAME).pd_darwin pluginhost~.o jload.o jsearch.o
rm -f *.o
# ----------------------- Generic -----------------------
@@ -60,7 +60,7 @@ clean:
rm -f *.o *.pd_* so_locations
install:
- cp dssi~.pd_* $(INSTALLPATH)
- install -d $(PDDIR)/doc/5.reference/dssi/
+ cp pluginhost~.pd_* $(INSTALLPATH)
+ install -d $(PDDIR)/doc/5.reference/pluginhost/
install -m 644 doc/*-help* $(PDDIR)/doc/5.reference/
- install -m 644 doc/output~.pd $(PDDIR)/doc/5.reference/dssi/
+ install -m 644 doc/output~.pd $(PDDIR)/doc/5.reference/pluginhost/
diff --git a/pluginhost~/src/dssi~.c b/pluginhost~/src/pluginhost~.c
index f195637..b18ef23 100644
--- a/pluginhost~/src/dssi~.c
+++ b/pluginhost~/src/pluginhost~.c
@@ -28,10 +28,10 @@
#include <assert.h>
-#include "dssi~.h"
+#include "pluginhost~.h"
#include "jutils.h"
-static t_class *dssi_tilde_class;
+static t_class *ph_tilde_class;
/*From dx7_voice_data.c by Sean Bolton */
@@ -114,7 +114,7 @@ static DSSI_Descriptor * ladspa_to_dssi(
return (DSSI_Descriptor *)dssiDesc;
}
/*
- static void dssi_tilde_load_plugin(const char *dll_path, void **dll_handle){
+ static void ph_tilde_load_plugin(const char *dll_path, void **dll_handle){
*dll_handle = dlopen(dll_path, RTLD_NOW | RTLD_LOCAL);
if (*dll_handle){
@@ -125,7 +125,7 @@ static DSSI_Descriptor * ladspa_to_dssi(
}
*/
-static void dssi_tilde_port_info(t_dssi_tilde *x){
+static void ph_tilde_port_info(t_ph_tilde *x){
t_int i;
for (i = 0; i < (t_int)x->descriptor->LADSPA_Plugin->PortCount; i++) {
@@ -198,7 +198,7 @@ static void dssi_tilde_port_info(t_dssi_tilde *x){
#endif
}
-static void dssi_tilde_assign_ports(t_dssi_tilde *x){
+static void ph_tilde_assign_ports(t_ph_tilde *x){
int i;
#if DEBUG
@@ -254,7 +254,7 @@ static void dssi_tilde_assign_ports(t_dssi_tilde *x){
}
-static void dssi_tilde_init_instance(t_dssi_tilde *x, t_int instance){
+static void ph_tilde_init_instance(t_ph_tilde *x, t_int instance){
x->instances[instance].pluginPrograms = NULL;
x->instances[instance].currentBank = 0;
@@ -280,7 +280,7 @@ static void dssi_tilde_init_instance(t_dssi_tilde *x, t_int instance){
}
-static void dssi_tilde_connect_ports(t_dssi_tilde *x, t_int instance){
+static void ph_tilde_connect_ports(t_ph_tilde *x, t_int instance){
t_int i;
@@ -343,7 +343,7 @@ static void dssi_tilde_connect_ports(t_dssi_tilde *x, t_int instance){
}
-static void dssi_tilde_activate_plugin(t_dssi_tilde *x, t_int instance){
+static void ph_tilde_activate_plugin(t_ph_tilde *x, t_int instance){
if(x->descriptor->LADSPA_Plugin->activate){
#if DEBUG
@@ -356,7 +356,7 @@ static void dssi_tilde_activate_plugin(t_dssi_tilde *x, t_int instance){
#endif
}
-static void dssi_tilde_deactivate_plugin(t_dssi_tilde *x, t_float instance_f){
+static void ph_tilde_deactivate_plugin(t_ph_tilde *x, t_float instance_f){
t_int instance = (t_int)instance_f;
if(x->descriptor->LADSPA_Plugin->deactivate)
@@ -368,10 +368,10 @@ static void dssi_tilde_deactivate_plugin(t_dssi_tilde *x, t_float instance_f){
static void osc_error(int num, const char *msg, const char *where)
{
- post("dssi~: osc error %d in path %s: %s\n",num, where, msg);
+ post("pluginhost~: osc error %d in path %s: %s\n",num, where, msg);
}
-static void query_programs(t_dssi_tilde *x, t_int instance) {
+static void query_programs(t_ph_tilde *x, t_int instance) {
int i;
#if DEBUG
post("querying programs");
@@ -420,13 +420,13 @@ static void query_programs(t_dssi_tilde *x, t_int instance) {
#endif
}
}
- /* No - it should be 0 anyway - dssi_init */
+ /* No - it should be 0 anyway - ph_init */
/* else
x->instances[instance].plugin_ProgramCount = 0;
*/ }
}
-static LADSPA_Data get_port_default(t_dssi_tilde *x, int port)
+static LADSPA_Data get_port_default(t_ph_tilde *x, int port)
{
LADSPA_Descriptor *plugin = (LADSPA_Descriptor *)x->descriptor->LADSPA_Plugin;
LADSPA_PortRangeHint hint = plugin->PortRangeHints[port];
@@ -489,7 +489,7 @@ static LADSPA_Data get_port_default(t_dssi_tilde *x, int port)
return 0.0f;
}
-static unsigned dssi_tilde_get_parm_number (t_dssi_tilde *x,
+static unsigned ph_tilde_get_parm_number (t_ph_tilde *x,
const char *str)
/* find out if str points to a parameter number or not and return the
number or zero. The number string has to begin with a '#' character */
@@ -518,7 +518,7 @@ static unsigned dssi_tilde_get_parm_number (t_dssi_tilde *x,
}
}
-static void dssi_tilde_set_control_input_by_index (t_dssi_tilde *x,
+static void ph_tilde_set_control_input_by_index (t_ph_tilde *x,
signed ctrl_input_index,
float value,
t_int instance)
@@ -526,7 +526,7 @@ static void dssi_tilde_set_control_input_by_index (t_dssi_tilde *x,
long port, portno;
if (ctrl_input_index >= x->plugin_controlIns) {
- post("dssi~: control port number %d is out of range [1, %d]",
+ post("pluginhost~: control port number %d is out of range [1, %d]",
ctrl_input_index + 1, x->plugin_controlIns);
return;
}
@@ -561,13 +561,13 @@ static void dssi_tilde_set_control_input_by_index (t_dssi_tilde *x,
if(x->is_DSSI){
if(x->instances[instance].uiTarget == NULL){
#if DEBUG
- post("dssi~: unable to send to NULL target");
+ post("pluginhost~: unable to send to NULL target");
#endif
return;
}
if(x->instances[instance].ui_osc_control_path == NULL){
#if DEBUG
- post("dssi~: unable to send to NULL control path");
+ post("pluginhost~: unable to send to NULL control path");
#endif
return;
}
@@ -578,7 +578,7 @@ static void dssi_tilde_set_control_input_by_index (t_dssi_tilde *x,
}
-static void dssi_tilde_set_control_input_by_name (t_dssi_tilde *x,
+static void ph_tilde_set_control_input_by_name (t_ph_tilde *x,
const char* name,
float value,
t_int instance)
@@ -588,7 +588,7 @@ static void dssi_tilde_set_control_input_by_name (t_dssi_tilde *x,
int found_port = 0; /* boolean */
if (name == NULL || strlen (name) == 0) {
- post("dssi~: no control port name specified");
+ post("pluginhost~: no control port name specified");
return;
}
@@ -620,15 +620,15 @@ static void dssi_tilde_set_control_input_by_name (t_dssi_tilde *x,
if (!found_port)
{
- post("dssi~: plugin doesn't have a control input port named \"%s\"",
+ post("pluginhost~: plugin doesn't have a control input port named \"%s\"",
name);
return;
}
- dssi_tilde_set_control_input_by_index (x, ctrl_input_index, value, instance);
+ ph_tilde_set_control_input_by_index (x, ctrl_input_index, value, instance);
}
-static void dssi_tilde_control (t_dssi_tilde *x,
+static void ph_tilde_control (t_ph_tilde *x,
t_symbol* ctrl_name,
t_float ctrl_value,
t_float instance_f)
@@ -639,7 +639,7 @@ static void dssi_tilde_control (t_dssi_tilde *x,
int n_instances = x->n_instances;
if (instance > x->n_instances || instance < -1){
- post("dssi~: control: invalid instance number %d", instance);
+ post("pluginhost~: control: invalid instance number %d", instance);
return;
}
@@ -648,33 +648,33 @@ static void dssi_tilde_control (t_dssi_tilde *x,
#endif
if (ctrl_name->s_name == NULL || strlen (ctrl_name->s_name) == 0) {
- post("dssi~: control messages must have a name and a value");
+ post("pluginhost~: control messages must have a name and a value");
return;
}
- parm_num = dssi_tilde_get_parm_number (x, ctrl_name->s_name);
+ parm_num = ph_tilde_get_parm_number (x, ctrl_name->s_name);
if (parm_num) {
if(instance >= 0)
- dssi_tilde_set_control_input_by_index (x, parm_num - 1,
+ ph_tilde_set_control_input_by_index (x, parm_num - 1,
ctrl_value, instance);
else if (instance == -1){
while(n_instances--)
- dssi_tilde_set_control_input_by_index (x, parm_num - 1,
+ ph_tilde_set_control_input_by_index (x, parm_num - 1,
ctrl_value, n_instances);
}
}
else {
if(instance >= 0)
- dssi_tilde_set_control_input_by_name (x, ctrl_name->s_name,
+ ph_tilde_set_control_input_by_name (x, ctrl_name->s_name,
ctrl_value, instance);
else if (instance == -1){
while(n_instances--)
- dssi_tilde_set_control_input_by_name (x,
+ ph_tilde_set_control_input_by_name (x,
ctrl_name->s_name, ctrl_value, n_instances);
}
}
}
-static void dssi_tilde_info (t_dssi_tilde *x){
+static void ph_tilde_info (t_ph_tilde *x){
unsigned int i,
ctrl_portno,
audio_portno;
@@ -709,7 +709,7 @@ static void dssi_tilde_info (t_dssi_tilde *x){
}
}
-static void dssi_tilde_ladspa_description(t_dssi_tilde *x, t_atom *at,
+static void ph_tilde_ladspa_description(t_ph_tilde *x, t_atom *at,
DSSI_Descriptor *psDescriptor){
at[0].a_w.w_symbol =
gensym ((char*)psDescriptor->LADSPA_Plugin->Name);
@@ -726,13 +726,13 @@ static void dssi_tilde_ladspa_description(t_dssi_tilde *x, t_atom *at,
outlet_anything (x->control_outlet, gensym ("maker"), 1, at);
}
-static void dssi_tilde_ladspa_describe(const char * pcFullFilename,
+static void ph_tilde_ladspa_describe(const char * pcFullFilename,
void * pvPluginHandle,
DSSI_Descriptor_Function fDescriptorFunction,
void* user_data,
int is_DSSI) {
- t_dssi_tilde *x = (((void**)user_data)[0]);
+ t_ph_tilde *x = (((void**)user_data)[0]);
t_atom at[1];
DSSI_Descriptor *psDescriptor;
long lIndex;
@@ -748,7 +748,7 @@ static void dssi_tilde_ladspa_describe(const char * pcFullFilename,
for (lIndex = 0;
(psDescriptor = (DSSI_Descriptor *)
fDescriptorFunction(lIndex)) != NULL; lIndex++)
- dssi_tilde_ladspa_description(x, &at[0], psDescriptor);
+ ph_tilde_ladspa_description(x, &at[0], psDescriptor);
}
else if(!is_DSSI)
@@ -763,7 +763,7 @@ static void dssi_tilde_ladspa_describe(const char * pcFullFilename,
fDescriptorFunction(lIndex++);
*/
if(psDescriptor->LADSPA_Plugin != NULL){
- dssi_tilde_ladspa_description(x, &at[0], psDescriptor);
+ ph_tilde_ladspa_description(x, &at[0], psDescriptor);
free((DSSI_Descriptor *)psDescriptor);
}
else
@@ -774,14 +774,14 @@ static void dssi_tilde_ladspa_describe(const char * pcFullFilename,
*/
}
-static void dssi_tilde_list_plugins (t_dssi_tilde *x) {
+static void ph_tilde_list_plugins (t_ph_tilde *x) {
void* user_data[1];
user_data[0] = x;
- LADSPAPluginSearch(dssi_tilde_ladspa_describe,(void*)user_data);
+ LADSPAPluginSearch(ph_tilde_ladspa_describe,(void*)user_data);
}
static int osc_debug_handler(const char *path, const char *types, lo_arg **argv,
- int argc, void *data, t_dssi_tilde *x)
+ int argc, void *data, t_ph_tilde *x)
{
int i;
printf("got unhandled OSC message:\npath: <%s>\n", path);
@@ -793,7 +793,7 @@ static int osc_debug_handler(const char *path, const char *types, lo_arg **argv,
return 1;
}
-static void dssi_tilde_get_current_program(t_dssi_tilde *x, int instance){
+static void ph_tilde_get_current_program(t_ph_tilde *x, int instance){
int i;
t_atom argv[3];
@@ -810,7 +810,7 @@ static void dssi_tilde_get_current_program(t_dssi_tilde *x, int instance){
}
-static void dssi_tilde_program_change(t_dssi_tilde *x, int instance){
+static void ph_tilde_program_change(t_ph_tilde *x, int instance){
/* jack-dssi-host queues program changes by using pending program change variables. In the audio callback, if a program change is received via MIDI it over writes the pending value (if any) set by the GUI. If unset, or processed the value will default back to -1. The following call to select_program is then made. I don't think it eventually needs to be done this way - i.e. do we need 'pending'? */
#if DEBUG
post("executing program change");
@@ -852,10 +852,10 @@ static void dssi_tilde_program_change(t_dssi_tilde *x, int instance){
x->instances[instance].pendingBankMSB = -1;
x->instances[instance].pendingBankLSB = -1;
}
- dssi_tilde_get_current_program(x, instance);
+ ph_tilde_get_current_program(x, instance);
}
-static int osc_program_handler(t_dssi_tilde *x, lo_arg **argv, int instance)
+static int osc_program_handler(t_ph_tilde *x, lo_arg **argv, int instance)
{
unsigned long bank = argv[0]->i;
unsigned long program = argv[1]->i;
@@ -871,7 +871,7 @@ static int osc_program_handler(t_dssi_tilde *x, lo_arg **argv, int instance)
for (i = 0; i < x->instances[instance].plugin_ProgramCount; ++i) {
if (x->instances[instance].pluginPrograms[i].Bank == bank &&
x->instances[instance].pluginPrograms[i].Program == program) {
- post("dssi~: OSC: setting bank %u, program %u, name %s\n",
+ post("pluginhost~: OSC: setting bank %u, program %u, name %s\n",
bank, program, x->instances[instance].pluginPrograms[i].Name);
found = 1;
@@ -889,12 +889,12 @@ static int osc_program_handler(t_dssi_tilde *x, lo_arg **argv, int instance)
#if DEBUG
post("bank = %d, program = %d, BankMSB = %d BankLSB = %d", bank, program, x->instances[instance].pendingBankMSB, x->instances[instance].pendingBankLSB);
#endif
- dssi_tilde_program_change(x, instance);
+ ph_tilde_program_change(x, instance);
return 0;
}
-static int osc_control_handler(t_dssi_tilde *x, lo_arg **argv, int instance)
+static int osc_control_handler(t_ph_tilde *x, lo_arg **argv, int instance)
{
int port = argv[0]->i;
LADSPA_Data value = argv[1]->f;
@@ -907,7 +907,7 @@ static int osc_control_handler(t_dssi_tilde *x, lo_arg **argv, int instance)
return 0;
}
-static int osc_midi_handler(t_dssi_tilde *x, lo_arg **argv, t_int instance)
+static int osc_midi_handler(t_ph_tilde *x, lo_arg **argv, t_int instance)
{
int ev_type = 0, chan = 0;
@@ -943,7 +943,7 @@ static int osc_midi_handler(t_dssi_tilde *x, lo_arg **argv, t_int instance)
return 0;
}
-static int osc_configure_handler(t_dssi_tilde *x, lo_arg **argv, int instance)
+static int osc_configure_handler(t_ph_tilde *x, lo_arg **argv, int instance)
{
const char *key = (const char *)&argv[0]->s;
const char *value = (const char *)&argv[1]->s;
@@ -975,7 +975,7 @@ static int osc_configure_handler(t_dssi_tilde *x, lo_arg **argv, int instance)
return 0;
}
-static int osc_exiting_handler(t_dssi_tilde *x, lo_arg **argv, int instance){
+static int osc_exiting_handler(t_ph_tilde *x, lo_arg **argv, int instance){
#if DEBUG
post("exiting handler called: Freeing ui_osc");
@@ -1003,13 +1003,13 @@ static int osc_exiting_handler(t_dssi_tilde *x, lo_arg **argv, int instance){
return 0;
}
-static int osc_update_handler(t_dssi_tilde *x, lo_arg **argv, int instance)
+static int osc_update_handler(t_ph_tilde *x, lo_arg **argv, int instance)
{
const char *url = (char *)&argv[0]->s;
const char *path;
t_int i;
char *host, *port;
- t_dssi_configure_pair *p;
+ t_ph_configure_pair *p;
p = x->configure_buffer_head;
@@ -1064,14 +1064,14 @@ static int osc_update_handler(t_dssi_tilde *x, lo_arg **argv, int instance)
while(p){
if(p->instance == instance)
- dssi_tilde_send_configure(x, p->key,
+ ph_tilde_send_configure(x, p->key,
p->value, instance);
p = p->next;
}
/* Send current bank/program (-FIX- another race...) */
if (x->instances[instance].pendingProgramChange >= 0)
- dssi_tilde_program_change(x, instance);
+ ph_tilde_program_change(x, instance);
#if DEBUG
post("pendingProgramChange = %d", x->instances[instance].pendingProgramChange);
#endif
@@ -1105,7 +1105,7 @@ static int osc_update_handler(t_dssi_tilde *x, lo_arg **argv, int instance)
return 0;
}
-static void dssi_tilde_osc_setup(t_dssi_tilde *x, int instance){
+static void ph_tilde_osc_setup(t_ph_tilde *x, int instance){
if(instance == 0){
x->osc_thread = lo_server_thread_new(NULL, osc_error);
@@ -1132,7 +1132,7 @@ static void dssi_tilde_osc_setup(t_dssi_tilde *x, int instance){
#endif
}
-static void dssi_tilde_init_programs(t_dssi_tilde *x, int instance){
+static void ph_tilde_init_programs(t_ph_tilde *x, int instance){
#if DEBUG
post("Setting up program data");
@@ -1152,7 +1152,7 @@ static void dssi_tilde_init_programs(t_dssi_tilde *x, int instance){
}
}
-static void dssi_tilde_load_gui(t_dssi_tilde *x, int instance){
+static void ph_tilde_load_gui(t_ph_tilde *x, int instance){
t_int err = 0;
char *osc_url;
char *gui_path;
@@ -1181,7 +1181,7 @@ static void dssi_tilde_load_gui(t_dssi_tilde *x, int instance){
#endif
if(!(dp = opendir(gui_base))){
- post("dssi~: unable to find GUI in %s, continuing without...", gui_base);
+ post("pluginhost~: unable to find GUI in %s, continuing without...", gui_base);
return;
}
else {
@@ -1216,7 +1216,7 @@ static void dssi_tilde_load_gui(t_dssi_tilde *x, int instance){
/* char osc_url[1024];*/
sprintf(osc_url, "%s/%s", x->osc_url_base,
x->instances[instance].osc_url_path);
- post("dssi~: instance %d URL: %s",instance, osc_url);
+ post("pluginhost~: instance %d URL: %s",instance, osc_url);
#if DEBUG
post("Trying to open GUI!");
#endif
@@ -1245,10 +1245,10 @@ static void dssi_tilde_load_gui(t_dssi_tilde *x, int instance){
}
}
-static void MIDIbuf(int type, int chan, int param, int val, t_dssi_tilde *x){
+static void MIDIbuf(int type, int chan, int param, int val, t_ph_tilde *x){
if(chan > x->n_instances - 1 || chan < 0){
- post("dssi~: note discarded: MIDI data is destined for a channel that doesn't exist");
+ post("pluginhost~: note discarded: MIDI data is destined for a channel that doesn't exist");
return;
}
@@ -1307,7 +1307,7 @@ static void MIDIbuf(int type, int chan, int param, int val, t_dssi_tilde *x){
post("pgm chabge received in buffer: MSB: %d, LSB %d, prog: %d",
x->instances[mapped].pendingBankMSB, x->instances[mapped].pendingBankLSB, val);
#endif
- dssi_tilde_program_change(x, mapped);
+ ph_tilde_program_change(x, mapped);
break;
}
}
@@ -1326,7 +1326,7 @@ static void MIDIbuf(int type, int chan, int param, int val, t_dssi_tilde *x){
pthread_mutex_unlock(&x->midiEventBufferMutex); /**release mutex*/
}
-static void dssi_tilde_list(t_dssi_tilde *x, t_symbol *s, int argc, t_atom *argv) {
+static void ph_tilde_list(t_ph_tilde *x, t_symbol *s, int argc, t_atom *argv) {
char *msg_type;
int ev_type = 0;
msg_type = (char *)malloc(TYPE_STRING_SIZE);
@@ -1364,7 +1364,7 @@ static void dssi_tilde_list(t_dssi_tilde *x, t_symbol *s, int argc, t_atom *argv
free(msg_type);
}
-static char *dssi_tilde_send_configure(t_dssi_tilde *x, char *key,
+static char *ph_tilde_send_configure(t_ph_tilde *x, char *key,
char *value, t_int instance){
char *debug;
@@ -1381,7 +1381,7 @@ static char *dssi_tilde_send_configure(t_dssi_tilde *x, char *key,
return debug;
}
-static void dssi_show(t_dssi_tilde *x, t_int instance, t_int toggle){
+static void ph_show(t_ph_tilde *x, t_int instance, t_int toggle){
if(x->instances[instance].uiTarget){
if (x->instances[instance].ui_hidden && toggle) {
@@ -1397,16 +1397,16 @@ static void dssi_show(t_dssi_tilde *x, t_int instance, t_int toggle){
}
else if(toggle){
x->instances[instance].ui_show = 1;
- dssi_tilde_load_gui(x, instance);
+ ph_tilde_load_gui(x, instance);
}
}
-static t_int dssi_tilde_configure_buffer(t_dssi_tilde *x, char *key,
+static t_int ph_tilde_configure_buffer(t_ph_tilde *x, char *key,
char *value, t_int instance){
/*#ifdef BLAH*/
- t_dssi_configure_pair *current, *p;
+ t_ph_configure_pair *current, *p;
t_int add_node;
add_node = 0;
current = x->configure_buffer_head;
@@ -1420,8 +1420,8 @@ static t_int dssi_tilde_configure_buffer(t_dssi_tilde *x, char *key,
if(current)
free(current->value);
else {
- current = (t_dssi_configure_pair *)malloc(sizeof
- (t_dssi_configure_pair));
+ current = (t_ph_configure_pair *)malloc(sizeof
+ (t_ph_configure_pair));
current->next = x->configure_buffer_head;
x->configure_buffer_head = current;
current->key = strdup(key);
@@ -1443,8 +1443,8 @@ static t_int dssi_tilde_configure_buffer(t_dssi_tilde *x, char *key,
return 0;
}
-static t_int dssi_tilde_configure_buffer_free(t_dssi_tilde *x){
- t_dssi_configure_pair *curr, *prev;
+static t_int ph_tilde_configure_buffer_free(t_ph_tilde *x){
+ t_ph_configure_pair *curr, *prev;
prev = curr = NULL;
for(curr = x->configure_buffer_head; curr != NULL; curr = curr->next){
@@ -1459,19 +1459,7 @@ static t_int dssi_tilde_configure_buffer_free(t_dssi_tilde *x){
return 0;
}
-/*
- static void dssi_tilde_plug (t_dssi_tilde *x, t_symbol* plug_name) {
- plugin_tilde_ladspa_close_plugin(x);
- x->plugin_library_filename = NULL;
- x->plugin_library_filename = plugin_tilde_search_plugin_by_label (x, plug_name->s_name);
- if (x->plugin_library_filename == NULL)
- post("plugin~: plugin not found in any library");
- if (plugin_tilde_open_plugin (x, plug_name->s_name, x->plugin_library_filename,(unsigned long)sys_getsr ()))
- post("plugin~: Unable to open plugin");
- }
- */
-
-static t_int dssi_tilde_reset(t_dssi_tilde *x, t_float instance_f){
+static t_int ph_tilde_reset(t_ph_tilde *x, t_float instance_f){
t_int instance = (t_int)instance_f - 1;
if (instance == -1){
@@ -1495,7 +1483,7 @@ static t_int dssi_tilde_reset(t_dssi_tilde *x, t_float instance_f){
return 0;
}
-static void dssi_tilde_search_plugin_callback (
+static void ph_tilde_search_plugin_callback (
const char* full_filename,
void* plugin_handle,
DSSI_Descriptor_Function descriptor_function,
@@ -1512,7 +1500,7 @@ static void dssi_tilde_search_plugin_callback (
if (*out_lib_name == NULL)
{
#if DEBUG
- post("plugin~: searching plugin \"%s\"...", full_filename);
+ post("pluginhost~: searching plugin \"%s\"...", full_filename);
#endif
for(plug_index = 0;(is_DSSI ?
(descriptor =
@@ -1522,14 +1510,14 @@ static void dssi_tilde_search_plugin_callback (
descriptor_function(plug_index)))->LADSPA_Plugin))
!= NULL; plug_index++){
#if DEBUG
- post("plugin~: label \"%s\"", descriptor->LADSPA_Plugin->Label);
+ post("pluginhost~: label \"%s\"", descriptor->LADSPA_Plugin->Label);
#endif
if (strcasecmp (name, descriptor->LADSPA_Plugin->Label)
== 0)
{
*out_lib_name = strdup (full_filename);
#if DEBUG
- post("plugin~: found plugin \"%s\" in library \"%s\"",
+ post("pluginhost~: found plugin \"%s\" in library \"%s\"",
name, full_filename);
#endif
/* if(!is_DSSI){
@@ -1546,7 +1534,7 @@ static void dssi_tilde_search_plugin_callback (
}
}
-static const char* plugin_tilde_search_plugin_by_label (t_dssi_tilde *x,
+static const char* plugin_tilde_search_plugin_by_label (t_ph_tilde *x,
const char *name)
{
char* lib_name = NULL;
@@ -1559,7 +1547,7 @@ static const char* plugin_tilde_search_plugin_by_label (t_dssi_tilde *x,
#endif
lib_name = NULL;
- LADSPAPluginSearch (dssi_tilde_search_plugin_callback,
+ LADSPAPluginSearch (ph_tilde_search_plugin_callback,
(void*)user_data);
/* The callback (allocates and) writes lib_name, if it finds the plugin */
@@ -1567,10 +1555,10 @@ static const char* plugin_tilde_search_plugin_by_label (t_dssi_tilde *x,
}
-static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_atom *argv)
+static t_int ph_tilde_ph_methods(t_ph_tilde *x, t_symbol *s, int argc, t_atom *argv)
{
if (!x->is_DSSI) {
- post("dssi~: plugin is not a DSSI plugin, operation not supported");
+ post("pluginhost~: plugin is not a DSSI plugin, operation not supported");
return 0;
}
char *msg_type,
@@ -1612,7 +1600,7 @@ static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_a
if(!strcmp(msg_type, "load") && x->descriptor->configure){
filename = argv[1].a_w.w_symbol->s_name;
- post("dssi~: loading patch: %s for instance %d", filename, instance);
+ post("pluginhost~: loading patch: %s for instance %d", filename, instance);
if(!strcmp(x->descriptor->LADSPA_Plugin->Label, "hexter") ||
!strcmp(x->descriptor->LADSPA_Plugin->Label, "hexter6")) {
@@ -1632,41 +1620,41 @@ static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_a
fp = fopen(filepath, "rb");
}
else{
- post("dssi~: unable to get file descriptor");
+ post("pluginhost~: unable to get file descriptor");
}
/*From dx7_voice_data by Sean Bolton */
if(fp == NULL){
- post("dssi~: unable to open patch file: %s", filename);
+ post("pluginhost~: unable to open patch file: %s", filename);
return 0;
}
if (fseek(fp, 0, SEEK_END) ||
(filelength = ftell(fp)) == -1 ||
fseek(fp, 0, SEEK_SET)) {
- post("dssi~: couldn't get length of patch file: %s",
+ post("pluginhost~: couldn't get length of patch file: %s",
filename);
fclose(fp);
return 0;
}
if (filelength == 0) {
- post("dssi~: patch file has zero length");
+ post("pluginhost~: patch file has zero length");
fclose(fp);
return 0;
} else if (filelength > 16384) {
- post("dssi~: patch file is too large");
+ post("pluginhost~: patch file is too large");
fclose(fp);
return 0;
}
if (!(raw_patch_data = (unsigned char *)
malloc(filelength))) {
post(
- "dssi~: couldn't allocate memory for raw patch file");
+ "pluginhost~: couldn't allocate memory for raw patch file");
fclose(fp);
return 0;
}
if (fread(raw_patch_data, 1, filelength, fp)
!= (size_t)filelength) {
- post("dssi~: short read on patch file: %s", filename);
+ post("pluginhost~: short read on patch file: %s", filename);
free(raw_patch_data);
fclose(fp);
return 0;
@@ -1711,7 +1699,7 @@ static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_a
if (filelength != DX7_DUMP_SIZE_BULK ||
raw_patch_data[DX7_DUMP_SIZE_BULK - 1] != 0xf7) {
- post("dssi~: badly formatted DX7 32 voice dump!");
+ post("pluginhost~: badly formatted DX7 32 voice dump!");
count = 0;
#ifdef CHECKSUM_PATCH_FILES_ON_LOAD
@@ -1719,7 +1707,7 @@ static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_a
DX7_VOICE_SIZE_PACKED * 32) !=
raw_patch_data[DX7_DUMP_SIZE_BULK - 2]) {
- post("dssi~: DX7 32 voice dump with bad checksum!");
+ post("pluginhost~: DX7 32 voice dump with bad checksum!");
count = 0;
#endif
@@ -1734,7 +1722,7 @@ static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_a
} else {
/* unsuccessful load */
- post("dssi~: unknown patch bank file format!");
+ post("pluginhost~: unknown patch bank file format!");
count = 0;
}
@@ -1753,7 +1741,7 @@ static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_a
value = filename;
}
else{
- post("dssi~: %s patches are not supported",
+ post("pluginhost~: %s patches are not supported",
x->descriptor->LADSPA_Plugin->Label);
}
@@ -1763,13 +1751,13 @@ static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_a
pathlen = strlen(argv[1].a_w.w_symbol->s_name) + 2;
x->project_dir = malloc((pathlen) * sizeof(char));
atom_string(&argv[1], x->project_dir, pathlen);
- post("dssi~: project directory for instance %d has been set to: %s", instance, x->project_dir);
+ post("pluginhost~: project directory for instance %d has been set to: %s", instance, x->project_dir);
key = DSSI_PROJECT_DIRECTORY_KEY;
value = x->project_dir;
}
else if(!strcmp(msg_type, "dir"))
- post("dssi~: %s %s: operation not supported", msg_type,
+ post("pluginhost~: %s %s: operation not supported", msg_type,
argv[1].a_w.w_symbol->s_name);
if(!strcmp(msg_type, "show") || !strcmp(msg_type, "hide")){
@@ -1781,17 +1769,17 @@ static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_a
if(instance == -1){
while(n_instances--)
- dssi_show(x, n_instances, toggle);
+ ph_show(x, n_instances, toggle);
}
else
- dssi_show(x, instance, toggle);
+ ph_show(x, instance, toggle);
}
if(!strcmp(msg_type, "remap")) {
/* remap channel to instance */
for(i = 0; i < x->n_instances && i < 128; i++){
chan = (int)atom_getfloatarg(1 + i, argc, argv);
- post("dssi~: remapped MIDI channel %d to %d", 1+i, chan);
+ post("pluginhost~: remapped MIDI channel %d to %d", 1+i, chan);
x->channelMap[i+1] = chan;
}
}
@@ -1829,16 +1817,16 @@ static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_a
if(key != NULL && value != NULL){
if(instance == -1){
while(n_instances--){
- debug = dssi_tilde_send_configure(
+ debug = ph_tilde_send_configure(
x, key, value, n_instances);
- dssi_tilde_configure_buffer(x, key, value, n_instances);
+ ph_tilde_configure_buffer(x, key, value, n_instances);
}
}
/*FIX: Put some error checking in here to make sure instance is valid*/
else{
- debug = dssi_tilde_send_configure(x, key, value, instance);
- dssi_tilde_configure_buffer(x, key, value, instance);
+ debug = ph_tilde_send_configure(x, key, value, instance);
+ ph_tilde_configure_buffer(x, key, value, instance);
}
}
#if DEBUG
@@ -1850,7 +1838,7 @@ static t_int dssi_tilde_dssi_methods(t_dssi_tilde *x, t_symbol *s, int argc, t_a
return 0;
}
-static void dssi_tilde_bang(t_dssi_tilde *x)
+static void ph_tilde_bang(t_ph_tilde *x)
{
t_atom at[3];
@@ -1870,14 +1858,14 @@ static void dssi_tilde_bang(t_dssi_tilde *x)
outlet_anything (x->control_outlet, gensym ("running"), 3, at);
}
-static t_int *dssi_tilde_perform(t_int *w)
+static t_int *ph_tilde_perform(t_int *w)
{
int N = (t_int)(w[2]);
- t_dssi_tilde *x = (t_dssi_tilde *)(w[1]);
+ t_ph_tilde *x = (t_ph_tilde *)(w[1]);
t_float **inputs = (t_float **)(&w[3]);
t_float **outputs = (t_float **)(&w[3] + x->plugin_ins);
int i, n, timediff, framediff, instance = 0;
- /*See comment for dssi_tilde_plug_plugin */
+ /*See comment for ph_tilde_plug_plugin */
if(x->dsp){
x->dsp_loop = 1;
@@ -1896,7 +1884,7 @@ static t_int *dssi_tilde_perform(t_int *w)
/*This should never happen, but check anyway*/
if(instance > x->n_instances || instance < 0){
post(
- "dssi~: %s: discarding spurious MIDI data, for instance %d",
+ "pluginhost~: %s: discarding spurious MIDI data, for instance %d",
x->descriptor->LADSPA_Plugin->Label,
instance);
#if DEBUG
@@ -1906,7 +1894,7 @@ static t_int *dssi_tilde_perform(t_int *w)
}
if (x->instanceEventCounts[instance] == EVENT_BUFSIZE){
- post("dssi~: MIDI overflow on channel %d", instance);
+ post("pluginhost~: MIDI overflow on channel %d", instance);
continue;
}
@@ -1977,7 +1965,7 @@ static t_int *dssi_tilde_perform(t_int *w)
return w + (x->plugin_ins + x->plugin_outs + 3);
}
-static void dssi_tilde_dsp(t_dssi_tilde *x, t_signal **sp)
+static void ph_tilde_dsp(t_ph_tilde *x, t_signal **sp)
{
if(x->n_instances){
@@ -1994,7 +1982,7 @@ static void dssi_tilde_dsp(t_dssi_tilde *x, t_signal **sp)
for(i = 2; i < M; i++)
dsp_vector[i] = (t_int)sp[i - 1]->s_vec;
- dsp_addv(dssi_tilde_perform, M, dsp_vector);
+ dsp_addv(ph_tilde_perform, M, dsp_vector);
/* int n, m;
@@ -2019,11 +2007,11 @@ static void dssi_tilde_dsp(t_dssi_tilde *x, t_signal **sp)
for(n = 0; n < x->plugin_outs; n++)
*outlets++ = sp[m++]->s_vec;
*/ }
- /* dsp_add(dssi_tilde_perform, 2, sp[0]->s_n, x); */
+ /* dsp_add(ph_tilde_perform, 2, sp[0]->s_n, x); */
}
-static void dssi_tilde_quit_plugin(t_dssi_tilde *x){
+static void ph_tilde_quit_plugin(t_ph_tilde *x){
t_int i, instance;
for(instance = 0; instance < x->n_instances; instance++) {
@@ -2039,7 +2027,7 @@ static void dssi_tilde_quit_plugin(t_dssi_tilde *x){
x->descriptor->LADSPA_Plugin->deactivate
(x->instanceHandles[instance]);
}*/
- dssi_tilde_deactivate_plugin(x, (t_float)instance);
+ ph_tilde_deactivate_plugin(x, (t_float)instance);
/* } */
if (x->descriptor->LADSPA_Plugin &&
x->descriptor->LADSPA_Plugin->cleanup) {
@@ -2049,7 +2037,7 @@ static void dssi_tilde_quit_plugin(t_dssi_tilde *x){
}
}
-static void dssi_tilde_free_plugin(t_dssi_tilde *x){
+static void ph_tilde_free_plugin(t_ph_tilde *x){
t_int i, instance;
if(x->plugin_label != NULL)
@@ -2098,7 +2086,7 @@ static void dssi_tilde_free_plugin(t_dssi_tilde *x){
if(x->project_dir != NULL)
free(x->project_dir);
free(x->osc_url_base);
- dssi_tilde_configure_buffer_free(x);
+ ph_tilde_configure_buffer_free(x);
}
free((snd_seq_event_t *)x->instanceEventBuffers);
free(x->instances);
@@ -2125,7 +2113,7 @@ static void dssi_tilde_free_plugin(t_dssi_tilde *x){
}
}
-static void dssi_tilde_init_plugin(t_dssi_tilde *x){
+static void ph_tilde_init_plugin(t_ph_tilde *x){
x->project_dir = NULL;
x->configure_buffer_head = NULL;
@@ -2156,7 +2144,7 @@ static void dssi_tilde_init_plugin(t_dssi_tilde *x){
}
-static void *dssi_tilde_load_plugin(t_dssi_tilde *x, t_int argc, t_atom *argv){
+static void *ph_tilde_load_plugin(t_ph_tilde *x, t_int argc, t_atom *argv){
char *plugin_basename = NULL,
*plugin_full_path = NULL,
*tmpstr,
@@ -2227,7 +2215,7 @@ static void *dssi_tilde_load_plugin(t_dssi_tilde *x, t_int argc, t_atom *argv){
}
if (x->plugin_handle == NULL)
- error("dssi~: can't find plugin in Pd paths, "
+ error("pluginhost~: can't find plugin in Pd paths, "
"try using [declare] to specify the path.");
}
@@ -2247,12 +2235,12 @@ static void *dssi_tilde_load_plugin(t_dssi_tilde *x, t_int argc, t_atom *argv){
#endif
}
else{
- post("dssi~: invalid plugin path, must end in .so");
+ post("pluginhost~: invalid plugin path, must end in .so");
return (void *) x;
}
}
free(tmpstr);
- if(x->desc_func = (DSSI_Descriptor_Function)dlsym(x->plugin_handle, "dssi_descriptor")){
+ if(x->desc_func = (DSSI_Descriptor_Function)dlsym(x->plugin_handle, "ph_descriptor")){
x->is_DSSI = 1;
x->descriptor = (DSSI_Descriptor *)x->desc_func(0);
}
@@ -2274,7 +2262,7 @@ static void *dssi_tilde_load_plugin(t_dssi_tilde *x, t_int argc, t_atom *argv){
#if DEBUG
post("n_instances = %d", x->n_instances);
#endif
- x->instances = (t_dssi_instance *)malloc(sizeof(t_dssi_instance) *
+ x->instances = (t_ph_instance *)malloc(sizeof(t_ph_instance) *
x->n_instances);
if(x->descriptor){
@@ -2289,35 +2277,35 @@ static void *dssi_tilde_load_plugin(t_dssi_tilde *x, t_int argc, t_atom *argv){
(x->descriptor->LADSPA_Plugin->PortCount *
sizeof(t_port_info));
- dssi_tilde_port_info(x);
- dssi_tilde_assign_ports(x);
+ ph_tilde_port_info(x);
+ ph_tilde_assign_ports(x);
for(i = 0; i < x->n_instances; i++){
x->instanceHandles[i] =
x->descriptor->LADSPA_Plugin->
instantiate(x->descriptor->LADSPA_Plugin, x->sr);
if (!x->instanceHandles[i]){
- post("dssi~: instantiation of instance %d failed", i);
+ post("pluginhost~: instantiation of instance %d failed", i);
stop = 1;
break;
}
}
if(!stop){
for(i = 0;i < x->n_instances; i++)
- dssi_tilde_init_instance(x, i);
+ ph_tilde_init_instance(x, i);
for(i = 0;i < x->n_instances; i++)
- dssi_tilde_connect_ports(x, i);
+ ph_tilde_connect_ports(x, i);
for(i = 0;i < x->n_instances; i++)
- dssi_tilde_activate_plugin(x, i);
+ ph_tilde_activate_plugin(x, i);
if(x->is_DSSI){
for(i = 0;i < x->n_instances; i++)
- dssi_tilde_osc_setup(x, i);
+ ph_tilde_osc_setup(x, i);
#if LOADGUI
for(i = 0;i < x->n_instances; i++)
- dssi_tilde_load_gui(x, i);
+ ph_tilde_load_gui(x, i);
#endif
for(i = 0;i < x->n_instances; i++)
- dssi_tilde_init_programs(x, i);
+ ph_tilde_init_programs(x, i);
for(i = 0; i < x->n_instances && i < 128; i++){
x->channelMap[i] = i;
@@ -2327,10 +2315,10 @@ static void *dssi_tilde_load_plugin(t_dssi_tilde *x, t_int argc, t_atom *argv){
}
}
else
- post("dssi~: error: plugin not loaded");
+ post("pluginhost~: error: plugin not loaded");
}
else
- post("dssi~: no arguments given, please supply a path");
+ post("pluginhost~: no arguments given, please supply a path");
x->control_outlet =
outlet_new (&x->x_obj, gensym("control"));
@@ -2346,7 +2334,7 @@ static void *dssi_tilde_load_plugin(t_dssi_tilde *x, t_int argc, t_atom *argv){
*/
}
else
- post("dssi~: error: plugin has no outputs");
+ post("pluginhost~: error: plugin has no outputs");
if(x->plugin_ins){
x->inlets = (t_inlet **)getbytes(x->plugin_ins * sizeof(t_inlet *));
for(i = 0;i < x->plugin_ins; i++)
@@ -2357,40 +2345,40 @@ static void *dssi_tilde_load_plugin(t_dssi_tilde *x, t_int argc, t_atom *argv){
*/
}
else
- post("dssi~: error: plugin has no inputs");
+ post("pluginhost~: error: plugin has no inputs");
x->dsp = 1;
- post("dssi~: %d instances of %s, ready.", x->n_instances,
+ post("pluginhost~: %d instances of %s, ready.", x->n_instances,
x->plugin_label);
}
else
- post("dssi~: error: no plugin handle");
+ post("pluginhost~: error: no plugin handle");
return (void *)x;
}
/* This method is currently buggy. PD's inlet/outlet handling seems buggy if you try to create ins/outs on the fly. Needs further investigation ...*/
-static void dssi_tilde_plug_plugin(t_dssi_tilde *x, t_symbol *s, int argc, t_atom *argv){
+static void ph_tilde_plug_plugin(t_ph_tilde *x, t_symbol *s, int argc, t_atom *argv){
x->dsp = 0;
- dssi_tilde_quit_plugin(x);
+ ph_tilde_quit_plugin(x);
while(1){
if(!x->dsp_loop){
- dssi_tilde_free_plugin(x);
+ ph_tilde_free_plugin(x);
break;
}
}
- dssi_tilde_init_plugin(x);
- dssi_tilde_load_plugin(x, argc, argv);
+ ph_tilde_init_plugin(x);
+ ph_tilde_load_plugin(x, argc, argv);
}
-static void *dssi_tilde_new(t_symbol *s, t_int argc, t_atom *argv){
+static void *ph_tilde_new(t_symbol *s, t_int argc, t_atom *argv){
- t_dssi_tilde *x = (t_dssi_tilde *)pd_new(dssi_tilde_class);
- post("\n========================================\ndssi~: DSSI/LADSPA host - version %.2f\n========================================\n", VERSION);
+ t_ph_tilde *x = (t_ph_tilde *)pd_new(ph_tilde_class);
+ post("\n========================================\npluginhost~: DSSI/LADSPA host - version %.2f\n========================================\n", VERSION);
- dssi_tilde_init_plugin(x);
+ ph_tilde_init_plugin(x);
x->sr = (t_int)sys_getsr();
x->sr_inv = 1 / (t_float)x->sr;
@@ -2400,52 +2388,52 @@ static void *dssi_tilde_new(t_symbol *s, t_int argc, t_atom *argv){
x->x_canvas = canvas_getcurrent();
pthread_mutex_init(&x->midiEventBufferMutex, NULL);
- return dssi_tilde_load_plugin(x, argc, argv);
+ return ph_tilde_load_plugin(x, argc, argv);
}
-static void dssi_tilde_free(t_dssi_tilde *x){
+static void ph_tilde_free(t_ph_tilde *x){
#if DEBUG
- post("Calling dssi_tilde_free");
+ post("Calling ph_tilde_free");
#endif
- dssi_tilde_quit_plugin(x);
- dssi_tilde_free_plugin(x);
+ ph_tilde_quit_plugin(x);
+ ph_tilde_free_plugin(x);
}
-static void dssi_tilde_sigchld_handler(int sig) {
+static void ph_tilde_sigchld_handler(int sig) {
wait(NULL);
}
-void dssi_tilde_setup(void) {
+void pluginhost_tilde_setup(void) {
- dssi_tilde_class = class_new(gensym("dssi~"), (t_newmethod)dssi_tilde_new,
- (t_method)dssi_tilde_free, sizeof(t_dssi_tilde), 0, A_GIMME, 0);
- class_addlist(dssi_tilde_class, dssi_tilde_list);
- class_addbang(dssi_tilde_class, dssi_tilde_bang);
- class_addmethod(dssi_tilde_class,
- (t_method)dssi_tilde_dsp, gensym("dsp"), 0);
- class_addmethod(dssi_tilde_class, (t_method)dssi_tilde_dssi_methods,
+ ph_tilde_class = class_new(gensym("pluginhost~"), (t_newmethod)ph_tilde_new,
+ (t_method)ph_tilde_free, sizeof(t_ph_tilde), 0, A_GIMME, 0);
+ class_addlist(ph_tilde_class, ph_tilde_list);
+ class_addbang(ph_tilde_class, ph_tilde_bang);
+ class_addmethod(ph_tilde_class,
+ (t_method)ph_tilde_dsp, gensym("dsp"), 0);
+ class_addmethod(ph_tilde_class, (t_method)ph_tilde_ph_methods,
gensym("dssi"), A_GIMME, 0);
- class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_control,
+ class_addmethod (ph_tilde_class,(t_method)ph_tilde_control,
gensym ("control"),A_DEFSYM, A_DEFFLOAT, A_DEFFLOAT, 0);
- class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_info,
+ class_addmethod (ph_tilde_class,(t_method)ph_tilde_info,
gensym ("info"),0);
- class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_list_plugins,
+ class_addmethod (ph_tilde_class,(t_method)ph_tilde_list_plugins,
gensym ("listplugins"),0);
- class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_reset,
+ class_addmethod (ph_tilde_class,(t_method)ph_tilde_reset,
gensym ("reset"), A_DEFFLOAT, 0);
- class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_plug_plugin,
+ class_addmethod (ph_tilde_class,(t_method)ph_tilde_plug_plugin,
gensym ("plug"),A_GIMME,0);
- /* class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_activate_plugin,
+ /* class_addmethod (ph_tilde_class,(t_method)ph_tilde_activate_plugin,
gensym ("activate"),A_DEFFLOAT - 1,0);
- class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_deactivate_plugin,
+ class_addmethod (ph_tilde_class,(t_method)ph_tilde_deactivate_plugin,
gensym ("deactivate"),A_DEFFLOAT - 1,0);*/
- class_sethelpsymbol(dssi_tilde_class, gensym("dssi-help"));
- CLASS_MAINSIGNALIN(dssi_tilde_class, t_dssi_tilde, f);
- signal(SIGCHLD, dssi_tilde_sigchld_handler);
+ class_sethelpsymbol(ph_tilde_class, gensym("pluginhost~-help"));
+ CLASS_MAINSIGNALIN(ph_tilde_class, t_ph_tilde, f);
+ signal(SIGCHLD, ph_tilde_sigchld_handler);
}
static int osc_message_handler(const char *path, const char *types,
@@ -2457,7 +2445,7 @@ static int osc_message_handler(const char *path, const char *types,
int i, instance = 0;
const char *method;
char chantemp[2];
- t_dssi_tilde *x = (t_dssi_tilde *)(user_data);
+ t_ph_tilde *x = (t_ph_tilde *)(user_data);
if (strncmp(path, "/dssi/", 6)){
#if DEBUG
diff --git a/pluginhost~/src/dssi~.h b/pluginhost~/src/pluginhost~.h
index 6aadb85..e154e90 100644
--- a/pluginhost~/src/dssi~.h
+++ b/pluginhost~/src/pluginhost~.h
@@ -24,8 +24,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include "m_pd.h"
-#include "dssi.h"
#include <dlfcn.h>
#include <lo/lo.h>
#include <unistd.h>
@@ -37,6 +35,9 @@
#include <sys/wait.h> /* for wait() */
#include <dirent.h> /* for readdir() */
+#include "m_pd.h"
+#include "dssi.h"
+
#define DX7_VOICE_SIZE_PACKED 128 /*From hexter_types.h by Sean Bolton */
#define DX7_DUMP_SIZE_BULK 4096+8
@@ -69,7 +70,7 @@ typedef struct _dx7_patch_t {
uint8_t data[128];
} dx7_patch_t;
-typedef struct _dssi_instance {
+typedef struct _ph_instance {
long currentBank;
long currentProgram;
@@ -96,16 +97,16 @@ typedef struct _dssi_instance {
char *osc_url_path;
pid_t gui_pid;
-} t_dssi_instance;
+} t_ph_instance;
-struct dssi_configure_pair {
+struct ph_configure_pair {
t_int instance;
char *key,
*value;
- struct dssi_configure_pair *next;
+ struct ph_configure_pair *next;
};
-typedef struct dssi_configure_pair t_dssi_configure_pair;
+typedef struct ph_configure_pair t_ph_configure_pair;
typedef struct _port_info {
t_atom type,
@@ -116,7 +117,7 @@ typedef struct _port_info {
p_default;
} t_port_info;
-typedef struct _dssi_tilde {
+typedef struct _ph_tilde {
t_object x_obj;
t_int is_DSSI;
char *plugin_label;
@@ -125,7 +126,7 @@ typedef struct _dssi_tilde {
void *plugin_handle;
char *project_dir; /* project dircetory */
LADSPA_Handle *instanceHandles; /*was handle*/
- t_dssi_instance *instances;
+ t_ph_instance *instances;
int n_instances;
unsigned long *instanceEventCounts;
unsigned char channelMap[128];
@@ -166,18 +167,18 @@ typedef struct _dssi_tilde {
t_inlet **inlets;
t_outlet *control_outlet;
- t_dssi_configure_pair *configure_buffer_head;
+ t_ph_configure_pair *configure_buffer_head;
t_int dsp; /* boolean dsp setting */
t_int dsp_loop;
-} t_dssi_tilde;
+} t_ph_tilde;
-static char *dssi_tilde_send_configure(t_dssi_tilde *x, char *key,
+static char *ph_tilde_send_configure(t_ph_tilde *x, char *key,
char *value, t_int instance);
static int osc_message_handler(const char *path, const char *types,
lo_arg **argv, int argc, void *data, void *user_data);
-static LADSPA_Data get_port_default(t_dssi_tilde *x, int port);
-static void MIDIbuf(int type, int chan, int param, int val, t_dssi_tilde *x);
+static LADSPA_Data get_port_default(t_ph_tilde *x, int port);
+static void MIDIbuf(int type, int chan, int param, int val, t_ph_tilde *x);