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.

65 lines
1.8KB

  1. /*
  2. * Carla JACK API for external applications
  3. * Copyright (C) 2016-2017 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. CARLA_BACKEND_USE_NAMESPACE
  19. // --------------------------------------------------------------------------------------------------------------------
  20. CARLA_EXPORT
  21. int jack_set_freewheel(jack_client_t*, int)
  22. {
  23. return ENOSYS;
  24. }
  25. CARLA_EXPORT
  26. int jack_set_buffer_size(jack_client_t* client, jack_nframes_t bufferSize)
  27. {
  28. JackClientState* const jclient = (JackClientState*)client;
  29. CARLA_SAFE_ASSERT_RETURN(jclient != nullptr, 0);
  30. return (jclient->server.bufferSize == bufferSize) ? 0 : 1;
  31. }
  32. CARLA_EXPORT
  33. jack_nframes_t jack_get_sample_rate(jack_client_t* client)
  34. {
  35. JackClientState* const jclient = (JackClientState*)client;
  36. CARLA_SAFE_ASSERT_RETURN(jclient != nullptr, 0);
  37. return jclient->server.sampleRate;
  38. }
  39. CARLA_EXPORT
  40. jack_nframes_t jack_get_buffer_size(jack_client_t* client)
  41. {
  42. JackClientState* const jclient = (JackClientState*)client;
  43. CARLA_SAFE_ASSERT_RETURN(jclient != nullptr, 0);
  44. return jclient->server.bufferSize;
  45. }
  46. CARLA_EXPORT
  47. float jack_cpu_load(jack_client_t*)
  48. {
  49. // TODO
  50. return 0.0f;
  51. }
  52. // --------------------------------------------------------------------------------------------------------------------