From c5afa1b564ce61130beffaf159b099801d5ade4d Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 3 Jul 2015 11:43:47 +0200 Subject: [PATCH] First doc push --- blank.gif | Bin 0 -> 148 bytes extui/external-ui.doap.ttl | 25 ++++++ extui/external-ui.h | 109 +++++++++++++++++++++++ extui/external-ui.ttl | 81 +++++++++++++++++ extui/index.html | 162 ++++++++++++++++++++++++++++++++++ extui/manifest.ttl | 8 ++ folder.gif | Bin 0 -> 225 bytes index.html | 38 ++++++++ progs/index.html | 159 +++++++++++++++++++++++++++++++++ progs/manifest.ttl | 8 ++ progs/programs.doap.ttl | 25 ++++++ progs/programs.h | 174 +++++++++++++++++++++++++++++++++++++ progs/programs.ttl | 62 +++++++++++++ rtmpl/index.html | 124 ++++++++++++++++++++++++++ rtmpl/manifest.ttl | 8 ++ rtmpl/rtmempool.doap.ttl | 25 ++++++ rtmpl/rtmempool.h | 105 ++++++++++++++++++++++ rtmpl/rtmempool.ttl | 33 +++++++ 18 files changed, 1146 insertions(+) create mode 100644 blank.gif create mode 100644 extui/external-ui.doap.ttl create mode 100755 extui/external-ui.h create mode 100644 extui/external-ui.ttl create mode 100644 extui/index.html create mode 100644 extui/manifest.ttl create mode 100644 folder.gif create mode 100644 index.html create mode 100644 progs/index.html create mode 100644 progs/manifest.ttl create mode 100644 progs/programs.doap.ttl create mode 100644 progs/programs.h create mode 100644 progs/programs.ttl create mode 100644 rtmpl/index.html create mode 100644 rtmpl/manifest.ttl create mode 100644 rtmpl/rtmempool.doap.ttl create mode 100644 rtmpl/rtmempool.h create mode 100644 rtmpl/rtmempool.ttl diff --git a/blank.gif b/blank.gif new file mode 100644 index 0000000000000000000000000000000000000000..0ccf01e1983e40365a9ab9f373b6fc497c8603cd GIT binary patch literal 148 zcmZ?wbhEHb6k!l!SjfQe|Ns9p|Nk?9f#N^Ekc`Y?g~Xx~1t67~r%;lSs!&jxl#`jP zkdmL9n3<=i;GJ3ql<+7`&qyuSQOE}IG8|GfOZ1ZSb9EGgQwvH`bCXhw6bvmbO&Jt_ pvM@3*Ff!-Xz$Dz$zw-23{>5{)-0I$ZZ_jW3Hcv(dYXE)}F?;|3 literal 0 HcmV?d00001 diff --git a/extui/external-ui.doap.ttl b/extui/external-ui.doap.ttl new file mode 100644 index 0000000..c011d2c --- /dev/null +++ b/extui/external-ui.doap.ttl @@ -0,0 +1,25 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix rdfs: . + + + a doap:Project ; + rdfs:seeAlso <../kx-meta/meta.ttl> ; + doap:license ; + doap:name "External UI" ; + doap:homepage ; + doap:created "2015-07-03" ; + doap:shortdesc "LV2 extension for implementing external UIs." ; + doap:developer ; + doap:maintainer ; + doap:release [ + doap:revision "1.0" ; + doap:created "2015-07-03" ; + doap:file-release ; + dcs:changeset [ + dcs:item [ + rdfs:label "First stable release." + ] + ] + ] . diff --git a/extui/external-ui.h b/extui/external-ui.h new file mode 100755 index 0000000..2c9e6ee --- /dev/null +++ b/extui/external-ui.h @@ -0,0 +1,109 @@ +/* + LV2 External UI extension + This work is in public domain. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + If you have questions, contact Filipe Coelho (aka falkTX) + or ask in #lad channel, FreeNode IRC network. +*/ + +/** + @file lv2_external_ui.h + C header for the LV2 External UI extension . +*/ + +#ifndef LV2_EXTERNAL_UI_H +#define LV2_EXTERNAL_UI_H + +#include "lv2/lv2plug.in/ns/extensions/ui/ui.h" + +#define LV2_EXTERNAL_UI_URI "http://kxstudio.sf.net/ns/lv2ext/external-ui" +#define LV2_EXTERNAL_UI_PREFIX LV2_EXTERNAL_UI_URI "#" + +#define LV2_EXTERNAL_UI__Host LV2_EXTERNAL_UI_PREFIX "Host" +#define LV2_EXTERNAL_UI__Widget LV2_EXTERNAL_UI_PREFIX "Widget" + +/** This extension used to be defined by a lv2plug.in URI */ +#define LV2_EXTERNAL_UI_DEPRECATED_URI "http://lv2plug.in/ns/extensions/ui#external" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * When LV2_EXTERNAL_UI__Widget UI is instantiated, the returned + * LV2UI_Widget handle must be cast to pointer to LV2_External_UI_Widget. + * UI is created in invisible state. + */ +typedef struct _LV2_External_UI_Widget { + /** + * Host calls this function regulary. UI library implementing the + * callback may do IPC or redraw the UI. + * + * @param _this_ the UI context + */ + void (*run)(struct _LV2_External_UI_Widget * _this_); + + /** + * Host calls this function to make the plugin UI visible. + * + * @param _this_ the UI context + */ + void (*show)(struct _LV2_External_UI_Widget * _this_); + + /** + * Host calls this function to make the plugin UI invisible again. + * + * @param _this_ the UI context + */ + void (*hide)(struct _LV2_External_UI_Widget * _this_); + +} LV2_External_UI_Widget; + +#define LV2_EXTERNAL_UI_RUN(ptr) (ptr)->run(ptr) +#define LV2_EXTERNAL_UI_SHOW(ptr) (ptr)->show(ptr) +#define LV2_EXTERNAL_UI_HIDE(ptr) (ptr)->hide(ptr) + +/** + * On UI instantiation, host must supply LV2_EXTERNAL_UI__Host feature. + * LV2_Feature::data must be pointer to LV2_External_UI_Host. + */ +typedef struct _LV2_External_UI_Host { + /** + * Callback that plugin UI will call when UI (GUI window) is closed by user. + * This callback will be called during execution of LV2_External_UI_Widget::run() + * (i.e. not from background thread). + * + * After this callback is called, UI is defunct. Host must call LV2UI_Descriptor::cleanup(). + * If host wants to make the UI visible again, the UI must be reinstantiated. + * + * @note When using the depreated URI LV2_EXTERNAL_UI_DEPRECATED_URI, + * some hosts will not call LV2UI_Descriptor::cleanup() as they should, + * and may call show() again without re-initialization. + * + * @param controller Host context associated with plugin UI, as + * supplied to LV2UI_Descriptor::instantiate(). + */ + void (*ui_closed)(LV2UI_Controller controller); + + /** + * Optional (may be NULL) "user friendly" identifier which the UI + * may display to allow a user to easily associate this particular + * UI instance with the correct plugin instance as it is represented + * by the host (e.g. "track 1" or "channel 4"). + * + * If supplied by host, the string will be referenced only during + * LV2UI_Descriptor::instantiate() + */ + const char * plugin_human_id; + +} LV2_External_UI_Host; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* LV2_EXTERNAL_UI_H */ diff --git a/extui/external-ui.ttl b/extui/external-ui.ttl new file mode 100644 index 0000000..0658435 --- /dev/null +++ b/extui/external-ui.ttl @@ -0,0 +1,81 @@ +@prefix lv2: . +@prefix extui: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix ui: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:seeAlso , + , + <../kx-meta/meta.ttl> ; + lv2:documentation """ +

