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.

63 lines
1.3KB

  1. %module lilv
  2. %typedef unsigned uint32_t;
  3. %{
  4. #define SWIG_FILE_WITH_INIT
  5. #include "lilv/lilv.h"
  6. #include "lilv/lilvmm.hpp"
  7. %}
  8. %include "numpy.i"
  9. %init %{
  10. import_array();
  11. %}
  12. %apply (float* INPLACE_ARRAY1) {(void* data_location)}
  13. %feature("compactdefaultargs") %{
  14. lilv_plugin_get_num_ports_of_class;
  15. get_num_ports_of_class;
  16. %}
  17. %varargs(3, LilvNode* node = NULL) lilv_plugin_get_num_ports_of_class;
  18. %varargs(3, LilvNode* node = NULL) get_num_ports_of_class;
  19. %typemap(in, numinputs=0) LilvNode *node3 ""; // Make sure it's NULL terminated
  20. %include "lilv/lilv.h"
  21. %include "lilv/lilvmm.hpp"
  22. namespace Lilv {
  23. %extend Plugins {
  24. %pythoncode %{
  25. def __iter__(self):
  26. class Iterator(object):
  27. def __init__(self, plugins):
  28. self.plugins = plugins
  29. self.iter = plugins.begin()
  30. def next(self):
  31. self.iter = self.plugins.next(self.iter)
  32. if not self.plugins.is_end(self.iter):
  33. return self.plugins.get(self.iter)
  34. else:
  35. raise StopIteration
  36. return Iterator(self)
  37. def get_by_uri(self, *args):
  38. """get_by_uri(self, LilvNode uri) -> PluginClass"""
  39. ret = _lilv.Plugins_get_by_uri(self, *args)
  40. if ret.me is None:
  41. return None
  42. else:
  43. return ret
  44. %}
  45. };
  46. %extend Node {
  47. %pythoncode %{
  48. def __str__(self):
  49. return self.get_turtle_token()
  50. %}
  51. };
  52. } /* namespace Lilv */