diff options
author | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2008-03-05 16:39:51 +0000 |
---|---|---|
committer | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2008-03-05 16:39:51 +0000 |
commit | ecb8da58c772c54baa9a07cbb8db99110f27fdd1 (patch) | |
tree | 9dfc5323eca91995e528884ca0575824559d787f /common/JackLibClient.cpp | |
parent | e463543e555dd95f2b1685efd59fc629fff10d52 (diff) | |
download | jack2-ecb8da58c772c54baa9a07cbb8db99110f27fdd1.tar.gz |
Beautifull code
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1909 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'common/JackLibClient.cpp')
-rw-r--r-- | common/JackLibClient.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/common/JackLibClient.cpp b/common/JackLibClient.cpp index 3ec3160c..22e2f261 100644 --- a/common/JackLibClient.cpp +++ b/common/JackLibClient.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 2004-2008 Grame +Copyright (C) 2004-2008 Grame This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,18 +29,18 @@ namespace Jack // Used for external C API (JackAPI.cpp) JackGraphManager* GetGraphManager() { - if (JackLibGlobals::fGlobals) - return JackLibGlobals::fGlobals->fGraphManager; - else - return NULL; + if (JackLibGlobals::fGlobals) + return JackLibGlobals::fGlobals->fGraphManager; + else + return NULL; } JackEngineControl* GetEngineControl() { - if (JackLibGlobals::fGlobals) - return JackLibGlobals::fGlobals->fEngineControl; - else - return NULL; + if (JackLibGlobals::fGlobals) + return JackLibGlobals::fGlobals->fEngineControl; + else + return NULL; } JackSynchro** GetSynchroTable() @@ -68,11 +68,11 @@ int JackLibClient::Open(const char* server_name, const char* name, jack_options_ { int shared_engine, shared_client, shared_graph, result; JackLog("JackLibClient::Open %s\n", name); - - snprintf(fServerName, sizeof(fServerName), server_name); - + + snprintf(fServerName, sizeof(fServerName), server_name); + // Open server/client channel - char name_res[JACK_CLIENT_NAME_SIZE]; + char name_res[JACK_CLIENT_NAME_SIZE]; if (fChannel->Open(server_name, name, name_res, this, options, status) < 0) { jack_error("Cannot connect to the server"); goto error; @@ -93,28 +93,28 @@ int JackLibClient::Open(const char* server_name, const char* name, jack_options_ try { // Map shared memory segments - JackLibGlobals::fGlobals->fEngineControl.SetShmIndex(shared_engine, fServerName); + JackLibGlobals::fGlobals->fEngineControl.SetShmIndex(shared_engine, fServerName); JackLibGlobals::fGlobals->fGraphManager.SetShmIndex(shared_graph, fServerName); fClientControl.SetShmIndex(shared_client, fServerName); jack_verbose = GetEngineControl()->fVerbose; - } catch (int n) { + } catch (int n) { jack_error("Map shared memory segments exception %d", n); goto error; } SetupDriverSync(false); -/* TODO : solve WIN32 thread Kill issue -#ifndef WIN32 - // Connect shared synchro : the synchro must be usable in I/O mode when several clients live in the same process - if (!fSynchroTable[fClientControl->fRefNum]->Connect(name)) { - jack_error("Cannot ConnectSemaphore %s client", name); - goto error; - } -#endif -*/ - // Connect shared synchro : the synchro must be usable in I/O mode when several clients live in the same process - if (!fSynchroTable[fClientControl->fRefNum]->Connect(name_res, fServerName)) { + /* TODO : solve WIN32 thread Kill issue + #ifndef WIN32 + // Connect shared synchro : the synchro must be usable in I/O mode when several clients live in the same process + if (!fSynchroTable[fClientControl->fRefNum]->Connect(name)) { + jack_error("Cannot ConnectSemaphore %s client", name); + goto error; + } + #endif + */ + // Connect shared synchro : the synchro must be usable in I/O mode when several clients live in the same process + if (!fSynchroTable[fClientControl->fRefNum]->Connect(name_res, fServerName)) { jack_error("Cannot ConnectSemaphore %s client", name_res); goto error; } @@ -140,7 +140,7 @@ int JackLibClient::ClientNotifyImp(int refnum, const char* name, int notify, int case kAddClient: JackLog("JackClient::AddClient name = %s, ref = %ld \n", name, refnum); - // the synchro must be usable in I/O mode when several clients live in the same process + // the synchro must be usable in I/O mode when several clients live in the same process res = fSynchroTable[refnum]->Connect(name, fServerName) ? 0 : -1; break; @@ -149,7 +149,7 @@ int JackLibClient::ClientNotifyImp(int refnum, const char* name, int notify, int if (strcmp(GetClientControl()->fName, name) != 0) res = fSynchroTable[refnum]->Disconnect() ? 0 : -1; break; - } + } return res; } |