Update of /cvsroot/pure-data/externals/postlude/dssi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3442
Modified Files: dssi~.c Log Message: fixed typo in osc_update_handler
Index: dssi~.c =================================================================== RCS file: /cvsroot/pure-data/externals/postlude/dssi/src/dssi~.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dssi~.c 16 Feb 2006 10:21:39 -0000 1.3 --- dssi~.c 16 Feb 2006 11:10:05 -0000 1.4 *************** *** 766,770 **** free(x->instances[instance].ui_osc_quit_path); x->instances[instance].ui_osc_quit_path = (char *)malloc(strlen(path) + 10); ! sprintf(x->instances[instance].ui_osc_hide_path, "%s/quit", path);
if (x->instances[instance].ui_osc_show_path) --- 766,770 ---- free(x->instances[instance].ui_osc_quit_path); x->instances[instance].ui_osc_quit_path = (char *)malloc(strlen(path) + 10); ! sprintf(x->instances[instance].ui_osc_quit_path, "%s/quit", path);
if (x->instances[instance].ui_osc_show_path) *************** *** 1507,1513 **** t_dssi_tilde *x = (t_dssi_tilde *)(w[2]); int i, n, timediff, framediff, instance = 0; ! ! /*FIX -hmmm do we need this */ ! if(x->n_instances){ for (i = 0; i < x->n_instances; i++) x->instanceEventCounts[i] = 0; --- 1507,1514 ---- t_dssi_tilde *x = (t_dssi_tilde *)(w[2]); int i, n, timediff, framediff, instance = 0; ! ! ! /* FIX: probably don't need this check, but leave it in now for 'safety' */ ! if(x->n_instances){ for (i = 0; i < x->n_instances; i++) x->instanceEventCounts[i] = 0; *************** *** 1518,1585 **** (x->bufReadIndex + 1) % EVENT_BUFSIZE) { ! instance = x->midiEventBuf[x->bufReadIndex].data.note.channel; ! /*This should never happen, but check anyway*/ ! if(instance > x->n_instances || instance < 0){ ! post("%s: discarding spurious MIDI data, for instance %d", x->descriptor->LADSPA_Plugin->Label, instance); #if DEBUG ! post("n_instances = %d", x->n_instances); #endif ! continue; ! } ! ! if (x->instanceEventCounts[instance] == EVENT_BUFSIZE){ ! post("MIDI overflow on channel %d", instance); ! continue; ! } ! timediff = (t_int)(clock_gettimesince(x->time_ref) * 1000) - ! x->midiEventBuf[x->bufReadIndex].time.time.tv_nsec; ! framediff = (t_int)((t_float)timediff * .000001 / x->sr_inv); ! if (framediff >= N || framediff < 0) ! x->midiEventBuf[x->bufReadIndex].time.tick = 0; ! else ! x->midiEventBuf[x->bufReadIndex].time.tick = N - framediff - 1; ! x->instanceEventBuffers[instance][x->instanceEventCounts[instance]] ! = x->midiEventBuf[x->bufReadIndex]; #if DEBUG ! post("%s, note received on channel %d", x->descriptor->LADSPA_Plugin->Label, x->instanceEventBuffers[instance][x->instanceEventCounts[instance]].data.note.channel); #endif ! x->instanceEventCounts[instance]++; #if DEBUG ! post("Instance event count for instance %d of %d: %d\n", ! instance + 1, x->n_instances, x->instanceEventCounts[instance]); #endif
}
! i = 0; ! while(i < x->n_instances){ ! if(x->instanceHandles[i] && ! x->descriptor->run_multiple_synths){ ! x->descriptor->run_multiple_synths ! (x->n_instances, x->instanceHandles, ! (unsigned long)N, x->instanceEventBuffers, ! &x->instanceEventCounts[0]); ! break; ! } ! else if (x->instanceHandles[i]){ ! x->descriptor->run_synth(x->instanceHandles[i], ! (unsigned long)N, x->instanceEventBuffers[i], ! x->instanceEventCounts[i]); ! i++; ! } } ! ! for(i = 0; i < x->n_instances; i++){ /* t_float *out = x->outlets[i];*/ ! for(n = 0; n < N; n++) ! x->outlets[i][n] = x->plugin_OutputBuffers[i][n]; /* x->outlets[i][n] = 1;*/ ! } ! } ! return (w+3); }
--- 1519,1594 ---- (x->bufReadIndex + 1) % EVENT_BUFSIZE) { ! instance = x->midiEventBuf[x->bufReadIndex].data.note.channel; ! /*This should never happen, but check anyway*/ ! if(instance > x->n_instances || instance < 0){ ! post( ! "%s: discarding spurious MIDI data, for instance %d", ! x->descriptor->LADSPA_Plugin->Label, ! instance); #if DEBUG ! post("n_instances = %d", x->n_instances); #endif ! continue; ! } ! ! if (x->instanceEventCounts[instance] == EVENT_BUFSIZE){ ! post("MIDI overflow on channel %d", instance); ! continue; ! } ! timediff = (t_int)(clock_gettimesince(x->time_ref) * 1000) - ! x->midiEventBuf[x->bufReadIndex].time.time.tv_nsec; ! framediff = (t_int)((t_float)timediff * .000001 / x->sr_inv); ! if (framediff >= N || framediff < 0) ! x->midiEventBuf[x->bufReadIndex].time.tick = 0; ! else ! x->midiEventBuf[x->bufReadIndex].time.tick = ! N - framediff - 1; ! x->instanceEventBuffers[instance] ! [x->instanceEventCounts[instance]] = ! x->midiEventBuf[x->bufReadIndex]; #if DEBUG ! post("%s, note received on channel %d", ! x->descriptor->LADSPA_Plugin->Label, ! x->instanceEventBuffers[instance] ! [x->instanceEventCounts[instance]].data.note.channel); #endif ! x->instanceEventCounts[instance]++; #if DEBUG ! post("Instance event count for instance %d of %d: %d\n", ! instance + 1, x->n_instances, x->instanceEventCounts[instance]); #endif
}
! i = 0; ! while(i < x->n_instances){ ! if(x->instanceHandles[i] && ! x->descriptor->run_multiple_synths){ ! x->descriptor->run_multiple_synths ! (x->n_instances, x->instanceHandles, ! (unsigned long)N, x->instanceEventBuffers, ! &x->instanceEventCounts[0]); ! break; } ! else if (x->instanceHandles[i]){ ! x->descriptor->run_synth(x->instanceHandles[i], ! (unsigned long)N, x->instanceEventBuffers[i], ! x->instanceEventCounts[i]); ! i++; ! } ! } ! ! for(i = 0; i < x->n_instances; i++){ /* t_float *out = x->outlets[i];*/ ! for(n = 0; n < N; n++) ! x->outlets[i][n] = x->plugin_OutputBuffers[i][n]; /* x->outlets[i][n] = 1;*/ ! } ! } ! return (w+3); }