Init engine fields, cleanup.
[jack2.git] / common / JackInternalClientChannel.h
blobbef060072cfbe2881f0c68937c9d52ba4007a9f9
1 /*
2 Copyright (C) 2004-2008 Grame
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.
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.
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.
20 #ifndef __JackInternalClientChannel__
21 #define __JackInternalClientChannel__
23 #include "JackChannel.h"
25 namespace Jack
28 /*!
29 \brief JackClientChannel for server internal clients.
32 class JackInternalClientChannel : public detail::JackClientChannelInterface
35 private:
37 JackServer* fServer;
38 JackLockedEngine* fEngine;
40 public:
42 JackInternalClientChannel(JackServer* server): fServer(server), fEngine(server->GetEngine())
44 virtual ~JackInternalClientChannel()
47 // Open the Server/Client connection
48 virtual int Open(const char* name, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status)
50 return 0;
53 void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result)
55 *result = fEngine->ClientCheck(name, name_res, protocol, options, status);
57 void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
59 *result = fEngine->ClientInternalOpen(name, ref, shared_engine, shared_manager, client, true);
61 void ClientClose(int refnum, int* result)
63 *result = fEngine->ClientInternalClose(refnum, true);
66 void ClientActivate(int refnum, int is_real_time, int* result)
68 *result = fEngine->ClientActivate(refnum, is_real_time);
70 void ClientDeactivate(int refnum, int* result)
72 *result = fEngine->ClientDeactivate(refnum);
75 void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, unsigned int* port_index, int* result)
77 *result = fEngine->PortRegister(refnum, name, type, flags, buffer_size, port_index);
79 void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
81 *result = fEngine->PortUnRegister(refnum, port_index);
84 void PortConnect(int refnum, const char* src, const char* dst, int* result)
86 *result = fEngine->PortConnect(refnum, src, dst);
88 void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
90 *result = fEngine->PortDisconnect(refnum, src, dst);
93 void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
95 *result = fEngine->PortConnect(refnum, src, dst);
97 void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
99 *result = fEngine->PortDisconnect(refnum, src, dst);
101 void PortRename(int refnum, jack_port_id_t port, const char* name, int* result)
103 *result = fEngine->PortRename(refnum, port, name);
106 void SetBufferSize(jack_nframes_t buffer_size, int* result)
108 *result = fServer->SetBufferSize(buffer_size);
110 void SetFreewheel(int onoff, int* result)
112 *result = fServer->SetFreewheel(onoff);
115 void SessionNotify( int refnum, const char *target, jack_session_event_type_t type, const char *path, jack_session_command_t **result )
117 *result = NULL;
120 void ReleaseTimebase(int refnum, int* result)
122 *result = fServer->ReleaseTimebase(refnum);
125 void SetTimebaseCallback(int refnum, int conditional, int* result)
127 *result = fServer->SetTimebaseCallback(refnum, conditional);
130 void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result)
132 *result = fEngine->GetInternalClientName(int_ref, name_res);
135 void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result)
137 *result = fEngine->InternalClientHandle(client_name, status, int_ref);
140 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)
142 *result = fServer->InternalClientLoad(client_name, so_name, objet_data, options, int_ref, uuid, status);
145 void InternalClientUnload(int refnum, int int_ref, int* status, int* result)
147 *result = fEngine->InternalClientUnload(int_ref, status);
152 } // end of namespace
154 #endif