Jack2 1.9.12

JackInternalClientChannel.h
1 /*
2 Copyright (C) 2004-2008 Grame
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __JackInternalClientChannel__
21 #define __JackInternalClientChannel__
22
23 #include "JackChannel.h"
24
25 namespace Jack
26 {
27
32 class JackInternalClientChannel : public detail::JackClientChannelInterface
33 {
34
35 private:
36
37 JackServer* fServer;
38 JackLockedEngine* fEngine;
39
40 public:
41
42 JackInternalClientChannel(JackServer* server): fServer(server), fEngine(server->GetEngine())
43 {}
44 virtual ~JackInternalClientChannel()
45 {}
46
47 void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
48 {
49 *result = fEngine->ClientCheck(name, uuid, name_res, protocol, options, status);
50 }
51 void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
52 {
53 *result = fEngine->ClientInternalOpen(name, ref, shared_engine, shared_manager, client, true);
54 }
55 void ClientClose(int refnum, int* result)
56 {
57 *result = fEngine->ClientInternalClose(refnum, true);
58 }
59
60 void ClientActivate(int refnum, int is_real_time, int* result)
61 {
62 *result = fEngine->ClientActivate(refnum, is_real_time);
63 }
64 void ClientDeactivate(int refnum, int* result)
65 {
66 *result = fEngine->ClientDeactivate(refnum);
67 }
68
69 void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, unsigned int* port_index, int* result)
70 {
71 *result = fEngine->PortRegister(refnum, name, type, flags, buffer_size, port_index);
72 }
73 void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
74 {
75 *result = fEngine->PortUnRegister(refnum, port_index);
76 }
77 void PortConnect(int refnum, const char* src, const char* dst, int* result)
78 {
79 *result = fEngine->PortConnect(refnum, src, dst);
80 }
81 void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
82 {
83 *result = fEngine->PortDisconnect(refnum, src, dst);
84 }
85 void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
86 {
87 *result = fEngine->PortConnect(refnum, src, dst);
88 }
89 void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
90 {
91 *result = fEngine->PortDisconnect(refnum, src, dst);
92 }
93 void PortRename(int refnum, jack_port_id_t port, const char* name, int* result)
94 {
95 *result = fEngine->PortRename(refnum, port, name);
96 }
97
98 void SetBufferSize(jack_nframes_t buffer_size, int* result)
99 {
100 *result = fServer->SetBufferSize(buffer_size);
101 }
102 void SetFreewheel(int onoff, int* result)
103 {
104 *result = fServer->SetFreewheel(onoff);
105 }
106 void ComputeTotalLatencies(int* result)
107 {
108 *result = fEngine->ComputeTotalLatencies();
109 }
110
111 void ReleaseTimebase(int refnum, int* result)
112 {
113 *result = fServer->ReleaseTimebase(refnum);
114 }
115
116 void SetTimebaseCallback(int refnum, int conditional, int* result)
117 {
118 *result = fServer->SetTimebaseCallback(refnum, conditional);
119 }
120
121 void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result)
122 {
123 *result = fEngine->GetInternalClientName(int_ref, name_res);
124 }
125
126 void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result)
127 {
128 *result = fEngine->InternalClientHandle(client_name, status, int_ref);
129 }
130
131 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)
132 {
133 *result = fServer->InternalClientLoad1(client_name, so_name, objet_data, options, int_ref, uuid, status);
134 }
135
136 void InternalClientUnload(int refnum, int int_ref, int* status, int* result)
137 {
138 *result = fEngine->InternalClientUnload(int_ref, status);
139 }
140
141 void SessionNotify(int refnum, const char *target, jack_session_event_type_t type, const char *path, jack_session_command_t** result)
142 {
143 JackSessionNotifyResult* res;
144 fEngine->SessionNotify(refnum, target, type, path, NULL, &res);
145 if (res == NULL) {
146 *result = NULL;
147 return;
148 }
149
150 *result = res->GetCommands();
151 delete(res);
152 }
153
154 void SessionReply(int refnum, int* result)
155 {
156 *result = fEngine->SessionReply(refnum);
157 }
158
159 void GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result)
160 {
161 *result = fEngine->GetUUIDForClientName(client_name, uuid_res);
162 }
163
164 void GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result)
165 {
166 *result = fEngine->GetClientNameForUUID(uuid, name_res);
167 }
168
169 void ReserveClientName(int refnum, const char* client_name, const char *uuid, int* result)
170 {
171 *result = fEngine->ReserveClientName(client_name, uuid);
172 }
173
174 void ClientHasSessionCallback(const char* client_name, int* result)
175 {
176 *result = fEngine->ClientHasSessionCallback(client_name);
177 }
178
179
180 };
181
182 } // end of namespace
183
184 #endif
185
Jack::detail::JackClientChannelInterface
Inter process channel for server/client bidirectionnal communication : request and (receiving) notifi...
Definition: JackChannel.h:90
Jack::JackInternalClientChannel
JackClientChannel for server internal clients.
Definition: JackInternalClientChannel.h:32
Jack::JackLockedEngine
Locked Engine, access to methods is serialized using a mutex.
Definition: JackLockedEngine.h:78
Jack::JackGraphManager
Graph manager: contains the connection manager and the port array.
Definition: JackGraphManager.h:40
jack_session_command_t
Definition: JackSession.h:59
Jack::JackServer
The Jack server.
Definition: JackServer.h:46
Jack::JackClientInterface
Client interface.
Definition: JackClientInterface.h:35
Jack::JackEngineControl
Engine control in shared memory.
Definition: JackEngineControl.h:49
Jack::JackSessionNotifyResult
Definition: JackRequest.h:1258