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.

105 lines
2.7KB

  1. /*
  2. * ANSI pedantic test for the Carla Backend & Host API
  3. * Copyright (C) 2013-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. #include "CarlaBackend.h"
  18. #include "CarlaHost.h"
  19. #include <stdio.h>
  20. #ifdef __cplusplus
  21. CARLA_BACKEND_USE_NAMESPACE
  22. # ifdef CARLA_PROPER_CPP11_SUPPORT
  23. # undef NULL
  24. # define NULL nullptr
  25. # endif
  26. #endif
  27. int main(int argc, char* argv[])
  28. {
  29. ParameterData a;
  30. ParameterRanges b;
  31. MidiProgramData c;
  32. CustomData d;
  33. EngineDriverDeviceInfo e;
  34. CarlaPluginInfo f;
  35. CarlaNativePluginInfo g;
  36. CarlaPortCountInfo h;
  37. CarlaParameterInfo i;
  38. CarlaScalePointInfo j;
  39. CarlaTransportInfo k;
  40. #if 0
  41. const char* licenseText;
  42. const char* fileExtensions;
  43. uint l, count;
  44. licenseText = carla_get_complete_license_text();
  45. printf("LICENSE:\n%s\n", licenseText);
  46. fileExtensions = carla_get_supported_file_extensions();
  47. printf("FILE EXTENSIONS:\n%s\n", fileExtensions);
  48. count = carla_get_engine_driver_count();
  49. printf("DRIVER COUNT: %i\n", count);
  50. for (l=0; l < count; ++l)
  51. {
  52. const char* driverName;
  53. const char* const* driverDeviceNames;
  54. uint m, count2;
  55. driverName = carla_get_engine_driver_name(l);
  56. driverDeviceNames = carla_get_engine_driver_device_names(l);
  57. printf("DRIVER %i/%i: \"%s\" : DEVICES:\n", l+1, count, driverName);
  58. count2 = 0;
  59. while (driverDeviceNames[count2] != NULL)
  60. ++count2;
  61. for (m = 0; m < count2; ++m)
  62. {
  63. printf("DRIVER DEVICE %i/%i: \"%s\"\n", m+1, count2, driverDeviceNames[m]);
  64. }
  65. }
  66. if (carla_engine_init("JACK", "ansi-test"))
  67. {
  68. if (carla_add_plugin(BINARY_NATIVE, PLUGIN_INTERNAL, NULL, NULL, "audiofile", 0, NULL))
  69. {
  70. carla_set_custom_data(0, CUSTOM_DATA_TYPE_STRING, "file", "/home/falktx/Music/test.wav");
  71. carla_transport_play();
  72. }
  73. else
  74. {
  75. printf("%s\n", carla_get_last_error());
  76. }
  77. carla_engine_close();
  78. }
  79. #endif
  80. return 0;
  81. /* unused */
  82. (void)argc;
  83. (void)argv;
  84. (void)a; (void)b; (void)c; (void)d; (void)e;
  85. (void)f; (void)g; (void)h; (void)i; (void)j; (void)k;
  86. }