Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14427/src
Modified Files:
Tag: devel_0_39
s_midi.c s_midi_pm.c u_main.tk
Log Message:
corrected some typos and logic errors
device indices in MIDI dialog are now 0-based
Index: s_midi.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_midi.c,v
retrieving revision 1.4.4.1.2.9
retrieving revision 1.4.4.1.2.10
diff -C2 -d -r1.4.4.1.2.9 -r1.4.4.1.2.10
*** s_midi.c 5 Aug 2006 19:03:59 -0000 1.4.4.1.2.9
--- s_midi.c 7 Aug 2006 11:31:31 -0000 1.4.4.1.2.10
***************
*** 643,654 ****
int nindev, midiindev[MAXMIDIINDEV];
int noutdev, midioutdev[MAXMIDIOUTDEV];
! int midiindev1, midiindev2, midiindev3, midiindev4,
! midiindev5, midiindev6, midiindev7, midiindev8,
! midiindev9, midiindev10, midiindev11, midiindev12,
! midiindev13, midiindev14, midiindev15, midiindev16,
! midioutdev1, midioutdev2, midioutdev3, midioutdev4,
! midioutdev5, midioutdev6, midioutdev7, midioutdev8,
! midioutdev9, midioutdev10, midioutdev11, midioutdev12,
! midioutdev13, midioutdev14, midioutdev15, midioutdev16;
/* these are all the devices on your system: */
--- 643,647 ----
int nindev, midiindev[MAXMIDIINDEV];
int noutdev, midioutdev[MAXMIDIOUTDEV];
! char midiinstr[16*4+1],midioutstr[16*4+1],*strptr;
/* these are all the devices on your system: */
***************
*** 662,666 ****
MAXNDEV, DEVDESCSIZE);
! strcpy(indevliststring, "{ {none} ");
for (i = 0; i < nindevs; i++)
{
--- 655,659 ----
MAXNDEV, DEVDESCSIZE);
! strcpy(indevliststring, "{");
for (i = 0; i < nindevs; i++)
{
***************
*** 671,675 ****
strcat(indevliststring, "}");
! strcpy(outdevliststring, "{ {none} ");
for (i = 0; i < noutdevs; i++)
{
--- 664,668 ----
strcat(indevliststring, "}");
! strcpy(outdevliststring, "{");
for (i = 0; i < noutdevs; i++)
{
***************
*** 685,758 ****
flongform = 1;
! midiindev1 = (nindev > 0 && midiindev[0]>= 0 ? midiindev[0]+1 : 0);
! midiindev2 = (nindev > 1 && midiindev[1]>= 0 ? midiindev[1]+1 : 0);
! midiindev3 = (nindev > 2 && midiindev[2]>= 0 ? midiindev[2]+1 : 0);
! midiindev4 = (nindev > 3 && midiindev[3]>= 0 ? midiindev[3]+1 : 0);
! midiindev5 = (nindev > 4 && midiindev[4]>= 0 ? midiindev[4]+1 : 0);
! midiindev6 = (nindev > 5 && midiindev[5]>= 0 ? midiindev[5]+1 : 0);
! midiindev7 = (nindev > 6 && midiindev[6]>= 0 ? midiindev[6]+1 : 0);
! midiindev8 = (nindev > 7 && midiindev[7]>= 0 ? midiindev[7]+1 : 0);
! midiindev9 = (nindev > 8 && midiindev[8]>= 0 ? midiindev[8]+1 : 0);
! midiindev10 = (nindev > 9 && midiindev[9]>= 0 ? midiindev[9]+1 : 0);
! midiindev11 = (nindev > 10 && midiindev[10]>= 0 ? midiindev[10]+1 : 0);
! midiindev12 = (nindev > 11 && midiindev[11]>= 0 ? midiindev[11]+1 : 0);
! midiindev13 = (nindev > 12 && midiindev[12]>= 0 ? midiindev[12]+1 : 0);
! midiindev14 = (nindev > 13 && midiindev[13]>= 0 ? midiindev[13]+1 : 0);
! midiindev15 = (nindev > 14 && midiindev[14]>= 0 ? midiindev[14]+1 : 0);
! midiindev16 = (nindev > 15 && midiindev[15]>= 0 ? midiindev[15]+1 : 0);
!
! midioutdev1 = (noutdev > 0 && midioutdev[0]>= 0 ? midioutdev[0]+1 : 0);
! midioutdev2 = (noutdev > 1 && midioutdev[1]>= 0 ? midioutdev[1]+1 : 0);
! midioutdev3 = (noutdev > 2 && midioutdev[2]>= 0 ? midioutdev[2]+1 : 0);
! midioutdev4 = (noutdev > 3 && midioutdev[3]>= 0 ? midioutdev[3]+1 : 0);
! midioutdev5 = (noutdev > 4 && midioutdev[4]>= 0 ? midioutdev[4]+1 : 0);
! midioutdev6 = (noutdev > 5 && midioutdev[5]>= 0 ? midioutdev[5]+1 : 0);
! midioutdev7 = (noutdev > 6 && midioutdev[6]>= 0 ? midioutdev[6]+1 : 0);
! midioutdev8 = (noutdev > 7 && midioutdev[7]>= 0 ? midioutdev[7]+1 : 0);
! midioutdev9 = (noutdev > 8 && midioutdev[8]>= 0 ? midioutdev[8]+1 : 0);
! midioutdev10 = (noutdev > 9 && midioutdev[9]>= 0 ? midioutdev[9]+1 : 0);
! midioutdev11 = (noutdev > 10 && midioutdev[10]>= 0 ? midioutdev[10]+1 : 0);
! midioutdev12 = (noutdev > 11 && midioutdev[11]>= 0 ? midioutdev[11]+1 : 0);
! midioutdev13 = (noutdev > 12 && midioutdev[12]>= 0 ? midioutdev[12]+1 : 0);
! midioutdev14 = (noutdev > 13 && midioutdev[13]>= 0 ? midioutdev[13]+1 : 0);
! midioutdev15 = (noutdev > 14 && midioutdev[14]>= 0 ? midioutdev[14]+1 : 0);
! midioutdev16 = (noutdev > 15 && midioutdev[15]>= 0 ? midioutdev[15]+1 : 0);
!
!
#ifdef USEAPI_ALSA
if (sys_midiapi == API_ALSA)
sprintf(buf,
! "pdtk_alsa_midi_dialog %%s \
! %s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \
! %d 1\n",
! indevliststring,
! midiindev1, midiindev2, midiindev3, midiindev4,
! midiindev5, midiindev6, midiindev7, midiindev8,
! midiindev9, midiindev10, midiindev11, midiindev12,
! midiindev13, midiindev14, midiindev15, midiindev16,
! outdevliststring,
! midioutdev1, midioutdev2, midioutdev3, midioutdev4,
! midioutdev5, midioutdev6, midioutdev7, midioutdev8,
! midioutdev9, midioutdev10, midioutdev11, midioutdev12,
! midioutdev13, midioutdev14, midioutdev15, midioutdev16,
(flongform != 0));
else
#endif
sprintf(buf,
! "pdtk_midi_dialog %%s \
! %s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \
! %d\n",
! indevliststring,
! midiindev1, midiindev2, midiindev3, midiindev4,
! midiindev5, midiindev6, midiindev7, midiindev8,
! midiindev9, midiindev10, midiindev11, midiindev12,
! midiindev13, midiindev14, midiindev15, midiindev16,
! outdevliststring,
! midioutdev1, midioutdev2, midioutdev3, midioutdev4,
! midioutdev5, midioutdev6, midioutdev7, midioutdev8,
! midioutdev9, midioutdev10, midioutdev11, midioutdev12,
! midioutdev13, midioutdev14, midioutdev15, midioutdev16,
(flongform != 0));
gfxstub_deleteforkey(0);
--- 678,708 ----
flongform = 1;
! *(strptr = midiinstr) = 0;
! for(i = 0; i < 16; ++i)
! {
! sprintf(strptr,"%3d ",nindev > i && midiindev[i]>= 0 ? midiindev[i] : -1);
! strptr += strlen(strptr);
! }
+ *(strptr = midioutstr) = 0;
+ for(i = 0; i < 16; ++i)
+ {
+ sprintf(strptr,"%3d ",noutdev > i && midioutdev[i]>= 0 ? midioutdev[i] : -1);
+ strptr += strlen(strptr);
+ }
#ifdef USEAPI_ALSA
if (sys_midiapi == API_ALSA)
sprintf(buf,
! "pdtk_alsa_midi_dialog %%s %s %s %s %s %d\n",
! indevliststring,midiinstr,
! outdevliststring,midioutstr,
(flongform != 0));
else
#endif
sprintf(buf,
! "pdtk_midi_dialog %%s %s %s %s %s %d\n",
! indevliststring,midiinstr,
! outdevliststring,midioutstr,
(flongform != 0));
gfxstub_deleteforkey(0);
***************
*** 777,783 ****
for (i = 0, nindev = 0; i < 16; i++)
{
! if (newmidiindev[i] > 0)
{
! newmidiindev[nindev] = newmidiindev[i]-1;
nindev++;
}
--- 727,733 ----
for (i = 0, nindev = 0; i < 16; i++)
{
! if (newmidiindev[i] >= 0)
{
! newmidiindev[nindev] = newmidiindev[i];
nindev++;
}
***************
*** 785,796 ****
for (i = 0, noutdev = 0; i < 16; i++)
{
! if (newmidioutdev[i] > 0)
{
! newmidioutdev[noutdev] = newmidioutdev[i]-1;
noutdev++;
}
}
! alsadevin = atom_getintarg(16, argc, argv);
! alsadevout = atom_getintarg(17, argc, argv);
#ifdef USEAPI_ALSA
--- 735,746 ----
for (i = 0, noutdev = 0; i < 16; i++)
{
! if (newmidioutdev[i] >= 0)
{
! newmidioutdev[noutdev] = newmidioutdev[i];
noutdev++;
}
}
! alsadevin = atom_getintarg(32, argc, argv);
! alsadevout = atom_getintarg(33, argc, argv);
#ifdef USEAPI_ALSA
***************
*** 933,939 ****
sys_get_midi_params(&nindev, midiindev, &noutdev, midioutdev);
! for (i = 0; i < noutdev; i++)
{
! SETFLOAT(argv+i, midiindev[i]+1);
}
typedmess(pd->s_thing, selector, nindev, argv);
--- 883,889 ----
sys_get_midi_params(&nindev, midiindev, &noutdev, midioutdev);
! for (i = 0; i < nindev; i++)
{
! SETFLOAT(argv+i, midiindev[i]);
}
typedmess(pd->s_thing, selector, nindev, argv);
***************
*** 962,968 ****
for (i = 0; i < noutdev; i++)
{
! SETFLOAT(argv+i, midioutdev[i]+1);
}
! typedmess(pd->s_thing, selector, nindev, argv);
}
--- 912,918 ----
for (i = 0; i < noutdev; i++)
{
! SETFLOAT(argv+i, midioutdev[i]);
}
! typedmess(pd->s_thing, selector, noutdev, argv);
}
Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.4.4.10.2.14
retrieving revision 1.4.4.10.2.15
diff -C2 -d -r1.4.4.10.2.14 -r1.4.4.10.2.15
*** u_main.tk 5 Aug 2006 20:00:44 -0000 1.4.4.10.2.14
--- u_main.tk 7 Aug 2006 11:31:31 -0000 1.4.4.10.2.15
***************
*** 3763,3798 ****
pd [concat pd midi-dialog \
! $midi_indev1 \
! $midi_indev2 \
! $midi_indev3 \
! $midi_indev4 \
! $midi_indev5 \
! $midi_indev6 \
! $midi_indev7 \
! $midi_indev8 \
! $midi_indev9 \
! $midi_indev10 \
! $midi_indev11 \
! $midi_indev12 \
! $midi_indev13 \
! $midi_indev14 \
! $midi_indev15 \
! $midi_indev16 \
! $midi_outdev1 \
! $midi_outdev2 \
! $midi_outdev3 \
! $midi_outdev4 \
! $midi_outdev5 \
! $midi_outdev6 \
! $midi_outdev7 \
! $midi_outdev8 \
! $midi_outdev9 \
! $midi_outdev10 \
! $midi_outdev11 \
! $midi_outdev12 \
! $midi_outdev13 \
! $midi_outdev14 \
! $midi_outdev15 \
! $midi_outdev16 \
$midi_alsain \
$midi_alsaout \
--- 3763,3798 ----
pd [concat pd midi-dialog \
! [expr $midi_indev1 - 1] \
! [expr $midi_indev2 - 1] \
! [expr $midi_indev3 - 1] \
! [expr $midi_indev4 - 1] \
! [expr $midi_indev5 - 1] \
! [expr $midi_indev6 - 1] \
! [expr $midi_indev7 - 1] \
! [expr $midi_indev8 - 1] \
! [expr $midi_indev9 - 1] \
! [expr $midi_indev10 - 1] \
! [expr $midi_indev11 - 1] \
! [expr $midi_indev12 - 1] \
! [expr $midi_indev13 - 1] \
! [expr $midi_indev14 - 1] \
! [expr $midi_indev15 - 1] \
! [expr $midi_indev16 - 1] \
! [expr $midi_outdev1 - 1] \
! [expr $midi_outdev2 - 1] \
! [expr $midi_outdev3 - 1] \
! [expr $midi_outdev4 - 1] \
! [expr $midi_outdev5 - 1] \
! [expr $midi_outdev6 - 1] \
! [expr $midi_outdev7 - 1] \
! [expr $midi_outdev8 - 1] \
! [expr $midi_outdev9 - 1] \
! [expr $midi_outdev10 - 1] \
! [expr $midi_outdev11 - 1] \
! [expr $midi_outdev12 - 1] \
! [expr $midi_outdev13 - 1] \
! [expr $midi_outdev14 - 1] \
! [expr $midi_outdev15 - 1] \
! [expr $midi_outdev16 - 1] \
$midi_alsain \
$midi_alsaout \
***************
*** 3852,3889 ****
global midi_alsain midi_alsaout
! set midi_indev1 $indev1
! set midi_indev2 $indev2
! set midi_indev3 $indev3
! set midi_indev4 $indev4
! set midi_indev5 $indev5
! set midi_indev6 $indev6
! set midi_indev7 $indev7
! set midi_indev8 $indev8
! set midi_indev9 $indev9
! set midi_indev10 $indev10
! set midi_indev11 $indev11
! set midi_indev12 $indev12
! set midi_indev13 $indev13
! set midi_indev14 $indev14
! set midi_indev15 $indev15
! set midi_indev16 $indev16
! set midi_outdev1 $outdev1
! set midi_outdev2 $outdev2
! set midi_outdev3 $outdev3
! set midi_outdev4 $outdev4
! set midi_outdev5 $outdev5
! set midi_outdev6 $outdev6
! set midi_outdev7 $outdev7
! set midi_outdev8 $outdev8
! set midi_outdev9 $outdev9
! set midi_outdev10 $outdev10
! set midi_outdev11 $outdev11
! set midi_outdev12 $outdev12
! set midi_outdev13 $outdev13
! set midi_outdev14 $outdev14
! set midi_outdev15 $outdev15
! set midi_outdev16 $outdev16
set midi_indevlist $indevlist
--- 3852,3892 ----
global midi_alsain midi_alsaout
! set midi_indev1 [expr $indev1 + 1]
! set midi_indev2 [expr $indev2 + 1]
! set midi_indev3 [expr $indev3 + 1]
! set midi_indev4 [expr $indev4 + 1]
! set midi_indev5 [expr $indev5 + 1]
! set midi_indev6 [expr $indev6 + 1]
! set midi_indev7 [expr $indev7 + 1]
! set midi_indev8 [expr $indev8 + 1]
! set midi_indev9 [expr $indev9 + 1]
! set midi_indev10 [expr $indev10 + 1]
! set midi_indev11 [expr $indev11 + 1]
! set midi_indev12 [expr $indev12 + 1]
! set midi_indev13 [expr $indev13 + 1]
! set midi_indev14 [expr $indev14 + 1]
! set midi_indev15 [expr $indev15 + 1]
! set midi_indev16 [expr $indev16 + 1]
! set midi_outdev1 [expr $outdev1 + 1]
! set midi_outdev2 [expr $outdev2 + 1]
! set midi_outdev3 [expr $outdev3 + 1]
! set midi_outdev4 [expr $outdev4 + 1]
! set midi_outdev5 [expr $outdev5 + 1]
! set midi_outdev6 [expr $outdev6 + 1]
! set midi_outdev7 [expr $outdev7 + 1]
! set midi_outdev8 [expr $outdev8 + 1]
! set midi_outdev9 [expr $outdev9 + 1]
! set midi_outdev10 [expr $outdev10 + 1]
! set midi_outdev11 [expr $outdev11 + 1]
! set midi_outdev12 [expr $outdev12 + 1]
! set midi_outdev13 [expr $outdev13 + 1]
! set midi_outdev14 [expr $outdev14 + 1]
! set midi_outdev15 [expr $outdev15 + 1]
! set midi_outdev16 [expr $outdev16 + 1]
+ # prepend "none"
+ set indevlist [concat {"none"} $indevlist]
+ set outdevlist [concat {"none"} $outdevlist]
set midi_indevlist $indevlist
***************
*** 4093,4097 ****
# output device 2
! if {$longform && [llength $indevlist] > 2} {
frame $id.out2f
pack $id.out2f -side top
--- 4096,4100 ----
# output device 2
! if {$longform && [llength $outdevlist] > 2} {
frame $id.out2f
pack $id.out2f -side top
***************
*** 4104,4108 ****
# output device 3
! if {$longform && [llength $indevlist] > 3} {
frame $id.out3f
pack $id.out3f -side top
--- 4107,4111 ----
# output device 3
! if {$longform && [llength $outdevlist] > 3} {
frame $id.out3f
pack $id.out3f -side top
***************
*** 4115,4119 ****
# output device 4
! if {$longform && [llength $indevlist] > 4} {
frame $id.out4f
pack $id.out4f -side top
--- 4118,4122 ----
# output device 4
! if {$longform && [llength $outdevlist] > 4} {
frame $id.out4f
pack $id.out4f -side top
***************
*** 4126,4130 ****
# output device 5
! if {$longform && [llength $indevlist] > 5} {
frame $id.out5f
pack $id.out5f -side top
--- 4129,4133 ----
# output device 5
! if {$longform && [llength $outdevlist] > 5} {
frame $id.out5f
pack $id.out5f -side top
***************
*** 4137,4141 ****
# output device 6
! if {$longform && [llength $indevlist] > 6} {
frame $id.out6f
pack $id.out6f -side top
--- 4140,4144 ----
# output device 6
! if {$longform && [llength $outdevlist] > 6} {
frame $id.out6f
pack $id.out6f -side top
***************
*** 4148,4152 ****
# output device 7
! if {$longform && [llength $indevlist] > 7} {
frame $id.out7f
pack $id.out7f -side top
--- 4151,4155 ----
# output device 7
! if {$longform && [llength $outdevlist] > 7} {
frame $id.out7f
pack $id.out7f -side top
***************
*** 4159,4163 ****
# output device 8
! if {$longform && [llength $indevlist] > 8} {
frame $id.out8f
pack $id.out8f -side top
--- 4162,4166 ----
# output device 8
! if {$longform && [llength $outdevlist] > 8} {
frame $id.out8f
pack $id.out8f -side top
***************
*** 4170,4174 ****
# output device 9
! if {$longform && [llength $indevlist] > 9} {
frame $id.out9f
pack $id.out9f -side top
--- 4173,4177 ----
# output device 9
! if {$longform && [llength $outdevlist] > 9} {
frame $id.out9f
pack $id.out9f -side top
***************
*** 4181,4185 ****
# output device 10
! if {$longform && [llength $indevlist] > 10} {
frame $id.out10f
pack $id.out10f -side top
--- 4184,4188 ----
# output device 10
! if {$longform && [llength $outdevlist] > 10} {
frame $id.out10f
pack $id.out10f -side top
***************
*** 4192,4196 ****
# output device 11
! if {$longform && [llength $indevlist] > 11} {
frame $id.out11f
pack $id.out11f -side top
--- 4195,4199 ----
# output device 11
! if {$longform && [llength $outdevlist] > 11} {
frame $id.out11f
pack $id.out11f -side top
***************
*** 4203,4207 ****
# output device 12
! if {$longform && [llength $indevlist] > 12} {
frame $id.out12f
pack $id.out12f -side top
--- 4206,4210 ----
# output device 12
! if {$longform && [llength $outdevlist] > 12} {
frame $id.out12f
pack $id.out12f -side top
***************
*** 4214,4218 ****
# output device 13
! if {$longform && [llength $indevlist] > 13} {
frame $id.out13f
pack $id.out13f -side top
--- 4217,4221 ----
# output device 13
! if {$longform && [llength $outdevlist] > 13} {
frame $id.out13f
pack $id.out13f -side top
***************
*** 4225,4229 ****
# output device 14
! if {$longform && [llength $indevlist] > 14} {
frame $id.out14f
pack $id.out14f -side top
--- 4228,4232 ----
# output device 14
! if {$longform && [llength $outdevlist] > 14} {
frame $id.out14f
pack $id.out14f -side top
***************
*** 4236,4240 ****
# output device 15
! if {$longform && [llength $indevlist] > 15} {
frame $id.out15f
pack $id.out15f -side top
--- 4239,4243 ----
# output device 15
! if {$longform && [llength $outdevlist] > 15} {
frame $id.out15f
pack $id.out15f -side top
***************
*** 4247,4251 ****
# output device 16
! if {$longform && [llength $indevlist] > 16} {
frame $id.out16f
pack $id.out16f -side top
--- 4250,4254 ----
# output device 16
! if {$longform && [llength $outdevlist] > 16} {
frame $id.out16f
pack $id.out16f -side top
Index: s_midi_pm.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_midi_pm.c,v
retrieving revision 1.4.4.1.2.4
retrieving revision 1.4.4.1.2.5
diff -C2 -d -r1.4.4.1.2.4 -r1.4.4.1.2.5
*** s_midi_pm.c 5 Aug 2006 19:03:59 -0000 1.4.4.1.2.4
--- s_midi_pm.c 7 Aug 2006 11:31:31 -0000 1.4.4.1.2.5
***************
*** 41,46 ****
for (i = 0; i < nmidiin; i++)
{
! int found = 0;
! for (j = 0, devno = 0; j < Pm_CountDevices(); j++)
{
const PmDeviceInfo *info = Pm_GetDeviceInfo(j);
--- 41,46 ----
for (i = 0; i < nmidiin; i++)
{
! int found = 0,count = Pm_CountDevices();
! for (j = 0, devno = 0; j < count && !found; j++)
{
const PmDeviceInfo *info = Pm_GetDeviceInfo(j);
***************
*** 61,66 ****
info->name);
mac_nmidiindev++;
- found = 1;
}
}
devno++;
--- 61,66 ----
info->name);
mac_nmidiindev++;
}
+ found = 1;
}
devno++;
***************
*** 74,79 ****
for (i = 0; i < nmidiout; i++)
{
! int found = 0;
! for (j = 0, devno = 0; j < Pm_CountDevices(); j++)
{
const PmDeviceInfo *info = Pm_GetDeviceInfo(j);
--- 74,79 ----
for (i = 0; i < nmidiout; i++)
{
! int found = 0,count = Pm_CountDevices();
! for (j = 0, devno = 0; j < count && !found; j++)
{
const PmDeviceInfo *info = Pm_GetDeviceInfo(j);
***************
*** 85,89 ****
&mac_midioutdevlist[mac_nmidioutdev],
j, NULL, 0, NULL, NULL, 0);
! if (err)
post("could not open midi output %d (%s): %s",
j, info->name, Pm_GetErrorText(err));
--- 85,89 ----
&mac_midioutdevlist[mac_nmidioutdev],
j, NULL, 0, NULL, NULL, 0);
! if (err != pmNoError)
post("could not open midi output %d (%s): %s",
j, info->name, Pm_GetErrorText(err));
***************
*** 94,99 ****
info->name);
mac_nmidioutdev++;
- found = 1;
}
}
devno++;
--- 94,99 ----
info->name);
mac_nmidioutdev++;
}
+ found = 1;
}
devno++;