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_server-control.cpp 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. // need to include this first
  18. #include "libjack.hpp"
  19. CARLA_BACKEND_USE_NAMESPACE
  20. // --------------------------------------------------------------------------------------------------------------------
  21. CARLA_EXPORT
  22. int jack_set_freewheel(jack_client_t*, int)
  23. {
  24. return ENOSYS;
  25. }
  26. CARLA_EXPORT
  27. int jack_set_buffer_size(jack_client_t* client, jack_nframes_t bufferSize)
  28. {
  29. JackClientState* const jclient = (JackClientState*)client;
  30. CARLA_SAFE_ASSERT_RETURN(jclient != nullptr, 0);
  31. return (jclient->server.bufferSize == bufferSize) ? 0 : 1;
  32. }
  33. CARLA_EXPORT
  34. jack_nframes_t jack_get_sample_rate(jack_client_t* client)
  35. {
  36. JackClientState* const jclient = (JackClientState*)client;
  37. CARLA_SAFE_ASSERT_RETURN(jclient != nullptr, 0);
  38. return jclient->server.sampleRate;
  39. }
  40. CARLA_EXPORT
  41. jack_nframes_t jack_get_buffer_size(jack_client_t* client)
  42. {
  43. JackClientState* const jclient = (JackClientState*)client;
  44. CARLA_SAFE_ASSERT_RETURN(jclient != nullptr, 0);
  45. return jclient->server.bufferSize;
  46. }
  47. CARLA_EXPORT
  48. float jack_cpu_load(jack_client_t*)
  49. {
  50. // TODO
  51. return 0.0f;
  52. }
  53. // --------------------------------------------------------------------------------------------------------------------