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.

libjack_base.cpp 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Carla JACK API for external applications
  3. * Copyright (C) 2016-2020 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_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. carla_stderr("\tLD_LIBRARY_PATH: '%s'", std::getenv("LD_LIBRARY_PATH"));
  29. carla_stderr("\tLD_PRELOAD: '%s'", std::getenv("LD_PRELOAD"));
  30. std::fflush(stderr);
  31. }
  32. // ::kill(::getpid(), SIGKILL);
  33. return 1337;
  34. }
  35. // --------------------------------------------------------------------------------------------------------------------
  36. CARLA_EXPORT
  37. void jack_get_version(int* major_ptr, int* minor_ptr, int* micro_ptr, int* proto_ptr)
  38. {
  39. carla_debug("%s(%p, %p, %p, %p)", __FUNCTION__, major_ptr, minor_ptr, micro_ptr, proto_ptr);
  40. *major_ptr = 1;
  41. *minor_ptr = 9;
  42. *micro_ptr = 12;
  43. *proto_ptr = 9; // FIXME
  44. }
  45. CARLA_EXPORT
  46. const char* jack_get_version_string(void)
  47. {
  48. carla_debug("%s()", __FUNCTION__);
  49. static const char* const kVersionStr = "1.9.12";
  50. return kVersionStr;
  51. }
  52. // --------------------------------------------------------------------------------------------------------------------
  53. CARLA_EXPORT
  54. int jack_is_realtime(jack_client_t* client)
  55. {
  56. carla_debug("%s(%p)", __FUNCTION__, client);
  57. return 1;
  58. // unused
  59. (void)client;
  60. }
  61. // --------------------------------------------------------------------------------------------------------------------
  62. CARLA_EXPORT
  63. void jack_free(void* ptr)
  64. {
  65. carla_debug("%s(%p)", __FUNCTION__, ptr);
  66. std::free(ptr);
  67. }
  68. // --------------------------------------------------------------------------------------------------------------------