diff options
author | David Robillard <d@drobilla.net> | 2010-10-29 00:59:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-10-29 00:59:58 +0000 |
commit | a31c23155b8b1902f70a63a12d7c09822dacda04 (patch) | |
tree | ca23c1b977b7e3fa1ebdbe7d64df3ae3e4f5e08f /ext | |
parent | 58884fbbfc03aeff277d30305b65dccf58189b2f (diff) | |
download | lv2-a31c23155b8b1902f70a63a12d7c09822dacda04.tar.xz |
Remove OSC buffer junk.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/osc.lv2/lv2_osc.c | 78 | ||||
-rw-r--r-- | ext/osc.lv2/osc.h | 6 |
2 files changed, 2 insertions, 82 deletions
diff --git a/ext/osc.lv2/lv2_osc.c b/ext/osc.lv2/lv2_osc.c index 0c1d1e0..afea2c9 100644 --- a/ext/osc.lv2/lv2_osc.c +++ b/ext/osc.lv2/lv2_osc.c @@ -83,6 +83,7 @@ lv2_osc_arg_size(char type, const LV2_OSC_Argument* arg) case 'c': case 'i': case 'f': + case 'S': // Symbol (URI-mapped integer) return 4; case 'h': @@ -92,9 +93,6 @@ lv2_osc_arg_size(char type, const LV2_OSC_Argument* arg) case 's': return lv2_osc_string_size(&arg->s); - /*case 'S': - return lv2_osc_string_size(&arg->S);*/ - case 'b': return lv2_osc_blob_size(&arg->b); @@ -238,77 +236,3 @@ lv2_osc_message_from_raw(uint32_t out_buf_size, return write_loc; } - - -#if 0 -/** Allocate a new LV2OSCBuffer. - * - * This function is NOT realtime safe. - */ -LV2_OSCBuffer* -lv2_osc_buffer_new(uint32_t capacity) -{ - LV2OSCBuffer* buf = (LV2OSCBuffer*)malloc((sizeof(uint32_t) * 3) + capacity); - buf->capacity = capacity; - buf->size = 0; - buf->message_count = 0; - memset(&buf->data, 0, capacity); - return buf; -} - - -void -lv2_osc_buffer_clear(LV2OSCBuffer* buf) -{ - buf->size = 0; - buf->message_count = 0; -} - -int -lv2_osc_buffer_append_message(LV2OSCBuffer* buf, LV2_OSC_Event* msg) -{ - const uint32_t msg_size = lv2_message_get_size(msg); - - if (buf->capacity - buf->size - ((buf->message_count + 1) * sizeof(uint32_t)) < msg_size) - return ENOBUFS; - - char* write_loc = &buf->data + buf->size; - - memcpy(write_loc, msg, msg_size); - - // Index is written backwards, starting at end of data - uint32_t* index_end = (uint32_t*)(&buf->data + buf->capacity - sizeof(uint32_t)); - *(index_end - buf->message_count) = buf->size; - - ++buf->message_count; - - buf->size += msg_size; - - return 0; -} - -int -lv2_osc_buffer_append(LV2OSCBuffer* buf, double time, const char* path, const char* types, ...) -{ - // FIXME: crazy unsafe - LV2_OSC_Event* write_msg = (LV2_OSC_Event*)(&buf->data + buf->size); - - write_msg->time = time; - write_msg->data_size = 0; - write_msg->argument_count = 0; - write_msg->types_offset = strlen(path) + 1; - - memcpy(&write_msg->data, path, write_msg->types_offset); - - /*fprintf(stderr, "Append message:\n"); - lv2_osc_message_print(write_msg); - fprintf(stderr, "\n");*/ - - uint32_t msg_size = lv2_message_get_size(write_msg); - buf->size += msg_size; - buf->message_count++; - - return 0; -} -#endif - diff --git a/ext/osc.lv2/osc.h b/ext/osc.lv2/osc.h index 23e49a9..05e39cc 100644 --- a/ext/osc.lv2/osc.h +++ b/ext/osc.lv2/osc.h @@ -27,11 +27,7 @@ extern "C" { /** @file * C header for the LV2 OSC extension <http://lv2plug.in/ns/ext/osc>. - * This extension uses (raw) OSC messages - * and a buffer format which contains a sequence of timestamped messages. - * Additional (ie beyond raw OSC) indexing information is stored in the buffer - * for performance, so that accessors for messages and arguments are very fast: - * O(1) and realtime safe, unless otherwise noted. + * This extension defines a format for (raw) OSC messages/events. */ |