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 "JackInternalClient.h"
26 #include "JackEngine.h"
27 #include "JackServer.h"
28 #include "JackGraphManager.h"
29 #include "JackEngineControl.h"
30 #include "JackClientControl.h"
31 #include "JackInternalClientChannel.h"
37 JackGraphManager
* JackInternalClient::fGraphManager
= NULL
;
38 JackEngineControl
* JackInternalClient::fEngineControl
= NULL
;
40 // Used for external C API (JackAPI.cpp)
41 JackGraphManager
* GetGraphManager()
43 return JackServer::fInstance
->GetGraphManager();
46 JackEngineControl
* GetEngineControl()
48 return JackServer::fInstance
->GetEngineControl();
51 JackSynchro
** GetSynchroTable()
53 return JackServer::fInstance
->GetSynchroTable();
56 JackInternalClient::JackInternalClient(JackServer
* server
, JackSynchro
** table
): JackClient(table
)
58 fClientControl
= new JackClientControl();
59 fChannel
= new JackInternalClientChannel(server
);
62 JackInternalClient::~JackInternalClient()
64 delete fClientControl
;
68 int JackInternalClient::Open(const char* name
)
71 JackLog("JackInternalClient::Open name = %s\n", name
);
72 strcpy(fClientControl
->fName
, name
);
75 fChannel
->ClientOpen(name
, &fClientControl
->fRefNum
, &fEngineControl
, &fGraphManager
, this, &result
);
77 jack_error("Cannot open client name = %s", name
);
81 SetupDriverSync(false);
90 JackGraphManager
* JackInternalClient::GetGraphManager() const
92 assert(fGraphManager
);
96 JackEngineControl
* JackInternalClient::GetEngineControl() const
98 assert(fEngineControl
);
99 return fEngineControl
;
102 JackClientControl
* JackInternalClient::GetClientControl() const
104 return fClientControl
;
107 } // end of namespace