Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dynmanifest.h 5.4KB

12 years ago
9 years ago
12 years ago
12 years ago
12 years ago
9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /*
  2. Dynamic manifest specification for LV2
  3. Copyright 2008-2011 Stefano D'Angelo <zanga.mail@gmail.com>
  4. Permission to use, copy, modify, and/or distribute this software for any
  5. purpose with or without fee is hereby granted, provided that the above
  6. copyright notice and this permission notice appear in all copies.
  7. THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. /**
  16. @defgroup dynmanifest Dynamic Manifest
  17. Support for dynamic data generation, see
  18. <http://lv2plug.in/ns/ext/dynmanifest> for details.
  19. @{
  20. */
  21. #ifndef LV2_DYN_MANIFEST_H_INCLUDED
  22. #define LV2_DYN_MANIFEST_H_INCLUDED
  23. #include <stdio.h>
  24. #include "lv2.h"
  25. #define LV2_DYN_MANIFEST_URI "http://lv2plug.in/ns/ext/dynmanifest" ///< http://lv2plug.in/ns/ext/dynmanifest
  26. #define LV2_DYN_MANIFEST_PREFIX LV2_DYN_MANIFEST_URI "#" ///< http://lv2plug.in/ns/ext/dynmanifest#
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /**
  31. Dynamic manifest generator handle.
  32. This handle indicates a particular status of a dynamic manifest generator.
  33. The host MUST NOT attempt to interpret it and, unlikely LV2_Handle, it is
  34. NOT even valid to compare this to NULL. The dynamic manifest generator MAY
  35. use it to reference internal data.
  36. */
  37. typedef void * LV2_Dyn_Manifest_Handle;
  38. /**
  39. Generate the dynamic manifest.
  40. @param handle Pointer to an uninitialized dynamic manifest generator handle.
  41. @param features NULL terminated array of LV2_Feature structs which represent
  42. the features the host supports. The dynamic manifest generator may refuse to
  43. (re)generate the dynamic manifest if required features are not found here
  44. (however hosts SHOULD NOT use this as a discovery mechanism, instead of
  45. reading the static manifest file). This array must always exist; if a host
  46. has no features, it MUST pass a single element array containing NULL.
  47. @return 0 on success, otherwise a non-zero error code. The host SHOULD
  48. evaluate the result of the operation by examining the returned value and
  49. MUST NOT try to interpret the value of handle.
  50. */
  51. int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle * handle,
  52. const LV2_Feature *const * features);
  53. /**
  54. Fetch a "list" of subject URIs described in the dynamic manifest.
  55. The dynamic manifest generator has to fill the resource only with the needed
  56. triples to make the host aware of the "objects" it wants to expose. For
  57. example, if the plugin library exposes a regular LV2 plugin, it should
  58. output only a triple like the following:
  59. <http://www.example.com/plugin/uri> a lv2:Plugin .
  60. The objects that are elegible for exposure are those that would need to be
  61. represented by a subject node in a static manifest.
  62. @param handle Dynamic manifest generator handle.
  63. @param fp FILE * identifying the resource the host has to set up for the
  64. dynamic manifest generator. The host MUST pass a writable, empty resource to
  65. this function, and the dynamic manifest generator MUST ONLY perform write
  66. operations on it at the end of the stream (e.g., using only fprintf(),
  67. fwrite() and similar).
  68. @return 0 on success, otherwise a non-zero error code.
  69. */
  70. int lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle,
  71. FILE * fp);
  72. /**
  73. Function that fetches data related to a specific URI.
  74. The dynamic manifest generator has to fill the resource with data related to
  75. object represented by the given URI. For example, if the library exposes a
  76. regular LV2 plugin whose URI, as retrieved by the host using
  77. lv2_dyn_manifest_get_subjects() is http://www.example.com/plugin/uri, it
  78. should output something like:
  79. <pre>
  80. <http://www.example.com/plugin/uri>
  81. a lv2:Plugin ;
  82. doap:name "My Plugin" ;
  83. lv2:binary <mylib.so> ;
  84. etc:etc "..." .
  85. </pre>
  86. @param handle Dynamic manifest generator handle.
  87. @param fp FILE * identifying the resource the host has to set up for the
  88. dynamic manifest generator. The host MUST pass a writable resource to this
  89. function, and the dynamic manifest generator MUST ONLY perform write
  90. operations on it at the current position of the stream (e.g. using only
  91. fprintf(), fwrite() and similar).
  92. @param uri URI to get data about (in the "plain" form, i.e., absolute URI
  93. without Turtle prefixes).
  94. @return 0 on success, otherwise a non-zero error code.
  95. */
  96. int lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle,
  97. FILE * fp,
  98. const char * uri);
  99. /**
  100. Function that ends the operations on the dynamic manifest generator.
  101. This function SHOULD be used by the dynamic manifest generator to perform
  102. cleanup operations, etc.
  103. Once this function is called, referring to handle will cause undefined
  104. behavior.
  105. @param handle Dynamic manifest generator handle.
  106. */
  107. void lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle);
  108. #ifdef __cplusplus
  109. }
  110. #endif
  111. #endif /* LV2_DYN_MANIFEST_H_INCLUDED */
  112. /**
  113. @}
  114. */