diff options
author | David Robillard <d@drobilla.net> | 2012-02-29 03:21:37 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-02-29 03:21:37 +0000 |
commit | 8de887f378b13e558bdd74e88be79dc96df9d7b4 (patch) | |
tree | 1942e36555c801bc0986e2796403719dc3e19331 /libs/ardour/lv2 | |
parent | 9dd4d79d6c8cf3169b7f755883245597f919065e (diff) |
Update to latest LV2 atom extension.
git-svn-id: svn://localhost/ardour2/branches/3.0@11548 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/lv2')
-rw-r--r-- | libs/ardour/lv2/lv2plug.in/ns/ext/atom/atom.h | 31 | ||||
-rw-r--r-- | libs/ardour/lv2/lv2plug.in/ns/ext/atom/forge.h | 10 |
2 files changed, 14 insertions, 27 deletions
diff --git a/libs/ardour/lv2/lv2plug.in/ns/ext/atom/atom.h b/libs/ardour/lv2/lv2plug.in/ns/ext/atom/atom.h index 9bce7ce7aa..6287830eed 100644 --- a/libs/ardour/lv2/lv2plug.in/ns/ext/atom/atom.h +++ b/libs/ardour/lv2/lv2plug.in/ns/ext/atom/atom.h @@ -33,6 +33,7 @@ #define LV2_ATOM__Beats LV2_ATOM_URI "#Beats" #define LV2_ATOM__Blank LV2_ATOM_URI "#Blank" #define LV2_ATOM__Bool LV2_ATOM_URI "#Bool" +#define LV2_ATOM__Chunk LV2_ATOM_URI "#Chunk" #define LV2_ATOM__Double LV2_ATOM_URI "#Double" #define LV2_ATOM__Event LV2_ATOM_URI "#Event" #define LV2_ATOM__Float LV2_ATOM_URI "#Float" @@ -55,6 +56,7 @@ #define LV2_ATOM__Vector LV2_ATOM_URI "#Vector" #define LV2_ATOM__beatTime LV2_ATOM_URI "#beatTime" #define LV2_ATOM__bufferType LV2_ATOM_URI "#bufferType" +#define LV2_ATOM__childType LV2_ATOM_URI "#childType" #define LV2_ATOM__eventTransfer LV2_ATOM_URI "#eventTransfer" #define LV2_ATOM__frameTime LV2_ATOM_URI "#frameTime" #define LV2_ATOM__supports LV2_ATOM_URI "#supports" @@ -91,6 +93,12 @@ typedef struct { uint32_t type; /**< Type of this atom (mapped URI). */ } LV2_Atom; +/** A chunk of memory that may be uninitialized or contain an Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + LV2_Atom body; /**< Body atom header. */ +} LV2_Atom_Chunk; + /** An atom:Int32 or atom:Bool. May be cast to LV2_Atom. */ typedef struct { LV2_Atom atom; /**< Atom header. */ @@ -229,29 +237,6 @@ typedef struct { LV2_Atom_Literal_Body body; /**< Body. */ } LV2_Atom_Sequence; -/** - The contents of an atom:AtomPort buffer. - - This contains a pointer to an Atom, which is the data to be - processed/written, as well as additional metadata. This struct may be - augmented in the future to add more metadata fields as they become - necessary. The initial version of this struct contains data, size, and - capacity. Implementations MUST check that any other fields they wish to use - are actually present by comparing the size with the offset of that field, - e.g.: - - @code - if (offsetof(LV2_Atom_Port_Buffer, field) < buf->size) { - do_stuff_with(buf->field); - } - @endcode -*/ -typedef struct { - LV2_Atom* data; /** Pointer to data. */ - uint32_t size; /** Total size of this struct. */ - uint32_t capacity; /** Available space for data body. */ -} LV2_Atom_Port_Buffer; - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/libs/ardour/lv2/lv2plug.in/ns/ext/atom/forge.h b/libs/ardour/lv2/lv2plug.in/ns/ext/atom/forge.h index b9dd51ca28..f55cb0800c 100644 --- a/libs/ardour/lv2/lv2plug.in/ns/ext/atom/forge.h +++ b/libs/ardour/lv2/lv2plug.in/ns/ext/atom/forge.h @@ -131,6 +131,7 @@ lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size) forge->offset = 0; forge->sink = NULL; forge->handle = NULL; + forge->stack = NULL; } /** @@ -154,6 +155,7 @@ lv2_atom_forge_set_sink(LV2_Atom_Forge* forge, forge->size = forge->offset = 0; forge->sink = sink; forge->handle = handle; + forge->stack = NULL; } /** @@ -195,7 +197,7 @@ lv2_atom_forge_raw(LV2_Atom_Forge* forge, const void* data, uint32_t size) { uint8_t* out = NULL; if (forge->sink) { - out = forge->sink(forge->handle, data, size); + out = (uint8_t*)forge->sink(forge->handle, data, size); } else { out = forge->buf + forge->offset; if (forge->offset + size > forge->size) { @@ -295,12 +297,12 @@ lv2_atom_forge_string_body(LV2_Atom_Forge* forge, const uint8_t* str, uint32_t len) { - uint8_t* out = NULL; + void* out = NULL; if ( (out = lv2_atom_forge_raw(forge, str, len)) && (out = lv2_atom_forge_raw(forge, "", 1))) { lv2_atom_forge_pad(forge, len + 1); } - return out; + return (uint8_t*)out; } /** Write an atom compatible with atom:String. Used internally. */ @@ -424,7 +426,7 @@ static inline LV2_Atom_Tuple* lv2_atom_forge_tuple(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame) { const LV2_Atom_Tuple a = { { 0, forge->Tuple } }; - LV2_Atom* atom = lv2_atom_forge_write(forge, &a, sizeof(a)); + LV2_Atom* atom = (LV2_Atom*)lv2_atom_forge_write(forge, &a, sizeof(a)); return (LV2_Atom_Tuple*)lv2_atom_forge_push(forge, frame, atom); } |