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.

ansi-pedantic-test.c 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * ANSI pedantic test for the Carla Backend API
  3. * Copyright (C) 2013 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. const char* licenseText;
  41. const char* fileExtensions;
  42. uint l, count;
  43. licenseText = carla_get_complete_license_text();
  44. printf("LICENSE:\n%s\n", licenseText);
  45. fileExtensions = carla_get_supported_file_extensions();
  46. printf("FILE EXTENSIONS:\n%s\n", fileExtensions);
  47. count = carla_get_engine_driver_count();
  48. printf("DRIVER COUNT: %i\n", count);
  49. for (l=0; l < count; ++l)
  50. {
  51. const char* driverName;
  52. const char* const* driverDeviceNames;
  53. uint m, count2;
  54. driverName = carla_get_engine_driver_name(l);
  55. driverDeviceNames = carla_get_engine_driver_device_names(l);
  56. printf("DRIVER %i/%i: \"%s\" : DEVICES:\n", l+1, count, driverName);
  57. count2 = 0;
  58. while (driverDeviceNames[count2] != NULL)
  59. ++count2;
  60. for (m = 0; m < count2; ++m)
  61. {
  62. printf("DRIVER DEVICE %i/%i: \"%s\"\n", m+1, count2, driverDeviceNames[m]);
  63. }
  64. }
  65. if (carla_engine_init("JACK", "ansi-test"))
  66. {
  67. if (carla_add_plugin(BINARY_NATIVE, PLUGIN_INTERNAL, NULL, NULL, "audiofile", NULL))
  68. {
  69. carla_set_custom_data(0, CUSTOM_DATA_TYPE_STRING, "file", "/home/falktx/Music/test.wav");
  70. carla_transport_play();
  71. }
  72. else
  73. {
  74. printf("%s\n", carla_get_last_error());
  75. }
  76. carla_engine_close();
  77. }
  78. return 0;
  79. /* unused */
  80. (void)argc;
  81. (void)argv;
  82. (void)a; (void)b; (void)c; (void)d; (void)e;
  83. (void)f; (void)g; (void)h; (void)i; (void)j; (void)k;
  84. }