Update of /cvsroot/pure-data/externals/io/hidio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9313
Modified Files: hidio.c hidio.h Log Message: some more threading related changes, changed some output values from type float to int in Max version
Index: hidio.c =================================================================== RCS file: /cvsroot/pure-data/externals/io/hidio/hidio.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** hidio.c 1 Dec 2006 16:04:37 -0000 1.5 --- hidio.c 1 Dec 2006 16:27:39 -0000 1.6 *************** *** 113,117 **** --- 113,121 ---- { t_atom *output_atom = (t_atom *)getbytes(sizeof(t_atom)); + #ifdef PD SETFLOAT(output_atom, output_value); + #else + atom_setlong(output_atom, output_value); + #endif outlet_anything( x->x_status_outlet, selector, 1, output_atom); freebytes(output_atom,sizeof(t_atom)); *************** *** 149,154 **** --- 153,163 ---- SETSYMBOL(output_data, element[x->x_device_number][i]->type); SETSYMBOL(output_data + 1, element[x->x_device_number][i]->name); + #ifdef PD SETFLOAT(output_data + 2, element[x->x_device_number][i]->min); SETFLOAT(output_data + 3, element[x->x_device_number][i]->max); + #else + atom_setlong(output_data + 2, element[x->x_device_number][i]->min); + atom_setlong(output_data + 3, element[x->x_device_number][i]->max); + #endif outlet_anything(x->x_status_outlet, ps_range, 4, output_data); } *************** *** 365,369 **** { debug_print(LOG_DEBUG,"hid_%s",s->s_name); - /* store running state to be restored after the device has been opened */ short device_number; --- 374,377 ---- *************** *** 425,434 **** static void hidio_info(t_hidio *x) { ! output_open_status(x); ! output_device_number(x); ! output_device_count(x); ! output_poll_time(x); ! output_element_ranges(x); ! hidio_platform_specific_info(x); }
--- 433,440 ---- static void hidio_info(t_hidio *x) { ! pthread_mutex_lock(&x->x_mutex); ! x->x_requestcode = REQUEST_INFO; ! pthread_cond_signal(&x->x_requestcondition); ! pthread_mutex_unlock(&x->x_mutex); }
*************** *** 474,477 **** --- 480,484 ---- { short device_number = x->x_device_number; + /* store running state to be restored after the device has been opened */ t_int started = x->x_started; int err; *************** *** 513,516 **** --- 520,537 ---- pthread_cond_signal(&x->x_answercondition); } + else if (x->x_requestcode == REQUEST_INFO) + { + pthread_mutex_unlock(&x->x_mutex); + output_open_status(x); + output_device_number(x); + output_device_count(x); + output_poll_time(x); + output_element_ranges(x); + hidio_platform_specific_info(x); + pthread_mutex_lock(&x->x_mutex); + if (x->x_requestcode == REQUEST_INFO) + x->x_requestcode = REQUEST_NOTHING; + pthread_cond_signal(&x->x_answercondition); + } else if (x->x_requestcode == REQUEST_CLOSE) {
Index: hidio.h =================================================================== RCS file: /cvsroot/pure-data/externals/io/hidio/hidio.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** hidio.h 1 Dec 2006 16:04:37 -0000 1.3 --- hidio.h 1 Dec 2006 16:27:39 -0000 1.4 *************** *** 62,67 **** #define REQUEST_READ 2 #define REQUEST_SEND 3 ! #define REQUEST_CLOSE 4 ! #define REQUEST_QUIT 5
--- 62,68 ---- #define REQUEST_READ 2 #define REQUEST_SEND 3 ! #define REQUEST_INFO 4 ! #define REQUEST_CLOSE 5 ! #define REQUEST_QUIT 6