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.

95 lines
3.1KB

  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. // int jack_release_timebase (jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
  22. // int jack_set_sync_callback (jack_client_t *client,
  23. // JackSyncCallback sync_callback,
  24. // void *arg) JACK_OPTIONAL_WEAK_EXPORT;
  25. // int jack_set_sync_timeout (jack_client_t *client,
  26. // jack_time_t timeout) JACK_OPTIONAL_WEAK_EXPORT;
  27. // int jack_set_timebase_callback (jack_client_t *client,
  28. // int conditional,
  29. // JackTimebaseCallback timebase_callback,
  30. // void *arg) JACK_OPTIONAL_WEAK_EXPORT;
  31. CARLA_EXPORT
  32. int jack_transport_locate(jack_client_t*, jack_nframes_t)
  33. {
  34. carla_stdout("CarlaJackClient :: %s", __FUNCTION__);
  35. return 1;
  36. }
  37. CARLA_EXPORT
  38. jack_transport_state_t jack_transport_query(const jack_client_t* client, jack_position_t* pos)
  39. {
  40. carla_debug("CarlaJackClient :: %s", __FUNCTION__);
  41. CarlaJackClient* const jclient = (CarlaJackClient*)client;
  42. CARLA_SAFE_ASSERT_RETURN(jclient != nullptr, JackTransportStopped);
  43. const JackClientState& jstate(jclient->fState);
  44. CARLA_SAFE_ASSERT_RETURN(jstate.activated, JackTransportStopped);
  45. if (pos != nullptr)
  46. std::memcpy(pos, &jstate.position, sizeof(jack_position_t));
  47. return jstate.playing ? JackTransportRolling : JackTransportStopped;
  48. }
  49. // jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
  50. CARLA_EXPORT
  51. int jack_transport_reposition(jack_client_t*, const jack_position_t*)
  52. {
  53. carla_stdout("CarlaJackClient :: %s", __FUNCTION__);
  54. return EINVAL;
  55. }
  56. CARLA_EXPORT
  57. void jack_transport_start(jack_client_t*)
  58. {
  59. carla_stdout("CarlaJackClient :: %s", __FUNCTION__);
  60. }
  61. CARLA_EXPORT
  62. void jack_transport_stop (jack_client_t*)
  63. {
  64. carla_stdout("CarlaJackClient :: %s", __FUNCTION__);
  65. }
  66. // void jack_get_transport_info (jack_client_t *client,
  67. // jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_EXPORT;
  68. // void jack_set_transport_info (jack_client_t *client,
  69. // jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_EXPORT;
  70. // --------------------------------------------------------------------------------------------------------------------