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.

92 lines
2.9KB

  1. /*
  2. * Carla JACK API for external applications
  3. * Copyright (C) 2016-2022 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 "libjack.hpp"
  18. // ---------------------------------------------------------------------------------------------------------------------
  19. CARLA_PLUGIN_EXPORT
  20. int jack_carla_interposed_action(uint, uint, void*)
  21. {
  22. static bool printWarning = true;
  23. if (printWarning)
  24. {
  25. printWarning = false;
  26. carla_stderr2("Non-exported jack_carla_interposed_action called, this should not happen!!");
  27. carla_stderr("Printing some info:");
  28. #ifdef CARLA_OS_MAC
  29. carla_stderr("\tDYLD_LIBRARY_PATH: '%s'", std::getenv("DYLD_LIBRARY_PATH"));
  30. carla_stderr("\tDYLD_INSERT_LIBRARIES: '%s'", std::getenv("DYLD_INSERT_LIBRARIES"));
  31. carla_stderr("\tDYLD_FORCE_FLAT_NAMESPACE: '%s'", std::getenv("DYLD_FORCE_FLAT_NAMESPACE"));
  32. #else
  33. carla_stderr("\tLD_LIBRARY_PATH: '%s'", std::getenv("LD_LIBRARY_PATH"));
  34. carla_stderr("\tLD_PRELOAD: '%s'", std::getenv("LD_PRELOAD"));
  35. #endif
  36. std::fflush(stderr);
  37. }
  38. // ::kill(::getpid(), SIGKILL);
  39. return 1337;
  40. }
  41. // --------------------------------------------------------------------------------------------------------------------
  42. CARLA_PLUGIN_EXPORT
  43. void jack_get_version(int* major_ptr, int* minor_ptr, int* micro_ptr, int* proto_ptr)
  44. {
  45. carla_debug("%s(%p, %p, %p, %p)", __FUNCTION__, major_ptr, minor_ptr, micro_ptr, proto_ptr);
  46. *major_ptr = 1;
  47. *minor_ptr = 9;
  48. *micro_ptr = 12;
  49. *proto_ptr = 9; // FIXME
  50. }
  51. CARLA_PLUGIN_EXPORT
  52. const char* jack_get_version_string(void)
  53. {
  54. carla_debug("%s()", __FUNCTION__);
  55. static const char* const kVersionStr = "1.9.12";
  56. return kVersionStr;
  57. }
  58. // --------------------------------------------------------------------------------------------------------------------
  59. CARLA_PLUGIN_EXPORT
  60. int jack_is_realtime(jack_client_t* client)
  61. {
  62. carla_debug("%s(%p)", __FUNCTION__, client);
  63. return 1;
  64. // unused
  65. (void)client;
  66. }
  67. // --------------------------------------------------------------------------------------------------------------------
  68. CARLA_PLUGIN_EXPORT
  69. void jack_free(void* ptr)
  70. {
  71. carla_debug("%s(%p)", __FUNCTION__, ptr);
  72. std::free(ptr);
  73. }
  74. // --------------------------------------------------------------------------------------------------------------------