Revision: 10278 http://pure-data.svn.sourceforge.net/pure-data/?rev=10278&view=rev Author: eighthave Date: 2008-09-08 17:24:19 +0000 (Mon, 08 Sep 2008)
Log Message: ----------- - fixed "open" state reporting, it was always reporting "open 1" - cleaned up hidio-help.pd a bit, removed deprecated [print( message
Modified Paths: -------------- trunk/externals/io/hidio/hidio-help.pd trunk/externals/io/hidio/hidio.c trunk/externals/io/hidio/hidio_darwin.c
Modified: trunk/externals/io/hidio/hidio-help.pd =================================================================== --- trunk/externals/io/hidio/hidio-help.pd 2008-09-04 09:07:54 UTC (rev 10277) +++ trunk/externals/io/hidio/hidio-help.pd 2008-09-08 17:24:19 UTC (rev 10278) @@ -1,17 +1,17 @@ -#N canvas 213 77 843 580 10; +#N canvas 187 24 843 580 10; #X floatatom 27 445 5 0 0 0 - - -; #X floatatom 83 445 5 0 0 0 - - -; -#X obj 191 164 tgl 35 0 empty empty empty 0 -6 0 8 -24198 -1 -1 0 25 -; +#X obj 191 164 tgl 35 0 empty empty empty 0 -6 0 8 -24198 -1 -1 25 +25; #X floatatom 765 335 5 0 0 1 value - -; #X symbolatom 631 360 15 0 0 1 event_code - -; #X symbolatom 544 377 15 0 0 1 event_type - -; #X obj 2 2 cnv 15 600 20 empty empty hidio 2 11 1 18 -233017 -66577 0; #X text 284 344 outlet message format:; -#X msg 374 130 close; -#X msg 374 109 refresh; -#X text 435 107 refresh device list; +#X msg 311 104 close; +#X msg 354 149 refresh; +#X text 416 148 refresh device list; #X text 537 487 For more info:; #X text 266 557 released under the GNU GPL; #X text 472 544 $Revision: 1.6 $$Date: 2007-07-26 07:31:38 $; @@ -21,9 +21,6 @@ #X obj 9 510 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0 1 ; #X floatatom 140 445 5 0 0 0 - - -; -#X msg 374 151 print; -#X text 437 131 close the device; -#X text 437 152 print the device and element lists; #X text 9 212 Any non-zero value starts polling ,; #X text 8 225 0 stops the polling. If the number; #X text 9 238 is greater than 1 , then the poll; @@ -65,73 +62,9 @@ 1; #X obj 459 510 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0 1; -#X msg 25 155 debug 0; -#X msg 298 135 info; -#N canvas 743 25 411 235 see 0; -#N canvas 108 318 543 264 route 0; -#X obj 27 14 inlet; -#X obj 72 226 outlet; -#X obj 19 226 outlet; -#X obj 172 226 outlet; -#X obj 222 204 symbol; -#X obj 222 226 outlet; -#X obj 272 204 symbol; -#X obj 272 226 outlet; -#X obj 322 204 symbol; -#X obj 322 226 outlet; -#X obj 372 204 symbol; -#X obj 372 226 outlet; -#X obj 122 225 outlet; -#X obj 422 204 symbol; -#X obj 422 226 outlet; -#X obj 472 204 symbol; -#X obj 472 226 outlet; -#X obj 26 63 route open device poll total product manufacturer transport -type vendorID productID; -#X connect 0 0 17 0; -#X connect 4 0 5 0; -#X connect 6 0 7 0; -#X connect 8 0 9 0; -#X connect 10 0 11 0; -#X connect 13 0 14 0; -#X connect 15 0 16 0; -#X connect 17 0 2 0; -#X connect 17 1 1 0; -#X connect 17 2 12 0; -#X connect 17 3 3 0; -#X connect 17 4 4 0; -#X connect 17 5 6 0; -#X connect 17 6 8 0; -#X connect 17 7 10 0; -#X connect 17 8 13 0; -#X connect 17 9 15 0; -#X restore 117 70 pd route info; -#X obj 81 96 tgl 15 0 empty empty open 0 -6 0 8 -262144 -1 -1 1 1; -#X obj 110 22 inlet; -#X obj 123 43 print info; -#X symbolatom 304 93 0 0 0 0 productID - -; -#X symbolatom 304 112 0 0 0 0 vendorID - -; -#X symbolatom 304 151 0 0 0 0 transport - -; -#X symbolatom 304 171 0 0 0 0 manufacturer - -; -#X symbolatom 186 192 0 0 0 0 product - -; -#X floatatom 97 140 5 0 0 0 device - -; -#X floatatom 97 162 5 0 0 0 poll - -; -#X symbolatom 304 131 0 0 0 0 type - -; -#X floatatom 97 182 5 0 0 0 total - -; -#X connect 0 0 1 0; -#X connect 0 1 9 0; -#X connect 0 2 10 0; -#X connect 0 3 12 0; -#X connect 0 4 8 0; -#X connect 0 5 7 0; -#X connect 0 6 6 0; -#X connect 0 7 11 0; -#X connect 0 8 5 0; -#X connect 0 9 4 0; -#X connect 2 0 0 0; -#X connect 2 0 3 0; -#X restore 575 278 pd see device info; -#N canvas 0 22 380 450 open 0; +#X msg 25 155 debug 6; +#X msg 354 126 info; +#N canvas 0 22 380 450 open 1; #X obj 77 61 hradio 15 1 0 8 empty empty empty 0 -6 0 8 -262144 -1 -1 0; #X msg 78 81 open mouse $1; @@ -174,7 +107,7 @@ #X connect 16 0 5 0; #X connect 17 0 5 0; #X restore 203 59 pd open by device type; -#N canvas 94 154 470 320 open 0; +#N canvas 795 22 470 320 open 0; #X text 217 82 Gravis/Destroyer Tiltpad; #X msg 76 81 open 0x047D 0x4008; #X msg 73 53 open 0x046d 0xc01d; @@ -186,19 +119,25 @@ #X msg 80 110 open 0x1043 0x0015; #X msg 84 139 open 0x06a3 0xff12; #X text 222 137 Saitek Cyborgforce; +#X text 228 167 (Belkin nostromo SpeedPad n50); +#X msg 90 169 open 0x050d 0x0805; +#X text 235 194 Apple Trackpad; +#X msg 97 196 open 0x05ac 0x021a; #X connect 1 0 4 0; #X connect 2 0 4 0; #X connect 7 0 4 0; #X connect 8 0 4 0; +#X connect 11 0 4 0; +#X connect 13 0 4 0; #X restore 174 37 pd open by vendor/product ID; -#X msg 285 329 key e 0 0; +#X msg 285 329 button button_7 0 0; #X text 49 543 (C) Copyright 2004 Hans-Christoph Steiner hans@at.or.at ; #N canvas 162 133 570 420 serin 0; -#X obj 209 61 cnv 15 15 15 empty $0-debug-canvas 0 4 8 0 14 -233017 +#X obj 209 61 cnv 15 15 15 empty $0-debug-canvas 6 4 8 0 14 -233017 -1 0; #X obj 60 61 hradio 15 1 1 10 empty empty empty 0 -6 0 8 -261689 -1 --1 0; +-1 6; #X obj 60 13 inlet; #X msg 200 202 label $1; #X obj 200 180 makefilename %d; @@ -223,10 +162,10 @@ #X coords 0 -1 1 1 165 17 1 60 60; #X restore 25 134 pd serin; #N canvas 162 133 570 420 serin 0; -#X obj 286 61 cnv 15 30 15 empty $0-open-canvas 1 4 8 0 14 -233017 +#X obj 286 61 cnv 15 30 15 empty $0-open-canvas 6 4 8 0 14 -233017 -1 0; #X obj 60 61 hradio 15 1 1 15 empty empty empty 0 -6 0 8 -225271 -1 --1 1; +-1 6; #X obj 60 13 inlet; #X msg 200 202 label $1; #X obj 200 180 makefilename %d; @@ -302,7 +241,7 @@ #X floatatom 63 401 6 0 0 0 - - -; #X obj 362 285 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; -#X msg 262 104 open 1; +#X msg 262 104 open 6; #N canvas 766 107 771 427 output 0; #X obj 286 341 outlet; #X msg 112 70 255; @@ -402,10 +341,10 @@ #X restore 357 219 pd output support; #X obj 27 420 route x y wheel rx ry; #X obj 241 445 print NOT MAPPED; -#X text 437 173 print a list of devices to the Pd window; -#X msg 374 172 devices; -#X msg 374 193 elements; -#X text 437 194 print a list of elements for the current device; +#X text 417 172 print a list of devices to the Pd window; +#X msg 354 172 devices; +#X msg 354 193 elements; +#X text 417 194 print a list of elements for the current device; #X obj 9 478 route a b c d e f g h i j k l m n o p; #N canvas 840 22 558 266 key_0 0; #X obj 17 17 inlet; @@ -487,61 +426,151 @@ #X restore 103 293 pd key_0 key mapping; #X text 14 462 (following the USB standard , US keycodes are used) ; -#X connect 2 0 57 0; -#X connect 8 0 57 0; -#X connect 9 0 57 0; -#X connect 18 0 57 0; -#X connect 47 0 57 0; -#X connect 48 0 57 0; -#X connect 50 0 57 0; -#X connect 51 0 57 0; -#X connect 54 0 47 0; -#X connect 55 0 68 0; -#X connect 57 0 65 0; -#X connect 57 0 59 0; -#X connect 57 0 58 0; -#X connect 57 0 64 0; -#X connect 57 1 49 0; -#X connect 58 0 52 0; -#X connect 59 0 5 0; -#X connect 59 1 4 0; -#X connect 59 2 60 0; -#X connect 59 3 3 0; -#X connect 61 0 66 0; -#X connect 61 1 26 0; -#X connect 61 2 27 0; -#X connect 61 3 28 0; -#X connect 61 4 29 0; -#X connect 61 5 30 0; -#X connect 61 6 31 0; -#X connect 62 0 76 0; -#X connect 62 1 70 0; -#X connect 62 2 61 0; -#X connect 64 0 62 0; -#X connect 64 0 77 0; -#X connect 67 0 65 1; -#X connect 68 0 57 0; -#X connect 69 0 57 0; -#X connect 70 0 0 0; -#X connect 70 1 1 0; -#X connect 70 2 17 0; -#X connect 70 4 25 0; -#X connect 70 5 71 0; -#X connect 73 0 57 0; -#X connect 74 0 57 0; -#X connect 76 0 16 0; -#X connect 76 1 32 0; -#X connect 76 2 33 0; -#X connect 76 3 34 0; -#X connect 76 4 35 0; -#X connect 76 5 36 0; -#X connect 76 6 37 0; -#X connect 76 7 38 0; -#X connect 76 8 39 0; -#X connect 76 9 40 0; -#X connect 76 10 41 0; -#X connect 76 11 42 0; -#X connect 76 12 43 0; -#X connect 76 13 44 0; -#X connect 76 14 45 0; -#X connect 76 15 46 0; +#X text 374 105 close the current device; +#X text 416 125 output device info to the right status outlet; +#N canvas 743 25 413 290 device 0; +#N canvas 108 318 543 264 route 0; +#X obj 27 14 inlet; +#X obj 72 226 outlet; +#X obj 19 226 outlet; +#X obj 172 226 outlet; +#X obj 222 204 symbol; +#X obj 222 226 outlet; +#X obj 272 204 symbol; +#X obj 272 226 outlet; +#X obj 322 204 symbol; +#X obj 322 226 outlet; +#X obj 372 204 symbol; +#X obj 372 226 outlet; +#X obj 122 225 outlet; +#X obj 422 204 symbol; +#X obj 422 226 outlet; +#X obj 472 204 symbol; +#X obj 472 226 outlet; +#X obj 26 63 route open device poll total product manufacturer transport +type vendorID productID; +#X connect 0 0 17 0; +#X connect 4 0 5 0; +#X connect 6 0 7 0; +#X connect 8 0 9 0; +#X connect 10 0 11 0; +#X connect 13 0 14 0; +#X connect 15 0 16 0; +#X connect 17 0 2 0; +#X connect 17 1 1 0; +#X connect 17 2 12 0; +#X connect 17 3 3 0; +#X connect 17 4 4 0; +#X connect 17 5 6 0; +#X connect 17 6 8 0; +#X connect 17 7 10 0; +#X connect 17 8 13 0; +#X connect 17 9 15 0; +#X restore 111 119 pd route info; +#X obj 75 145 tgl 15 0 empty empty open 0 -6 0 8 -262144 -1 -1 1 1 +; +#X obj 110 22 inlet; +#X obj 157 85 print info; +#X symbolatom 298 142 0 0 0 0 productID - -; +#X symbolatom 298 161 0 0 0 0 vendorID - -; +#X symbolatom 298 200 0 0 0 0 transport - -; +#X symbolatom 298 220 0 0 0 0 manufacturer - -; +#X symbolatom 180 241 0 0 0 0 product - -; +#X floatatom 91 189 5 0 0 0 device - -; +#X floatatom 91 211 5 0 0 0 poll - -; +#X symbolatom 298 180 0 0 0 0 type - -; +#X floatatom 91 231 5 0 0 0 total - -; +#X obj 242 20 inlet; +#N canvas 0 22 450 300 spigot 0; +#X obj 78 31 inlet; +#X obj 83 263 outlet; +#X obj 210 32 inlet; +#X obj 210 67 select 0; +#X msg 210 90 0; +#X obj 255 89 bang; +#X obj 82 148 spigot; +#X msg 255 110 1; +#X connect 0 0 6 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 3 1 5 0; +#X connect 4 0 6 1; +#X connect 5 0 7 0; +#X connect 6 0 1 0; +#X connect 7 0 6 1; +#X restore 157 65 pd spigot; +#X connect 0 0 1 0; +#X connect 0 1 9 0; +#X connect 0 2 10 0; +#X connect 0 3 12 0; +#X connect 0 4 8 0; +#X connect 0 5 7 0; +#X connect 0 6 6 0; +#X connect 0 7 11 0; +#X connect 0 8 5 0; +#X connect 0 9 4 0; +#X connect 2 0 0 0; +#X connect 2 0 14 0; +#X connect 13 0 14 1; +#X connect 14 0 3 0; +#X restore 542 283 pd device info; +#X obj 632 284 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 +1; +#X connect 2 0 53 0; +#X connect 8 0 53 0; +#X connect 9 0 53 0; +#X connect 44 0 53 0; +#X connect 45 0 53 0; +#X connect 46 0 53 0; +#X connect 47 0 53 0; +#X connect 50 0 44 0; +#X connect 51 0 64 0; +#X connect 53 0 61 0; +#X connect 53 0 55 0; +#X connect 53 0 54 0; +#X connect 53 0 60 0; +#X connect 53 1 77 0; +#X connect 54 0 48 0; +#X connect 55 0 5 0; +#X connect 55 1 4 0; +#X connect 55 2 56 0; +#X connect 55 3 3 0; +#X connect 57 0 62 0; +#X connect 57 1 23 0; +#X connect 57 2 24 0; +#X connect 57 3 25 0; +#X connect 57 4 26 0; +#X connect 57 5 27 0; +#X connect 57 6 28 0; +#X connect 58 0 72 0; +#X connect 58 1 66 0; +#X connect 58 2 57 0; +#X connect 60 0 58 0; +#X connect 60 0 73 0; +#X connect 63 0 61 1; +#X connect 64 0 53 0; +#X connect 65 0 53 0; +#X connect 66 0 0 0; +#X connect 66 1 1 0; +#X connect 66 2 17 0; +#X connect 66 4 22 0; +#X connect 66 5 67 0; +#X connect 69 0 53 0; +#X connect 70 0 53 0; +#X connect 72 0 16 0; +#X connect 72 1 29 0; +#X connect 72 2 30 0; +#X connect 72 3 31 0; +#X connect 72 4 32 0; +#X connect 72 5 33 0; +#X connect 72 6 34 0; +#X connect 72 7 35 0; +#X connect 72 8 36 0; +#X connect 72 9 37 0; +#X connect 72 10 38 0; +#X connect 72 11 39 0; +#X connect 72 12 40 0; +#X connect 72 13 41 0; +#X connect 72 14 42 0; +#X connect 72 15 43 0; +#X connect 78 0 77 1;
Modified: trunk/externals/io/hidio/hidio.c =================================================================== --- trunk/externals/io/hidio/hidio.c 2008-09-04 09:07:54 UTC (rev 10277) +++ trunk/externals/io/hidio/hidio.c 2008-09-08 17:24:19 UTC (rev 10278) @@ -435,11 +435,10 @@ /* just to be safe, stop it first */ hidio_stop_poll(x);
- if(! hidio_close_device(x)) - { - debug_post(LOG_INFO,"[hidio] closed device %d",x->x_device_number); - x->x_device_open = 0; - } + if(hidio_close_device(x) != 0) + debug_error(x, LOG_ERR,"[hidio] error closing device %d",x->x_device_number); + debug_post(LOG_DEBUG,"[hidio] closed device %d",x->x_device_number); + x->x_device_open = 0; output_open_status(x); }
@@ -565,6 +564,7 @@
static void hidio_debug(t_hidio *x, t_float f) { + debug_post(LOG_INFO,"[hidio] set global debug level to %d", (int)f); global_debug_level = f; }
Modified: trunk/externals/io/hidio/hidio_darwin.c =================================================================== --- trunk/externals/io/hidio/hidio_darwin.c 2008-09-04 09:07:54 UTC (rev 10277) +++ trunk/externals/io/hidio/hidio_darwin.c 2008-09-08 17:24:19 UTC (rev 10278) @@ -830,6 +830,7 @@ }
+// TODO: return the same as POSIX open()/close() - 0=success, -1=fail t_int hidio_close_device(t_hidio *x) { debug_post(LOG_DEBUG,"hidio_close_device");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.