+ LV2 External UI extension is an LV2 UI extension, subclass of ui:UI just like ui:GtkUI is.
+ The ui:Widget type used in this extension is extui:Widget, see the C header file for more details.
+

+

+ This extension used to be (wronly) defined in a lv2plug.in domain.
+ The old URI is deprecated and the extension is available under the new URI.
+ Or if you prefer, the old extension is deprecated and a new one with exactly same semantics but different URI is available. +

+ +

+ List of plugins that use this extension: +

+ + +

+ List of hosts that support this extension: +

+ +""" . + +extui:Host + a lv2:Feature ; + lv2:documentation """ +

+TODO +

+""" . + +extui:Widget + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "External UI" ; + lv2:documentation """ +

+TODO +

+""" . + + + a lv2:Feature , + rdfs:Class , + owl:Class ; + owl:deprecated true ; + rdfs:seeAlso extui:Host, extui:Widget ; + rdfs:label "Old External UI" ; + lv2:documentation """ +

+TODO +

+""" . diff --git a/extui/index.html b/extui/index.html new file mode 100644 index 0000000..10c7f54 --- /dev/null +++ b/extui/index.html @@ -0,0 +1,162 @@ + + + + + External UI + + + + + + + +
+ + +
+ + + +
+

+ LV2 External UI extension is an LV2 UI extension, subclass of ui:UI just like ui:GtkUI is.
+ The ui:Widget type used in this extension is extui:Widget, see the C header file for more details.
+

+

+ This extension used to be (wronly) defined in a lv2plug.in domain.
+ The old URI is deprecated and the extension is available under the new URI.
+ Or if you prefer, the old extension is deprecated and a new one with exactly same semantics but different URI is available. +

+ +

+ List of plugins that use this extension: +

+ + +

+ List of hosts that support this extension: +

+ +
+ + +

Index

+ + + +

Reference

+
+
+

Class extui:Widget

+
External UI
+

+TODO +

+
+ + +
Sub-class ofui:UI
+
+
+ +
+

Instance extui:Host

+
+

+TODO +

+
+ +
Typelv2:Feature
+
+
+ + +
+ + +

History

+
+
+
Version 1.0 (2015-07-03)
+
    +
  • First stable release.
  • +
+ +
+ + + + + + diff --git a/extui/manifest.ttl b/extui/manifest.ttl new file mode 100644 index 0000000..5c7dc8b --- /dev/null +++ b/extui/manifest.ttl @@ -0,0 +1,8 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 0 ; + rdfs:seeAlso . diff --git a/folder.gif b/folder.gif new file mode 100644 index 0000000000000000000000000000000000000000..48264601ae0655bbb5b5539e54ab9c4c52c0ca96 GIT binary patch literal 225 zcmZ?wbhEHb6k!l!IK;s49|+FOJoEqm%rs*lV1NO|e|{kunZ*i;MI{PADl<=^BqLR! zpfo8bGg%=eKQ}QmPfx)+wG1fXQJS8STCAgx4dP`uq-K`rCFkerCyg@&WtvAFs%+oyn@vrAN+!2FgA&7LgdM$msG{jgj*VKw;b&W_&MNEp LeCV-eWUvMRho4eP literal 0 HcmV?d00001 diff --git a/index.html b/index.html new file mode 100644 index 0000000..aa8103f --- /dev/null +++ b/index.html @@ -0,0 +1,38 @@ + + + + Index of / + + +

Index of /

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
[ICO]NameSizeDescription

[DIR]External UI/ -  
[DIR]Programs/ -  
[DIR]Real-Time Memory Pool/ -  

+ + + diff --git a/progs/index.html b/progs/index.html new file mode 100644 index 0000000..a842a5a --- /dev/null +++ b/progs/index.html @@ -0,0 +1,159 @@ + + + + + Programs + + + + + + + +
+ + +
+ + + +
+

+ LV2 Programs is an LV2 Extension that allows a host to access plugin-side midi-mapped programs.
+ It is not the same as LV2 Presets, + which defines host-side presets where the plugin has no control or role whatsoever.
+

+ +

+ List of plugins that use this extension: +

+ + +

+ List of hosts that support this extension: +

+ +
+ + +

Index

+ + + +

Reference

+
+
+

Instance progs:Host

+
+

+TODO +

+
+ +
Typelv2:Feature
+
+
+ +
+

Instance progs:Interface

+
Programs Plugin Interface
+

+TODO +

+
+ +
Typelv2:ExtensionData
+
+
+ +
+

Instance progs:UIInterface

+
Programs UI Interface
+

+TODO +

+
+ +
Typelv2:ExtensionData
+
+
+ + +
+ + +

History

+
+
+
Version 1.0 (2015-07-03)
+
    +
  • First stable release.
  • +
+ +
+ + + + + + diff --git a/progs/manifest.ttl b/progs/manifest.ttl new file mode 100644 index 0000000..b9ff520 --- /dev/null +++ b/progs/manifest.ttl @@ -0,0 +1,8 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 0 ; + rdfs:seeAlso . diff --git a/progs/programs.doap.ttl b/progs/programs.doap.ttl new file mode 100644 index 0000000..b4b72b3 --- /dev/null +++ b/progs/programs.doap.ttl @@ -0,0 +1,25 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix rdfs: . + + + a doap:Project ; + rdfs:seeAlso <../kx-meta/meta.ttl> ; + doap:license ; + doap:name "Programs" ; + doap:homepage ; + doap:created "2015-07-03" ; + doap:shortdesc "LV2 extension for implementing plugin-side programs." ; + doap:developer ; + doap:maintainer ; + doap:release [ + doap:revision "1.0" ; + doap:created "2015-07-03" ; + doap:file-release ; + dcs:changeset [ + dcs:item [ + rdfs:label "First stable release." + ] + ] + ] . diff --git a/progs/programs.h b/progs/programs.h new file mode 100644 index 0000000..0e2997d --- /dev/null +++ b/progs/programs.h @@ -0,0 +1,174 @@ +/* + LV2 Programs Extension + Copyright 2012 Filipe Coelho + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/** + @file lv2_programs.h + C header for the LV2 programs extension . +*/ + +#ifndef LV2_PROGRAMS_H +#define LV2_PROGRAMS_H + +#include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include "lv2/lv2plug.in/ns/extensions/ui/ui.h" + +#define LV2_PROGRAMS_URI "http://kxstudio.sf.net/ns/lv2ext/programs" +#define LV2_PROGRAMS_PREFIX LV2_PROGRAMS_URI "#" + +#define LV2_PROGRAMS__Host LV2_PROGRAMS_PREFIX "Host" +#define LV2_PROGRAMS__Interface LV2_PROGRAMS_PREFIX "Interface" +#define LV2_PROGRAMS__UIInterface LV2_PROGRAMS_PREFIX "UIInterface" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* LV2_Programs_Handle; + +typedef struct _LV2_Program_Descriptor { + + /** Bank number for this program. Note that this extension does not + support MIDI-style separation of bank LSB and MSB values. There is + no restriction on the set of available banks: the numbers do not + need to be contiguous, there does not need to be a bank 0, etc. */ + uint32_t bank; + + /** Program number (unique within its bank) for this program. There is + no restriction on the set of available programs: the numbers do not + need to be contiguous, there does not need to be a program 0, etc. */ + uint32_t program; + + /** Name of the program. */ + const char * name; + +} LV2_Program_Descriptor; + +/** + Programs extension, plugin data. + + When the plugin's extension_data is called with argument LV2_PROGRAMS__Interface, + the plugin MUST return an LV2_Programs_Instance structure, which remains valid + for the lifetime of the plugin. +*/ +typedef struct _LV2_Programs_Interface { + /** + * get_program() + * + * This member is a function pointer that provides a description + * of a program (named preset sound) available on this plugin. + * + * The index argument is an index into the plugin's list of + * programs, not a program number as represented by the Program + * field of the LV2_Program_Descriptor. (This distinction is + * needed to support plugins that use non-contiguous program or + * bank numbers.) + * + * This function returns a LV2_Program_Descriptor pointer that is + * guaranteed to be valid only until the next call to get_program + * or deactivate, on the same plugin instance. This function must + * return NULL if passed an index argument out of range, so that + * the host can use it to query the number of programs as well as + * their properties. + */ + const LV2_Program_Descriptor *(*get_program)(LV2_Handle handle, + uint32_t index); + + /** + * select_program() + * + * This member is a function pointer that selects a new program + * for this plugin. The program change should take effect + * immediately at the start of the next run() call. (This + * means that a host providing the capability of changing programs + * between any two notes on a track must vary the block size so as + * to place the program change at the right place. A host that + * wanted to avoid this would probably just instantiate a plugin + * for each program.) + * + * Plugins should ignore a select_program() call with an invalid + * bank or program. + * + * A plugin is not required to select any particular default + * program on activate(): it's the host's duty to set a program + * explicitly. + * + * A plugin is permitted to re-write the values of its input + * control ports when select_program is called. The host should + * re-read the input control port values and update its own + * records appropriately. (This is the only circumstance in which + * a LV2 plugin is allowed to modify its own control-input ports.) + */ + void (*select_program)(LV2_Handle handle, + uint32_t bank, + uint32_t program); + +} LV2_Programs_Interface; + +/** + Programs extension, UI data. + + When the UI's extension_data is called with argument LV2_PROGRAMS__UIInterface, + the UI MUST return an LV2_Programs_UI_Interface structure, which remains valid + for the lifetime of the UI. +*/ +typedef struct _LV2_Programs_UI_Interface { + /** + * select_program() + * + * This is exactly the same as select_program in LV2_Programs_Instance, + * but this struct relates to the UI instead of the plugin. + * + * When called, UIs should update their state to match the selected program. + */ + void (*select_program)(LV2UI_Handle handle, + uint32_t bank, + uint32_t program); + +} LV2_Programs_UI_Interface; + +/** + Feature data for LV2_PROGRAMS__Host. +*/ +typedef struct _LV2_Programs_Host { + /** + * Opaque host data. + */ + LV2_Programs_Handle handle; + + /** + * program_changed() + * + * Tell the host to reload a plugin's program. + * Parameter handle MUST be the 'handle' member of this struct. + * Parameter index is program index to change. + * When index is -1, host should reload all the programs. + * + * The plugin MUST NEVER call this function on a RT context or during run(). + * + * NOTE: This call is to inform the host about a program's bank, program or name change. + * It DOES NOT change the current selected program. + */ + void (*program_changed)(LV2_Programs_Handle handle, + int32_t index); + +} LV2_Programs_Host; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* LV2_PROGRAMS_H */ diff --git a/progs/programs.ttl b/progs/programs.ttl new file mode 100644 index 0000000..75f094a --- /dev/null +++ b/progs/programs.ttl @@ -0,0 +1,62 @@ +@prefix lv2: . +@prefix owl: . +@prefix progs: . +@prefix rdf: . +@prefix rdfs: . +@prefix ui: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:seeAlso , + , + <../kx-meta/meta.ttl> ; + lv2:documentation """ +

