Update of /cvsroot/pure-data/externals/hcs/hid
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4287
Modified Files:
hid-help.pd hid.c hid.h hid_linux.c mouse-help.pd
Log Message:
switched Linux to use common hid_output_event()
Index: mouse-help.pd
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/hid/mouse-help.pd,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** mouse-help.pd 26 Apr 2005 03:50:24 -0000 1.11
--- mouse-help.pd 28 Apr 2005 04:29:58 -0000 1.12
***************
*** 1,3 ****
! #N canvas 338 423 659 461 10;
#X symbolatom 211 268 6 0 0 1 code - -;
#X obj 130 106 tgl 25 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0
--- 1,3 ----
! #N canvas 349 114 659 461 10;
#X symbolatom 211 268 6 0 0 1 code - -;
#X obj 130 106 tgl 25 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0
***************
*** 16,34 ****
#X msg 180 102 open 1;
#X msg 185 121 open 2;
! #N canvas 22 231 672 582 mouse-noise 0;
! #X obj 100 25 inlet;
#X obj 210 324 noise~;
#X obj 155 346 osc~;
#X obj 113 397 *~;
! #X msg 130 78 \; pd dsp 1;
#X obj 110 510 dac~;
! #X obj 338 61 inlet;
! #X text 400 62 open msgs;
#X obj 138 169 mouse \$1;
- #X obj 100 58 t f b;
#X text 328 192 get button value only;
#X obj 210 350 *~;
#X obj 317 242 / 2;
! #X obj 113 458 pan;
#X obj 289 439 line;
#X msg 289 416 \$1 20;
--- 16,33 ----
#X msg 180 102 open 1;
#X msg 185 121 open 2;
! #N canvas 22 231 672 582 mouse-noise 1;
! #X obj 112 38 inlet;
#X obj 210 324 noise~;
#X obj 155 346 osc~;
#X obj 113 397 *~;
! #X msg 155 94 \; pd dsp 1;
#X obj 110 510 dac~;
! #X obj 386 33 inlet;
! #X text 448 34 open msgs;
#X obj 138 169 mouse \$1;
#X text 328 192 get button value only;
#X obj 210 350 *~;
#X obj 317 242 / 2;
! #X obj 113 458 linearpan~;
#X obj 289 439 line;
#X msg 289 416 \$1 20;
***************
*** 36,40 ****
#X obj 359 328 f;
#X msg 343 297 0;
- #X msg 141 131 close;
#X obj 155 252 abs;
#X obj 189 192 unpack symbol float;
--- 35,38 ----
***************
*** 47,93 ****
#X obj 326 389 / 20;
#X obj 155 297 mtof;
- #X floatatom 199 259 5 0 0 0 - - -;
#X obj 155 213 hid_rel2abs 0 1;
#X obj 155 233 - 1;
#X floatatom 217 521 5 0 0 0 - - -;
#X obj 155 277 notescale 30 60;
! #X connect 0 0 9 0;
! #X connect 1 0 11 0;
#X connect 2 0 3 1;
! #X connect 3 0 13 0;
#X connect 6 0 8 0;
! #X connect 8 0 23 0;
! #X connect 8 1 31 0;
! #X connect 8 2 27 0;
! #X connect 8 3 21 0;
! #X connect 9 0 8 0;
! #X connect 9 1 4 0;
! #X connect 11 0 3 1;
! #X connect 12 0 11 1;
! #X connect 13 0 5 0;
! #X connect 13 1 5 1;
! #X connect 14 0 13 1;
! #X connect 15 0 14 0;
! #X connect 16 0 25 0;
#X connect 17 0 16 1;
! #X connect 18 0 17 1;
! #X connect 18 0 16 1;
! #X connect 19 0 8 0;
! #X connect 20 0 30 0;
! #X connect 20 0 34 0;
! #X connect 21 1 12 0;
! #X connect 22 0 3 0;
! #X connect 23 0 22 0;
! #X connect 24 0 2 0;
! #X connect 25 0 26 0;
! #X connect 26 0 17 0;
! #X connect 26 0 28 0;
! #X connect 27 0 16 0;
! #X connect 28 0 15 0;
! #X connect 29 0 24 0;
! #X connect 31 0 32 0;
! #X connect 32 0 20 0;
! #X connect 34 0 29 0;
! #X connect 34 0 33 0;
#X restore 425 186 pd mouse-noise 1;
#X obj 425 119 tgl 25 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0
--- 45,99 ----
#X obj 326 389 / 20;
#X obj 155 297 mtof;
#X obj 155 213 hid_rel2abs 0 1;
#X obj 155 233 - 1;
#X floatatom 217 521 5 0 0 0 - - -;
#X obj 155 277 notescale 30 60;
! #X obj 179 410 loadbang;
! #X msg 177 433 0.5;
! #X obj 26 260 select 0;
! #X msg 26 282 0;
! #X text 11 234 mute on finish;
! #X obj 112 71 t f f b;
! #X connect 0 0 37 0;
! #X connect 1 0 10 0;
#X connect 2 0 3 1;
! #X connect 3 0 12 0;
#X connect 6 0 8 0;
! #X connect 8 0 21 0;
! #X connect 8 1 28 0;
! #X connect 8 2 25 0;
! #X connect 8 3 19 0;
! #X connect 10 0 3 1;
! #X connect 11 0 10 1;
! #X connect 12 0 5 0;
! #X connect 12 1 5 1;
! #X connect 13 0 12 1;
! #X connect 14 0 13 0;
! #X connect 15 0 23 0;
! #X connect 16 0 15 1;
#X connect 17 0 16 1;
! #X connect 17 0 15 1;
! #X connect 18 0 31 0;
! #X connect 19 1 11 0;
! #X connect 20 0 3 0;
! #X connect 21 0 20 0;
! #X connect 22 0 2 0;
! #X connect 23 0 24 0;
! #X connect 24 0 16 0;
! #X connect 24 0 26 0;
! #X connect 25 0 15 0;
! #X connect 26 0 14 0;
! #X connect 27 0 22 0;
! #X connect 28 0 29 0;
! #X connect 29 0 18 0;
! #X connect 31 0 27 0;
! #X connect 31 0 30 0;
! #X connect 32 0 33 0;
! #X connect 33 0 12 1;
! #X connect 34 0 35 0;
! #X connect 35 0 21 0;
! #X connect 37 0 34 0;
! #X connect 37 1 8 0;
! #X connect 37 2 4 0;
#X restore 425 186 pd mouse-noise 1;
#X obj 425 119 tgl 25 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0
***************
*** 115,120 ****
#X text 424 436 $Author$;
#X text 424 423 $Revision$;
! #X obj 526 382 pddp_open all_about_hid;
! #X text 417 383 For more info:;
#X obj 601 334 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
1;
--- 121,126 ----
#X text 424 436 $Author$;
#X text 424 423 $Revision$;
! #X obj 466 382 pddp_open all_about_hid;
! #X text 357 383 For more info:;
#X obj 601 334 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
1;
***************
*** 130,136 ****
#X msg 500 148 open \$1;
#X obj 500 128 hradio 15 1 1 8 \$0-device-number empty choose_a_device
! 0 -6 1 9 -262144 -1 -1 3;
#X obj 474 128 nbx 1 14 -1e+37 1e+37 0 0 empty \$0-device-number empty
! 0 -6 0 14 -166441 -1 -1 0 256;
#X connect 1 0 35 0;
#X connect 9 0 35 0;
--- 136,142 ----
#X msg 500 148 open \$1;
#X obj 500 128 hradio 15 1 1 8 \$0-device-number empty choose_a_device
! 0 -6 1 9 -262144 -1 -1 4;
#X obj 474 128 nbx 1 14 -1e+37 1e+37 0 0 empty \$0-device-number empty
! 0 -6 0 14 -166441 -1 -1 4 256;
#X connect 1 0 35 0;
#X connect 9 0 35 0;
Index: hid.h
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/hid/hid.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** hid.h 3 Mar 2005 20:03:34 -0000 1.13
--- hid.h 28 Apr 2005 04:29:58 -0000 1.14
***************
*** 57,62 ****
/* support functions */
! void hid_output_event(t_hid *x,
! char *type, char *code, t_float value, t_float timestamp);
/* generic, cross-platform functions */
--- 57,61 ----
/* support functions */
! void hid_output_event(t_hid *x, char *type, char *code, t_float value);
/* generic, cross-platform functions */
Index: hid-help.pd
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/hid/hid-help.pd,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** hid-help.pd 26 Apr 2005 03:50:24 -0000 1.15
--- hid-help.pd 28 Apr 2005 04:29:58 -0000 1.16
***************
*** 1,4 ****
#N canvas 71 186 913 626 10;
! #X msg 455 295 key btn_0 0 4.27029e+09;
#X obj 455 274 prepend set;
#X floatatom 37 484 5 0 0 0 - - -;
--- 1,4 ----
#N canvas 71 186 913 626 10;
! #X msg 455 295 rel rel_y 1;
#X obj 455 274 prepend set;
#X floatatom 37 484 5 0 0 0 - - -;
***************
*** 6,11 ****
#X msg 158 121 start;
#X msg 158 141 stop;
- #X floatatom 548 354 12 0 0 1 time - -;
- #X obj 455 335 unpack s s f f;
#X msg 261 34 open 0;
#X msg 268 52 open 1;
--- 6,9 ----
***************
*** 15,23 ****
#X floatatom 84 439 7 0 0 0 - - -;
#X floatatom 138 439 7 0 0 0 - - -;
! #X obj 68 122 tgl 35 0 empty empty empty 0 -6 0 8 -24198 -1 -1 25 25
;
! #X floatatom 517 370 12 0 0 1 value - -;
! #X symbolatom 486 386 15 0 0 1 event_code - -;
! #X symbolatom 455 402 15 0 0 1 event_type - -;
#X obj 17 271 bng 35 250 50 0 empty empty event_received 38 18 1 9
-262144 -1 -1;
--- 13,21 ----
#X floatatom 84 439 7 0 0 0 - - -;
#X floatatom 138 439 7 0 0 0 - - -;
! #X obj 68 122 tgl 35 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 25
;
! #X floatatom 534 356 12 0 0 1 value - -;
! #X symbolatom 494 372 15 0 0 1 event_code - -;
! #X symbolatom 455 388 15 0 0 1 event_type - -;
#X obj 17 271 bng 35 250 50 0 empty empty event_received 38 18 1 9
-262144 -1 -1;
***************
*** 320,386 ****
#X obj 37 464 route rel_x rel_y rel_z rel_wheel;
#X floatatom 206 484 5 0 0 0 - - -;
#X connect 1 0 0 0;
! #X connect 4 0 90 0;
! #X connect 5 0 90 0;
! #X connect 7 0 18 0;
! #X connect 7 1 17 0;
! #X connect 7 2 16 0;
! #X connect 7 3 6 0;
! #X connect 8 0 90 0;
! #X connect 9 0 90 0;
! #X connect 10 0 90 0;
! #X connect 11 0 90 0;
! #X connect 12 0 90 0;
! #X connect 15 0 90 0;
! #X connect 36 0 35 0;
! #X connect 36 0 19 0;
! #X connect 37 0 36 1;
! #X connect 38 0 39 1;
! #X connect 39 0 38 0;
! #X connect 40 0 39 0;
! #X connect 41 0 90 0;
! #X connect 42 0 90 0;
! #X connect 50 0 90 0;
! #X connect 51 0 90 0;
! #X connect 55 0 66 0;
! #X connect 55 1 98 0;
! #X connect 55 2 72 0;
! #X connect 55 3 40 0;
! #X connect 65 0 90 0;
! #X connect 66 0 56 0;
! #X connect 66 1 57 0;
! #X connect 66 2 58 0;
! #X connect 66 3 59 0;
! #X connect 66 4 60 0;
! #X connect 66 5 61 0;
! #X connect 66 6 62 0;
! #X connect 66 7 63 0;
! #X connect 66 8 64 0;
! #X connect 66 9 67 0;
! #X connect 72 0 13 0;
! #X connect 72 1 14 0;
! #X connect 72 2 49 0;
! #X connect 72 3 73 0;
! #X connect 72 4 74 0;
! #X connect 72 5 75 0;
! #X connect 72 6 76 0;
! #X connect 76 0 77 0;
! #X connect 76 1 79 0;
! #X connect 76 2 81 0;
! #X connect 76 3 83 0;
#X connect 77 0 78 0;
#X connect 79 0 80 0;
#X connect 81 0 82 0;
! #X connect 83 0 84 0;
! #X connect 85 0 90 0;
! #X connect 86 0 90 0;
! #X connect 89 0 90 0;
! #X connect 90 0 36 0;
! #X connect 90 0 1 0;
! #X connect 90 0 7 0;
! #X connect 90 0 55 0;
! #X connect 97 0 90 0;
! #X connect 98 0 2 0;
! #X connect 98 1 3 0;
! #X connect 98 2 71 0;
! #X connect 98 3 99 0;
--- 318,384 ----
#X obj 37 464 route rel_x rel_y rel_z rel_wheel;
#X floatatom 206 484 5 0 0 0 - - -;
+ #X obj 455 335 unpack s s f;
#X connect 1 0 0 0;
! #X connect 4 0 88 0;
! #X connect 5 0 88 0;
! #X connect 6 0 88 0;
! #X connect 7 0 88 0;
! #X connect 8 0 88 0;
! #X connect 9 0 88 0;
! #X connect 10 0 88 0;
! #X connect 13 0 88 0;
! #X connect 34 0 33 0;
! #X connect 34 0 17 0;
! #X connect 35 0 34 1;
! #X connect 36 0 37 1;
! #X connect 37 0 36 0;
! #X connect 38 0 37 0;
! #X connect 39 0 88 0;
! #X connect 40 0 88 0;
! #X connect 48 0 88 0;
! #X connect 49 0 88 0;
! #X connect 53 0 64 0;
! #X connect 53 1 96 0;
! #X connect 53 2 70 0;
! #X connect 53 3 38 0;
! #X connect 63 0 88 0;
! #X connect 64 0 54 0;
! #X connect 64 1 55 0;
! #X connect 64 2 56 0;
! #X connect 64 3 57 0;
! #X connect 64 4 58 0;
! #X connect 64 5 59 0;
! #X connect 64 6 60 0;
! #X connect 64 7 61 0;
! #X connect 64 8 62 0;
! #X connect 64 9 65 0;
! #X connect 70 0 11 0;
! #X connect 70 1 12 0;
! #X connect 70 2 47 0;
! #X connect 70 3 71 0;
! #X connect 70 4 72 0;
! #X connect 70 5 73 0;
! #X connect 70 6 74 0;
! #X connect 74 0 75 0;
! #X connect 74 1 77 0;
! #X connect 74 2 79 0;
! #X connect 74 3 81 0;
! #X connect 75 0 76 0;
#X connect 77 0 78 0;
#X connect 79 0 80 0;
#X connect 81 0 82 0;
! #X connect 83 0 88 0;
! #X connect 84 0 88 0;
! #X connect 87 0 88 0;
! #X connect 88 0 34 0;
! #X connect 88 0 1 0;
! #X connect 88 0 53 0;
! #X connect 88 0 98 0;
! #X connect 95 0 88 0;
! #X connect 96 0 2 0;
! #X connect 96 1 3 0;
! #X connect 96 2 69 0;
! #X connect 96 3 97 0;
! #X connect 98 0 16 0;
! #X connect 98 1 15 0;
! #X connect 98 2 14 0;
Index: hid_linux.c
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/hid/hid_linux.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** hid_linux.c 3 Apr 2005 11:56:05 -0000 1.9
--- hid_linux.c 28 Apr 2005 04:29:58 -0000 1.10
***************
*** 269,273 ****
DEBUG(t_int event_counter = 0;);
t_int read_bytes;
! t_atom event_data[4];
/* this will go into the generic read function declared in hid.h and
--- 269,275 ----
DEBUG(t_int event_counter = 0;);
t_int read_bytes;
! t_atom event_data[3];
!
! char hid_code[7];
/* this will go into the generic read function declared in hid.h and
***************
*** 280,303 ****
while (read (x->x_fd, &(hid_input_event), sizeof(struct input_event)) > -1)
{
- /* build event_data list from event data */
- /* type */
- SETSYMBOL(event_data, gensym(ev[hid_input_event.type]));
- /* code */
if (hid_input_event.type == EV_KEY)
{
- char hid_code[7];
hid_convert_linux_buttons_to_numbers(hid_input_event.code,hid_code);
! hid_convert_linux_keys(hid_input_event.code,hid_code);
! SETSYMBOL(event_data + 1,
! gensym(hid_code));
}
else
! SETSYMBOL(event_data + 1,
! gensym(event_names[hid_input_event.type][hid_input_event.code]));
! /* value */
! SETFLOAT(event_data + 2, (t_float)hid_input_event.value);
! /* time */
! SETFLOAT(event_data + 3, (t_float)(hid_input_event.time).tv_sec);
! outlet_anything(x->x_obj.te_outlet,atom_gensym(event_data),3,event_data+1);
DEBUG(++event_counter;);
}
--- 282,297 ----
while (read (x->x_fd, &(hid_input_event), sizeof(struct input_event)) > -1)
{
if (hid_input_event.type == EV_KEY)
{
hid_convert_linux_buttons_to_numbers(hid_input_event.code,hid_code);
! hid_convert_linux_keys(hid_input_event.code,hid_code);
}
else
! {
! strcpy(hid_code, event_names[hid_input_event.type][hid_input_event.code]);
! }
!
! hid_output_event(x, ev[hid_input_event.type], hid_code,
! (t_float)hid_input_event.value);
DEBUG(++event_counter;);
}
Index: hid.c
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/hid/hid.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** hid.c 28 Nov 2004 01:27:47 -0000 1.15
--- hid.c 28 Apr 2005 04:29:58 -0000 1.16
***************
*** 49,54 ****
*/
! void hid_output_event(t_hid *x,
! char *type, char *code, t_float value, t_float timestamp)
{
t_atom event_data[4];
--- 49,53 ----
*/
! void hid_output_event(t_hid *x, char *type, char *code, t_float value)
{
t_atom event_data[4];
***************
*** 57,63 ****
SETSYMBOL(event_data + 1, gensym(code)); /* code */
SETFLOAT(event_data + 2, value); /* value */
- SETFLOAT(event_data + 3, timestamp); /* timestamp */
! outlet_anything(x->x_obj.te_outlet,atom_gensym(event_data),3,event_data+1);
}
--- 56,61 ----
SETSYMBOL(event_data + 1, gensym(code)); /* code */
SETFLOAT(event_data + 2, value); /* value */
! outlet_anything(x->x_obj.te_outlet,atom_gensym(event_data),2,event_data+1);
}