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.

56 lines
2.2KB

  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. //jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT;
  22. CARLA_EXPORT
  23. jack_nframes_t jack_frame_time(const jack_client_t* client)
  24. {
  25. carla_debug("CarlaJackClient :: %s", __FUNCTION__);
  26. CarlaJackClient* const jclient = (CarlaJackClient*)client;
  27. CARLA_SAFE_ASSERT_RETURN(jclient != nullptr, 0);
  28. const JackClientState& jstate(jclient->fState);
  29. CARLA_SAFE_ASSERT_RETURN(jstate.activated, 0);
  30. return jstate.position.usecs;
  31. }
  32. // jack_nframes_t jack_last_frame_time (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
  33. // int jack_get_cycle_times(const jack_client_t *client,
  34. // jack_nframes_t *current_frames,
  35. // jack_time_t *current_usecs,
  36. // jack_time_t *next_usecs,
  37. // float *period_usecs) JACK_OPTIONAL_WEAK_EXPORT;
  38. // --------------------------------------------------------------------------------------------------------------------
  39. // jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t) JACK_OPTIONAL_WEAK_EXPORT;
  40. // jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t) JACK_OPTIONAL_WEAK_EXPORT;
  41. // jack_time_t jack_get_time(void) JACK_OPTIONAL_WEAK_EXPORT;
  42. // --------------------------------------------------------------------------------------------------------------------