Better isolation of server and clients system resources to allow starting the server...
[jack2.git] / common / JackEngineTiming.h
blob5c0a9b1891c6452b1215e8190c5ceda9793fc8eb
1 /*
2 Copyright (C) 2003 Paul Davis
3 Copyright (C) 2004-2008 Grame
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.
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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #ifndef __JackEngineTiming__
22 #define __JackEngineTiming__
24 #include "types.h"
25 #include "JackTypes.h"
26 #include "JackConstants.h"
28 namespace Jack
31 #define TIME_POINTS 1000
33 /*!
34 \brief Timing stucture for a client.
37 struct JackTimingMeasureClient
39 int fRefNum;
40 jack_time_t fSignaledAt;
41 jack_time_t fAwakeAt;
42 jack_time_t fFinishedAt;
43 jack_client_state_t fStatus;
46 /*!
47 \brief Timing stucture for a table of clients.
50 struct JackTimingMeasure
52 unsigned int fAudioCycle;
53 jack_time_t fEngineTime;
54 JackTimingMeasureClient fClientTable[CLIENT_NUM];
57 /*!
58 \brief Client timing.
61 class JackClientInterface;
62 class JackGraphManager;
64 class JackEngineTiming
67 private:
69 JackTimingMeasure fMeasure[TIME_POINTS];
70 unsigned int fAudioCycle;
71 jack_time_t fPrevCycleTime;
72 jack_time_t fCurCycleTime;
74 public:
76 JackEngineTiming():fAudioCycle(0),fPrevCycleTime(0),fCurCycleTime(0)
78 ~JackEngineTiming()
81 void GetTimeMeasure(JackClientInterface** table, JackGraphManager* manager, jack_time_t cur_cycle_begin, jack_time_t prev_cycle_end);
82 void ClearTimeMeasures();
85 } // end of namespace
87 #endif