git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4684 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.9.5
@@ -36,6 +36,10 @@ John Emmas | |||||
Jackdmp changes log | Jackdmp changes log | ||||
--------------------------- | --------------------------- | ||||
2012-01-11 Stephane Letz <letz@grame.fr> | |||||
* Factorize code the server/client request. | |||||
2012-01-06 Stephane Letz <letz@grame.fr> | 2012-01-06 Stephane Letz <letz@grame.fr> | ||||
* Cleanup drivers and internals loading code. | * Cleanup drivers and internals loading code. | ||||
@@ -35,6 +35,36 @@ class JackGraphManager; | |||||
namespace detail | namespace detail | ||||
{ | { | ||||
class JackChannelTransactionInterface | |||||
{ | |||||
public: | |||||
JackChannelTransactionInterface() | |||||
{} | |||||
virtual ~JackChannelTransactionInterface() | |||||
{} | |||||
virtual int Read(void* data, int len) = 0; | |||||
virtual int Write(void* data, int len) = 0; | |||||
}; | |||||
class JackClientRequestInterface : public JackChannelTransactionInterface | |||||
{ | |||||
public: | |||||
JackClientRequestInterface() | |||||
{} | |||||
virtual ~JackClientRequestInterface() | |||||
{} | |||||
virtual int Connect(const char* dir, const char* name, int which) = 0; | |||||
virtual int Close() = 0; | |||||
}; | |||||
/*! | /*! | ||||
\brief Inter process channel for server/client bidirectionnal communication : request and (receiving) notifications. | \brief Inter process channel for server/client bidirectionnal communication : request and (receiving) notifications. | ||||
*/ | */ | ||||
@@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||||
#include "JackSynchro.h" | #include "JackSynchro.h" | ||||
#include "JackPlatformPlug.h" | #include "JackPlatformPlug.h" | ||||
#include "JackChannel.h" | #include "JackChannel.h" | ||||
#include "JackRequest.h" | |||||
#include "varargs.h" | #include "varargs.h" | ||||
#include <list> | #include <list> | ||||
@@ -932,7 +932,7 @@ int JackEngine::PortRename(int refnum, jack_port_id_t port, const char* name) | |||||
// Session management | // Session management | ||||
//-------------------- | //-------------------- | ||||
void JackEngine::SessionNotify(int refnum, const char *target, jack_session_event_type_t type, const char *path, JackChannelTransaction *socket, JackSessionNotifyResult** result) | |||||
void JackEngine::SessionNotify(int refnum, const char *target, jack_session_event_type_t type, const char *path, detail::JackChannelTransactionInterface *socket, JackSessionNotifyResult** result) | |||||
{ | { | ||||
if (fSessionPendingReplies != 0) { | if (fSessionPendingReplies != 0) { | ||||
JackSessionNotifyResult res(-1); | JackSessionNotifyResult res(-1); | ||||
@@ -26,6 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
#include "JackMutex.h" | #include "JackMutex.h" | ||||
#include "JackTransportEngine.h" | #include "JackTransportEngine.h" | ||||
#include "JackPlatformPlug.h" | #include "JackPlatformPlug.h" | ||||
#include "JackRequest.h" | |||||
#include <map> | #include <map> | ||||
namespace Jack | namespace Jack | ||||
@@ -34,6 +35,7 @@ namespace Jack | |||||
class JackClientInterface; | class JackClientInterface; | ||||
struct JackEngineControl; | struct JackEngineControl; | ||||
class JackExternalClient; | class JackExternalClient; | ||||
class detail::JackChannelTransactionInterface; | |||||
/*! | /*! | ||||
\brief Engine description. | \brief Engine description. | ||||
@@ -54,7 +56,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||||
jack_time_t fLastSwitchUsecs; | jack_time_t fLastSwitchUsecs; | ||||
int fSessionPendingReplies; | int fSessionPendingReplies; | ||||
JackChannelTransaction* fSessionTransaction; | |||||
detail::JackChannelTransactionInterface* fSessionTransaction; | |||||
JackSessionNotifyResult* fSessionResult; | JackSessionNotifyResult* fSessionResult; | ||||
std::map<int,std::string> fReservationMap; | std::map<int,std::string> fReservationMap; | ||||
int fMaxUUID; | int fMaxUUID; | ||||
@@ -145,7 +147,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||||
void NotifyQuit(); | void NotifyQuit(); | ||||
// Session management | // Session management | ||||
void SessionNotify(int refnum, const char *target, jack_session_event_type_t type, const char *path, JackChannelTransaction *socket, JackSessionNotifyResult** result); | |||||
void SessionNotify(int refnum, const char *target, jack_session_event_type_t type, const char *path, detail::JackChannelTransactionInterface *socket, JackSessionNotifyResult** result); | |||||
void SessionReply(int refnum); | void SessionReply(int refnum); | ||||
void GetUUIDForClientName(const char *client_name, char *uuid_res, int *result); | void GetUUIDForClientName(const char *client_name, char *uuid_res, int *result); | ||||
@@ -0,0 +1,284 @@ | |||||
/* | |||||
Copyright (C) 2004-2008 Grame | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU Lesser General Public License as published by | |||||
the Free Software Foundation; either version 2.1 of the License, or | |||||
(at your option) any later version. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU Lesser General Public License for more details. | |||||
You should have received a copy of the GNU Lesser General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||||
*/ | |||||
#include "JackGenericClientChannel.h" | |||||
#include "JackClient.h" | |||||
#include "JackGlobals.h" | |||||
#include "JackError.h" | |||||
namespace Jack | |||||
{ | |||||
JackGenericClientChannel::JackGenericClientChannel():fClient(NULL) | |||||
{} | |||||
JackGenericClientChannel::~JackGenericClientChannel() | |||||
{} | |||||
int JackGenericClientChannel::ServerCheck(const char* server_name) | |||||
{ | |||||
jack_log("JackGenericClientChannel::ServerCheck = %s", server_name); | |||||
// Connect to server | |||||
if (fRequest->Connect(jack_server_dir, server_name, 0) < 0) { | |||||
jack_error("Cannot connect to server request channel"); | |||||
return -1; | |||||
} else { | |||||
return 0; | |||||
} | |||||
} | |||||
void JackGenericClientChannel::ServerSyncCall(JackRequest* req, JackResult* res, int* result) | |||||
{ | |||||
if (req->Write(fRequest) < 0) { | |||||
jack_error("Could not write request type = %ld", req->fType); | |||||
*result = -1; | |||||
return; | |||||
} | |||||
if (res->Read(fRequest) < 0) { | |||||
jack_error("Could not read result type = %ld", req->fType); | |||||
*result = -1; | |||||
return; | |||||
} | |||||
*result = res->fResult; | |||||
} | |||||
void JackGenericClientChannel::ServerAsyncCall(JackRequest* req, JackResult* res, int* result) | |||||
{ | |||||
if (req->Write(fRequest) < 0) { | |||||
jack_error("Could not write request type = %ld", req->fType); | |||||
*result = -1; | |||||
} else { | |||||
*result = 0; | |||||
} | |||||
} | |||||
void JackGenericClientChannel::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open) | |||||
{ | |||||
JackClientCheckRequest req(name, protocol, options, uuid, open); | |||||
JackClientCheckResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*status = res.fStatus; | |||||
strcpy(name_res, res.fName); | |||||
} | |||||
void JackGenericClientChannel::ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||||
{ | |||||
JackClientOpenRequest req(name, pid, uuid); | |||||
JackClientOpenResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*shared_engine = res.fSharedEngine; | |||||
*shared_client = res.fSharedClient; | |||||
*shared_graph = res.fSharedGraph; | |||||
} | |||||
void JackGenericClientChannel::ClientClose(int refnum, int* result) | |||||
{ | |||||
JackClientCloseRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::ClientActivate(int refnum, int is_real_time, int* result) | |||||
{ | |||||
JackActivateRequest req(refnum, is_real_time); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::ClientDeactivate(int refnum, int* result) | |||||
{ | |||||
JackDeactivateRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result) | |||||
{ | |||||
JackPortRegisterRequest req(refnum, name, type, flags, buffer_size); | |||||
JackPortRegisterResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*port_index = res.fPortIndex; | |||||
} | |||||
void JackGenericClientChannel::PortUnRegister(int refnum, jack_port_id_t port_index, int* result) | |||||
{ | |||||
JackPortUnRegisterRequest req(refnum, port_index); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::PortConnect(int refnum, const char* src, const char* dst, int* result) | |||||
{ | |||||
JackPortConnectNameRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::PortDisconnect(int refnum, const char* src, const char* dst, int* result) | |||||
{ | |||||
JackPortDisconnectNameRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result) | |||||
{ | |||||
JackPortConnectRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result) | |||||
{ | |||||
JackPortDisconnectRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::PortRename(int refnum, jack_port_id_t port, const char* name, int* result) | |||||
{ | |||||
JackPortRenameRequest req(refnum, port, name); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::SetBufferSize(jack_nframes_t buffer_size, int* result) | |||||
{ | |||||
JackSetBufferSizeRequest req(buffer_size); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::SetFreewheel(int onoff, int* result) | |||||
{ | |||||
JackSetFreeWheelRequest req(onoff); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::ComputeTotalLatencies(int* result) | |||||
{ | |||||
JackComputeTotalLatenciesRequest req; | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result) | |||||
{ | |||||
JackSessionNotifyRequest req(refnum, path, type, target); | |||||
JackSessionNotifyResult res; | |||||
int intresult; | |||||
ServerSyncCall(&req, &res, &intresult); | |||||
*result = res.GetCommands(); | |||||
} | |||||
void JackGenericClientChannel::SessionReply(int refnum, int* result) | |||||
{ | |||||
JackSessionReplyRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result) | |||||
{ | |||||
JackGetUUIDRequest req(client_name); | |||||
JackUUIDResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
strncpy(uuid_res, res.fUUID, JACK_UUID_SIZE); | |||||
} | |||||
void JackGenericClientChannel::GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result) | |||||
{ | |||||
JackGetClientNameRequest req(uuid); | |||||
JackClientNameResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
strncpy(name_res, res.fName, JACK_CLIENT_NAME_SIZE); | |||||
} | |||||
void JackGenericClientChannel::ClientHasSessionCallback(const char* client_name, int* result) | |||||
{ | |||||
JackClientHasSessionCallbackRequest req(client_name); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::ReserveClientName(int refnum, const char* client_name, const char* uuid, int* result) | |||||
{ | |||||
JackReserveNameRequest req(refnum, client_name, uuid); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::ReleaseTimebase(int refnum, int* result) | |||||
{ | |||||
JackReleaseTimebaseRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::SetTimebaseCallback(int refnum, int conditional, int* result) | |||||
{ | |||||
JackSetTimebaseCallbackRequest req(refnum, conditional); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackGenericClientChannel::GetInternalClientName(int refnum, int int_ref, char* name_res, int* result) | |||||
{ | |||||
JackGetInternalClientNameRequest req(refnum, int_ref); | |||||
JackGetInternalClientNameResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
strcpy(name_res, res.fName); | |||||
} | |||||
void JackGenericClientChannel::InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result) | |||||
{ | |||||
JackInternalClientHandleRequest req(refnum, client_name); | |||||
JackInternalClientHandleResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*int_ref = res.fIntRefNum; | |||||
*status = res.fStatus; | |||||
} | |||||
void JackGenericClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result) | |||||
{ | |||||
JackInternalClientLoadRequest req(refnum, client_name, so_name, objet_data, options, uuid); | |||||
JackInternalClientLoadResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*int_ref = res.fIntRefNum; | |||||
*status = res.fStatus; | |||||
} | |||||
void JackGenericClientChannel::InternalClientUnload(int refnum, int int_ref, int* status, int* result) | |||||
{ | |||||
JackInternalClientUnloadRequest req(refnum, int_ref); | |||||
JackInternalClientUnloadResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*status = res.fStatus; | |||||
} | |||||
} // end of namespace | |||||
@@ -0,0 +1,105 @@ | |||||
/* | |||||
Copyright (C) 2004-2008 Grame | |||||
This program is free software; you can redistribute it and/or modify | |||||
it under the terms of the GNU Lesser General Public License as published by | |||||
the Free Software Foundation; either version 2.1 of the License, or | |||||
(at your option) any later version. | |||||
This program is distributed in the hope that it will be useful, | |||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU Lesser General Public License for more details. | |||||
You should have received a copy of the GNU Lesser General Public License | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||||
*/ | |||||
#ifndef __JackGenericClientChannel__ | |||||
#define __JackGenericClientChannel__ | |||||
#include "JackChannel.h" | |||||
namespace Jack | |||||
{ | |||||
struct JackRequest; | |||||
struct JackResult; | |||||
class detail::JackClientRequestInterface; | |||||
/*! | |||||
\brief Generic JackClientChannel class. | |||||
*/ | |||||
class JackGenericClientChannel : public detail::JackClientChannelInterface | |||||
{ | |||||
protected: | |||||
detail::JackClientRequestInterface* fRequest; | |||||
JackClient* fClient; | |||||
void ServerSyncCall(JackRequest* req, JackResult* res, int* result); | |||||
void ServerAsyncCall(JackRequest* req, JackResult* res, int* result); | |||||
public: | |||||
JackGenericClientChannel(); | |||||
virtual ~JackGenericClientChannel(); | |||||
virtual int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) { return -1; } | |||||
virtual void Close() {} | |||||
virtual int Start() { return -1; } | |||||
virtual void Stop() {} | |||||
int ServerCheck(const char* server_name); | |||||
void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open); | |||||
void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||||
void ClientOpen(const char* name, int* ref, int uuid, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) | |||||
{} | |||||
void ClientClose(int refnum, int* result); | |||||
void ClientActivate(int refnum, int is_real_time, int* result); | |||||
void ClientDeactivate(int refnum, int* result); | |||||
void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result); | |||||
void PortUnRegister(int refnum, jack_port_id_t port_index, int* result); | |||||
void PortConnect(int refnum, const char* src, const char* dst, int* result); | |||||
void PortDisconnect(int refnum, const char* src, const char* dst, int* result); | |||||
void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result); | |||||
void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result); | |||||
void PortRename(int refnum, jack_port_id_t port, const char* name, int* result); | |||||
void SetBufferSize(jack_nframes_t buffer_size, int* result); | |||||
void SetFreewheel(int onoff, int* result); | |||||
void ComputeTotalLatencies(int* result); | |||||
void ReleaseTimebase(int refnum, int* result); | |||||
void SetTimebaseCallback(int refnum, int conditional, int* result); | |||||
void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result); | |||||
void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result); | |||||
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result); | |||||
void InternalClientUnload(int refnum, int int_ref, int* status, int* result); | |||||
// Session API | |||||
void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result); | |||||
void SessionReply(int refnum, int* result); | |||||
void GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result); | |||||
void GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result); | |||||
void ReserveClientName(int refnum, const char* client_name, const char *uuid, int* result); | |||||
void ClientHasSessionCallback(const char* client_name, int* result); | |||||
}; | |||||
} // end of namespace | |||||
#endif | |||||
@@ -325,7 +325,7 @@ class SERVER_EXPORT JackLockedEngine | |||||
CATCH_EXCEPTION | CATCH_EXCEPTION | ||||
} | } | ||||
void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char *path, JackChannelTransaction *socket, JackSessionNotifyResult** result) | |||||
void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char *path, detail::JackChannelTransactionInterface *socket, JackSessionNotifyResult** result) | |||||
{ | { | ||||
TRY_CALL | TRY_CALL | ||||
JackLock lock(&fEngine); | JackLock lock(&fEngine); | ||||
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||||
#include "JackConstants.h" | #include "JackConstants.h" | ||||
#include "JackPlatformPlug.h" | #include "JackPlatformPlug.h" | ||||
#include "JackChannel.h" | |||||
#include "JackTime.h" | #include "JackTime.h" | ||||
#include "types.h" | #include "types.h" | ||||
#include <string.h> | #include <string.h> | ||||
@@ -100,12 +101,12 @@ struct JackRequest | |||||
virtual ~JackRequest() | virtual ~JackRequest() | ||||
{} | {} | ||||
virtual int Read(JackChannelTransaction* trans) | |||||
virtual int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
return trans->Read(&fType, sizeof(RequestType)); | return trans->Read(&fType, sizeof(RequestType)); | ||||
} | } | ||||
virtual int Write(JackChannelTransaction* trans) | |||||
virtual int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
return trans->Write(&fType, sizeof(RequestType)); | return trans->Write(&fType, sizeof(RequestType)); | ||||
} | } | ||||
@@ -128,12 +129,12 @@ struct JackResult | |||||
virtual ~JackResult() | virtual ~JackResult() | ||||
{} | {} | ||||
virtual int Read(JackChannelTransaction* trans) | |||||
virtual int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
return trans->Read(&fResult, sizeof(int)); | return trans->Read(&fResult, sizeof(int)); | ||||
} | } | ||||
virtual int Write(JackChannelTransaction* trans) | |||||
virtual int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
return trans->Write(&fResult, sizeof(int)); | return trans->Write(&fResult, sizeof(int)); | ||||
} | } | ||||
@@ -161,7 +162,7 @@ struct JackClientCheckRequest : public JackRequest | |||||
snprintf(fName, sizeof(fName), "%s", name); | snprintf(fName, sizeof(fName), "%s", name); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fName, sizeof(fName))); | CheckRes(trans->Read(&fName, sizeof(fName))); | ||||
CheckRes(trans->Read(&fProtocol, sizeof(int))); | CheckRes(trans->Read(&fProtocol, sizeof(int))); | ||||
@@ -170,7 +171,7 @@ struct JackClientCheckRequest : public JackRequest | |||||
return trans->Read(&fOpen, sizeof(int)); | return trans->Read(&fOpen, sizeof(int)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fName, sizeof(fName))); | CheckRes(trans->Write(&fName, sizeof(fName))); | ||||
@@ -200,7 +201,7 @@ struct JackClientCheckResult : public JackResult | |||||
snprintf(fName, sizeof(fName), "%s", name); | snprintf(fName, sizeof(fName), "%s", name); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Read(trans)); | CheckRes(JackResult::Read(trans)); | ||||
CheckRes(trans->Read(&fName, sizeof(fName))); | CheckRes(trans->Read(&fName, sizeof(fName))); | ||||
@@ -208,7 +209,7 @@ struct JackClientCheckResult : public JackResult | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Write(trans)); | CheckRes(JackResult::Write(trans)); | ||||
CheckRes(trans->Write(&fName, sizeof(fName))); | CheckRes(trans->Write(&fName, sizeof(fName))); | ||||
@@ -238,14 +239,14 @@ struct JackClientOpenRequest : public JackRequest | |||||
fUUID = uuid; | fUUID = uuid; | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fPID, sizeof(int))); | CheckRes(trans->Read(&fPID, sizeof(int))); | ||||
CheckRes(trans->Read(&fUUID, sizeof(int))); | CheckRes(trans->Read(&fUUID, sizeof(int))); | ||||
return trans->Read(&fName, sizeof(fName)); | return trans->Read(&fName, sizeof(fName)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fPID, sizeof(int))); | CheckRes(trans->Write(&fPID, sizeof(int))); | ||||
@@ -273,7 +274,7 @@ struct JackClientOpenResult : public JackResult | |||||
: JackResult(result), fSharedEngine(index1), fSharedClient(index2), fSharedGraph(index3) | : JackResult(result), fSharedEngine(index1), fSharedClient(index2), fSharedGraph(index3) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Read(trans)); | CheckRes(JackResult::Read(trans)); | ||||
CheckRes(trans->Read(&fSharedEngine, sizeof(int))); | CheckRes(trans->Read(&fSharedEngine, sizeof(int))); | ||||
@@ -282,7 +283,7 @@ struct JackClientOpenResult : public JackResult | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Write(trans)); | CheckRes(JackResult::Write(trans)); | ||||
CheckRes(trans->Write(&fSharedEngine, sizeof(int))); | CheckRes(trans->Write(&fSharedEngine, sizeof(int))); | ||||
@@ -307,12 +308,12 @@ struct JackClientCloseRequest : public JackRequest | |||||
JackClientCloseRequest(int refnum): JackRequest(JackRequest::kClientClose), fRefNum(refnum) | JackClientCloseRequest(int refnum): JackRequest(JackRequest::kClientClose), fRefNum(refnum) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
return trans->Read(&fRefNum, sizeof(int)); | return trans->Read(&fRefNum, sizeof(int)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
return trans->Write(&fRefNum, sizeof(int)); | return trans->Write(&fRefNum, sizeof(int)); | ||||
@@ -336,13 +337,13 @@ struct JackActivateRequest : public JackRequest | |||||
: JackRequest(JackRequest::kActivateClient), fRefNum(refnum), fIsRealTime(is_real_time) | : JackRequest(JackRequest::kActivateClient), fRefNum(refnum), fIsRealTime(is_real_time) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
return trans->Read(&fIsRealTime, sizeof(int)); | return trans->Read(&fIsRealTime, sizeof(int)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -365,12 +366,12 @@ struct JackDeactivateRequest : public JackRequest | |||||
JackDeactivateRequest(int refnum): JackRequest(JackRequest::kDeactivateClient), fRefNum(refnum) | JackDeactivateRequest(int refnum): JackRequest(JackRequest::kDeactivateClient), fRefNum(refnum) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
return trans->Read(&fRefNum, sizeof(int)); | return trans->Read(&fRefNum, sizeof(int)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
return trans->Write(&fRefNum, sizeof(int)); | return trans->Write(&fRefNum, sizeof(int)); | ||||
@@ -400,7 +401,7 @@ struct JackPortRegisterRequest : public JackRequest | |||||
strcpy(fPortType, port_type); | strcpy(fPortType, port_type); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
CheckRes(trans->Read(&fName, sizeof(fName))); | CheckRes(trans->Read(&fName, sizeof(fName))); | ||||
@@ -410,7 +411,7 @@ struct JackPortRegisterRequest : public JackRequest | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -435,13 +436,13 @@ struct JackPortRegisterResult : public JackResult | |||||
JackPortRegisterResult(): JackResult(), fPortIndex(NO_PORT) | JackPortRegisterResult(): JackResult(), fPortIndex(NO_PORT) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Read(trans)); | CheckRes(JackResult::Read(trans)); | ||||
return trans->Read(&fPortIndex, sizeof(jack_port_id_t)); | return trans->Read(&fPortIndex, sizeof(jack_port_id_t)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Write(trans)); | CheckRes(JackResult::Write(trans)); | ||||
return trans->Write(&fPortIndex, sizeof(jack_port_id_t)); | return trans->Write(&fPortIndex, sizeof(jack_port_id_t)); | ||||
@@ -465,14 +466,14 @@ struct JackPortUnRegisterRequest : public JackRequest | |||||
: JackRequest(JackRequest::kUnRegisterPort), fRefNum(refnum), fPortIndex(index) | : JackRequest(JackRequest::kUnRegisterPort), fRefNum(refnum), fPortIndex(index) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
CheckRes(trans->Read(&fPortIndex, sizeof(jack_port_id_t))); | CheckRes(trans->Read(&fPortIndex, sizeof(jack_port_id_t))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -502,7 +503,7 @@ struct JackPortConnectNameRequest : public JackRequest | |||||
strcpy(fDst, dst_name); | strcpy(fDst, dst_name); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
CheckRes(trans->Read(&fSrc, sizeof(fSrc))); | CheckRes(trans->Read(&fSrc, sizeof(fSrc))); | ||||
@@ -511,7 +512,7 @@ struct JackPortConnectNameRequest : public JackRequest | |||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -542,7 +543,7 @@ struct JackPortDisconnectNameRequest : public JackRequest | |||||
strcpy(fDst, dst_name); | strcpy(fDst, dst_name); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
CheckRes(trans->Read(&fSrc, sizeof(fSrc))); | CheckRes(trans->Read(&fSrc, sizeof(fSrc))); | ||||
@@ -550,7 +551,7 @@ struct JackPortDisconnectNameRequest : public JackRequest | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -578,7 +579,7 @@ struct JackPortConnectRequest : public JackRequest | |||||
: JackRequest(JackRequest::kConnectPorts), fRefNum(refnum), fSrc(src), fDst(dst) | : JackRequest(JackRequest::kConnectPorts), fRefNum(refnum), fSrc(src), fDst(dst) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
CheckRes(trans->Read(&fSrc, sizeof(jack_port_id_t))); | CheckRes(trans->Read(&fSrc, sizeof(jack_port_id_t))); | ||||
@@ -586,7 +587,7 @@ struct JackPortConnectRequest : public JackRequest | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -614,7 +615,7 @@ struct JackPortDisconnectRequest : public JackRequest | |||||
: JackRequest(JackRequest::kDisconnectPorts), fRefNum(refnum), fSrc(src), fDst(dst) | : JackRequest(JackRequest::kDisconnectPorts), fRefNum(refnum), fSrc(src), fDst(dst) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
CheckRes(trans->Read(&fSrc, sizeof(jack_port_id_t))); | CheckRes(trans->Read(&fSrc, sizeof(jack_port_id_t))); | ||||
@@ -622,7 +623,7 @@ struct JackPortDisconnectRequest : public JackRequest | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -652,7 +653,7 @@ struct JackPortRenameRequest : public JackRequest | |||||
strcpy(fName, name); | strcpy(fName, name); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
CheckRes(trans->Read(&fPort, sizeof(jack_port_id_t))); | CheckRes(trans->Read(&fPort, sizeof(jack_port_id_t))); | ||||
@@ -660,7 +661,7 @@ struct JackPortRenameRequest : public JackRequest | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -687,12 +688,12 @@ struct JackSetBufferSizeRequest : public JackRequest | |||||
: JackRequest(JackRequest::kSetBufferSize), fBufferSize(buffer_size) | : JackRequest(JackRequest::kSetBufferSize), fBufferSize(buffer_size) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
return trans->Read(&fBufferSize, sizeof(jack_nframes_t)); | return trans->Read(&fBufferSize, sizeof(jack_nframes_t)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
return trans->Write(&fBufferSize, sizeof(jack_nframes_t)); | return trans->Write(&fBufferSize, sizeof(jack_nframes_t)); | ||||
@@ -715,12 +716,12 @@ struct JackSetFreeWheelRequest : public JackRequest | |||||
: JackRequest(JackRequest::kSetFreeWheel), fOnOff(onoff) | : JackRequest(JackRequest::kSetFreeWheel), fOnOff(onoff) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
return trans->Read(&fOnOff, sizeof(int)); | return trans->Read(&fOnOff, sizeof(int)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
return trans->Write(&fOnOff, sizeof(int)); | return trans->Write(&fOnOff, sizeof(int)); | ||||
@@ -739,12 +740,12 @@ struct JackComputeTotalLatenciesRequest : public JackRequest | |||||
: JackRequest(JackRequest::kComputeTotalLatencies) | : JackRequest(JackRequest::kComputeTotalLatencies) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
return 0; | return 0; | ||||
@@ -767,12 +768,12 @@ struct JackReleaseTimebaseRequest : public JackRequest | |||||
: JackRequest(JackRequest::kReleaseTimebase), fRefNum(refnum) | : JackRequest(JackRequest::kReleaseTimebase), fRefNum(refnum) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
return trans->Read(&fRefNum, sizeof(int)); | return trans->Read(&fRefNum, sizeof(int)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
return trans->Write(&fRefNum, sizeof(int)); | return trans->Write(&fRefNum, sizeof(int)); | ||||
@@ -796,13 +797,13 @@ struct JackSetTimebaseCallbackRequest : public JackRequest | |||||
: JackRequest(JackRequest::kSetTimebaseCallback), fRefNum(refnum), fConditionnal(conditional) | : JackRequest(JackRequest::kSetTimebaseCallback), fRefNum(refnum), fConditionnal(conditional) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
return trans->Read(&fConditionnal, sizeof(int)); | return trans->Read(&fConditionnal, sizeof(int)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -827,13 +828,13 @@ struct JackGetInternalClientNameRequest : public JackRequest | |||||
: JackRequest(JackRequest::kGetInternalClientName), fRefNum(refnum), fIntRefNum(int_ref) | : JackRequest(JackRequest::kGetInternalClientName), fRefNum(refnum), fIntRefNum(int_ref) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
return trans->Read(&fIntRefNum, sizeof(int)); | return trans->Read(&fIntRefNum, sizeof(int)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -859,14 +860,14 @@ struct JackGetInternalClientNameResult : public JackResult | |||||
snprintf(fName, sizeof(fName), "%s", name); | snprintf(fName, sizeof(fName), "%s", name); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Read(trans)); | CheckRes(JackResult::Read(trans)); | ||||
CheckRes(trans->Read(&fName, sizeof(fName))); | CheckRes(trans->Read(&fName, sizeof(fName))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Write(trans)); | CheckRes(JackResult::Write(trans)); | ||||
CheckRes(trans->Write(&fName, sizeof(fName))); | CheckRes(trans->Write(&fName, sizeof(fName))); | ||||
@@ -893,13 +894,13 @@ struct JackInternalClientHandleRequest : public JackRequest | |||||
snprintf(fName, sizeof(fName), "%s", client_name); | snprintf(fName, sizeof(fName), "%s", client_name); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
return trans->Read(&fName, sizeof(fName)); | return trans->Read(&fName, sizeof(fName)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -924,7 +925,7 @@ struct JackInternalClientHandleResult : public JackResult | |||||
: JackResult(result), fStatus(status), fIntRefNum(int_ref) | : JackResult(result), fStatus(status), fIntRefNum(int_ref) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Read(trans)); | CheckRes(JackResult::Read(trans)); | ||||
CheckRes(trans->Read(&fStatus, sizeof(int))); | CheckRes(trans->Read(&fStatus, sizeof(int))); | ||||
@@ -932,7 +933,7 @@ struct JackInternalClientHandleResult : public JackResult | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Write(trans)); | CheckRes(JackResult::Write(trans)); | ||||
CheckRes(trans->Write(&fStatus, sizeof(int))); | CheckRes(trans->Write(&fStatus, sizeof(int))); | ||||
@@ -971,7 +972,7 @@ struct JackInternalClientLoadRequest : public JackRequest | |||||
snprintf(fLoadInitName, sizeof(fLoadInitName), "%s", objet_data); | snprintf(fLoadInitName, sizeof(fLoadInitName), "%s", objet_data); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
CheckRes(trans->Read(&fName, sizeof(fName))); | CheckRes(trans->Read(&fName, sizeof(fName))); | ||||
@@ -981,7 +982,7 @@ struct JackInternalClientLoadRequest : public JackRequest | |||||
return trans->Read(&fOptions, sizeof(int)); | return trans->Read(&fOptions, sizeof(int)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -1010,7 +1011,7 @@ struct JackInternalClientLoadResult : public JackResult | |||||
: JackResult(result), fStatus(status), fIntRefNum(int_ref) | : JackResult(result), fStatus(status), fIntRefNum(int_ref) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Read(trans)); | CheckRes(JackResult::Read(trans)); | ||||
CheckRes(trans->Read(&fStatus, sizeof(int))); | CheckRes(trans->Read(&fStatus, sizeof(int))); | ||||
@@ -1018,7 +1019,7 @@ struct JackInternalClientLoadResult : public JackResult | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Write(trans)); | CheckRes(JackResult::Write(trans)); | ||||
CheckRes(trans->Write(&fStatus, sizeof(int))); | CheckRes(trans->Write(&fStatus, sizeof(int))); | ||||
@@ -1044,13 +1045,13 @@ struct JackInternalClientUnloadRequest : public JackRequest | |||||
: JackRequest(JackRequest::kInternalClientUnload), fRefNum(refnum), fIntRefNum(int_ref) | : JackRequest(JackRequest::kInternalClientUnload), fRefNum(refnum), fIntRefNum(int_ref) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
return trans->Read(&fIntRefNum, sizeof(int)); | return trans->Read(&fIntRefNum, sizeof(int)); | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -1073,14 +1074,14 @@ struct JackInternalClientUnloadResult : public JackResult | |||||
: JackResult(result), fStatus(status) | : JackResult(result), fStatus(status) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Read(trans)); | CheckRes(JackResult::Read(trans)); | ||||
CheckRes(trans->Read(&fStatus, sizeof(int))); | CheckRes(trans->Read(&fStatus, sizeof(int))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Write(trans)); | CheckRes(JackResult::Write(trans)); | ||||
CheckRes(trans->Write(&fStatus, sizeof(int))); | CheckRes(trans->Write(&fStatus, sizeof(int))); | ||||
@@ -1106,7 +1107,7 @@ struct JackClientNotificationRequest : public JackRequest | |||||
: JackRequest(JackRequest::kNotification), fRefNum(refnum), fNotify(notify), fValue(value) | : JackRequest(JackRequest::kNotification), fRefNum(refnum), fNotify(notify), fValue(value) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
CheckRes(trans->Read(&fNotify, sizeof(int))); | CheckRes(trans->Read(&fNotify, sizeof(int))); | ||||
@@ -1114,7 +1115,7 @@ struct JackClientNotificationRequest : public JackRequest | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -1156,7 +1157,7 @@ struct JackSessionNotifyResult : public JackResult | |||||
: JackResult(result), fDone(false) | : JackResult(result), fDone(false) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
if (trans == NULL) | if (trans == NULL) | ||||
{ | { | ||||
@@ -1183,7 +1184,7 @@ struct JackSessionNotifyResult : public JackResult | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
if (trans == NULL) | if (trans == NULL) | ||||
{ | { | ||||
@@ -1257,7 +1258,7 @@ struct JackSessionNotifyRequest : public JackRequest | |||||
} | } | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(fRefNum))); | CheckRes(trans->Read(&fRefNum, sizeof(fRefNum))); | ||||
CheckRes(trans->Read(&fPath, sizeof(fPath))); | CheckRes(trans->Read(&fPath, sizeof(fPath))); | ||||
@@ -1266,7 +1267,7 @@ struct JackSessionNotifyRequest : public JackRequest | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(fRefNum))); | CheckRes(trans->Write(&fRefNum, sizeof(fRefNum))); | ||||
@@ -1289,13 +1290,13 @@ struct JackSessionReplyRequest : public JackRequest | |||||
: JackRequest(JackRequest::kSessionReply), fRefNum(refnum) | : JackRequest(JackRequest::kSessionReply), fRefNum(refnum) | ||||
{} | {} | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fRefNum, sizeof(fRefNum))); | CheckRes(trans->Read(&fRefNum, sizeof(fRefNum))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(fRefNum))); | CheckRes(trans->Write(&fRefNum, sizeof(fRefNum))); | ||||
@@ -1316,14 +1317,14 @@ struct JackClientNameResult : public JackResult | |||||
snprintf(fName, sizeof(fName), "%s", name); | snprintf(fName, sizeof(fName), "%s", name); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Read(trans)); | CheckRes(JackResult::Read(trans)); | ||||
CheckRes(trans->Read(&fName, sizeof(fName))); | CheckRes(trans->Read(&fName, sizeof(fName))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Write(trans)); | CheckRes(JackResult::Write(trans)); | ||||
CheckRes(trans->Write(&fName, sizeof(fName))); | CheckRes(trans->Write(&fName, sizeof(fName))); | ||||
@@ -1344,14 +1345,14 @@ struct JackUUIDResult : public JackResult | |||||
snprintf(fUUID, sizeof(fUUID), "%s", uuid); | snprintf(fUUID, sizeof(fUUID), "%s", uuid); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Read(trans)); | CheckRes(JackResult::Read(trans)); | ||||
CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackResult::Write(trans)); | CheckRes(JackResult::Write(trans)); | ||||
CheckRes(trans->Write(&fUUID, sizeof(fUUID))); | CheckRes(trans->Write(&fUUID, sizeof(fUUID))); | ||||
@@ -1373,13 +1374,13 @@ struct JackGetUUIDRequest : public JackRequest | |||||
strncpy(fName, client_name, sizeof(fName)); | strncpy(fName, client_name, sizeof(fName)); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fName, sizeof(fName))); | CheckRes(trans->Read(&fName, sizeof(fName))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fName, sizeof(fName))); | CheckRes(trans->Write(&fName, sizeof(fName))); | ||||
@@ -1401,13 +1402,13 @@ struct JackGetClientNameRequest : public JackRequest | |||||
strncpy(fUUID, uuid, sizeof(fUUID)); | strncpy(fUUID, uuid, sizeof(fUUID)); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fUUID, sizeof(fUUID))); | CheckRes(trans->Write(&fUUID, sizeof(fUUID))); | ||||
@@ -1432,7 +1433,7 @@ struct JackReserveNameRequest : public JackRequest | |||||
strncpy(fUUID, uuid, sizeof(fUUID)); | strncpy(fUUID, uuid, sizeof(fUUID)); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | ||||
CheckRes(trans->Read(&fName, sizeof(fName))); | CheckRes(trans->Read(&fName, sizeof(fName))); | ||||
@@ -1440,7 +1441,7 @@ struct JackReserveNameRequest : public JackRequest | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fUUID, sizeof(fUUID))); | CheckRes(trans->Write(&fUUID, sizeof(fUUID))); | ||||
@@ -1464,13 +1465,13 @@ struct JackClientHasSessionCallbackRequest : public JackRequest | |||||
strncpy(fName, name, sizeof(fName)); | strncpy(fName, name, sizeof(fName)); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fName, sizeof(fName))); | CheckRes(trans->Read(&fName, sizeof(fName))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(JackRequest::Write(trans)); | CheckRes(JackRequest::Write(trans)); | ||||
CheckRes(trans->Write(&fName, sizeof(fName))); | CheckRes(trans->Write(&fName, sizeof(fName))); | ||||
@@ -1502,7 +1503,7 @@ struct JackClientNotification | |||||
snprintf(fMessage, sizeof(fMessage), "%s", message); | snprintf(fMessage, sizeof(fMessage), "%s", message); | ||||
} | } | ||||
int Read(JackChannelTransaction* trans) | |||||
int Read(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Read(&fName, sizeof(fName))); | CheckRes(trans->Read(&fName, sizeof(fName))); | ||||
CheckRes(trans->Read(&fRefNum, sizeof(int))); | CheckRes(trans->Read(&fRefNum, sizeof(int))); | ||||
@@ -1514,7 +1515,7 @@ struct JackClientNotification | |||||
return 0; | return 0; | ||||
} | } | ||||
int Write(JackChannelTransaction* trans) | |||||
int Write(detail::JackChannelTransactionInterface* trans) | |||||
{ | { | ||||
CheckRes(trans->Write(&fName, sizeof(fName))); | CheckRes(trans->Write(&fName, sizeof(fName))); | ||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
@@ -56,6 +56,7 @@ def build(bld): | |||||
'JackMidiAPI.cpp', | 'JackMidiAPI.cpp', | ||||
'JackEngineControl.cpp', | 'JackEngineControl.cpp', | ||||
'JackShmMem.cpp', | 'JackShmMem.cpp', | ||||
'JackGenericClientChannel.cpp', | |||||
'shm.c', | 'shm.c', | ||||
'JackGlobals.cpp', | 'JackGlobals.cpp', | ||||
'JackDebugClient.cpp', | 'JackDebugClient.cpp', | ||||
@@ -12,7 +12,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU Lesser General Public License for more details. | GNU Lesser General Public License for more details. | ||||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | ||||
along with this program; if not, write to the Free Software | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||||
*/ | */ | ||||
@@ -28,7 +28,7 @@ namespace Jack | |||||
{ | { | ||||
struct JackRequest; | struct JackRequest; | ||||
struct JackResult; | struct JackResult; | ||||
class JackPosixMutex; | class JackPosixMutex; | ||||
class JackPosixThread; | class JackPosixThread; | ||||
class JackFifo; | class JackFifo; | ||||
@@ -58,14 +58,16 @@ namespace Jack { typedef JackFifo JackSynchro; } | |||||
namespace Jack { typedef JackPosixSemaphore JackSynchro; } | namespace Jack { typedef JackPosixSemaphore JackSynchro; } | ||||
/* __JackPlatformChannelTransaction__ */ | /* __JackPlatformChannelTransaction__ */ | ||||
/* | |||||
#include "JackSocket.h" | #include "JackSocket.h" | ||||
namespace Jack { typedef JackClientSocket JackChannelTransaction; } | namespace Jack { typedef JackClientSocket JackChannelTransaction; } | ||||
*/ | |||||
#include "JackProcessSync.h" | #include "JackProcessSync.h" | ||||
/* __JackPlatformProcessSync__ */ | /* __JackPlatformProcessSync__ */ | ||||
/* Only on windows a special JackProcessSync is used. It is directly defined by including JackProcessSync.h here */ | /* Only on windows a special JackProcessSync is used. It is directly defined by including JackProcessSync.h here */ | ||||
/* __JackPlatformServerChannel__ */ | |||||
/* __JackPlatformServerChannel__ */ | |||||
#include "JackSocketServerChannel.h" | #include "JackSocketServerChannel.h" | ||||
namespace Jack { typedef JackSocketServerChannel JackServerChannel; } | namespace Jack { typedef JackSocketServerChannel JackServerChannel; } | ||||
@@ -64,12 +64,6 @@ namespace Jack { typedef JackMachThread JackThread; } | |||||
namespace Jack { typedef JackMachSemaphore JackSynchro; } | namespace Jack { typedef JackMachSemaphore JackSynchro; } | ||||
#endif | #endif | ||||
#include "JackSocket.h" | |||||
namespace Jack { typedef JackClientSocket JackChannelTransaction; } | |||||
#include "JackSocket.h" | |||||
namespace Jack { typedef JackClientSocket JackChannelTransaction; } | |||||
/* __JackPlatformProcessSync__ */ | /* __JackPlatformProcessSync__ */ | ||||
#include "JackProcessSync.h" | #include "JackProcessSync.h" | ||||
/* Only on windows a special JackProcessSync is used. It is directly defined by including JackProcessSync.h here */ | /* Only on windows a special JackProcessSync is used. It is directly defined by including JackProcessSync.h here */ | ||||
@@ -109,6 +109,18 @@ | |||||
/* Begin PBXBuildFile section */ | /* Begin PBXBuildFile section */ | ||||
4B0A28ED0D520852002EFF74 /* tw.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0A28EC0D520852002EFF74 /* tw.c */; }; | 4B0A28ED0D520852002EFF74 /* tw.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0A28EC0D520852002EFF74 /* tw.c */; }; | ||||
4B0A29260D52108E002EFF74 /* tw.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0A28EC0D520852002EFF74 /* tw.c */; }; | 4B0A29260D52108E002EFF74 /* tw.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0A28EC0D520852002EFF74 /* tw.c */; }; | ||||
4B1499F014BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1499EE14BDA5B300A51A3C /* JackGenericClientChannel.cpp */; }; | |||||
4B1499F114BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B1499EF14BDA5B300A51A3C /* JackGenericClientChannel.h */; }; | |||||
4B1499F214BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1499EE14BDA5B300A51A3C /* JackGenericClientChannel.cpp */; }; | |||||
4B1499F314BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B1499EF14BDA5B300A51A3C /* JackGenericClientChannel.h */; }; | |||||
4B1499F414BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1499EE14BDA5B300A51A3C /* JackGenericClientChannel.cpp */; }; | |||||
4B1499F514BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B1499EF14BDA5B300A51A3C /* JackGenericClientChannel.h */; }; | |||||
4B1499F614BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1499EE14BDA5B300A51A3C /* JackGenericClientChannel.cpp */; }; | |||||
4B1499F714BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B1499EF14BDA5B300A51A3C /* JackGenericClientChannel.h */; }; | |||||
4B1499F814BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1499EE14BDA5B300A51A3C /* JackGenericClientChannel.cpp */; }; | |||||
4B1499F914BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B1499EF14BDA5B300A51A3C /* JackGenericClientChannel.h */; }; | |||||
4B1499FA14BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1499EE14BDA5B300A51A3C /* JackGenericClientChannel.cpp */; }; | |||||
4B1499FB14BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B1499EF14BDA5B300A51A3C /* JackGenericClientChannel.h */; }; | |||||
4B193991133F321500547810 /* JackFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B193990133F321500547810 /* JackFilters.h */; }; | 4B193991133F321500547810 /* JackFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B193990133F321500547810 /* JackFilters.h */; }; | ||||
4B193992133F321500547810 /* JackFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B193990133F321500547810 /* JackFilters.h */; }; | 4B193992133F321500547810 /* JackFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B193990133F321500547810 /* JackFilters.h */; }; | ||||
4B193993133F321500547810 /* JackFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B193990133F321500547810 /* JackFilters.h */; }; | 4B193993133F321500547810 /* JackFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B193990133F321500547810 /* JackFilters.h */; }; | ||||
@@ -1586,6 +1598,8 @@ | |||||
4B0A28E60D52073D002EFF74 /* jack_thread_wait */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_thread_wait; sourceTree = BUILT_PRODUCTS_DIR; }; | 4B0A28E60D52073D002EFF74 /* jack_thread_wait */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_thread_wait; sourceTree = BUILT_PRODUCTS_DIR; }; | ||||
4B0A28EC0D520852002EFF74 /* tw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tw.c; path = "../example-clients/tw.c"; sourceTree = SOURCE_ROOT; }; | 4B0A28EC0D520852002EFF74 /* tw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tw.c; path = "../example-clients/tw.c"; sourceTree = SOURCE_ROOT; }; | ||||
4B0A292D0D52108E002EFF74 /* jack_thread_wait */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_thread_wait; sourceTree = BUILT_PRODUCTS_DIR; }; | 4B0A292D0D52108E002EFF74 /* jack_thread_wait */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_thread_wait; sourceTree = BUILT_PRODUCTS_DIR; }; | ||||
4B1499EE14BDA5B300A51A3C /* JackGenericClientChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackGenericClientChannel.cpp; path = ../common/JackGenericClientChannel.cpp; sourceTree = SOURCE_ROOT; }; | |||||
4B1499EF14BDA5B300A51A3C /* JackGenericClientChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackGenericClientChannel.h; path = ../common/JackGenericClientChannel.h; sourceTree = SOURCE_ROOT; }; | |||||
4B193931133F311400547810 /* JackMidiAsyncQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackMidiAsyncQueue.cpp; path = ../common/JackMidiAsyncQueue.cpp; sourceTree = SOURCE_ROOT; }; | 4B193931133F311400547810 /* JackMidiAsyncQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackMidiAsyncQueue.cpp; path = ../common/JackMidiAsyncQueue.cpp; sourceTree = SOURCE_ROOT; }; | ||||
4B193932133F311400547810 /* JackMidiAsyncQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackMidiAsyncQueue.h; path = ../common/JackMidiAsyncQueue.h; sourceTree = SOURCE_ROOT; }; | 4B193932133F311400547810 /* JackMidiAsyncQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackMidiAsyncQueue.h; path = ../common/JackMidiAsyncQueue.h; sourceTree = SOURCE_ROOT; }; | ||||
4B19393B133F313000547810 /* JackMidiAsyncWaitQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackMidiAsyncWaitQueue.cpp; path = ../common/JackMidiAsyncWaitQueue.cpp; sourceTree = SOURCE_ROOT; }; | 4B19393B133F313000547810 /* JackMidiAsyncWaitQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackMidiAsyncWaitQueue.cpp; path = ../common/JackMidiAsyncWaitQueue.cpp; sourceTree = SOURCE_ROOT; }; | ||||
@@ -3245,6 +3259,8 @@ | |||||
4BA550FF05E2423600569492 /* Channels */ = { | 4BA550FF05E2423600569492 /* Channels */ = { | ||||
isa = PBXGroup; | isa = PBXGroup; | ||||
children = ( | children = ( | ||||
4B1499EE14BDA5B300A51A3C /* JackGenericClientChannel.cpp */, | |||||
4B1499EF14BDA5B300A51A3C /* JackGenericClientChannel.h */, | |||||
4BF8D1AF0834EEC400C94B91 /* JackChannel.h */, | 4BF8D1AF0834EEC400C94B91 /* JackChannel.h */, | ||||
4BB371D40C1AD85A0050C1E4 /* JackNotification.h */, | 4BB371D40C1AD85A0050C1E4 /* JackNotification.h */, | ||||
4BF8D1B30834EED500C94B91 /* JackInternalClientChannel.h */, | 4BF8D1B30834EED500C94B91 /* JackInternalClientChannel.h */, | ||||
@@ -3553,6 +3569,7 @@ | |||||
4B193993133F321500547810 /* JackFilters.h in Headers */, | 4B193993133F321500547810 /* JackFilters.h in Headers */, | ||||
4B49D44614865F22003390F8 /* net.h in Headers */, | 4B49D44614865F22003390F8 /* net.h in Headers */, | ||||
4B49D44714865F22003390F8 /* session.h in Headers */, | 4B49D44714865F22003390F8 /* session.h in Headers */, | ||||
4B1499F714BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -3637,6 +3654,7 @@ | |||||
4B21795213E2EEA60095B3E5 /* JackTimedDriver.h in Headers */, | 4B21795213E2EEA60095B3E5 /* JackTimedDriver.h in Headers */, | ||||
4B49D44A14865F22003390F8 /* net.h in Headers */, | 4B49D44A14865F22003390F8 /* net.h in Headers */, | ||||
4B49D44B14865F22003390F8 /* session.h in Headers */, | 4B49D44B14865F22003390F8 /* session.h in Headers */, | ||||
4B1499F114BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -3935,6 +3953,7 @@ | |||||
4B193994133F321500547810 /* JackFilters.h in Headers */, | 4B193994133F321500547810 /* JackFilters.h in Headers */, | ||||
4B49D44814865F22003390F8 /* net.h in Headers */, | 4B49D44814865F22003390F8 /* net.h in Headers */, | ||||
4B49D44914865F22003390F8 /* session.h in Headers */, | 4B49D44914865F22003390F8 /* session.h in Headers */, | ||||
4B1499F914BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -4029,6 +4048,7 @@ | |||||
4B193991133F321500547810 /* JackFilters.h in Headers */, | 4B193991133F321500547810 /* JackFilters.h in Headers */, | ||||
4B49D44414865F22003390F8 /* net.h in Headers */, | 4B49D44414865F22003390F8 /* net.h in Headers */, | ||||
4B49D44514865F22003390F8 /* session.h in Headers */, | 4B49D44514865F22003390F8 /* session.h in Headers */, | ||||
4B1499F514BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -4116,6 +4136,7 @@ | |||||
4B21795013E2EEA60095B3E5 /* JackTimedDriver.h in Headers */, | 4B21795013E2EEA60095B3E5 /* JackTimedDriver.h in Headers */, | ||||
4B49D44214865F22003390F8 /* net.h in Headers */, | 4B49D44214865F22003390F8 /* net.h in Headers */, | ||||
4B49D44314865F22003390F8 /* session.h in Headers */, | 4B49D44314865F22003390F8 /* session.h in Headers */, | ||||
4B1499FB14BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -4338,6 +4359,7 @@ | |||||
4B21795413E2EEA60095B3E5 /* JackTimedDriver.h in Headers */, | 4B21795413E2EEA60095B3E5 /* JackTimedDriver.h in Headers */, | ||||
4B49D44C14865F22003390F8 /* net.h in Headers */, | 4B49D44C14865F22003390F8 /* net.h in Headers */, | ||||
4B49D44D14865F22003390F8 /* session.h in Headers */, | 4B49D44D14865F22003390F8 /* session.h in Headers */, | ||||
4B1499F314BDA5B300A51A3C /* JackGenericClientChannel.h in Headers */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -7072,6 +7094,7 @@ | |||||
4B8A38F1117B827E00664E07 /* JackSocketClientChannel.cpp in Sources */, | 4B8A38F1117B827E00664E07 /* JackSocketClientChannel.cpp in Sources */, | ||||
4B8A38F6117B82AB00664E07 /* JackSocket.cpp in Sources */, | 4B8A38F6117B82AB00664E07 /* JackSocket.cpp in Sources */, | ||||
4B327BAB14B4B50400976483 /* JackPosixMutex.cpp in Sources */, | 4B327BAB14B4B50400976483 /* JackPosixMutex.cpp in Sources */, | ||||
4B1499F614BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -7142,6 +7165,7 @@ | |||||
4B21795113E2EEA60095B3E5 /* JackTimedDriver.cpp in Sources */, | 4B21795113E2EEA60095B3E5 /* JackTimedDriver.cpp in Sources */, | ||||
4B67AB8E14B4B03800B4AA9A /* JackException.cpp in Sources */, | 4B67AB8E14B4B03800B4AA9A /* JackException.cpp in Sources */, | ||||
4B327BA814B4B50400976483 /* JackPosixMutex.cpp in Sources */, | 4B327BA814B4B50400976483 /* JackPosixMutex.cpp in Sources */, | ||||
4B1499F014BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -7454,6 +7478,7 @@ | |||||
4B47ACCE10B5890100469C67 /* JackMachTime.c in Sources */, | 4B47ACCE10B5890100469C67 /* JackMachTime.c in Sources */, | ||||
4B47ACCF10B5890100469C67 /* JackProcessSync.cpp in Sources */, | 4B47ACCF10B5890100469C67 /* JackProcessSync.cpp in Sources */, | ||||
4B327BAC14B4B50400976483 /* JackPosixMutex.cpp in Sources */, | 4B327BAC14B4B50400976483 /* JackPosixMutex.cpp in Sources */, | ||||
4B1499F814BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -7538,6 +7563,7 @@ | |||||
4B2209EC12F6BC2100E5DC26 /* JackSocket.cpp in Sources */, | 4B2209EC12F6BC2100E5DC26 /* JackSocket.cpp in Sources */, | ||||
4B2209EE12F6BC2300E5DC26 /* JackSocketClientChannel.cpp in Sources */, | 4B2209EE12F6BC2300E5DC26 /* JackSocketClientChannel.cpp in Sources */, | ||||
4B327BAA14B4B50400976483 /* JackPosixMutex.cpp in Sources */, | 4B327BAA14B4B50400976483 /* JackPosixMutex.cpp in Sources */, | ||||
4B1499F414BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -7608,6 +7634,7 @@ | |||||
4B21794F13E2EEA60095B3E5 /* JackTimedDriver.cpp in Sources */, | 4B21794F13E2EEA60095B3E5 /* JackTimedDriver.cpp in Sources */, | ||||
4B67AB8D14B4B03800B4AA9A /* JackException.cpp in Sources */, | 4B67AB8D14B4B03800B4AA9A /* JackException.cpp in Sources */, | ||||
4B327BA714B4B50400976483 /* JackPosixMutex.cpp in Sources */, | 4B327BA714B4B50400976483 /* JackPosixMutex.cpp in Sources */, | ||||
4B1499FA14BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -7834,6 +7861,7 @@ | |||||
4B21795313E2EEA60095B3E5 /* JackTimedDriver.cpp in Sources */, | 4B21795313E2EEA60095B3E5 /* JackTimedDriver.cpp in Sources */, | ||||
4B67AB8F14B4B03800B4AA9A /* JackException.cpp in Sources */, | 4B67AB8F14B4B03800B4AA9A /* JackException.cpp in Sources */, | ||||
4B327BA914B4B50400976483 /* JackPosixMutex.cpp in Sources */, | 4B327BA914B4B50400976483 /* JackPosixMutex.cpp in Sources */, | ||||
4B1499F214BDA5B300A51A3C /* JackGenericClientChannel.cpp in Sources */, | |||||
); | ); | ||||
runOnlyForDeploymentPostprocessing = 0; | runOnlyForDeploymentPostprocessing = 0; | ||||
}; | }; | ||||
@@ -36,7 +36,7 @@ static void BuildName(const char* client_name, char* res, const char* dir, int w | |||||
sprintf(res, "%s/jack_%s_%d_%d", dir, ext_client_name, JackTools::GetUID(), which); | sprintf(res, "%s/jack_%s_%d_%d", dir, ext_client_name, JackTools::GetUID(), which); | ||||
} | } | ||||
JackClientSocket::JackClientSocket(int socket): fSocket(socket),fTimeOut(0) | |||||
JackClientSocket::JackClientSocket(int socket): JackClientRequestInterface(), fSocket(socket),fTimeOut(0) | |||||
{} | {} | ||||
#if defined(__sun__) || defined(sun) | #if defined(__sun__) || defined(sun) | ||||
@@ -12,7 +12,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
GNU Lesser General Public License for more details. | GNU Lesser General Public License for more details. | ||||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | ||||
along with this program; if not, write to the Free Software | |||||
along with this program; if not, write to the Free Software | |||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||||
*/ | */ | ||||
@@ -23,12 +23,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/un.h> | #include <sys/un.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/ioctl.h> | |||||
#include <sys/ioctl.h> | |||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <arpa/inet.h> | #include <arpa/inet.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include "JackChannel.h" | |||||
namespace Jack | namespace Jack | ||||
{ | { | ||||
@@ -36,17 +38,17 @@ namespace Jack | |||||
\brief Client socket. | \brief Client socket. | ||||
*/ | */ | ||||
class JackClientSocket | |||||
class JackClientSocket : public detail::JackClientRequestInterface | |||||
{ | { | ||||
private: | private: | ||||
int fSocket; | int fSocket; | ||||
int fTimeOut; | int fTimeOut; | ||||
public: | public: | ||||
JackClientSocket(): fSocket( -1),fTimeOut(0) | |||||
JackClientSocket():JackClientRequestInterface(), fSocket( -1),fTimeOut(0) | |||||
{} | {} | ||||
JackClientSocket(int socket); | JackClientSocket(int socket); | ||||
@@ -60,7 +62,7 @@ class JackClientSocket | |||||
} | } | ||||
void SetReadTimeOut(long sec); | void SetReadTimeOut(long sec); | ||||
void SetWriteTimeOut(long sec); | void SetWriteTimeOut(long sec); | ||||
void SetNonBlocking(bool onoff); | void SetNonBlocking(bool onoff); | ||||
}; | }; | ||||
@@ -26,38 +26,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||||
namespace Jack | namespace Jack | ||||
{ | { | ||||
JackSocketClientChannel::JackSocketClientChannel(): | |||||
fThread(this) | |||||
JackSocketClientChannel::JackSocketClientChannel() | |||||
:JackGenericClientChannel(), fThread(this) | |||||
{ | { | ||||
fRequest = new JackClientSocket(); | |||||
fNotificationSocket = NULL; | fNotificationSocket = NULL; | ||||
fClient = NULL; | |||||
} | } | ||||
JackSocketClientChannel::~JackSocketClientChannel() | JackSocketClientChannel::~JackSocketClientChannel() | ||||
{ | { | ||||
delete fRequest; | |||||
delete fNotificationSocket; | delete fNotificationSocket; | ||||
} | } | ||||
int JackSocketClientChannel::ServerCheck(const char* server_name) | |||||
{ | |||||
jack_log("JackSocketClientChannel::ServerCheck = %s", server_name); | |||||
// Connect to server | |||||
if (fRequestSocket.Connect(jack_server_dir, server_name, 0) < 0) { | |||||
jack_error("Cannot connect to server socket"); | |||||
fRequestSocket.Close(); | |||||
return -1; | |||||
} else { | |||||
return 0; | |||||
} | |||||
} | |||||
int JackSocketClientChannel::Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) | int JackSocketClientChannel::Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) | ||||
{ | { | ||||
int result = 0; | int result = 0; | ||||
jack_log("JackSocketClientChannel::Open name = %s", name); | jack_log("JackSocketClientChannel::Open name = %s", name); | ||||
if (fRequestSocket.Connect(jack_server_dir, server_name, 0) < 0) { | |||||
if (fRequest->Connect(jack_server_dir, server_name, 0) < 0) { | |||||
jack_error("Cannot connect to server socket"); | jack_error("Cannot connect to server socket"); | ||||
goto error; | goto error; | ||||
} | } | ||||
@@ -83,14 +70,14 @@ int JackSocketClientChannel::Open(const char* server_name, const char* name, int | |||||
return 0; | return 0; | ||||
error: | error: | ||||
fRequestSocket.Close(); | |||||
fRequest->Close(); | |||||
fNotificationListenSocket.Close(); | fNotificationListenSocket.Close(); | ||||
return -1; | return -1; | ||||
} | } | ||||
void JackSocketClientChannel::Close() | void JackSocketClientChannel::Close() | ||||
{ | { | ||||
fRequestSocket.Close(); | |||||
fRequest->Close(); | |||||
fNotificationListenSocket.Close(); | fNotificationListenSocket.Close(); | ||||
if (fNotificationSocket) | if (fNotificationSocket) | ||||
fNotificationSocket->Close(); | fNotificationSocket->Close(); | ||||
@@ -116,238 +103,6 @@ void JackSocketClientChannel::Stop() | |||||
fThread.Kill(); | fThread.Kill(); | ||||
} | } | ||||
void JackSocketClientChannel::ServerSyncCall(JackRequest* req, JackResult* res, int* result) | |||||
{ | |||||
if (req->Write(&fRequestSocket) < 0) { | |||||
jack_error("Could not write request type = %ld", req->fType); | |||||
*result = -1; | |||||
return; | |||||
} | |||||
if (res->Read(&fRequestSocket) < 0) { | |||||
jack_error("Could not read result type = %ld", req->fType); | |||||
*result = -1; | |||||
return; | |||||
} | |||||
*result = res->fResult; | |||||
} | |||||
void JackSocketClientChannel::ServerAsyncCall(JackRequest* req, JackResult* res, int* result) | |||||
{ | |||||
if (req->Write(&fRequestSocket) < 0) { | |||||
jack_error("Could not write request type = %ld", req->fType); | |||||
*result = -1; | |||||
} else { | |||||
*result = 0; | |||||
} | |||||
} | |||||
void JackSocketClientChannel::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open) | |||||
{ | |||||
JackClientCheckRequest req(name, protocol, options, uuid, open); | |||||
JackClientCheckResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*status = res.fStatus; | |||||
strcpy(name_res, res.fName); | |||||
} | |||||
void JackSocketClientChannel::ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||||
{ | |||||
JackClientOpenRequest req(name, pid, uuid); | |||||
JackClientOpenResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*shared_engine = res.fSharedEngine; | |||||
*shared_client = res.fSharedClient; | |||||
*shared_graph = res.fSharedGraph; | |||||
} | |||||
void JackSocketClientChannel::ClientClose(int refnum, int* result) | |||||
{ | |||||
JackClientCloseRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::ClientActivate(int refnum, int is_real_time, int* result) | |||||
{ | |||||
JackActivateRequest req(refnum, is_real_time); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::ClientDeactivate(int refnum, int* result) | |||||
{ | |||||
JackDeactivateRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result) | |||||
{ | |||||
JackPortRegisterRequest req(refnum, name, type, flags, buffer_size); | |||||
JackPortRegisterResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*port_index = res.fPortIndex; | |||||
} | |||||
void JackSocketClientChannel::PortUnRegister(int refnum, jack_port_id_t port_index, int* result) | |||||
{ | |||||
JackPortUnRegisterRequest req(refnum, port_index); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::PortConnect(int refnum, const char* src, const char* dst, int* result) | |||||
{ | |||||
JackPortConnectNameRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::PortDisconnect(int refnum, const char* src, const char* dst, int* result) | |||||
{ | |||||
JackPortDisconnectNameRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result) | |||||
{ | |||||
JackPortConnectRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result) | |||||
{ | |||||
JackPortDisconnectRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::PortRename(int refnum, jack_port_id_t port, const char* name, int* result) | |||||
{ | |||||
JackPortRenameRequest req(refnum, port, name); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::SetBufferSize(jack_nframes_t buffer_size, int* result) | |||||
{ | |||||
JackSetBufferSizeRequest req(buffer_size); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::SetFreewheel(int onoff, int* result) | |||||
{ | |||||
JackSetFreeWheelRequest req(onoff); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::ComputeTotalLatencies(int* result) | |||||
{ | |||||
JackComputeTotalLatenciesRequest req; | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result) | |||||
{ | |||||
JackSessionNotifyRequest req(refnum, path, type, target); | |||||
JackSessionNotifyResult res; | |||||
int intresult; | |||||
ServerSyncCall(&req, &res, &intresult); | |||||
*result = res.GetCommands(); | |||||
} | |||||
void JackSocketClientChannel::SessionReply(int refnum, int* result) | |||||
{ | |||||
JackSessionReplyRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result) | |||||
{ | |||||
JackGetUUIDRequest req(client_name); | |||||
JackUUIDResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
strncpy(uuid_res, res.fUUID, JACK_UUID_SIZE); | |||||
} | |||||
void JackSocketClientChannel::GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result) | |||||
{ | |||||
JackGetClientNameRequest req(uuid); | |||||
JackClientNameResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
strncpy(name_res, res.fName, JACK_CLIENT_NAME_SIZE); | |||||
} | |||||
void JackSocketClientChannel::ClientHasSessionCallback(const char* client_name, int* result) | |||||
{ | |||||
JackClientHasSessionCallbackRequest req(client_name); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::ReserveClientName(int refnum, const char* client_name, const char* uuid, int* result) | |||||
{ | |||||
JackReserveNameRequest req(refnum, client_name, uuid); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::ReleaseTimebase(int refnum, int* result) | |||||
{ | |||||
JackReleaseTimebaseRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::SetTimebaseCallback(int refnum, int conditional, int* result) | |||||
{ | |||||
JackSetTimebaseCallbackRequest req(refnum, conditional); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackSocketClientChannel::GetInternalClientName(int refnum, int int_ref, char* name_res, int* result) | |||||
{ | |||||
JackGetInternalClientNameRequest req(refnum, int_ref); | |||||
JackGetInternalClientNameResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
strcpy(name_res, res.fName); | |||||
} | |||||
void JackSocketClientChannel::InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result) | |||||
{ | |||||
JackInternalClientHandleRequest req(refnum, client_name); | |||||
JackInternalClientHandleResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*int_ref = res.fIntRefNum; | |||||
*status = res.fStatus; | |||||
} | |||||
void JackSocketClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result) | |||||
{ | |||||
JackInternalClientLoadRequest req(refnum, client_name, so_name, objet_data, options, uuid); | |||||
JackInternalClientLoadResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*int_ref = res.fIntRefNum; | |||||
*status = res.fStatus; | |||||
} | |||||
void JackSocketClientChannel::InternalClientUnload(int refnum, int int_ref, int* status, int* result) | |||||
{ | |||||
JackInternalClientUnloadRequest req(refnum, int_ref); | |||||
JackInternalClientUnloadResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*status = res.fStatus; | |||||
} | |||||
bool JackSocketClientChannel::Init() | bool JackSocketClientChannel::Init() | ||||
{ | { | ||||
jack_log("JackSocketClientChannel::Init"); | jack_log("JackSocketClientChannel::Init"); | ||||
@@ -20,10 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||||
#ifndef __JackSocketClientChannel__ | #ifndef __JackSocketClientChannel__ | ||||
#define __JackSocketClientChannel__ | #define __JackSocketClientChannel__ | ||||
#include "JackChannel.h" | |||||
#include "JackGenericClientChannel.h" | |||||
#include "JackSocket.h" | #include "JackSocket.h" | ||||
#include "JackPlatformPlug.h" | #include "JackPlatformPlug.h" | ||||
#include "JackRequest.h" | |||||
#include "JackThread.h" | |||||
namespace Jack | namespace Jack | ||||
{ | { | ||||
@@ -32,19 +32,14 @@ namespace Jack | |||||
\brief JackClientChannel using sockets. | \brief JackClientChannel using sockets. | ||||
*/ | */ | ||||
class JackSocketClientChannel : public detail::JackClientChannelInterface, public JackRunnableInterface | |||||
class JackSocketClientChannel : public JackGenericClientChannel, public JackRunnableInterface | |||||
{ | { | ||||
private: | private: | ||||
JackClientSocket fRequestSocket; // Socket to communicate with the server | |||||
JackServerSocket fNotificationListenSocket; // Socket listener for server notification | JackServerSocket fNotificationListenSocket; // Socket listener for server notification | ||||
JackClientSocket* fNotificationSocket; // Socket for server notification | JackClientSocket* fNotificationSocket; // Socket for server notification | ||||
JackThread fThread; // Thread to execute the event loop | JackThread fThread; // Thread to execute the event loop | ||||
JackClient* fClient; | |||||
void ServerSyncCall(JackRequest* req, JackResult* res, int* result); | |||||
void ServerAsyncCall(JackRequest* req, JackResult* res, int* result); | |||||
public: | public: | ||||
@@ -57,49 +52,6 @@ class JackSocketClientChannel : public detail::JackClientChannelInterface, publi | |||||
int Start(); | int Start(); | ||||
void Stop(); | void Stop(); | ||||
int ServerCheck(const char* server_name); | |||||
void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open); | |||||
void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||||
void ClientOpen(const char* name, int* ref, int uuid, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) | |||||
{} | |||||
void ClientClose(int refnum, int* result); | |||||
void ClientActivate(int refnum, int is_real_time, int* result); | |||||
void ClientDeactivate(int refnum, int* result); | |||||
void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result); | |||||
void PortUnRegister(int refnum, jack_port_id_t port_index, int* result); | |||||
void PortConnect(int refnum, const char* src, const char* dst, int* result); | |||||
void PortDisconnect(int refnum, const char* src, const char* dst, int* result); | |||||
void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result); | |||||
void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result); | |||||
void PortRename(int refnum, jack_port_id_t port, const char* name, int* result); | |||||
void SetBufferSize(jack_nframes_t buffer_size, int* result); | |||||
void SetFreewheel(int onoff, int* result); | |||||
void ComputeTotalLatencies(int* result); | |||||
void ReleaseTimebase(int refnum, int* result); | |||||
void SetTimebaseCallback(int refnum, int conditional, int* result); | |||||
void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result); | |||||
void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result); | |||||
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result); | |||||
void InternalClientUnload(int refnum, int int_ref, int* status, int* result); | |||||
// Session API | |||||
void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result); | |||||
void SessionReply(int refnum, int* result); | |||||
void GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result); | |||||
void GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result); | |||||
void ReserveClientName(int refnum, const char* client_name, const char *uuid, int* result); | |||||
void ClientHasSessionCallback(const char* client_name, int* result); | |||||
// JackRunnableInterface interface | // JackRunnableInterface interface | ||||
bool Init(); | bool Init(); | ||||
bool Execute(); | bool Execute(); | ||||
@@ -477,8 +477,8 @@ int process4(jack_nframes_t nframes, void *arg) | |||||
jack_nframes_t delta_time = cur_time - last_time; | jack_nframes_t delta_time = cur_time - last_time; | ||||
Log("calling process4 callback : jack_frame_time = %ld delta_time = %ld\n", cur_time, delta_time); | Log("calling process4 callback : jack_frame_time = %ld delta_time = %ld\n", cur_time, delta_time); | ||||
if (delta_time > 0 && (jack_nframes_t)abs((double)(delta_time - cur_buffer_size)) > tolerance) { | |||||
printf("!!! ERROR !!! jack_frame_time seems to return incorrect values cur_buffer_size = %d, delta_time = %d\n", cur_buffer_size, delta_time); | |||||
if (delta_time > 0 && (jack_nframes_t)abs(delta_time - cur_buffer_size) > tolerance) { | |||||
printf("!!! ERROR !!! jack_frame_time seems to return incorrect values cur_buffer_size = %d, delta_time = %d tolerance %d\n", cur_buffer_size, delta_time, tolerance); | |||||
} | } | ||||
last_time = cur_time; | last_time = cur_time; | ||||
@@ -27,25 +27,15 @@ | |||||
namespace Jack | namespace Jack | ||||
{ | { | ||||
JackWinNamedPipeClientChannel::JackWinNamedPipeClientChannel():fThread(this) | |||||
JackWinNamedPipeClientChannel::JackWinNamedPipeClientChannel() | |||||
:JackGenericClientChannel(),fThread(this) | |||||
{ | { | ||||
fClient = NULL; | |||||
fRequest = new JackWinNamedPipeClient(); | |||||
} | } | ||||
JackWinNamedPipeClientChannel::~JackWinNamedPipeClientChannel() | JackWinNamedPipeClientChannel::~JackWinNamedPipeClientChannel() | ||||
{} | |||||
int JackWinNamedPipeClientChannel::ServerCheck(const char* server_name) | |||||
{ | { | ||||
jack_log("JackWinNamedPipeClientChannel::ServerCheck = %s", server_name); | |||||
// Connect to server | |||||
if (fRequestPipe.Connect(jack_server_dir, server_name, 0) < 0) { | |||||
jack_error("Cannot connect to server pipe"); | |||||
return -1; | |||||
} else { | |||||
return 0; | |||||
} | |||||
delete fRequest; | |||||
} | } | ||||
int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) | int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) | ||||
@@ -54,14 +44,14 @@ int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* nam | |||||
jack_log("JackWinNamedPipeClientChannel::Open name = %s", name); | jack_log("JackWinNamedPipeClientChannel::Open name = %s", name); | ||||
/* | /* | ||||
16/08/07: was called before doing "fRequestPipe.Connect" .... still necessary? | |||||
16/08/07: was called before doing "fRequest->Connect" .... still necessary? | |||||
if (fNotificationListenPipe.Bind(jack_client_dir, name, 0) < 0) { | if (fNotificationListenPipe.Bind(jack_client_dir, name, 0) < 0) { | ||||
jack_error("Cannot bind pipe"); | jack_error("Cannot bind pipe"); | ||||
goto error; | goto error; | ||||
} | } | ||||
*/ | */ | ||||
if (fRequestPipe.Connect(jack_server_dir, server_name, 0) < 0) { | |||||
if (fRequest->Connect(jack_server_dir, server_name, 0) < 0) { | |||||
jack_error("Cannot connect to server pipe"); | jack_error("Cannot connect to server pipe"); | ||||
goto error; | goto error; | ||||
} | } | ||||
@@ -86,14 +76,14 @@ int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* nam | |||||
return 0; | return 0; | ||||
error: | error: | ||||
fRequestPipe.Close(); | |||||
fRequest->Close(); | |||||
fNotificationListenPipe.Close(); | fNotificationListenPipe.Close(); | ||||
return -1; | return -1; | ||||
} | } | ||||
void JackWinNamedPipeClientChannel::Close() | void JackWinNamedPipeClientChannel::Close() | ||||
{ | { | ||||
fRequestPipe.Close(); | |||||
fRequest->Close(); | |||||
fNotificationListenPipe.Close(); | fNotificationListenPipe.Close(); | ||||
// Here the thread will correctly stop when the pipe are closed | // Here the thread will correctly stop when the pipe are closed | ||||
fThread.Stop(); | fThread.Stop(); | ||||
@@ -119,238 +109,6 @@ void JackWinNamedPipeClientChannel::Stop() | |||||
fThread.Kill(); // Unsafe on WIN32... TODO : solve WIN32 thread Kill issue | fThread.Kill(); // Unsafe on WIN32... TODO : solve WIN32 thread Kill issue | ||||
} | } | ||||
void JackWinNamedPipeClientChannel::ServerSyncCall(JackRequest* req, JackResult* res, int* result) | |||||
{ | |||||
if (req->Write(&fRequestPipe) < 0) { | |||||
jack_error("Could not write request type = %ld", req->fType); | |||||
*result = -1; | |||||
return ; | |||||
} | |||||
if (res->Read(&fRequestPipe) < 0) { | |||||
jack_error("Could not read result type = %ld", req->fType); | |||||
*result = -1; | |||||
return ; | |||||
} | |||||
*result = res->fResult; | |||||
} | |||||
void JackWinNamedPipeClientChannel::ServerAsyncCall(JackRequest* req, JackResult* res, int* result) | |||||
{ | |||||
if (req->Write(&fRequestPipe) < 0) { | |||||
jack_error("Could not write request type = %ld", req->fType); | |||||
*result = -1; | |||||
} else { | |||||
*result = 0; | |||||
} | |||||
} | |||||
void JackWinNamedPipeClientChannel::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open) | |||||
{ | |||||
JackClientCheckRequest req(name, protocol, options, uuid, open); | |||||
JackClientCheckResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*status = res.fStatus; | |||||
strcpy(name_res, res.fName); | |||||
} | |||||
void JackWinNamedPipeClientChannel::ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result) | |||||
{ | |||||
JackClientOpenRequest req(name, pid, uuid); | |||||
JackClientOpenResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*shared_engine = res.fSharedEngine; | |||||
*shared_client = res.fSharedClient; | |||||
*shared_graph = res.fSharedGraph; | |||||
} | |||||
void JackWinNamedPipeClientChannel::ClientClose(int refnum, int* result) | |||||
{ | |||||
JackClientCloseRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::ClientActivate(int refnum, int is_real_time, int* result) | |||||
{ | |||||
JackActivateRequest req(refnum, is_real_time); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::ClientDeactivate(int refnum, int* result) | |||||
{ | |||||
JackDeactivateRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result) | |||||
{ | |||||
JackPortRegisterRequest req(refnum, name, type, flags, buffer_size); | |||||
JackPortRegisterResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*port_index = res.fPortIndex; | |||||
} | |||||
void JackWinNamedPipeClientChannel::PortUnRegister(int refnum, jack_port_id_t port_index, int* result) | |||||
{ | |||||
JackPortUnRegisterRequest req(refnum, port_index); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::PortConnect(int refnum, const char* src, const char* dst, int* result) | |||||
{ | |||||
JackPortConnectNameRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::PortDisconnect(int refnum, const char* src, const char* dst, int* result) | |||||
{ | |||||
JackPortDisconnectNameRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result) | |||||
{ | |||||
JackPortConnectRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result) | |||||
{ | |||||
JackPortDisconnectRequest req(refnum, src, dst); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::PortRename(int refnum, jack_port_id_t port, const char* name, int* result) | |||||
{ | |||||
JackPortRenameRequest req(refnum, port, name); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::SetBufferSize(jack_nframes_t buffer_size, int* result) | |||||
{ | |||||
JackSetBufferSizeRequest req(buffer_size); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::SetFreewheel(int onoff, int* result) | |||||
{ | |||||
JackSetFreeWheelRequest req(onoff); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::ComputeTotalLatencies(int* result) | |||||
{ | |||||
JackComputeTotalLatenciesRequest req; | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result) | |||||
{ | |||||
JackSessionNotifyRequest req(refnum, path, type, target); | |||||
JackSessionNotifyResult res; | |||||
int intresult; | |||||
ServerSyncCall(&req, &res, &intresult); | |||||
*result = res.GetCommands(); | |||||
} | |||||
void JackWinNamedPipeClientChannel::SessionReply(int refnum, int* result) | |||||
{ | |||||
JackSessionReplyRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result) | |||||
{ | |||||
JackGetUUIDRequest req(client_name); | |||||
JackUUIDResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
strncpy(uuid_res, res.fUUID, JACK_UUID_SIZE); | |||||
} | |||||
void JackWinNamedPipeClientChannel::GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result) | |||||
{ | |||||
JackGetClientNameRequest req(uuid); | |||||
JackClientNameResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
strncpy(name_res, res.fName, JACK_CLIENT_NAME_SIZE); | |||||
} | |||||
void JackWinNamedPipeClientChannel::ClientHasSessionCallback(const char* client_name, int* result) | |||||
{ | |||||
JackClientHasSessionCallbackRequest req(client_name); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::ReserveClientName(int refnum, const char* client_name, const char* uuid, int* result) | |||||
{ | |||||
JackReserveNameRequest req(refnum, client_name, uuid); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::ReleaseTimebase(int refnum, int* result) | |||||
{ | |||||
JackReleaseTimebaseRequest req(refnum); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::SetTimebaseCallback(int refnum, int conditional, int* result) | |||||
{ | |||||
JackSetTimebaseCallbackRequest req(refnum, conditional); | |||||
JackResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
} | |||||
void JackWinNamedPipeClientChannel::GetInternalClientName(int refnum, int int_ref, char* name_res, int* result) | |||||
{ | |||||
JackGetInternalClientNameRequest req(refnum, int_ref); | |||||
JackGetInternalClientNameResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
strcpy(name_res, res.fName); | |||||
} | |||||
void JackWinNamedPipeClientChannel::InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result) | |||||
{ | |||||
JackInternalClientHandleRequest req(refnum, client_name); | |||||
JackInternalClientHandleResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*int_ref = res.fIntRefNum; | |||||
*status = res.fStatus; | |||||
} | |||||
void JackWinNamedPipeClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result) | |||||
{ | |||||
JackInternalClientLoadRequest req(refnum, client_name, so_name, objet_data, options, uuid); | |||||
JackInternalClientLoadResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*int_ref = res.fIntRefNum; | |||||
*status = res.fStatus; | |||||
} | |||||
void JackWinNamedPipeClientChannel::InternalClientUnload(int refnum, int int_ref, int* status, int* result) | |||||
{ | |||||
JackInternalClientUnloadRequest req(refnum, int_ref); | |||||
JackInternalClientUnloadResult res; | |||||
ServerSyncCall(&req, &res, result); | |||||
*status = res.fStatus; | |||||
} | |||||
bool JackWinNamedPipeClientChannel::Init() | bool JackWinNamedPipeClientChannel::Init() | ||||
{ | { | ||||
jack_log("JackWinNamedPipeClientChannel::Init"); | jack_log("JackWinNamedPipeClientChannel::Init"); | ||||
@@ -386,7 +144,7 @@ bool JackWinNamedPipeClientChannel::Execute() | |||||
error: | error: | ||||
// Close the pipes, server wont be able to create them otherwise. | // Close the pipes, server wont be able to create them otherwise. | ||||
fNotificationListenPipe.Close(); | fNotificationListenPipe.Close(); | ||||
fRequestPipe.Close(); | |||||
fRequest->Close(); | |||||
fClient->ShutDown(); | fClient->ShutDown(); | ||||
return false; | return false; | ||||
} | } | ||||
@@ -21,10 +21,10 @@ | |||||
#ifndef __JackWinNamedPipeClientChannel__ | #ifndef __JackWinNamedPipeClientChannel__ | ||||
#define __JackWinNamedPipeClientChannel__ | #define __JackWinNamedPipeClientChannel__ | ||||
#include "JackChannel.h" | |||||
#include "JackGenericClientChannel.h" | |||||
#include "JackWinNamedPipe.h" | #include "JackWinNamedPipe.h" | ||||
#include "JackPlatformPlug.h" | #include "JackPlatformPlug.h" | ||||
#include "JackRequest.h" | |||||
#include "JackThread.h" | |||||
namespace Jack | namespace Jack | ||||
{ | { | ||||
@@ -38,13 +38,8 @@ class JackWinNamedPipeClientChannel : public detail::JackClientChannelInterface, | |||||
private: | private: | ||||
JackWinNamedPipeClient fRequestPipe; // Pipe to communicate with the server | |||||
JackWinNamedPipeServer fNotificationListenPipe; // Pipe listener for server notification | JackWinNamedPipeServer fNotificationListenPipe; // Pipe listener for server notification | ||||
JackThread fThread; // Thread to execute the event loop | JackThread fThread; // Thread to execute the event loop | ||||
JackClient* fClient; | |||||
void ServerSyncCall(JackRequest* req, JackResult* res, int* result); | |||||
void ServerAsyncCall(JackRequest* req, JackResult* res, int* result); | |||||
public: | public: | ||||
@@ -57,47 +52,6 @@ class JackWinNamedPipeClientChannel : public detail::JackClientChannelInterface, | |||||
int Start(); | int Start(); | ||||
void Stop(); | void Stop(); | ||||
int ServerCheck(const char* server_name); | |||||
void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open); | |||||
void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result); | |||||
void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) | |||||
{} | |||||
void ClientClose(int refnum, int* result); | |||||
void ClientActivate(int refnum, int is_real_time, int* result); | |||||
void ClientDeactivate(int refnum, int* result); | |||||
void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result); | |||||
void PortUnRegister(int refnum, jack_port_id_t port_index, int* result); | |||||
void PortConnect(int refnum, const char* src, const char* dst, int* result); | |||||
void PortDisconnect(int refnum, const char* src, const char* dst, int* result); | |||||
void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result); | |||||
void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result); | |||||
void PortRename(int refnum, jack_port_id_t port, const char* name, int* result); | |||||
void SetBufferSize(jack_nframes_t buffer_size, int* result); | |||||
void SetFreewheel(int onoff, int* result); | |||||
void ComputeTotalLatencies(int* result); | |||||
void ReleaseTimebase(int refnum, int* result); | |||||
void SetTimebaseCallback(int refnum, int conditional, int* result); | |||||
void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result); | |||||
void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result); | |||||
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result); | |||||
void InternalClientUnload(int refnum, int int_ref, int* status, int* result); | |||||
void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result); | |||||
void SessionReply(int refnum, int* result); | |||||
void GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result); | |||||
void GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result); | |||||
void ReserveClientName(int refnum, const char* client_name, const char *uuid, int* result); | |||||
void ClientHasSessionCallback(const char* client_name, int* result); | |||||
// JackRunnableInterface interface | // JackRunnableInterface interface | ||||
bool Init(); | bool Init(); | ||||
bool Execute(); | bool Execute(); | ||||