[PD-cvs] externals/io/hidio hidio-help.pd, 1.4, 1.5 hidio.c, 1.14, 1.15 hidio.h, 1.12, 1.13 hidio_darwin.c, 1.5, 1.6 hidio_linux.c, 1.3, 1.4 hidio_windows.c, 1.1, 1.2

Hans-Christoph Steiner eighthave at users.sourceforge.net
Mon Jan 1 02:06:13 CET 2007


Update of /cvsroot/pure-data/externals/io/hidio
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26138

Modified Files:
	hidio-help.pd hidio.c hidio.h hidio_darwin.c hidio_linux.c 
	hidio_windows.c 
Log Message:
renamed debug_print() to debug_post() since its a wrapper to post()

Index: hidio.h
===================================================================
RCS file: /cvsroot/pure-data/externals/io/hidio/hidio.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** hidio.h	31 Dec 2006 22:49:16 -0000	1.12
--- hidio.h	1 Jan 2007 01:06:11 -0000	1.13
***************
*** 151,155 ****
      t_int min; // from device report
      t_int max; // from device report
!     t_float instance; // usage page/usage instance # ([absolute throttle 2 163( 
      t_int value; // output the sum of events in a poll for relative axes
      t_int previous_value; //only output on change on abs and buttons
--- 151,155 ----
      t_int min; // from device report
      t_int max; // from device report
!     t_float instance; // usage page/usage instance # (e.g. [absolute x 2 163( )
      t_int value; // output the sum of events in a poll for relative axes
      t_int previous_value; //only output on change on abs and buttons
***************
*** 169,173 ****
  
  /* support functions */
! void debug_print(t_int debug_level, const char *fmt, ...);
  void debug_error(t_hidio *x, t_int debug_level, const char *fmt, ...);
  void hidio_output_event(t_hidio *x, t_hid_element *output_data);
--- 169,173 ----
  
  /* support functions */
! void debug_post(t_int debug_level, const char *fmt, ...);
  void debug_error(t_hidio *x, t_int debug_level, const char *fmt, ...);
  void hidio_output_event(t_hidio *x, t_hid_element *output_data);

Index: hidio.c
===================================================================
RCS file: /cvsroot/pure-data/externals/io/hidio/hidio.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** hidio.c	31 Dec 2006 22:49:16 -0000	1.14
--- hidio.c	1 Jan 2007 01:06:11 -0000	1.15
***************
*** 95,99 ****
   */
  
! void debug_print(t_int message_debug_level, const char *fmt, ...)
  {
  	if(message_debug_level <= global_debug_level)
--- 95,99 ----
   */
  
! void debug_post(t_int message_debug_level, const char *fmt, ...)
  {
  	if(message_debug_level <= global_debug_level)
***************
*** 230,234 ****
  #endif /* PD */
  			if(device_number < 0) device_number = -1;
! 			debug_print(LOG_DEBUG,"[hidio] setting device# to %d",device_number);
  		}
  		else
--- 230,234 ----
  #endif /* PD */
  			if(device_number < 0) device_number = -1;
! 			debug_post(LOG_DEBUG,"[hidio] setting device# to %d",device_number);
  		}
  		else
***************
*** 243,247 ****
  			device_number = get_device_number_from_usage(0, usage >> 16, 
  														 usage & 0xffff);
! 			debug_print(LOG_INFO,"[hidio] using 0x%04x 0x%04x for %s",
  						usage >> 16, usage & 0xffff, device_type_string);
  		}
--- 243,247 ----
  			device_number = get_device_number_from_usage(0, usage >> 16, 
  														 usage & 0xffff);
! 			debug_post(LOG_INFO,"[hidio] using 0x%04x 0x%04x for %s",
  						usage >> 16, usage & 0xffff, device_type_string);
  		}
***************
*** 268,272 ****
  			atom_arg_getlong(&device_type_instance, 1, argc, argv);
  #endif /* PD */
! 			debug_print(LOG_DEBUG,"[hidio] looking for %s at #%d",
  						device_type_string, device_type_instance);
  			device_number = get_device_number_from_usage(device_type_instance,
--- 268,272 ----
  			atom_arg_getlong(&device_type_instance, 1, argc, argv);
  #endif /* PD */
! 			debug_post(LOG_DEBUG,"[hidio] looking for %s at #%d",
  						device_type_string, device_type_instance);
  			device_number = get_device_number_from_usage(device_type_instance,
***************
*** 292,302 ****
  		(output_data->value != output_data->previous_value) )
  	{
  		t_atom event_data[3];
  #ifdef PD
! 		SETSYMBOL(event_data, output_data->name);
  		SETFLOAT(event_data + 1, output_data->instance);
  		SETFLOAT(event_data + 2, output_data->value);
  #else /* Max */
  		atom_setsym(event_data, output_data->name);
  		atom_setsym(event_data, output_data->name);
  		atom_setlong(event_data + 1, (long)output_data->instance);
--- 292,309 ----
  		(output_data->value != output_data->previous_value) )
  	{
+ /*		debug_post(LOG_DEBUG,"hidio_output_event: instance %d/%d last: %llu", 
+ 				   x->x_instance+1, hidio_instance_count,
+ 				   last_execute_time[x->x_device_number]);*/
  		t_atom event_data[3];
+ 		/* TODO: this output message should be stored in t_hid_element, then just
+ 		 * the value updated.  That would save a bit of CPU time since this is
+ 		 * run for every event that is output. */
  #ifdef PD
! 		SETSYMBOL(event_data, output_data->name); 
  		SETFLOAT(event_data + 1, output_data->instance);
  		SETFLOAT(event_data + 2, output_data->value);
  #else /* Max */
  		atom_setsym(event_data, output_data->name);
+ 		//TODO: why is this line repeated?
  		atom_setsym(event_data, output_data->name);
  		atom_setlong(event_data + 1, (long)output_data->instance);
***************
*** 304,308 ****
  #endif /* PD */
  		outlet_anything(x->x_data_outlet, output_data->type, 3, event_data);
! 	} 
  }
  
