From f39bb01ba3c81af91b76ea6b36bd318845cd77de Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 1 Jan 2007 02:17:27 +0000 Subject: The output message is pre-generated by hidio_build_element_list() and stored in t_hid_element->output_message. Then just the value is updated. This saves a bit of CPU time since this is run for every event that is output. Previously, for each event outputted, it had to allocate a t_atom[3] and run a SETSYMBOL for the name and a SETFLOAT for the instance. svn path=/trunk/externals/io/hidio/; revision=7117 --- hidio_darwin.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hidio_darwin.c') diff --git a/hidio_darwin.c b/hidio_darwin.c index d9ae055..16a9fd1 100644 --- a/hidio_darwin.c +++ b/hidio_darwin.c @@ -417,6 +417,13 @@ static void hidio_build_element_list(t_hidio *x) new_element = (t_hid_element *)getbytes(sizeof(t_hid_element)); new_element->pHIDElement = (void *) pCurrentHIDElement; get_usage_symbols(pCurrentHIDElement, new_element); +#ifdef PD + SETSYMBOL(new_element->output_message, new_element->name); + SETFLOAT(new_element->output_message + 1, new_element->instance); +#else /* Max */ + atom_setsym(new_element->output_message, new_element->name); + atom_setlong(new_element->output_message + 1, (long)new_element->instance); +#endif /* PD */ new_element->relative = pCurrentHIDElement->relative; new_element->instance = get_type_name_instance(new_element->type, new_element->name, -- cgit v1.2.1