+ LV2 Programs is an LV2 Extension that allows a host to access plugin-side midi-mapped programs.
+ It is not the same as LV2 Presets, + which defines host-side presets where the plugin has no control or role whatsoever.
+

+ +

+ List of plugins that use this extension: +

+ + +

+ List of hosts that support this extension: +

+ +""" . + +progs:Host + a lv2:Feature ; + lv2:documentation """ +

+TODO +

+""" . + +progs:Interface + a lv2:ExtensionData ; + rdfs:label "Programs Plugin Interface" ; + lv2:documentation """ +

+TODO +

+""" . + +progs:UIInterface + a lv2:ExtensionData ; + rdfs:label "Programs UI Interface" ; + lv2:documentation """ +

+TODO +

+""" . diff --git a/rtmpl/index.html b/rtmpl/index.html new file mode 100644 index 0000000..1aa32d1 --- /dev/null +++ b/rtmpl/index.html @@ -0,0 +1,124 @@ + + + + + External UI + + + + + + + +
+ + +
+ + + +
+

+ LV2 realtime safe memory pool extension definition. +

+ +

+ List of hosts that support this extension: +

+ +
+ + +

Index

+ + + +

Reference

+
+
+

Instance rtmpl:Pool

+
+

+TODO +

+
+ +
Typelv2:Feature
+
+
+ + +
+ + +

History

+
+
+
Version 1.0 (2015-07-03)
+
    +
  • First stable release.
  • +
+ +
+ + + + + + diff --git a/rtmpl/manifest.ttl b/rtmpl/manifest.ttl new file mode 100644 index 0000000..c9d5cf0 --- /dev/null +++ b/rtmpl/manifest.ttl @@ -0,0 +1,8 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 0 ; + rdfs:seeAlso . diff --git a/rtmpl/rtmempool.doap.ttl b/rtmpl/rtmempool.doap.ttl new file mode 100644 index 0000000..bc8ea42 --- /dev/null +++ b/rtmpl/rtmempool.doap.ttl @@ -0,0 +1,25 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix rdfs: . + + + a doap:Project ; + rdfs:seeAlso <../kx-meta/meta.ttl> ; + doap:license ; + doap:name "External UI" ; + doap:homepage ; + doap:created "2015-07-03" ; + doap:shortdesc "LV2 extension that provides a realtime safe memory pool for plugins." ; + doap:developer ; + doap:maintainer ; + doap:release [ + doap:revision "1.0" ; + doap:created "2015-07-03" ; + doap:file-release ; + dcs:changeset [ + dcs:item [ + rdfs:label "First stable release." + ] + ] + ] . diff --git a/rtmpl/rtmempool.h b/rtmpl/rtmempool.h new file mode 100644 index 0000000..5a06644 --- /dev/null +++ b/rtmpl/rtmempool.h @@ -0,0 +1,105 @@ +/* + LV2 realtime safe memory pool extension definition + This work is in public domain. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + If you have questions, contact Filipe Coelho (aka falkTX) + or ask in #lad channel, FreeNode IRC network. +*/ + +/** + * @file lv2_rtmempool.h + * C header for the LV2 rtmempool extension . + * + */ + +#ifndef LV2_RTMEMPOOL_H +#define LV2_RTMEMPOOL_H + +#define LV2_RTSAFE_MEMORY_POOL_URI "http://kxstudio.sf.net/ns/lv2ext/rtmempool" +#define LV2_RTSAFE_MEMORY_POOL_PREFIX LV2_RTSAFE_MEMORY_POOL_URI "#" + +#define LV2_RTSAFE_MEMORY_POOL__Pool LV2_RTSAFE_MEMORY_POOL_URI "Pool" + +/** max size of memory pool name, in chars, including terminating zero char */ +#define LV2_RTSAFE_MEMORY_POOL_NAME_MAX 128 + +#ifdef __cplusplus +extern "C" { +#else +#include +#endif + +/** + * Opaque data to host data for LV2_RtMemPool_Pool. + */ +typedef void* LV2_RtMemPool_Handle; + +/** + * On instantiation, host must supply LV2_RTSAFE_MEMORY_POOL__Pool feature. + * LV2_Feature::data must be pointer to LV2_RtMemPool_Pool. + */ +typedef struct _LV2_RtMemPool_Pool { + /** + * This function is called when plugin wants to create memory pool + * + * may/will sleep + * + * @param pool_name pool name, for debug purposes, max RTSAFE_MEMORY_POOL_NAME_MAX chars, including terminating zero char. May be NULL. + * @param data_size memory chunk size + * @param min_preallocated min chunks preallocated + * @param max_preallocated max chunks preallocated + * + * @return Success status, true if successful + */ + bool (*create)(LV2_RtMemPool_Handle * handle_ptr, + const char * pool_name, + size_t data_size, + size_t min_preallocated, + size_t max_preallocated); + + /** + * This function is called when plugin wants to destroy previously created memory pool + * + * may/will sleep + */ + void (*destroy)(LV2_RtMemPool_Handle handle); + + /** + * This function is called when plugin wants to allocate memory in context where sleeping is not allowed + * + * will not sleep + * + * @return Pointer to allocated memory or NULL if memory no memory is available + */ + void * (*allocate_atomic)(LV2_RtMemPool_Handle handle); + + /** + * This function is called when plugin wants to allocate memory in context where sleeping is allowed + * + * may/will sleep + * + * @return Pointer to allocated memory or NULL if memory no memory is available (should not happen under normal conditions) + */ + void * (*allocate_sleepy)(LV2_RtMemPool_Handle handle); + + /** + * This function is called when plugin wants to deallocate previously allocated memory + * + * will not sleep + * + * @param memory_ptr pointer to previously allocated memory chunk + */ + void (*deallocate)(LV2_RtMemPool_Handle handle, + void * memory_ptr); + +} LV2_RtMemPool_Pool; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* LV2_RTMEMPOOL_H */ diff --git a/rtmpl/rtmempool.ttl b/rtmpl/rtmempool.ttl new file mode 100644 index 0000000..ccc1ed1 --- /dev/null +++ b/rtmpl/rtmempool.ttl @@ -0,0 +1,33 @@ +@prefix lv2: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix rtmpl: . +@prefix ui: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:seeAlso , + , + <../kx-meta/meta.ttl> ; + lv2:documentation """ +

+ LV2 realtime safe memory pool extension definition. +

+ +

+ List of hosts that support this extension: +

+ +""" . + +rtmpl:Pool + a lv2:Feature ; + lv2:documentation """ +

+TODO +

+""" .