--- 311,315 ----
  #endif /* PD */
  		outlet_anything(x->x_data_outlet, output_data->type, 3, event_data);
! 	}
  }
  
***************
*** 311,320 ****
  static void hidio_stop_poll(t_hidio* x) 
  {
!   debug_print(LOG_DEBUG,"hidio_stop_poll");
    
    if (x->x_started) 
    { 
  	  clock_unset(x->x_clock);
! 	  debug_print(LOG_INFO,"[hidio] polling stopped");
  	  x->x_started = 0;
    }
--- 318,327 ----
  static void hidio_stop_poll(t_hidio* x) 
  {
!   debug_post(LOG_DEBUG,"hidio_stop_poll");
    
    if (x->x_started) 
    { 
  	  clock_unset(x->x_clock);
! 	  debug_post(LOG_INFO,"[hidio] polling stopped");
  	  x->x_started = 0;
    }
***************
*** 331,335 ****
  void hidio_poll(t_hidio* x, t_float f) 
  {
! 	debug_print(LOG_DEBUG,"hidio_poll");
    
  /*	if the user sets the delay less than 2, set to block size */
--- 338,342 ----
  void hidio_poll(t_hidio* x, t_float f) 
  {
! 	debug_post(LOG_DEBUG,"hidio_poll");
    
  /*	if the user sets the delay less than 2, set to block size */
***************
*** 347,351 ****
  		{
  			clock_delay(x->x_clock, x->x_delay);
! 			debug_print(LOG_DEBUG,"[hidio] polling started");
  			x->x_started = 1;
  		} 
--- 354,358 ----
  		{
  			clock_delay(x->x_clock, x->x_delay);
! 			debug_post(LOG_DEBUG,"[hidio] polling started");
  			x->x_started = 1;
  		} 
***************
*** 378,382 ****
  t_int hidio_close(t_hidio *x) 
  {
! 	debug_print(LOG_DEBUG,"hidio_close");
  
   /* just to be safe, stop it first */
--- 385,389 ----
  t_int hidio_close(t_hidio *x) 
  {
! 	debug_post(LOG_DEBUG,"hidio_close");
  
   /* just to be safe, stop it first */
***************
*** 385,389 ****
   	if(! hidio_close_device(x))
   	{
!  		debug_print(LOG_INFO,"[hidio] closed device %d",x->x_device_number);
   		x->x_device_open = 0;
   		return (0);
--- 392,396 ----
   	if(! hidio_close_device(x))
   	{
!  		debug_post(LOG_INFO,"[hidio] closed device %d",x->x_device_number);
   		x->x_device_open = 0;
   		return (0);
***************
*** 404,408 ****
  static void hidio_open(t_hidio *x, t_symbol *s, int argc, t_atom *argv) 
  {
! 	debug_print(LOG_DEBUG,"hid_%s",s->s_name);
  	short new_device_number = get_device_number_from_arguments(argc, argv);
  	t_int started = x->x_started; // store state to restore after device is opened
--- 411,415 ----
  static void hidio_open(t_hidio *x, t_symbol *s, int argc, t_atom *argv) 
  {
! 	debug_post(LOG_DEBUG,"hid_%s",s->s_name);
  	short new_device_number = get_device_number_from_arguments(argc, argv);
  	t_int started = x->x_started; // store state to restore after device is opened
***************
*** 432,441 ****
  				if (started)
  					hidio_set_from_float(x,x->x_delay); // TODO is this useful?
! 				debug_print(LOG_DEBUG,"[hidio] set device# to %d",new_device_number);
  				output_device_number(x);
  			}
  		}
  	}
! 	else debug_print(LOG_WARNING,"[hidio] device does not exist");
  	/* always output open result so you can test for success in Pd space */
  	output_open_status(x);
--- 439,448 ----
  				if (started)
  					hidio_set_from_float(x,x->x_delay); // TODO is this useful?
! 				debug_post(LOG_DEBUG,"[hidio] set device# to %d",new_device_number);
  				output_device_number(x);
  			}
  		}
  	}
! 	else debug_post(LOG_WARNING,"[hidio] device does not exist");
  	/* always output open result so you can test for success in Pd space */
  	output_open_status(x);
***************
*** 445,449 ****
  static void hidio_tick(t_hidio *x)
  {
! //	debug_print(LOG_DEBUG,"hidio_tick");
  	t_hid_element *current_element;
  	unsigned int i;
--- 452,456 ----
  static void hidio_tick(t_hidio *x)
  {
! //	debug_post(LOG_DEBUG,"hidio_tick");
  	t_hid_element *current_element;
  	unsigned int i;
***************
*** 455,469 ****
  #endif /* PD */
  
! 	debug_print(LOG_DEBUG,"# %u\tnow: %u\tlast: %u", x->x_device_number,
! 				right_now, last_execute_time[x->x_device_number]);
  	if(right_now > last_execute_time[x->x_device_number])
  	{
  		hidio_get_events(x);
  		last_execute_time[x->x_device_number] = right_now;
! /*		post("executing: instance %d/%d at %ld", 
! 		x->x_instance, hidio_instance_count, right_now);*/
  	}
  	for(i=0; i< element_count[x->x_device_number]; ++i)
  	{
  		current_element = element[x->x_device_number][i];
  		if(current_element->previous_value != current_element->value)
--- 462,481 ----
  #endif /* PD */
  
! //	debug_post(LOG_DEBUG,"# %u\tnow: %llu\tlast: %llu", x->x_device_number,
! //				right_now, last_execute_time[x->x_device_number]);
  	if(right_now > last_execute_time[x->x_device_number])
  	{
  		hidio_get_events(x);
  		last_execute_time[x->x_device_number] = right_now;
! /*		debug_post(LOG_DEBUG,"executing: instance %d/%d at %llu last: %llu", 
! 			 x->x_instance+1, hidio_instance_count, right_now,
! 			 last_execute_time[x->x_device_number]);*/
  	}
  	for(i=0; i< element_count[x->x_device_number]; ++i)
  	{
+ 		/* TODO: since relative events need to be output every time, they need
+ 		 * to be flagged when new relative events arrive.  Otherwise, it'll
+ 		 * just spam out relative events no matter if anything new has
+ 		 * arrived */
  		current_element = element[x->x_device_number][i];
  		if(current_element->previous_value != current_element->value)
***************
*** 492,496 ****
  static void hidio_float(t_hidio* x, t_floatarg f) 
  {
! 	debug_print(LOG_DEBUG,"hid_float");
  
  	hidio_set_from_float(x,f);
--- 504,508 ----
  static void hidio_float(t_hidio* x, t_floatarg f) 
  {
! 	debug_post(LOG_DEBUG,"hid_float");
  
  	hidio_set_from_float(x,f);
***************
*** 500,504 ****
  static void hidio_int(t_hidio* x, long l) 
  {
! 	debug_print(LOG_DEBUG,"hid_int");
  
  	hidio_set_from_float(x, (float)l);
--- 512,516 ----
  static void hidio_int(t_hidio* x, long l) 
  {
! 	debug_post(LOG_DEBUG,"hid_int");
  
  	hidio_set_from_float(x, (float)l);
***************
*** 517,521 ****
  static void hidio_free(t_hidio* x) 
  {
! 	debug_print(LOG_DEBUG,"hidio_free");
  
  	hidio_close(x);
--- 529,533 ----
  static void hidio_free(t_hidio* x) 
  {
! 	debug_post(LOG_DEBUG,"hidio_free");
  
  	hidio_close(x);

Index: hidio_darwin.c
===================================================================
RCS file: /cvsroot/pure-data/externals/io/hidio/hidio_darwin.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** hidio_darwin.c	31 Dec 2006 22:49:16 -0000	1.5
--- hidio_darwin.c	1 Jan 2007 01:06:11 -0000	1.6
***************
*** 111,125 ****
  static void get_usage_symbols(pRecElement pCurrentHIDElement, t_hid_element *new_element) 
  {
! //	debug_print(LOG_DEBUG,"get_usage_symbols");
  	char buffer[MAXPDSTRING];
  
  	if(new_element == NULL)
  	{
! 		debug_print(LOG_EMERG,"[hidio] new_element == NULL!!  This is a bug, please report it.");
  		return;
  	}
  	if(pCurrentHIDElement == NULL)
  	{
! 		debug_print(LOG_EMERG,"[hidio] pCurrentHIDElement == NULL!!  This is a bug, please report it.");
  		return;
  	}
--- 111,125 ----
  static void get_usage_symbols(pRecElement pCurrentHIDElement, t_hid_element *new_element) 
  {
! //	debug_post(LOG_DEBUG,"get_usage_symbols");
  	char buffer[MAXPDSTRING];
  
  	if(new_element == NULL)
  	{
! 		debug_post(LOG_EMERG,"[hidio] new_element == NULL!!  This is a bug, please report it.");
  		return;
  	}
  	if(pCurrentHIDElement == NULL)
  	{
! 		debug_post(LOG_EMERG,"[hidio] pCurrentHIDElement == NULL!!  This is a bug, please report it.");
  		return;
  	}
***************
*** 303,307 ****
  short get_device_number_by_id(unsigned short vendor_id, unsigned short product_id)
  {
! 	debug_print(LOG_DEBUG,"get_device_number_from_usage");
  
  	pRecDevice    pCurrentHIDDevice;
--- 303,307 ----
  short get_device_number_by_id(unsigned short vendor_id, unsigned short product_id)
  {
! 	debug_post(LOG_DEBUG,"get_device_number_from_usage");
  
  	pRecDevice    pCurrentHIDDevice;
***************
*** 316,320 ****
  	{
  		--i;
! 		debug_print(LOG_INFO,"compare 0x%04x == 0x%04x  0x%04x == 0x%04x",
  					pCurrentHIDDevice->vendorID,
  					vendor_id,
--- 316,320 ----
  	{
  		--i;
! 		debug_post(LOG_INFO,"compare 0x%04x == 0x%04x  0x%04x == 0x%04x",
  					pCurrentHIDDevice->vendorID,
  					vendor_id,
***************
*** 337,341 ****
  										unsigned short usage)
  {
! //	debug_print(LOG_DEBUG,"get_device_number_from_usage");
  
  	pRecDevice    pCurrentHIDDevice;
--- 337,341 ----
  										unsigned short usage)
  {
! //	debug_post(LOG_DEBUG,"get_device_number_from_usage");
  
  	pRecDevice    pCurrentHIDDevice;
***************
*** 370,374 ****
  							pCurrentHIDDevice->usage, 
  							cstrDeviceName);
! 			debug_print(LOG_DEBUG,"[hidio]: found a %s at %d/%d: %s %s"
  						,cstrDeviceName,
  						i,
--- 370,374 ----
  							pCurrentHIDDevice->usage, 
  							cstrDeviceName);
! 			debug_post(LOG_DEBUG,"[hidio]: found a %s at %d/%d: %s %s"
  						,cstrDeviceName,
  						i,
***************
*** 441,454 ****
  					case kHIDUsage_GD_Wheel:
  						//case kHIDUsage_GD_Hatswitch: // hatswitches are more like buttons, so queue them
! 						debug_print(LOG_INFO,"[hidio] storing absolute axis to poll %s, %s (0x%04x 0x%04x)",
  									type_name, usage_name, 
  									pCurrentHIDElement->usagePage, pCurrentHIDElement->usage);
  						if(HIDDequeueElement(pCurrentHIDDevice,pCurrentHIDElement) != kIOReturnSuccess)
! 							debug_print(LOG_ERR,"[hidio] could not dequeue element");
  						new_element->polled = 1;
  						break;
  					}
  				default:
! 					debug_print(LOG_INFO,"\tqueuing element %s, %s (0x%04x 0x%04x)",
  								type_name, usage_name,
  								pCurrentHIDElement->usagePage, pCurrentHIDElement->usage);
--- 441,454 ----
  					case kHIDUsage_GD_Wheel:
  						//case kHIDUsage_GD_Hatswitch: // hatswitches are more like buttons, so queue them
! 						debug_post(LOG_INFO,"[hidio] storing absolute axis to poll %s, %s (0x%04x 0x%04x)",
  									type_name, usage_name, 
  									pCurrentHIDElement->usagePage, pCurrentHIDElement->usage);
  						if(HIDDequeueElement(pCurrentHIDDevice,pCurrentHIDElement) != kIOReturnSuccess)
! 							debug_post(LOG_ERR,"[hidio] could not dequeue element");
  						new_element->polled = 1;
  						break;
  					}
  				default:
! 					debug_post(LOG_INFO,"\tqueuing element %s, %s (0x%04x 0x%04x)",
  								type_name, usage_name,
  								pCurrentHIDElement->usagePage, pCurrentHIDElement->usage);
***************
*** 457,461 ****
  			else 
  			{
! 				debug_print(LOG_INFO,"\tqueuing element %s, %s (0x%04x 0x%04x)",
  							type_name, usage_name,
  							pCurrentHIDElement->usagePage, pCurrentHIDElement->usage);
--- 457,461 ----
  			else 
  			{
! 				debug_post(LOG_INFO,"\tqueuing element %s, %s (0x%04x 0x%04x)",
  							type_name, usage_name,
  							pCurrentHIDElement->usagePage, pCurrentHIDElement->usage);
***************
*** 463,467 ****
  			new_element->min = pCurrentHIDElement->min;
  			new_element->max = pCurrentHIDElement->max;
! 			debug_print(LOG_DEBUG,"\tlogical min %d max %d",
  						pCurrentHIDElement->min,pCurrentHIDElement->max);
  			element[x->x_device_number][element_count[x->x_device_number]] = new_element;
--- 463,467 ----
  			new_element->min = pCurrentHIDElement->min;
  			new_element->max = pCurrentHIDElement->max;
! 			debug_post(LOG_DEBUG,"\tlogical min %d max %d",
  						pCurrentHIDElement->min,pCurrentHIDElement->max);
  			element[x->x_device_number][element_count[x->x_device_number]] = new_element;
***************
*** 474,478 ****
  static void hidio_print_element_list(t_hidio *x)
  {
! //	debug_print(LOG_DEBUG,"hidio_print_element_list");
  	int i;
  	pRecElement	pCurrentHIDElement;
--- 474,478 ----
  static void hidio_print_element_list(t_hidio *x)
  {
! //	debug_post(LOG_DEBUG,"hidio_print_element_list");
  	int i;
  	pRecElement	pCurrentHIDElement;
***************
*** 508,512 ****
  void hidio_ff_print( t_hidio *x )
  {
! 	debug_print(LOG_DEBUG,"hidio_ff_print");
  	HRESULT result;
  	UInt32 value;
--- 508,512 ----
  void hidio_ff_print( t_hidio *x )
  {
! 	debug_post(LOG_DEBUG,"hidio_ff_print");
  	HRESULT result;
  	UInt32 value;
***************
*** 664,675 ****
  		
  		current_element->value = event.value;
! //		debug_print(LOG_DEBUG,"output this: %s %s %d prev %d",current_element->type->s_name,
  //			 current_element->name->s_name, current_element->value, 
  //			 current_element->previous_value);
! //		debug_print(LOG_DEBUG,"timestamp: %u %u", event.timestamp.hi, event.timestamp.lo);
  		timestamp =  * (uint64_t *) &(event.timestamp);
  		now =  mach_absolute_time();
  		difference = calculate_event_latency(now, timestamp);
! 		// temp hack to measure latency
  		if( latency_i < LATENCY_MAX)
  		{
--- 664,675 ----
  		
  		current_element->value = event.value;
! //		debug_post(LOG_DEBUG,"output this: %s %s %d prev %d",current_element->type->s_name,
  //			 current_element->name->s_name, current_element->value, 
  //			 current_element->previous_value);
! //		debug_post(LOG_DEBUG,"timestamp: %u %u", event.timestamp.hi, event.timestamp.lo);
  		timestamp =  * (uint64_t *) &(event.timestamp);
  		now =  mach_absolute_time();
  		difference = calculate_event_latency(now, timestamp);
! // temp hack to measure latency
  		if( latency_i < LATENCY_MAX)
  		{
***************
*** 681,688 ****
  		else
  		{
- /*			for(j=0;j<LATENCY_MAX;++j)
- 			{
- 				fprintf(stderr,"%d ",latency[j]);
- 				}*/
  			latency_average = latency_average / LATENCY_MAX;
  			fprintf(stderr,"average: %d\n",latency_average);
--- 681,684 ----
***************
*** 690,696 ****
  			latency_average = 0;
  		}
- //		debug_print(LOG_DEBUG,"\t\t\t\t\ttimestamp: %llu",timestamp);
- //		debug_print(LOG_DEBUG,"\t\t\t\t\tdifference: %llu", difference);
- //		post("%d %llu", i, difference);
  	}
  	/* absolute axes don't need to be queued, they can just be polled */
--- 686,689 ----
***************
*** 710,714 ****
  t_int hidio_open_device(t_hidio *x, short device_number)
  {
! 	debug_print(LOG_DEBUG,"hidio_open_device");
  
  	t_int result = 0;
--- 703,707 ----
  t_int hidio_open_device(t_hidio *x, short device_number)
  {
! 	debug_post(LOG_DEBUG,"hidio_open_device");
  
  	t_int result = 0;
***************
*** 734,738 ****
  		return(1);
  	}
! 	debug_print(LOG_WARNING,"[hidio] opened device %d: %s %s",
  				device_number, pCurrentHIDDevice->manufacturer, pCurrentHIDDevice->product);
  
--- 727,731 ----
  		return(1);
  	}
! 	debug_post(LOG_WARNING,"[hidio] opened device %d: %s %s",
  				device_number, pCurrentHIDDevice->manufacturer, pCurrentHIDDevice->product);
  
***************
*** 742,746 ****
  	if( FFIsForceFeedback(hidDevice) == FF_OK ) 
  	{
! 		debug_print(LOG_WARNING,"\tdevice has Force Feedback support");
  		if( FFCreateDevice(hidDevice,&ffDeviceReference) == FF_OK ) 
  		{
--- 735,739 ----
  	if( FFIsForceFeedback(hidDevice) == FF_OK ) 
  	{
! 		debug_post(LOG_WARNING,"\tdevice has Force Feedback support");
  		if( FFCreateDevice(hidDevice,&ffDeviceReference) == FF_OK ) 
  		{
***************
*** 761,765 ****
  t_int hidio_close_device(t_hidio *x)
  {
! 	debug_print(LOG_DEBUG,"hidio_close_device");
  
  	t_int result = 0;
--- 754,758 ----
  t_int hidio_close_device(t_hidio *x)
  {
! 	debug_post(LOG_DEBUG,"hidio_close_device");
  
  	t_int result = 0;
***************
*** 780,786 ****
  	pRecDevice pCurrentHIDDevice;
  	
! 	debug_print(LOG_DEBUG,"hidio_build_device_list");
  
! 	debug_print(LOG_WARNING,"[hidio] Building device list...");
  	if(HIDBuildDeviceList (0, 0)) 
  		post("[hidio]: no HID devices found\n");
--- 773,779 ----
  	pRecDevice pCurrentHIDDevice;
  	
! 	debug_post(LOG_DEBUG,"hidio_build_device_list");
  
! 	debug_post(LOG_WARNING,"[hidio] Building device list...");
  	if(HIDBuildDeviceList (0, 0)) 
  		post("[hidio]: no HID devices found\n");
***************
*** 798,802 ****
  	}
  	device_count = (unsigned int) HIDCountDevices(); // set the global variable
! 	debug_print(LOG_WARNING,"[hidio] completed device list.");
  }
  
--- 791,795 ----
  	}
  	device_count = (unsigned int) HIDCountDevices(); // set the global variable
! 	debug_post(LOG_WARNING,"[hidio] completed device list.");
  }
  
***************
*** 817,821 ****
  {
  	int j;
! 	debug_print(LOG_DEBUG,"hidio_platform_specific_free");
  /* only call this if the last instance is being freed */
  	if (hidio_instance_count < 1) 
--- 810,814 ----
  {
  	int j;
! 	debug_post(LOG_DEBUG,"hidio_platform_specific_free");
  /* only call this if the last instance is being freed */
  	if (hidio_instance_count < 1) 
***************
*** 825,832 ****
  		HIDReleaseDeviceList();
  	}
! 	for(j=0;j<LATENCY_MAX;++j)
  	{
  		fprintf(stderr,"%d ",latency[j]);
! 	}
  }
  
--- 818,826 ----
  		HIDReleaseDeviceList();
  	}
! /* dump latency test array */
! /*	for(j=0;j<LATENCY_MAX;++j)
  	{
  		fprintf(stderr,"%d ",latency[j]);
! 		}*/
  }
  
***************
*** 843,847 ****
  t_int hidio_ff_autocenter(t_hidio *x, t_float value)
  {
! 	debug_print(LOG_DEBUG,"hidio_ff_autocenter");
  	HRESULT result;
  	UInt32 autocenter_value;
--- 837,841 ----
  t_int hidio_ff_autocenter(t_hidio *x, t_float value)
  {
! 	debug_post(LOG_DEBUG,"hidio_ff_autocenter");
  	HRESULT result;
  	UInt32 autocenter_value;
***************
*** 867,871 ****
  t_int hidio_ff_gain(t_hidio *x, t_float value)
  {
! 	debug_print(LOG_DEBUG,"hidio_ff_gain");
  	HRESULT result;
  	UInt32 ffgain_value;
--- 861,865 ----
  t_int hidio_ff_gain(t_hidio *x, t_float value)
  {
! 	debug_post(LOG_DEBUG,"hidio_ff_gain");
  	HRESULT result;
  	UInt32 ffgain_value;
***************
*** 908,912 ****
  t_int hidio_ff_continue( t_hidio *x )
  {
! 	debug_print(LOG_DEBUG,"hidio_ff_continue");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_CONTINUE ) );
  }
--- 902,906 ----
  t_int hidio_ff_continue( t_hidio *x )
  {
! 	debug_post(LOG_DEBUG,"hidio_ff_continue");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_CONTINUE ) );
  }
***************
*** 914,918 ****
  t_int hidio_ff_pause( t_hidio *x )
  {
! 	debug_print(LOG_DEBUG,"hidio_ff_pause");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_PAUSE ) );
  }
--- 908,912 ----
  t_int hidio_ff_pause( t_hidio *x )
  {
! 	debug_post(LOG_DEBUG,"hidio_ff_pause");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_PAUSE ) );
  }
***************
*** 920,924 ****
  t_int hidio_ff_reset( t_hidio *x )
  {
! 	debug_print(LOG_DEBUG,"hidio_ff_reset");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_RESET ) );
  }
--- 914,918 ----
  t_int hidio_ff_reset( t_hidio *x )
  {
! 	debug_post(LOG_DEBUG,"hidio_ff_reset");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_RESET ) );
  }
***************
*** 926,930 ****
  t_int hidio_ff_setactuatorsoff( t_hidio *x )
  {
! 	debug_print(LOG_DEBUG,"hidio_ff_setactuatorsoff");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_SETACTUATORSOFF ) );
  }
--- 920,924 ----
  t_int hidio_ff_setactuatorsoff( t_hidio *x )
  {
! 	debug_post(LOG_DEBUG,"hidio_ff_setactuatorsoff");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_SETACTUATORSOFF ) );
  }
***************
*** 932,936 ****
  t_int hidio_ff_setactuatorson( t_hidio *x )
  {
! 	debug_print(LOG_DEBUG,"hidio_ff_setactuatorson");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_SETACTUATORSON ) );
  }
--- 926,930 ----
  t_int hidio_ff_setactuatorson( t_hidio *x )
  {
! 	debug_post(LOG_DEBUG,"hidio_ff_setactuatorson");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_SETACTUATORSON ) );
  }
***************
*** 938,942 ****
  t_int hidio_ff_stopall( t_hidio *x )
  {
! 	debug_print(LOG_DEBUG,"hidio_ff_stopall");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_STOPALL ) );
  }
--- 932,936 ----
  t_int hidio_ff_stopall( t_hidio *x )
  {
! 	debug_post(LOG_DEBUG,"hidio_ff_stopall");
  	return(  hidio_ff_send_ff_command( x, FFSFFC_STOPALL ) );
  }
***************
*** 961,965 ****
  t_int hidio_ff_fftest ( t_hidio *x, t_float value)
  {
! 	debug_print(LOG_DEBUG,"hidio_ff_fftest");
  	
  	return( 0 );
--- 955,959 ----
  t_int hidio_ff_fftest ( t_hidio *x, t_float value)
  {
! 	debug_post(LOG_DEBUG,"hidio_ff_fftest");
  	
  	return( 0 );

Index: hidio_windows.c
===================================================================
RCS file: /cvsroot/pure-data/externals/io/hidio/hidio_windows.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** hidio_windows.c	30 Nov 2006 05:53:40 -0000	1.1
--- hidio_windows.c	1 Jan 2007 01:06:11 -0000	1.2
***************
*** 73,77 ****
  t_int hidio_print_element_list(t_hidio *x)
  {
! 	debug_print(LOG_DEBUG,"hidio_print_element_list");
  
  
--- 73,77 ----
  t_int hidio_print_element_list(t_hidio *x)
  {
! 	debug_post(LOG_DEBUG,"hidio_print_element_list");
  
  
***************
*** 249,253 ****
  t_int hidio_get_events(t_hidio *x)
  {
! 	//debug_print(LOG_DEBUG,"hidio_get_events");
  
  	return (0);	
--- 249,253 ----
  t_int hidio_get_events(t_hidio *x)
  {
! 	//debug_post(LOG_DEBUG,"hidio_get_events");
  
  	return (0);	
***************
*** 257,261 ****
  t_int hidio_open_device(t_hidio *x, t_int device_number)
  {
! 	debug_print(LOG_DEBUG,"hidio_open_device");
  	t_int result = 0;
  	
--- 257,261 ----
  t_int hidio_open_device(t_hidio *x, t_int device_number)
  {
! 	debug_post(LOG_DEBUG,"hidio_open_device");
  	t_int result = 0;
  	
***************
*** 267,271 ****
  t_int hidio_close_device(t_hidio *x)
  {
! 	debug_print(LOG_DEBUG,"hidio_close_device");
  
  	t_int result = 0;
--- 267,271 ----
  t_int hidio_close_device(t_hidio *x)
  {
! 	debug_post(LOG_DEBUG,"hidio_close_device");
  
  	t_int result = 0;
***************
*** 277,281 ****
  t_int hidio_build_device_list(t_hidio *x)
  {
! 	debug_print(LOG_DEBUG,"hidio_build_device_list");
  	
  /*
--- 277,281 ----
  t_int hidio_build_device_list(t_hidio *x)
  {
! 	debug_post(LOG_DEBUG,"hidio_build_device_list");
  	
  /*
***************
*** 322,326 ****
  void hidio_platform_specific_free(t_hidio *x)
  {
! 	debug_print(LOG_DEBUG,"hidio_platform_specific_free");
  /* only call this if the last instance is being freed */
  	if (hidio_instance_count < 1) 
--- 322,326 ----
  void hidio_platform_specific_free(t_hidio *x)
  {
! 	debug_post(LOG_DEBUG,"hidio_platform_specific_free");
  /* only call this if the last instance is being freed */
  	if (hidio_instance_count < 1) 

Index: hidio_linux.c
===================================================================
RCS file: /cvsroot/pure-data/externals/io/hidio/hidio_linux.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** hidio_linux.c	31 Dec 2006 22:49:16 -0000	1.3
--- hidio_linux.c	1 Jan 2007 01:06:11 -0000	1.4
***************
*** 142,146 ****
  void hidio_print_element_list(t_hidio *x)
  {
!     debug_print(LOG_DEBUG,"hidio_print_element_list");
      unsigned long element_bitmask[EV_MAX][NBITS(KEY_MAX)];
  //    char event_type_string[256];
--- 142,146 ----
  void hidio_print_element_list(t_hidio *x)
  {
!     debug_post(LOG_DEBUG,"hidio_print_element_list");
      unsigned long element_bitmask[EV_MAX][NBITS(KEY_MAX)];
  //    char event_type_string[256];
***************
*** 265,269 ****
  void hidio_print_device_list(void)
  {
!     debug_print(LOG_DEBUG,"hidio_print_device_list");
      int i,fd;
      char device_output_string[MAXPDSTRING] = "Unknown";
--- 265,269 ----
  void hidio_print_device_list(void)
  {
!     debug_post(LOG_DEBUG,"hidio_print_device_list");
      int i,fd;
      char device_output_string[MAXPDSTRING] = "Unknown";
***************
*** 300,304 ****
  static void hidio_build_element_list(t_hidio *x) 
  {
!     debug_print(LOG_DEBUG,"hidio_build_element_list");
      unsigned long element_bitmask[EV_MAX][NBITS(KEY_MAX)];
      uint8_t abs_bitmask[ABS_MAX/8 + 1];
--- 300,304 ----
  static void hidio_build_element_list(t_hidio *x) 
  {
!     debug_post(LOG_DEBUG,"hidio_build_element_list");
      unsigned long element_bitmask[EV_MAX][NBITS(KEY_MAX)];
      uint8_t abs_bitmask[ABS_MAX/8 + 1];
***************
*** 384,388 ****
  void hidio_get_events(t_hidio *x)
  {
!     debug_print(9,"hidio_get_events");
  
  /* for debugging, counts how many events are processed each time hidio_read() is called */
--- 384,388 ----
  void hidio_get_events(t_hidio *x)
  {
!     debug_post(9,"hidio_get_events");
  
  /* for debugging, counts how many events are processed each time hidio_read() is called */
***************
*** 409,415 ****
                  {
                      output_element->value = hidio_input_event.value;
! 					debug_print(9,"i: %d  linux_type: %d  linux_code: %d", i, 
  								output_element->linux_type, output_element->linux_code);
!                     debug_print(9,"value to output: %d",output_element->value);
                      break;
                  }
--- 409,415 ----
                  {
                      output_element->value = hidio_input_event.value;
! 					debug_post(9,"i: %d  linux_type: %d  linux_code: %d", i, 
  								output_element->linux_type, output_element->linux_code);
!                     debug_post(9,"value to output: %d",output_element->value);
                      break;
                  }
***************
*** 422,426 ****
      DEBUG(
          if(event_counter > 0)
!         debug_print(8,"output %d events",event_counter);
  	);
  	
--- 422,426 ----
      DEBUG(
          if(event_counter > 0)
!         debug_post(8,"output %d events",event_counter);
  	);
  	
***************
*** 438,442 ****
  t_int hidio_open_device(t_hidio *x, short device_number)
  {
!     debug_print(LOG_DEBUG,"hidio_open_device");
  
      char device_name[MAXPDSTRING] = "Unknown";
--- 438,442 ----
  t_int hidio_open_device(t_hidio *x, short device_number)
  {
!     debug_post(LOG_DEBUG,"hidio_open_device");
  
      char device_name[MAXPDSTRING] = "Unknown";
***************
*** 482,486 ****
  t_int hidio_close_device(t_hidio *x)
  {
!     debug_print(LOG_DEBUG,"hidio_close_device");
      if(x->x_fd <0) 
          return 0;
--- 482,486 ----
  t_int hidio_close_device(t_hidio *x)
  {
!     debug_post(LOG_DEBUG,"hidio_close_device");
      if(x->x_fd <0) 
          return 0;
***************
*** 505,511 ****
      struct input_event  x_input_event; 
      
!     debug_print(LOG_DEBUG,"hidio_build_device_list");
      
!     debug_print(LOG_WARNING,"[hidio] Building device list...");
      
      for(i=0; i<MAX_DEVICES; ++i)
--- 505,511 ----
      struct input_event  x_input_event; 
      
!     debug_post(LOG_DEBUG,"hidio_build_device_list");
      
!     debug_post(LOG_WARNING,"[hidio] Building device list...");
      
      for(i=0; i<MAX_DEVICES; ++i)
***************
*** 535,539 ****
      }
      device_count = last_active_device ; // set the global variable
!     debug_print(LOG_WARNING,"[hidio] completed device list.");
  }
  
--- 535,539 ----
      }
      device_count = last_active_device ; // set the global variable
!     debug_post(LOG_WARNING,"[hidio] completed device list.");
  }
  

Index: hidio-help.pd
===================================================================
RCS file: /cvsroot/pure-data/externals/io/hidio/hidio-help.pd,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** hidio-help.pd	31 Dec 2006 22:49:16 -0000	1.4
--- hidio-help.pd	1 Jan 2007 01:06:11 -0000	1.5
***************
*** 1,3 ****
! #N canvas 157 38 878 603 10;
  #X floatatom 27 445 5 0 0 0 - - -;
  #X floatatom 83 445 5 0 0 0 - - -;
--- 1,3 ----
! #N canvas 157 38 886 611 10;
  #X floatatom 27 445 5 0 0 0 - - -;
  #X floatatom 83 445 5 0 0 0 - - -;
***************
*** 22,27 ****
  #X text 425 33 !!! This software is very much alpha \, so any aspect
  of it could change without notice !!!;
! #X obj 9 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0 1
! ;
  #N canvas 278 328 631 544 Event_Codes 0;
  #X text 28 48 (For a complete listing of Linux Input Events \, see
--- 22,27 ----
  #X text 425 33 !!! This software is very much alpha \, so any aspect
  of it could change without notice !!!;
! #X obj 9 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 66455
! 66455;
  #N canvas 278 328 631 544 Event_Codes 0;
  #X text 28 48 (For a complete listing of Linux Input Events \, see
***************
*** 241,274 ****
  #X floatatom 313 401 6 0 0 0 - - -;
  #X floatatom 363 401 6 0 0 0 - - -;
! #X obj 39 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0 1
! ;
! #X obj 69 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0 1
! ;
! #X obj 99 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0 1
! ;
! #X obj 129 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 159 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 189 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 219 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 249 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 279 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 309 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 339 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 369 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 399 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 429 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
! #X obj 459 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0
! 1;
  #X msg 25 155 debug 9;
  #X msg 298 145 info;
--- 241,274 ----
  #X floatatom 313 401 6 0 0 0 - - -;
  #X floatatom 363 401 6 0 0 0 - - -;
! #X obj 39 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 133004
! 133004;
! #X obj 69 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 133004
! 133004;
! #X obj 99 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 66455
! 66455;
! #X obj 129 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 66455
! 66455;
! #X obj 159 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 66455
! 66455;
! #X obj 189 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 133004
! 133004;
! #X obj 219 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 133004
! 133004;
! #X obj 249 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 66455
! 66455;
! #X obj 279 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 133004
! 133004;
! #X obj 309 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 133004
! 133004;
! #X obj 339 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 66455
! 66455;
! #X obj 369 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 66455
! 66455;
! #X obj 399 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 133004
! 133004;
! #X obj 429 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 66455
! 66455;
! #X obj 459 508 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 66455
! 66455;
  #X msg 25 155 debug 9;
  #X msg 298 145 info;
***************
*** 395,399 ****
  #X restore 174 37 pd open by vendor/product ID;
  #X msg 504 201 poll 200;
! #X msg 225 309 relative y 0 1;
  #X text 49 543 (C) Copyright 2004 Hans-Christoph Steiner <hans at at.or.at>
  ;
--- 395,399 ----
  #X restore 174 37 pd open by vendor/product ID;
  #X msg 504 201 poll 200;
! #X msg 225 309 key key_255 0 133004;
  #X text 49 543 (C) Copyright 2004 Hans-Christoph Steiner <hans at at.or.at>
  ;
***************
*** 426,435 ****
  #X coords 0 -1 1 1 165 17 1 60 60;
  #X restore 25 134 pd serin;
! #X msg 262 114 open 2;
  #N canvas 162 133 570 420 serin 0;
! #X obj 209 61 cnv 15 15 15 empty \$0-open-canvas 2 4 8 0 14 -233017
  -1 0;
  #X obj 60 61 hradio 15 1 1 10 empty empty empty 0 -6 0 8 -225271 -1
! -1 2;
  #X obj 60 13 inlet;
  #X msg 200 202 label \$1;
--- 426,435 ----
  #X coords 0 -1 1 1 165 17 1 60 60;
  #X restore 25 134 pd serin;
! #X msg 262 114 open 0;
  #N canvas 162 133 570 420 serin 0;
! #X obj 209 61 cnv 15 15 15 empty \$0-open-canvas 0 4 8 0 14 -233017
  -1 0;
  #X obj 60 61 hradio 15 1 1 10 empty empty empty 0 -6 0 8 -225271 -1
! -1 0;
  #X obj 60 13 inlet;
  #X msg 200 202 label \$1;
***************
*** 479,483 ****
  #X obj 9 466 route a_key b_key c_key d_key e_key f_key g_key h_key
  i_key j_key k_key l_key m_key n_key o_key p_key;
! #N canvas 114 93 475 354 raw 0;
  #X obj 144 45 inlet;
  #X obj 88 104 route DESKTOP;
--- 479,483 ----
  #X obj 9 466 route a_key b_key c_key d_key e_key f_key g_key h_key
  i_key j_key k_key l_key m_key n_key o_key p_key;
! #N canvas 114 93 487 366 raw 0;
  #X obj 144 45 inlet;
  #X obj 88 104 route DESKTOP;
***************
*** 491,498 ****
  1;
  #X obj 292 122 spigot;
- #X obj 290 163 print test;
  #X obj 333 99 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
  ;
  #X obj 354 45 inlet;
  #X connect 0 0 1 0;
  #X connect 0 0 8 0;
--- 491,498 ----
  1;
  #X obj 292 122 spigot;
  #X obj 333 99 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
  ;
  #X obj 354 45 inlet;
+ #X obj 290 162 print RAW;
  #X connect 0 0 1 0;
  #X connect 0 0 8 0;
***************
*** 503,509 ****
  #X connect 5 0 6 0;
  #X connect 7 0 5 1;
! #X connect 8 0 9 0;
! #X connect 10 0 8 1;
! #X connect 11 0 10 0;
  #X restore 408 294 pd raw;
  #X floatatom 63 401 6 0 0 0 - - -;
--- 503,509 ----
  #X connect 5 0 6 0;
  #X connect 7 0 5 1;
! #X connect 8 0 11 0;
! #X connect 9 0 8 1;
! #X connect 10 0 9 0;
  #X restore 408 294 pd raw;
  #X floatatom 63 401 6 0 0 0 - - -;





More information about the Pd-cvs mailing list