Update of /cvsroot/pure-data/externals/postlude/dssi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7336/src
Modified Files: dssi~.c dssi~.h Log Message: Modified helpfile. Fixed LADSPA control in bug
Index: dssi~.c =================================================================== RCS file: /cvsroot/pure-data/externals/postlude/dssi/src/dssi~.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dssi~.c 23 Mar 2006 08:48:06 -0000 1.11 --- dssi~.c 27 Mar 2006 21:53:43 -0000 1.12 *************** *** 342,347 **** }
! static void dssi_tilde_activate(t_dssi_tilde *x, t_int instance){
if(x->descriptor->LADSPA_Plugin->activate) x->descriptor->LADSPA_Plugin->activate(x->instanceHandles[instance]); --- 342,348 ---- }
! static void dssi_tilde_activate_plugin(t_dssi_tilde *x, t_float instance_f){
+ t_int instance = (t_int)instance_f; if(x->descriptor->LADSPA_Plugin->activate) x->descriptor->LADSPA_Plugin->activate(x->instanceHandles[instance]); *************** *** 351,354 **** --- 352,365 ---- }
+ static void dssi_tilde_deactivate_plugin(t_dssi_tilde *x, t_float instance_f){ + + t_int instance = (t_int)instance_f; + if(x->descriptor->LADSPA_Plugin->deactivate) + x->descriptor->LADSPA_Plugin->deactivate(x->instanceHandles[instance]); + #if DEBUG + post("plugin deactivated!"); + #endif + } + static void osc_error(int num, const char *msg, const char *where) { *************** *** 603,616 **** { unsigned parm_num = 0; ! t_int instance = (t_int)instance_f; int n_instances = x->n_instances;
if (instance > x->n_instances || instance < 0){ ! post("dssi~: control: invalid instance number"); return; }
- instance -= 1; - #if DEBUG post("Received LADSPA control data for instance %d", instance); --- 614,625 ---- { unsigned parm_num = 0; ! t_int instance = (t_int)instance_f - 1; int n_instances = x->n_instances;
if (instance > x->n_instances || instance < 0){ ! post("dssi~: control: invalid instance number %d", instance); return; }
#if DEBUG post("Received LADSPA control data for instance %d", instance); *************** *** 646,650 **** static void dssi_tilde_info (t_dssi_tilde *x){ unsigned int i; ! t_atom argv[6];
for(i = 0; i < x->descriptor->LADSPA_Plugin->PortCount; i++){ --- 655,659 ---- static void dssi_tilde_info (t_dssi_tilde *x){ unsigned int i; ! t_atom argv[7];
for(i = 0; i < x->descriptor->LADSPA_Plugin->PortCount; i++){ *************** *** 653,665 **** memcpy(&argv[1], &x->port_info[i].data_type, sizeof(t_atom)); ! memcpy(&argv[2], &x->port_info[i].name, sizeof(t_atom)); ! memcpy(&argv[3], &x->port_info[i].lower_bound, sizeof(t_atom)); ! memcpy(&argv[4], &x->port_info[i].upper_bound, sizeof(t_atom)); ! memcpy(&argv[5], &x->port_info[i].p_default, sizeof(t_atom)); ! outlet_anything (x->control_outlet, gensym ("port"), 6, argv); } } --- 662,676 ---- memcpy(&argv[1], &x->port_info[i].data_type, sizeof(t_atom)); ! memcpy(&argv[3], &x->port_info[i].name, sizeof(t_atom)); ! memcpy(&argv[4], &x->port_info[i].lower_bound, sizeof(t_atom)); ! memcpy(&argv[5], &x->port_info[i].upper_bound, sizeof(t_atom)); ! memcpy(&argv[6], &x->port_info[i].p_default, sizeof(t_atom)); ! argv[2].a_type = A_FLOAT; ! argv[2].a_w.w_float = (t_float)i - 1; ! outlet_anything (x->control_outlet, gensym ("port"), 7, argv); } } *************** *** 751,764 **** static void dssi_tilde_get_current_program(t_dssi_tilde *x, int instance){ int i; ! t_atom argv[2];
argv[0].a_type = A_FLOAT; ! argv[1].a_type = A_SYMBOL; i = x->instances[instance].currentProgram;
! argv[0].a_w.w_float = x->instances[instance].pluginPrograms[i].Program; ! argv[1].a_w.w_symbol = gensym ((char*)x->instances[instance].pluginPrograms[i].Name); ! outlet_anything (x->control_outlet, gensym ("program"), 2, argv);
} --- 762,777 ---- static void dssi_tilde_get_current_program(t_dssi_tilde *x, int instance){ int i; ! t_atom argv[3];
argv[0].a_type = A_FLOAT; ! argv[1].a_type = A_FLOAT; ! argv[2].a_type = A_SYMBOL; i = x->instances[instance].currentProgram;
! argv[0].a_w.w_float = (t_float)instance; ! argv[1].a_w.w_float = x->instances[instance].pluginPrograms[i].Program; ! argv[2].a_w.w_symbol = gensym ((char*)x->instances[instance].pluginPrograms[i].Name); ! outlet_anything (x->control_outlet, gensym ("program"), 3, argv);
} *************** *** 1406,1410 **** static t_int dssi_tilde_reset(t_dssi_tilde *x, t_float instance_f){
! t_int instance = (t_int)instance_f; if (instance == -1){ for(instance = 0; instance < x->n_instances; instance++) { --- 1419,1423 ---- static t_int dssi_tilde_reset(t_dssi_tilde *x, t_float instance_f){
! t_int instance = (t_int)instance_f - 1; if (instance == -1){ for(instance = 0; instance < x->n_instances; instance++) { *************** *** 1928,1935 **** /* no -- see comment in osc_exiting_handler */ /* if (!instances[i].inactive) { */ ! if (x->descriptor->LADSPA_Plugin->deactivate) { x->descriptor->LADSPA_Plugin->deactivate (x->instanceHandles[instance]); ! } /* } */ if (x->descriptor->LADSPA_Plugin && --- 1941,1949 ---- /* no -- see comment in osc_exiting_handler */ /* if (!instances[i].inactive) { */ ! /* if (x->descriptor->LADSPA_Plugin->deactivate) { x->descriptor->LADSPA_Plugin->deactivate (x->instanceHandles[instance]); ! }*/ ! dssi_tilde_deactivate_plugin(x, (t_float)instance); /* } */ if (x->descriptor->LADSPA_Plugin && *************** *** 2171,2175 **** dssi_tilde_connect_ports(x, i); for(i = 0;i < x->n_instances; i++) ! dssi_tilde_activate(x, i); if(x->is_DSSI){ for(i = 0;i < x->n_instances; i++) --- 2185,2189 ---- dssi_tilde_connect_ports(x, i); for(i = 0;i < x->n_instances; i++) ! dssi_tilde_activate_plugin(x, (t_float)i); if(x->is_DSSI){ for(i = 0;i < x->n_instances; i++) *************** *** 2234,2243 **** }
- static void dssi_tilde_activate_plugin(t_dssi_tilde *x){ - - x->dsp = 1; - - } - static void *dssi_tilde_new(t_symbol *s, t_int argc, t_atom *argv){
--- 2248,2251 ---- *************** *** 2289,2294 **** class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_plug_plugin, gensym ("plug"),A_GIMME,0); ! class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_activate_plugin, ! gensym ("active"),A_DEFFLOAT,0); class_sethelpsymbol(dssi_tilde_class, gensym("help-dssi")); CLASS_MAINSIGNALIN(dssi_tilde_class, t_dssi_tilde, f); --- 2297,2304 ---- class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_plug_plugin, gensym ("plug"),A_GIMME,0); ! /* class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_activate_plugin, ! gensym ("activate"),A_DEFFLOAT - 1,0); ! class_addmethod (dssi_tilde_class,(t_method)dssi_tilde_deactivate_plugin, ! gensym ("deactivate"),A_DEFFLOAT - 1,0);*/ class_sethelpsymbol(dssi_tilde_class, gensym("help-dssi")); CLASS_MAINSIGNALIN(dssi_tilde_class, t_dssi_tilde, f);
Index: dssi~.h =================================================================== RCS file: /cvsroot/pure-data/externals/postlude/dssi/src/dssi~.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dssi~.h 24 Mar 2006 21:11:55 -0000 1.8 --- dssi~.h 27 Mar 2006 21:53:43 -0000 1.9 *************** *** 42,46 ****
! #define VERSION 0.92 #define EVENT_BUFSIZE 1024 #define OSC_BASE_MAX 1024 --- 42,46 ----
! #define VERSION 0.93 #define EVENT_BUFSIZE 1024 #define OSC_BASE_MAX 1024