21 #ifndef __JackEngineControl__ 22 #define __JackEngineControl__ 24 #include "JackShmMem.h" 25 #include "JackFrameTimer.h" 26 #include "JackTransportEngine.h" 27 #include "JackConstants.h" 32 #include "JackEngineProfiling.h" 38 class JackClientInterface;
39 class JackGraphManager;
41 #define JACK_ENGINE_ROLLING_COUNT 32 42 #define JACK_ENGINE_ROLLING_INTERVAL 1024 52 jack_nframes_t fBufferSize;
53 jack_nframes_t fSampleRate;
56 jack_time_t fPeriodUsecs;
57 jack_time_t fTimeOutUsecs;
58 float fMaxDelayedUsecs;
59 float fXrunDelayedUsecs;
65 int fMaxClientPriority;
66 char fServerName[JACK_SERVER_NAME_SIZE+1];
68 jack_timer_type_t fClockSource;
73 jack_time_t fPrevCycleTime;
74 jack_time_t fCurCycleTime;
75 jack_time_t fSpareUsecs;
76 jack_time_t fMaxUsecs;
77 jack_time_t fRollingClientUsecs[JACK_ENGINE_ROLLING_COUNT];
78 unsigned int fRollingClientUsecsCnt;
79 int fRollingClientUsecsIndex;
95 JackEngineControl(
bool sync,
bool temporary,
long timeout,
bool rt,
long priority,
bool verbose, jack_timer_type_t clock,
const char* server_name)
99 fPeriodUsecs = jack_time_t(1000000.f / fSampleRate * fBufferSize);
101 fTemporary = temporary;
102 fTimeOut = (timeout > 0);
103 fTimeOutUsecs = timeout * 1000;
105 fSavedRealTime =
false;
106 fServerPriority = priority;
109 fClientPriority = (rt) ? priority - 3 : 0;
111 fClientPriority = (rt) ? priority - 5 : 0;
113 fMaxClientPriority = (rt) ? priority - 1 : 0;
120 strncpy(fServerName, server_name,
sizeof(fServerName));
125 fMaxDelayedUsecs = 0.f;
126 fXrunDelayedUsecs = 0.f;
127 fClockSource = clock;
136 fPeriodUsecs = jack_time_t(1000000.f / fSampleRate * fBufferSize);
137 if (!(fTimeOut && fTimeOutUsecs > 2 * fPeriodUsecs)) {
138 fTimeOutUsecs = 2 * fPeriodUsecs;
143 void CycleIncTime(jack_time_t callback_usecs)
146 fFrameTimer.IncFrameTime(fBufferSize, callback_usecs, fPeriodUsecs);
151 fTransport.CycleBegin(fSampleRate, cur_cycle_begin);
152 CalcCPULoad(table, manager, cur_cycle_begin, prev_cycle_end);
154 fProfiler.Profile(table, manager, fPeriodUsecs, cur_cycle_begin, prev_cycle_end);
160 fTransport.CycleEnd(table, fSampleRate, fBufferSize);
166 fFrameTimer.InitFrameTime();
169 void ResetFrameTime(jack_time_t callback_usecs)
171 fFrameTimer.ResetFrameTime(callback_usecs);
176 fFrameTimer.ReadFrameTime(timer);
180 void NotifyXRun(jack_time_t callback_usecs,
float delayed_usecs);
183 fMaxDelayedUsecs = 0.f;
188 void ResetRollingUsecs();
190 } POST_PACKED_STRUCTURE;
A structure used for time management.
Graph manager: contains the connection manager and the port array.
A class using the JackAtomicState to manage jack time.
Engine control in shared memory.
The base class for shared memory management.