Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27545
Modified Files: Tag: desiredata s_midi_alsa.c Log Message: extended midi max message size to 256 bytes
Index: s_midi_alsa.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_midi_alsa.c,v retrieving revision 1.1.2.2.2.6.2.3 retrieving revision 1.1.2.2.2.6.2.4 diff -C2 -d -r1.1.2.2.2.6.2.3 -r1.1.2.2.2.6.2.4 *** s_midi_alsa.c 24 Jul 2007 20:58:25 -0000 1.1.2.2.2.6.2.3 --- s_midi_alsa.c 24 Jul 2007 21:03:42 -0000 1.1.2.2.2.6.2.4 *************** *** 19,22 **** --- 19,24 ---- //#include "s_stuff.h"
+ #define MAX_EVENT_SIZE 256 + static int alsa_nmidiin; static int alsa_midiinfd[MAXMIDIINDEV]; *************** *** 73,77 **** post("Opened Alsa Client %d in:%d out:%d",client,nmidiin,nmidiout); sys_setalarm(0); ! snd_midi_event_new(20,&midiev); alsa_nmidiout = nmidiout; alsa_nmidiin = nmidiin; --- 75,79 ---- post("Opened Alsa Client %d in:%d out:%d",client,nmidiin,nmidiout); sys_setalarm(0); ! snd_midi_event_new(MAX_EVENT_SIZE,&midiev); alsa_nmidiout = nmidiout; alsa_nmidiin = nmidiin; *************** *** 165,172 **** }
- /* this version uses the asynchronous "read()" ... */ ! void sys_alsa_poll_midi(void) { ! unsigned char buf[20]; int count, alsa_source; snd_seq_event_t *midievent = NULL; --- 167,173 ---- }
/* this version uses the asynchronous "read()" ... */ ! void sys_alsa_poll_midi() { ! unsigned char buf[MAX_EVENT_SIZE]; int count, alsa_source; snd_seq_event_t *midievent = NULL; *************** *** 177,181 **** if (count != 0) count = snd_seq_event_input(midi_handle,&midievent); if (midievent != NULL) { ! count = snd_midi_event_decode(midiev,buf,20,midievent); alsa_source = midievent->dest.port; for(int i=0; i<count; i++) sys_midibytein(alsa_source, (buf[i] & 0xff)); --- 178,182 ---- if (count != 0) count = snd_seq_event_input(midi_handle,&midievent); if (midievent != NULL) { ! count = snd_midi_event_decode(midiev,buf,sizeof(buf),midievent); alsa_source = midievent->dest.port; for(int i=0; i<count; i++) sys_midibytein(alsa_source, (buf[i] & 0xff)); *************** *** 195,199 **** static int alsa_nmidiindevs, alsa_nmidioutdevs, alsa_initted;
! void midi_alsa_init(void) { if (alsa_initted) return; alsa_initted = 1; --- 196,200 ---- static int alsa_nmidiindevs, alsa_nmidioutdevs, alsa_initted;
! void midi_alsa_init() { if (alsa_initted) return; alsa_initted = 1;