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.

scalepoint.c 1.4KB

12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. Copyright 2007-2014 David Robillard <http://drobilla.net>
  3. Permission to use, copy, modify, and/or distribute this software for any
  4. purpose with or without fee is hereby granted, provided that the above
  5. copyright notice and this permission notice appear in all copies.
  6. THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  7. WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  8. MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  9. ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  10. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  11. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  12. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  13. */
  14. #include "lilv_internal.h"
  15. /** Ownership of value and label is taken */
  16. LilvScalePoint*
  17. lilv_scale_point_new(LilvNode* value, LilvNode* label)
  18. {
  19. LilvScalePoint* point = (LilvScalePoint*)malloc(sizeof(LilvScalePoint));
  20. point->value = value;
  21. point->label = label;
  22. return point;
  23. }
  24. void
  25. lilv_scale_point_free(LilvScalePoint* point)
  26. {
  27. if (point) {
  28. lilv_node_free(point->value);
  29. lilv_node_free(point->label);
  30. free(point);
  31. }
  32. }
  33. LILV_API const LilvNode*
  34. lilv_scale_point_get_value(const LilvScalePoint* p)
  35. {
  36. return p->value;
  37. }
  38. LILV_API const LilvNode*
  39. lilv_scale_point_get_label(const LilvScalePoint* p)
  40. {
  41. return p->label;
  42. }