path: root/hidio_linux.c
diff options
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2007-01-01 02:17:27 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2007-01-01 02:17:27 +0000
commitf39bb01ba3c81af91b76ea6b36bd318845cd77de (patch)
tree94e96ba7a745a9a05b7216553e096c9e3b46aa26 /hidio_linux.c
parent5e357ed1cc0c85e950d6ab5fc27d249df7fae2bf (diff)
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
Diffstat (limited to 'hidio_linux.c')
1 files changed, 2 insertions, 0 deletions
diff --git a/hidio_linux.c b/hidio_linux.c
index 2436b32..5949c40 100644
--- a/hidio_linux.c
+++ b/hidio_linux.c
@@ -359,6 +359,8 @@ static void hidio_build_element_list(t_hidio *x)
new_element->relative = 1;
new_element->relative = 0;
+ SETSYMBOL(new_element->output_message, new_element->name);
+ SETFLOAT(new_element->output_message + 1, new_element->instance);
// fill in the t_hid_element struct here
post("x->x_device_number: %d element_count[]: %d",
x->x_device_number, element_count[x->x_device_number]);