jack1 codebase
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.

64 lines
2.0KB

  1. /*
  2. JACK transport engine -- runs in the server process.
  3. Copyright (C) 2001-2003 Paul Davis
  4. Copyright (C) 2003 Jack O'Quin
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU Lesser General Public License as published by
  7. the Free Software Foundation; either version 2.1 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  16. */
  17. #include <config.h>
  18. #include <jack/internal.h>
  19. #include <jack/engine.h>
  20. #include "transengine.h"
  21. int
  22. jack_set_sample_rate (jack_engine_t *engine, jack_nframes_t nframes)
  23. {
  24. engine->control->current_time.frame_rate = nframes;
  25. engine->control->pending_time.frame_rate = nframes;
  26. return 0;
  27. }
  28. void
  29. jack_transport_cycle_end (jack_engine_t *engine)
  30. {
  31. jack_control_t *ctl = engine->control;
  32. /* maintain the current_time.usecs and frame_rate values,
  33. since clients are not permitted to set them.
  34. */
  35. ctl->pending_time.usecs = ctl->current_time.usecs;
  36. ctl->pending_time.frame_rate = ctl->current_time.frame_rate;
  37. ctl->current_time = ctl->pending_time;
  38. }
  39. void
  40. jack_transport_reset (jack_engine_t *engine)
  41. {
  42. #ifdef OLD_TRANSPORT
  43. jack_control_t *ctl = engine->control;
  44. ctl->current_time.frame = 0;
  45. ctl->pending_time.frame = 0;
  46. ctl->current_time.transport_state = JackTransportStopped;
  47. ctl->pending_time.transport_state = JackTransportStopped;
  48. ctl->current_time.valid =
  49. JackTransportState|JackTransportPosition;
  50. ctl->pending_time.valid =
  51. JackTransportState|JackTransportPosition;
  52. #endif /* OLD_TRANSPORT */
  53. }