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.2KB

12 years ago
9 years ago
12 years ago
12 years ago
9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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"
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /**
  30. Dynamic manifest generator handle.
  31. This handle indicates a particular status of a dynamic manifest generator.
  32. The host MUST NOT attempt to interpret it and, unlikely LV2_Handle, it is
  33. NOT even valid to compare this to NULL. The dynamic manifest generator MAY
  34. use it to reference internal data.
  35. */
  36. typedef void * LV2_Dyn_Manifest_Handle;
  37. /**
  38. Generate the dynamic manifest.
  39. @param handle Pointer to an uninitialized dynamic manifest generator handle.
  40. @param features NULL terminated array of LV2_Feature structs which represent
  41. the features the host supports. The dynamic manifest generator may refuse to
  42. (re)generate the dynamic manifest if required features are not found here
  43. (however hosts SHOULD NOT use this as a discovery mechanism, instead of
  44. reading the static manifest file). This array must always exist; if a host
  45. has no features, it MUST pass a single element array containing NULL.
  46. @return 0 on success, otherwise a non-zero error code. The host SHOULD
  47. evaluate the result of the operation by examining the returned value and
  48. MUST NOT try to interpret the value of handle.
  49. */
  50. int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle * handle,
  51. const LV2_Feature *const * features);
  52. /**
  53. Fetch a "list" of subject URIs described in the dynamic manifest.
  54. The dynamic manifest generator has to fill the resource only with the needed
  55. triples to make the host aware of the "objects" it wants to expose. For
  56. example, if the plugin library exposes a regular LV2 plugin, it should
  57. output only a triple like the following:
  58. <http://www.example.com/plugin/uri> a lv2:Plugin .
  59. The objects that are elegible for exposure are those that would need to be
  60. represented by a subject node in a static manifest.
  61. @param handle Dynamic manifest generator handle.
  62. @param fp FILE * identifying the resource the host has to set up for the
  63. dynamic manifest generator. The host MUST pass a writable, empty resource to
  64. this function, and the dynamic manifest generator MUST ONLY perform write
  65. operations on it at the end of the stream (e.g., using only fprintf(),
  66. fwrite() and similar).
  67. @return 0 on success, otherwise a non-zero error code.
  68. */
  69. int lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle,
  70. FILE * fp);
  71. /**
  72. Function that fetches data related to a specific URI.
  73. The dynamic manifest generator has to fill the resource with data related to
  74. object represented by the given URI. For example, if the library exposes a
  75. regular LV2 plugin whose URI, as retrieved by the host using
  76. lv2_dyn_manifest_get_subjects() is http://www.example.com/plugin/uri, it
  77. should output something like:
  78. <pre>
  79. <http://www.example.com/plugin/uri>
  80. a lv2:Plugin ;
  81. doap:name "My Plugin" ;
  82. lv2:binary <mylib.so> ;
  83. etc:etc "..." .
  84. </pre>
  85. @param handle Dynamic manifest generator handle.
  86. @param fp FILE * identifying the resource the host has to set up for the
  87. dynamic manifest generator. The host MUST pass a writable resource to this
  88. function, and the dynamic manifest generator MUST ONLY perform write
  89. operations on it at the current position of the stream (e.g. using only
  90. fprintf(), fwrite() and similar).
  91. @param uri URI to get data about (in the "plain" form, i.e., absolute URI
  92. without Turtle prefixes).
  93. @return 0 on success, otherwise a non-zero error code.
  94. */
  95. int lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle,
  96. FILE * fp,
  97. const char * uri);
  98. /**
  99. Function that ends the operations on the dynamic manifest generator.
  100. This function SHOULD be used by the dynamic manifest generator to perform
  101. cleanup operations, etc.
  102. Once this function is called, referring to handle will cause undefined
  103. behavior.
  104. @param handle Dynamic manifest generator handle.
  105. */
  106. void lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle);
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110. #endif /* LV2_DYN_MANIFEST_H_INCLUDED */
  111. /**
  112. @}
  113. */