Jack2
1.9.10
|
00001 /* 00002 Copyright (C) 2004-2008 Grame 00003 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 00018 */ 00019 00020 #ifndef __JackInternalClientChannel__ 00021 #define __JackInternalClientChannel__ 00022 00023 #include "JackChannel.h" 00024 00025 namespace Jack 00026 { 00027 00032 class JackInternalClientChannel : public detail::JackClientChannelInterface 00033 { 00034 00035 private: 00036 00037 JackServer* fServer; 00038 JackLockedEngine* fEngine; 00039 00040 public: 00041 00042 JackInternalClientChannel(JackServer* server): fServer(server), fEngine(server->GetEngine()) 00043 {} 00044 virtual ~JackInternalClientChannel() 00045 {} 00046 00047 void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open) 00048 { 00049 *result = fEngine->ClientCheck(name, uuid, name_res, protocol, options, status); 00050 } 00051 void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) 00052 { 00053 *result = fEngine->ClientInternalOpen(name, ref, shared_engine, shared_manager, client, true); 00054 } 00055 void ClientClose(int refnum, int* result) 00056 { 00057 *result = fEngine->ClientInternalClose(refnum, true); 00058 } 00059 00060 void ClientActivate(int refnum, int is_real_time, int* result) 00061 { 00062 *result = fEngine->ClientActivate(refnum, is_real_time); 00063 } 00064 void ClientDeactivate(int refnum, int* result) 00065 { 00066 *result = fEngine->ClientDeactivate(refnum); 00067 } 00068 00069 void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, unsigned int* port_index, int* result) 00070 { 00071 *result = fEngine->PortRegister(refnum, name, type, flags, buffer_size, port_index); 00072 } 00073 void PortUnRegister(int refnum, jack_port_id_t port_index, int* result) 00074 { 00075 *result = fEngine->PortUnRegister(refnum, port_index); 00076 } 00077 void PortConnect(int refnum, const char* src, const char* dst, int* result) 00078 { 00079 *result = fEngine->PortConnect(refnum, src, dst); 00080 } 00081 void PortDisconnect(int refnum, const char* src, const char* dst, int* result) 00082 { 00083 *result = fEngine->PortDisconnect(refnum, src, dst); 00084 } 00085 void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result) 00086 { 00087 *result = fEngine->PortConnect(refnum, src, dst); 00088 } 00089 void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result) 00090 { 00091 *result = fEngine->PortDisconnect(refnum, src, dst); 00092 } 00093 void PortRename(int refnum, jack_port_id_t port, const char* name, int* result) 00094 { 00095 *result = fEngine->PortRename(refnum, port, name); 00096 } 00097 00098 void SetBufferSize(jack_nframes_t buffer_size, int* result) 00099 { 00100 *result = fServer->SetBufferSize(buffer_size); 00101 } 00102 void SetFreewheel(int onoff, int* result) 00103 { 00104 *result = fServer->SetFreewheel(onoff); 00105 } 00106 void ComputeTotalLatencies(int* result) 00107 { 00108 *result = fEngine->ComputeTotalLatencies(); 00109 } 00110 00111 void ReleaseTimebase(int refnum, int* result) 00112 { 00113 *result = fServer->ReleaseTimebase(refnum); 00114 } 00115 00116 void SetTimebaseCallback(int refnum, int conditional, int* result) 00117 { 00118 *result = fServer->SetTimebaseCallback(refnum, conditional); 00119 } 00120 00121 void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result) 00122 { 00123 *result = fEngine->GetInternalClientName(int_ref, name_res); 00124 } 00125 00126 void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result) 00127 { 00128 *result = fEngine->InternalClientHandle(client_name, status, int_ref); 00129 } 00130 00131 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) 00132 { 00133 *result = fServer->InternalClientLoad1(client_name, so_name, objet_data, options, int_ref, uuid, status); 00134 } 00135 00136 void InternalClientUnload(int refnum, int int_ref, int* status, int* result) 00137 { 00138 *result = fEngine->InternalClientUnload(int_ref, status); 00139 } 00140 00141 void SessionNotify(int refnum, const char *target, jack_session_event_type_t type, const char *path, jack_session_command_t** result) 00142 { 00143 JackSessionNotifyResult* res; 00144 fEngine->SessionNotify(refnum, target, type, path, NULL, &res); 00145 if (res == NULL) { 00146 *result = NULL; 00147 return; 00148 } 00149 00150 *result = res->GetCommands(); 00151 delete(res); 00152 } 00153 00154 void SessionReply(int refnum, int* result) 00155 { 00156 *result = fEngine->SessionReply(refnum); 00157 } 00158 00159 void GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result) 00160 { 00161 *result = fEngine->GetUUIDForClientName(client_name, uuid_res); 00162 } 00163 00164 void GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result) 00165 { 00166 *result = fEngine->GetClientNameForUUID(uuid, name_res); 00167 } 00168 00169 void ReserveClientName(int refnum, const char* client_name, const char *uuid, int* result) 00170 { 00171 *result = fEngine->ReserveClientName(client_name, uuid); 00172 } 00173 00174 void ClientHasSessionCallback(const char* client_name, int* result) 00175 { 00176 *result = fEngine->ClientHasSessionCallback(client_name); 00177 } 00178 00179 00180 }; 00181 00182 } // end of namespace 00183 00184 #endif 00185