jack2 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.

88 lines
2.0KB

  1. /*
  2. Copyright (C) 2003 Paul Davis
  3. Copyright (C) 2004-2008 Grame
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. #ifndef __JackEngineTiming__
  17. #define __JackEngineTiming__
  18. #include "types.h"
  19. #include "JackTypes.h"
  20. #include "JackConstants.h"
  21. namespace Jack
  22. {
  23. #define TIME_POINTS 1000
  24. /*!
  25. \brief Timing stucture for a client.
  26. */
  27. struct JackTimingMeasureClient
  28. {
  29. int fRefNum;
  30. jack_time_t fSignaledAt;
  31. jack_time_t fAwakeAt;
  32. jack_time_t fFinishedAt;
  33. jack_client_state_t fStatus;
  34. };
  35. /*!
  36. \brief Timing stucture for a table of clients.
  37. */
  38. struct JackTimingMeasure
  39. {
  40. unsigned int fAudioCycle;
  41. jack_time_t fEngineTime;
  42. JackTimingMeasureClient fClientTable[CLIENT_NUM];
  43. };
  44. /*!
  45. \brief Client timing.
  46. */
  47. class JackClientInterface;
  48. class JackGraphManager;
  49. class JackEngineTiming
  50. {
  51. private:
  52. JackTimingMeasure fMeasure[TIME_POINTS];
  53. unsigned int fAudioCycle;
  54. jack_time_t fPrevCycleTime;
  55. jack_time_t fCurCycleTime;
  56. public:
  57. JackEngineTiming():fAudioCycle(0),fPrevCycleTime(0),fCurCycleTime(0)
  58. {}
  59. ~JackEngineTiming()
  60. {}
  61. void GetTimeMeasure(JackClientInterface** table, JackGraphManager* manager, jack_time_t cur_cycle_begin, jack_time_t prev_cycle_end);
  62. void ClearTimeMeasures();
  63. };
  64. } // end of namespace
  65. #endif