JackEngineControl.h

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     float fCPULoad;
00041         bool fSyncMode;
00042         bool fTemporary;
00043     jack_time_t fPeriodUsecs;
00044     jack_time_t fTimeOutUsecs;
00045         bool fRealTime;
00046         int32_t fPriority;
00047     UInt64 fPeriod;
00048     UInt64 fComputation;
00049     UInt64 fConstraint;
00050     JackFrameTimer fFrameTimer;
00051     JackTransportEngine fTransport;
00052     bool fVerbose;
00053         
00054         JackEngineControl(bool sync, bool temporary, long timeout, bool rt, long priority, bool verbose)
00055                                         :fSyncMode(sync), 
00056                                         fTemporary(temporary),
00057                                         fTimeOutUsecs(timeout * 1000), 
00058                                         fRealTime(rt), 
00059                                         fPriority(priority), 
00060                                         fVerbose(verbose)
00061         {}
00062         
00063         void InitFrameTime()
00064         {
00065                 fFrameTimer.InitFrameTime();
00066         }
00067         
00068         void IncFrameTime(jack_time_t callback_usecs)
00069         {
00070                 fFrameTimer.IncFrameTime(fBufferSize, callback_usecs, fPeriodUsecs);
00071         }
00072         
00073         void ResetFrameTime(jack_time_t callback_usecs)
00074         {
00075                 fFrameTimer.ResetFrameTime(fSampleRate, callback_usecs, fPeriodUsecs);
00076         }
00077         
00078         void ReadFrameTime(JackTimer* timer)
00079         {
00080                 fFrameTimer.ReadFrameTime(timer);
00081         }
00082         
00083         void CycleBegin(jack_time_t callback_usecs)
00084         {
00085                 fTransport.CycleBegin(fSampleRate, callback_usecs);
00086         }
00087 
00088         void CycleEnd(JackClientInterface** table)
00089         {
00090                 fTransport.CycleEnd(table, fSampleRate, fBufferSize);
00091         }
00092 
00093 };
00094 
00095 
00096 } // end of namespace
00097 
00098 
00099 #endif

Generated on Mon Oct 15 17:11:14 2007 for Jackdmp by  doxygen 1.5.1