00001 /* 00002 Copyright (C) 2003 Paul Davis 00003 Copyright (C) 2004-2006 Grame 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 00019 */ 00020 00021 #ifndef __JackEngineControl__ 00022 #define __JackEngineControl__ 00023 00024 #include "JackShmMem.h" 00025 #include "JackFrameTimer.h" 00026 #include "JackTransportEngine.h" 00027 #include "types.h" 00028 00029 namespace Jack 00030 { 00031 00036 struct JackEngineControl : public JackShmMem 00037 { 00038 jack_nframes_t fBufferSize; 00039 jack_nframes_t fSampleRate; 00040 bool fRealTime; 00041 int32_t fPriority; 00042 float fCPULoad; 00043 jack_time_t fPeriodUsecs; 00044 jack_time_t fTimeOutUsecs; 00045 UInt64 fPeriod; 00046 UInt64 fComputation; 00047 UInt64 fConstraint; 00048 JackFrameTimer fFrameTimer; 00049 JackTransportEngine fTransport; 00050 bool fSyncMode; 00051 bool fVerbose; 00052 00053 void InitFrameTime() 00054 { 00055 fFrameTimer.InitFrameTime(); 00056 } 00057 00058 void IncFrameTime(jack_time_t callback_usecs) 00059 { 00060 fFrameTimer.IncFrameTime(fBufferSize, callback_usecs, fPeriodUsecs); 00061 } 00062 00063 void ResetFrameTime(jack_time_t callback_usecs) 00064 { 00065 fFrameTimer.ResetFrameTime(fSampleRate, callback_usecs, fPeriodUsecs); 00066 } 00067 00068 void ReadFrameTime(JackTimer* timer) 00069 { 00070 fFrameTimer.ReadFrameTime(timer); 00071 } 00072 00073 void CycleBegin(jack_time_t callback_usecs) 00074 { 00075 fTransport.CycleBegin(fSampleRate, callback_usecs); 00076 } 00077 00078 void CycleEnd(JackClientInterface** table) 00079 { 00080 fTransport.CycleEnd(table, fSampleRate, fBufferSize); 00081 } 00082 00083 }; 00084 00085 00086 } // end of namespace 00087 00088 00089 #endif