diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/lv2/atom/atom.h | 4 | ||||
-rw-r--r-- | include/lv2/atom/forge.h | 50 | ||||
-rw-r--r-- | include/lv2/atom/util.h | 13 | ||||
-rw-r--r-- | include/lv2/core/lv2.h | 8 | ||||
-rw-r--r-- | include/lv2/core/lv2_util.h | 4 | ||||
-rw-r--r-- | include/lv2/dynmanifest/dynmanifest.h | 14 | ||||
-rw-r--r-- | include/lv2/event/event-helpers.h | 7 | ||||
-rw-r--r-- | include/lv2/event/event.h | 17 | ||||
-rw-r--r-- | include/lv2/log/log.h | 2 | ||||
-rw-r--r-- | include/lv2/log/logger.h | 4 | ||||
-rw-r--r-- | include/lv2/options/options.h | 4 | ||||
-rw-r--r-- | include/lv2/state/state.h | 2 | ||||
-rw-r--r-- | include/lv2/ui/ui.h | 11 | ||||
-rw-r--r-- | include/lv2/uri-map/uri-map.h | 8 | ||||
-rw-r--r-- | include/lv2/worker/worker.h | 2 |
15 files changed, 69 insertions, 81 deletions
diff --git a/include/lv2/atom/atom.h b/include/lv2/atom/atom.h index ca607d3..41af21a 100644 --- a/include/lv2/atom/atom.h +++ b/include/lv2/atom/atom.h @@ -68,13 +68,13 @@ extern "C" { @param type The type of the atom, for example LV2_Atom_String. @param atom A variable-sized atom. */ -#define LV2_ATOM_CONTENTS(type, atom) ((void*)((uint8_t*)(atom) + sizeof(type))) +#define LV2_ATOM_CONTENTS(type, atom) ((void*)((type*)(atom) + 1U)) /** Const version of LV2_ATOM_CONTENTS. */ #define LV2_ATOM_CONTENTS_CONST(type, atom) \ - ((const void*)((const uint8_t*)(atom) + sizeof(type))) + ((const void*)((const type*)(atom) + 1U)) /** Return a pointer to the body of an Atom. The "body" of an atom is the diff --git a/include/lv2/atom/forge.h b/include/lv2/atom/forge.h index f894a5a..58b7512 100644 --- a/include/lv2/atom/forge.h +++ b/include/lv2/atom/forge.h @@ -38,10 +38,10 @@ @{ */ -#include "lv2/atom/atom.h" -#include "lv2/atom/util.h" -#include "lv2/core/attributes.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/util.h> +#include <lv2/core/attributes.h> +#include <lv2/urid/urid.h> #include <assert.h> #include <stdbool.h> @@ -90,24 +90,24 @@ typedef struct { LV2_Atom_Forge_Frame* stack; - LV2_URID Blank LV2_DEPRECATED; - LV2_URID Bool; - LV2_URID Chunk; - LV2_URID Double; - LV2_URID Float; - LV2_URID Int; - LV2_URID Long; - LV2_URID Literal; - LV2_URID Object; - LV2_URID Path; - LV2_URID Property; + LV2_URID Blank LV2_DEPRECATED; + LV2_URID Bool; + LV2_URID Chunk; + LV2_URID Double; + LV2_URID Float; + LV2_URID Int; + LV2_URID Long; + LV2_URID Literal; + LV2_URID Object; + LV2_URID Path; + LV2_URID Property; LV2_URID Resource LV2_DEPRECATED; - LV2_URID Sequence; - LV2_URID String; - LV2_URID Tuple; - LV2_URID URI; - LV2_URID URID; - LV2_URID Vector; + LV2_URID Sequence; + LV2_URID String; + LV2_URID Tuple; + LV2_URID URI; + LV2_URID URID; + LV2_URID Vector; } LV2_Atom_Forge; static inline void @@ -492,7 +492,7 @@ lv2_atom_forge_vector(LV2_Atom_Forge* forge, const void* elems) { const LV2_Atom_Vector a = { - {(uint32_t)sizeof(LV2_Atom_Vector_Body) + n_elems * child_size, + {(uint32_t)sizeof(LV2_Atom_Vector_Body) + (n_elems * child_size), forge->Vector}, {child_size, child_type}}; const LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a)); @@ -569,8 +569,7 @@ lv2_atom_forge_object(LV2_Atom_Forge* forge, This function is deprecated and should not be used in new code. Use lv2_atom_forge_object() directly instead. */ -LV2_DEPRECATED -static inline LV2_Atom_Forge_Ref +LV2_DEPRECATED static inline LV2_Atom_Forge_Ref lv2_atom_forge_resource(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame, LV2_URID id, @@ -588,8 +587,7 @@ lv2_atom_forge_resource(LV2_Atom_Forge* forge, This function is deprecated and should not be used in new code. Use lv2_atom_forge_object() directly instead. */ -LV2_DEPRECATED -static inline LV2_Atom_Forge_Ref +LV2_DEPRECATED static inline LV2_Atom_Forge_Ref lv2_atom_forge_blank(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame, uint32_t id, diff --git a/include/lv2/atom/util.h b/include/lv2/atom/util.h index b1a1e93..9a3d8a3 100644 --- a/include/lv2/atom/util.h +++ b/include/lv2/atom/util.h @@ -1,4 +1,4 @@ -// Copyright 2008-2015 David Robillard <d@drobilla.net> +// Copyright 2008-2024 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC #ifndef LV2_ATOM_UTIL_H @@ -13,7 +13,7 @@ */ /** - @defgroup util Utilities + @defgroup atom_util Utilities @ingroup atom Utilities for working with atoms. @@ -21,7 +21,7 @@ @{ */ -#include "lv2/atom/atom.h" +#include <lv2/atom/atom.h> #include <stdarg.h> #include <stdbool.h> @@ -61,8 +61,7 @@ lv2_atom_is_null(const LV2_Atom* atom) static inline bool lv2_atom_equals(const LV2_Atom* a, const LV2_Atom* b) { - return (a == b) || ((a->type == b->type) && (a->size == b->size) && - !memcmp(a + 1, b + 1, a->size)); + return (a == b) || !memcmp(a, b, sizeof(LV2_Atom) + a->size); } /** @@ -182,7 +181,7 @@ lv2_atom_sequence_append_event(LV2_Atom_Sequence* seq, static inline LV2_Atom* lv2_atom_tuple_begin(const LV2_Atom_Tuple* tup) { - return (LV2_Atom*)(LV2_ATOM_BODY(tup)); + return (LV2_Atom*)tup + 1U; } /** Return true iff `i` has reached the end of `body`. */ @@ -252,7 +251,7 @@ static inline LV2_Atom_Property_Body* lv2_atom_object_next(const LV2_Atom_Property_Body* i) { const LV2_Atom* const value = - (const LV2_Atom*)((const uint8_t*)i + 2 * sizeof(uint32_t)); + (const LV2_Atom*)((const uint8_t*)i + (2 * sizeof(uint32_t))); return (LV2_Atom_Property_Body*)((const uint8_t*)i + lv2_atom_pad_size( (uint32_t)sizeof(LV2_Atom_Property_Body) + diff --git a/include/lv2/core/lv2.h b/include/lv2/core/lv2.h index b085ac5..e4b90fd 100644 --- a/include/lv2/core/lv2.h +++ b/include/lv2/core/lv2.h @@ -36,6 +36,7 @@ #define LV2_CORE__AnalyserPlugin LV2_CORE_PREFIX "AnalyserPlugin" ///< http://lv2plug.in/ns/lv2core#AnalyserPlugin #define LV2_CORE__AudioPort LV2_CORE_PREFIX "AudioPort" ///< http://lv2plug.in/ns/lv2core#AudioPort #define LV2_CORE__BandpassPlugin LV2_CORE_PREFIX "BandpassPlugin" ///< http://lv2plug.in/ns/lv2core#BandpassPlugin +#define LV2_CORE__BandstopPlugin LV2_CORE_PREFIX "BandstopPlugin" ///< http://lv2plug.in/ns/lv2core#BandstopPlugin #define LV2_CORE__CVPort LV2_CORE_PREFIX "CVPort" ///< http://lv2plug.in/ns/lv2core#CVPort #define LV2_CORE__ChorusPlugin LV2_CORE_PREFIX "ChorusPlugin" ///< http://lv2plug.in/ns/lv2core#ChorusPlugin #define LV2_CORE__CombPlugin LV2_CORE_PREFIX "CombPlugin" ///< http://lv2plug.in/ns/lv2core#CombPlugin @@ -99,6 +100,7 @@ #define LV2_CORE__index LV2_CORE_PREFIX "index" ///< http://lv2plug.in/ns/lv2core#index #define LV2_CORE__integer LV2_CORE_PREFIX "integer" ///< http://lv2plug.in/ns/lv2core#integer #define LV2_CORE__isLive LV2_CORE_PREFIX "isLive" ///< http://lv2plug.in/ns/lv2core#isLive +#define LV2_CORE__isSideChain LV2_CORE_PREFIX "isSideChain" ///< http://lv2plug.in/ns/lv2core#isSideChain #define LV2_CORE__latency LV2_CORE_PREFIX "latency" ///< http://lv2plug.in/ns/lv2core#latency #define LV2_CORE__maximum LV2_CORE_PREFIX "maximum" ///< http://lv2plug.in/ns/lv2core#maximum #define LV2_CORE__microVersion LV2_CORE_PREFIX "microVersion" ///< http://lv2plug.in/ns/lv2core#microVersion @@ -383,8 +385,7 @@ typedef struct LV2_Descriptor { Note that `index` has no meaning, hosts MUST NOT depend on it remaining consistent between loads of the plugin library. */ -LV2_SYMBOL_EXPORT -const LV2_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index); /** @@ -449,8 +450,7 @@ typedef struct { be destroyed (using LV2_Lib_Descriptor::cleanup()) until all plugins loaded from that library have been destroyed. */ -LV2_SYMBOL_EXPORT -const LV2_Lib_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Lib_Descriptor* lv2_lib_descriptor(const char* bundle_path, const LV2_Feature* const* features); /** diff --git a/include/lv2/core/lv2_util.h b/include/lv2/core/lv2_util.h index 4e98e07..82c5e1e 100644 --- a/include/lv2/core/lv2_util.h +++ b/include/lv2/core/lv2_util.h @@ -5,12 +5,12 @@ #define LV2_CORE_LV2_UTIL_H /** - @defgroup util Utilities + @defgroup lv2_util Utilities @ingroup lv2core @{ */ -#include "lv2/core/lv2.h" +#include <lv2/core/lv2.h> #include <stdarg.h> #include <stdbool.h> diff --git a/include/lv2/dynmanifest/dynmanifest.h b/include/lv2/dynmanifest/dynmanifest.h index b1a273c..7a6854d 100644 --- a/include/lv2/dynmanifest/dynmanifest.h +++ b/include/lv2/dynmanifest/dynmanifest.h @@ -15,7 +15,7 @@ @{ */ -#include "lv2/core/lv2.h" +#include <lv2/core/lv2.h> #include <stdio.h> @@ -56,8 +56,7 @@ typedef void* LV2_Dyn_Manifest_Handle; evaluate the result of the operation by examining the returned value and MUST NOT try to interpret the value of handle. */ -LV2_SYMBOL_EXPORT -int +LV2_SYMBOL_EXPORT int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle* handle, const LV2_Feature* const* features); @@ -84,8 +83,7 @@ lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle* handle, @return 0 on success, otherwise a non-zero error code. */ -LV2_SYMBOL_EXPORT -int +LV2_SYMBOL_EXPORT int lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, FILE* fp); /** @@ -118,8 +116,7 @@ lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, FILE* fp); @return 0 on success, otherwise a non-zero error code. */ -LV2_SYMBOL_EXPORT -int +LV2_SYMBOL_EXPORT int lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle, FILE* fp, const char* uri); @@ -135,8 +132,7 @@ lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle, @param handle Dynamic manifest generator handle. */ -LV2_SYMBOL_EXPORT -void +LV2_SYMBOL_EXPORT void lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle); #ifdef __cplusplus diff --git a/include/lv2/event/event-helpers.h b/include/lv2/event/event-helpers.h index a9eb423..de386ca 100644 --- a/include/lv2/event/event-helpers.h +++ b/include/lv2/event/event-helpers.h @@ -9,8 +9,8 @@ <http://lv2plug.in/ns/ext/event>. */ -#include "lv2/core/attributes.h" -#include "lv2/event/event.h" +#include <lv2/core/attributes.h> +#include <lv2/event/event.h> #include <stdbool.h> #include <stdint.h> @@ -107,7 +107,8 @@ lv2_event_increment(LV2_Event_Iterator* iter) return false; } - LV2_Event* const ev = (LV2_Event*)(iter->buf->data + iter->offset); + const LV2_Event* const ev = + (const LV2_Event*)(iter->buf->data + iter->offset); iter->offset += lv2_event_pad_size((uint16_t)((uint16_t)sizeof(LV2_Event) + ev->size)); diff --git a/include/lv2/event/event.h b/include/lv2/event/event.h index e255291..42ba54f 100644 --- a/include/lv2/event/event.h +++ b/include/lv2/event/event.h @@ -36,7 +36,7 @@ #define LV2_EVENT_AUDIO_STAMP 0 ///< Special timestamp type for audio frames -#include "lv2/core/attributes.h" +#include <lv2/core/attributes.h> #include <stdint.h> @@ -51,8 +51,7 @@ LV2_DISABLE_DEPRECATION_WARNINGS Equal to 2^12 * 5 * 7 * 9 * 11 * 13 * 17, which is evenly divisible by all integers from 1 through 18 inclusive, and powers of 2 up to 2^12. */ -LV2_DEPRECATED -static const uint32_t LV2_EVENT_PPQN = 3136573440U; +LV2_DEPRECATED static const uint32_t LV2_EVENT_PPQN = 3136573440U; /** An LV2 event (header only). @@ -67,8 +66,7 @@ static const uint32_t LV2_EVENT_PPQN = 3136573440U; memcpy(ev_copy, ev, sizeof(LV2_Event) + ev->size); (or equivalent) */ -LV2_DEPRECATED -typedef struct { +LV2_DEPRECATED typedef struct { /** The frames portion of timestamp. The units used here can optionally be set for a port (with the lv2ev:timeUnits property), otherwise this is @@ -127,8 +125,7 @@ typedef struct { | | | | | | | | | | | | | | | | | | | | | | | | | |FRAMES |SUBFRMS|TYP|LEN|DATA..DATA..PAD|FRAMES | ... */ -LV2_DEPRECATED -typedef struct { +LV2_DEPRECATED typedef struct { /** The contents of the event buffer. This may or may not reside in the same block of memory as this header, plugins must not assume either. @@ -210,8 +207,7 @@ typedef struct { /** Opaque pointer to host data. */ -LV2_DEPRECATED -typedef void* LV2_Event_Callback_Data; +LV2_DEPRECATED typedef void* LV2_Event_Callback_Data; /** Non-POD events feature. @@ -221,8 +217,7 @@ typedef void* LV2_Event_Callback_Data; and data pointed to an instance of this struct. Note this feature is not mandatory to support the event extension. */ -LV2_DEPRECATED -typedef struct { +LV2_DEPRECATED typedef struct { /** Opaque pointer to host data. diff --git a/include/lv2/log/log.h b/include/lv2/log/log.h index b460f45..2616ffe 100644 --- a/include/lv2/log/log.h +++ b/include/lv2/log/log.h @@ -29,7 +29,7 @@ // clang-format on -#include "lv2/urid/urid.h" +#include <lv2/urid/urid.h> #include <stdarg.h> diff --git a/include/lv2/log/logger.h b/include/lv2/log/logger.h index 37fe564..83e2132 100644 --- a/include/lv2/log/logger.h +++ b/include/lv2/log/logger.h @@ -15,8 +15,8 @@ @{ */ -#include "lv2/log/log.h" -#include "lv2/urid/urid.h" +#include <lv2/log/log.h> +#include <lv2/urid/urid.h> #include <stdarg.h> #include <stdio.h> diff --git a/include/lv2/options/options.h b/include/lv2/options/options.h index 0169b46..5dea9f3 100644 --- a/include/lv2/options/options.h +++ b/include/lv2/options/options.h @@ -15,8 +15,8 @@ @{ */ -#include "lv2/core/lv2.h" -#include "lv2/urid/urid.h" +#include <lv2/core/lv2.h> +#include <lv2/urid/urid.h> #include <stdint.h> diff --git a/include/lv2/state/state.h b/include/lv2/state/state.h index a44f3cc..c1a357a 100644 --- a/include/lv2/state/state.h +++ b/include/lv2/state/state.h @@ -16,7 +16,7 @@ @{ */ -#include "lv2/core/lv2.h" +#include <lv2/core/lv2.h> #include <stddef.h> #include <stdint.h> diff --git a/include/lv2/ui/ui.h b/include/lv2/ui/ui.h index 4d2fed7..408b570 100644 --- a/include/lv2/ui/ui.h +++ b/include/lv2/ui/ui.h @@ -16,8 +16,8 @@ @{ */ -#include "lv2/core/lv2.h" -#include "lv2/urid/urid.h" +#include <lv2/core/lv2.h> +#include <lv2/urid/urid.h> #include <stdbool.h> #include <stdint.h> @@ -29,11 +29,13 @@ #define LV2_UI__CocoaUI LV2_UI_PREFIX "CocoaUI" ///< http://lv2plug.in/ns/extensions/ui#CocoaUI #define LV2_UI__Gtk3UI LV2_UI_PREFIX "Gtk3UI" ///< http://lv2plug.in/ns/extensions/ui#Gtk3UI +#define LV2_UI__Gtk4UI LV2_UI_PREFIX "Gtk4UI" ///< http://lv2plug.in/ns/extensions/ui#Gtk4UI #define LV2_UI__GtkUI LV2_UI_PREFIX "GtkUI" ///< http://lv2plug.in/ns/extensions/ui#GtkUI #define LV2_UI__PortNotification LV2_UI_PREFIX "PortNotification" ///< http://lv2plug.in/ns/extensions/ui#PortNotification #define LV2_UI__PortProtocol LV2_UI_PREFIX "PortProtocol" ///< http://lv2plug.in/ns/extensions/ui#PortProtocol #define LV2_UI__Qt4UI LV2_UI_PREFIX "Qt4UI" ///< http://lv2plug.in/ns/extensions/ui#Qt4UI #define LV2_UI__Qt5UI LV2_UI_PREFIX "Qt5UI" ///< http://lv2plug.in/ns/extensions/ui#Qt5UI +#define LV2_UI__Qt6UI LV2_UI_PREFIX "Qt6UI" ///< http://lv2plug.in/ns/extensions/ui#Qt6UI #define LV2_UI__UI LV2_UI_PREFIX "UI" ///< http://lv2plug.in/ns/extensions/ui#UI #define LV2_UI__WindowsUI LV2_UI_PREFIX "WindowsUI" ///< http://lv2plug.in/ns/extensions/ui#WindowsUI #define LV2_UI__X11UI LV2_UI_PREFIX "X11UI" ///< http://lv2plug.in/ns/extensions/ui#X11UI @@ -67,7 +69,7 @@ /** The index returned by LV2UI_Port_Map::port_index() for unknown ports. */ -#define LV2UI_INVALID_PORT_INDEX ((uint32_t)-1) +#define LV2UI_INVALID_PORT_INDEX ((uint32_t)(-1)) #ifdef __cplusplus extern "C" { @@ -509,8 +511,7 @@ typedef struct { This is the entry point to a UI library, which works in the same way as lv2_descriptor() but for UIs rather than plugins. */ -LV2_SYMBOL_EXPORT -const LV2UI_Descriptor* +LV2_SYMBOL_EXPORT const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index); /** diff --git a/include/lv2/uri-map/uri-map.h b/include/lv2/uri-map/uri-map.h index dc25a55..90bc9bd 100644 --- a/include/lv2/uri-map/uri-map.h +++ b/include/lv2/uri-map/uri-map.h @@ -30,7 +30,7 @@ // clang-format on -#include "lv2/core/attributes.h" +#include <lv2/core/attributes.h> #include <stdint.h> @@ -43,8 +43,7 @@ LV2_DISABLE_DEPRECATION_WARNINGS /** Opaque pointer to host data. */ -LV2_DEPRECATED -typedef void* LV2_URI_Map_Callback_Data; +LV2_DEPRECATED typedef void* LV2_URI_Map_Callback_Data; /** URI Map Feature. @@ -53,8 +52,7 @@ typedef void* LV2_URI_Map_Callback_Data; plugin's instantiate method with URI "http://lv2plug.in/ns/ext/uri-map" and data pointed to an instance of this struct. */ -LV2_DEPRECATED -typedef struct { +LV2_DEPRECATED typedef struct { /** Opaque pointer to host data. diff --git a/include/lv2/worker/worker.h b/include/lv2/worker/worker.h index 613198b..2cfd052 100644 --- a/include/lv2/worker/worker.h +++ b/include/lv2/worker/worker.h @@ -15,7 +15,7 @@ @{ */ -#include "lv2/core/lv2.h" +#include <lv2/core/lv2.h> #include <stdint.h> |