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.

RDF.cpp 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*
  2. * Carla LADSPA/LV2_RDF Tests
  3. * Copyright (C) 2014 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #ifdef NDEBUG
  18. # error Build this file with debug ON please
  19. #endif
  20. #include "ladspa_rdf.hpp"
  21. #include "lv2_rdf.hpp"
  22. #include "CarlaUtils.hpp"
  23. // -----------------------------------------------------------------------
  24. // main
  25. int main()
  26. {
  27. // ladspa
  28. {
  29. LADSPA_RDF_ScalePoint scalePoint1, scalePoint2;
  30. scalePoint2.Label = carla_strdup("");
  31. LADSPA_RDF_Port port1, port2, port3;
  32. port2.Label = carla_strdup("");
  33. port3.Label = carla_strdup("");
  34. port3.ScalePoints = new LADSPA_RDF_ScalePoint[2];
  35. assert(port3.ScalePoints[0].Label == nullptr);
  36. port3.ScalePoints[0].Label = carla_strdup("");
  37. port3.ScalePoints[1].Label = carla_strdup("");
  38. LADSPA_RDF_Descriptor desc1, desc2, desc3;
  39. desc2.Title = carla_strdup("");
  40. desc3.Title = carla_strdup("");
  41. desc2.Creator = carla_strdup("");
  42. desc3.Creator = carla_strdup("");
  43. desc3.Ports = new LADSPA_RDF_Port[1];
  44. assert(desc3.Ports[0].Label == nullptr);
  45. desc3.Ports[0].Label = carla_strdup("");
  46. desc3.Ports[0].ScalePoints = new LADSPA_RDF_ScalePoint[1];
  47. desc3.Ports[0].ScalePoints[0].Label = carla_strdup("");
  48. }
  49. // lv2
  50. {
  51. LV2_RDF_PortMidiMap portMidiMap;
  52. LV2_RDF_PortPoints portPoints;
  53. LV2_RDF_PortUnit portUnit1, portUnit2;
  54. assert(portUnit1.Name == nullptr);
  55. portUnit2.Name = carla_strdup("");
  56. portUnit2.Render = carla_strdup("");
  57. portUnit2.Symbol = carla_strdup("");
  58. LV2_RDF_PortScalePoint portScalePoint1, portScalePoint2;
  59. assert(portScalePoint1.Label == nullptr);
  60. portScalePoint2.Label = carla_strdup("");
  61. LV2_RDF_Port port1, port2, port3;
  62. assert(port1.Name == nullptr);
  63. port2.Name = carla_strdup("");
  64. port3.Name = carla_strdup("");
  65. port2.Symbol = carla_strdup("");
  66. port3.Symbol = carla_strdup("");
  67. port3.Unit.Name = carla_strdup("");
  68. port3.Unit.Render = carla_strdup("");
  69. port3.Unit.Symbol = carla_strdup("");
  70. port3.ScalePoints = new LV2_RDF_PortScalePoint[2];
  71. assert(port3.ScalePoints[0].Label == nullptr);
  72. port3.ScalePoints[0].Label = carla_strdup("");
  73. port3.ScalePoints[1].Label = carla_strdup("");
  74. LV2_RDF_Preset preset1, preset2;
  75. assert(preset1.Label == nullptr);
  76. preset2.URI = carla_strdup("");
  77. preset2.Label = carla_strdup("");
  78. LV2_RDF_Feature feat1, feat2;
  79. assert(feat1.URI == nullptr);
  80. feat2.URI = carla_strdup("");
  81. LV2_RDF_UI ui1, ui2, ui3;
  82. assert(ui1.Binary == nullptr);
  83. ui2.URI = carla_strdup("");
  84. ui3.URI = carla_strdup("");
  85. ui2.Binary = carla_strdup("");
  86. ui3.Binary = carla_strdup("");
  87. ui2.Bundle = carla_strdup("");
  88. ui3.Bundle = carla_strdup("");
  89. ui3.Features = new LV2_RDF_Feature[1];
  90. assert(ui3.Features[0].URI == nullptr);
  91. ui3.Features[0].URI = carla_strdup("");
  92. ui3.Extensions = new LV2_URI[3];
  93. ui3.Extensions[0] = carla_strdup("");
  94. ui3.Extensions[1] = nullptr;
  95. ui3.Extensions[2] = carla_strdup("");
  96. ui3.ExtensionCount = 3;
  97. LV2_RDF_Descriptor desc1, desc2, desc3;
  98. assert(desc1.URI == nullptr);
  99. desc2.URI = carla_strdup("");
  100. desc3.URI = carla_strdup("");
  101. desc2.Name = carla_strdup("");
  102. desc3.Name = carla_strdup("");
  103. desc2.Author = carla_strdup("");
  104. desc3.Author = carla_strdup("");
  105. desc2.License = carla_strdup("");
  106. desc3.License = carla_strdup("");
  107. desc2.Binary = carla_strdup("");
  108. desc3.Binary = carla_strdup("");
  109. desc2.Bundle = carla_strdup("");
  110. desc3.Bundle = carla_strdup("");
  111. desc3.Ports = new LV2_RDF_Port[1];
  112. assert(desc3.Ports[0].Name == nullptr);
  113. desc3.Ports[0].Name = carla_strdup("");
  114. desc3.Ports[0].Symbol = carla_strdup("");
  115. desc3.Ports[0].Unit.Name = carla_strdup("");
  116. desc3.Ports[0].Unit.Render = carla_strdup("");
  117. desc3.Ports[0].Unit.Symbol = carla_strdup("");
  118. desc3.Ports[0].ScalePoints = new LV2_RDF_PortScalePoint[1];
  119. assert(desc3.Ports[0].ScalePoints[0].Label == nullptr);
  120. desc3.Ports[0].ScalePoints[0].Label = carla_strdup("");
  121. desc3.Presets = new LV2_RDF_Preset[1];
  122. assert(desc3.Presets[0].URI == nullptr);
  123. desc3.Presets[0].URI = carla_strdup("");
  124. desc3.Presets[0].Label = carla_strdup("");
  125. desc3.Features = new LV2_RDF_Feature[1];
  126. assert(desc3.Features[0].URI == nullptr);
  127. desc3.Features[0].URI = carla_strdup("");
  128. desc3.Extensions = new LV2_URI[3];
  129. desc3.Extensions[0] = carla_strdup("");
  130. desc3.Extensions[1] = nullptr;
  131. desc3.Extensions[2] = carla_strdup("");
  132. desc3.ExtensionCount = 3;
  133. desc3.UIs = new LV2_RDF_UI[1];
  134. assert(desc3.UIs[0].URI == nullptr);
  135. desc3.UIs[0].URI = carla_strdup("");
  136. desc3.UIs[0].Binary = carla_strdup("");
  137. desc3.UIs[0].Bundle = carla_strdup("");
  138. desc3.UIs[0].Features = new LV2_RDF_Feature[1];
  139. assert(desc3.UIs[0].Features[0].URI == nullptr);
  140. desc3.UIs[0].Features[0].URI = carla_strdup("");
  141. desc3.UIs[0].Extensions = new LV2_URI[3];
  142. desc3.UIs[0].Extensions[0] = carla_strdup("");
  143. desc3.UIs[0].Extensions[1] = nullptr;
  144. desc3.UIs[0].Extensions[2] = carla_strdup("");
  145. desc3.UIs[0].ExtensionCount = 3;
  146. }
  147. return 0;
  148. }
  149. // -----------------------------------------------------------------------