2 Copyright (C) 2004-2006 Grame
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (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 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __JackEngineTiming__
21 #define __JackEngineTiming__
24 #include "JackGraphManager.h"
29 #define TIME_POINTS 1000
30 #define JACK_ENGINE_ROLLING_COUNT 32
31 #define JACK_ENGINE_ROLLING_INTERVAL 1024
33 class JackClientInterface
;
34 struct JackEngineControl
;
37 \brief Timing stucture for a client.
40 struct JackTimingMeasureClient
43 jack_time_t fSignaledAt
;
45 jack_time_t fFinishedAt
;
46 jack_client_state_t fStatus
;
50 \brief Timing stucture for a table of clients.
53 struct JackTimingMeasure
56 jack_time_t fEngineTime
;
57 JackTimingMeasureClient fClientTable
[CLIENT_NUM
];
61 \brief Engine timing management.
64 class JackEngineTiming
68 JackClientInterface
** fClientTable
;
69 JackGraphManager
* fGraphManager
;
70 JackEngineControl
* fEngineControl
;
72 JackTimingMeasure fMeasure
[TIME_POINTS
];
73 jack_time_t fLastTime
;
75 jack_time_t fProcessTime
;
76 jack_time_t fLastProcessTime
;
77 jack_time_t fSpareUsecs
;
78 jack_time_t fMaxUsecs
;
81 jack_time_t fRollingClientUsecs
[JACK_ENGINE_ROLLING_COUNT
];
82 int fRollingClientUsecsCnt
;
83 int fRollingClientUsecsIndex
;
87 void GetTimeMeasure(jack_time_t callback_usecs
);
91 JackEngineTiming(JackClientInterface
** table
, JackGraphManager
* manager
, JackEngineControl
* control
);
92 virtual ~JackEngineTiming()
95 void UpdateTiming(jack_time_t callback_usecs
);
96 void ResetRollingUsecs();
98 void ClearTimeMeasures();
102 } // end of namespace