2 Copyright (C) 2001 Paul Davis
3 Copyright (C) 2004-2006 Grame
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #pragma warning (disable : 4786)
25 #include "JackFreewheelDriver.h"
26 #include "JackEngineControl.h"
27 #include "JackEngine.h"
32 int JackFreewheelDriver::Process()
35 JackLog("JackFreewheelDriver::Process master %lld\n", fEngineControl
->fTimeOutUsecs
);
36 fLastWaitUst
= GetMicroSeconds();
37 fEngine
->Process(fLastWaitUst
);
38 fGraphManager
->ResumeRefNum(fClientControl
, fSynchroTable
); // Signal all clients
39 if (fGraphManager
->SuspendRefNum(fClientControl
, fSynchroTable
, fEngineControl
->fTimeOutUsecs
* 20) < 0) // Wait for all clients to finish
40 jack_error("JackFreewheelDriver::ProcessSync SuspendRefNum error");
42 fGraphManager
->ResumeRefNum(fClientControl
, fSynchroTable
); // Signal all clients
43 if (fEngineControl
->fSyncMode
) {
44 if (fGraphManager
->SuspendRefNum(fClientControl
, fSynchroTable
, fEngineControl
->fTimeOutUsecs
) < 0) {
45 jack_error("JackFreewheelDriver::ProcessSync SuspendRefNum error");