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 Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __JackChannel__
21 #define __JackChannel__
24 #include "JackSession.h"
25 #include "JackMetadata.h"
30 class JackClientInterface
;
33 struct JackEngineControl
;
34 class JackGraphManager
;
39 class JackChannelTransactionInterface
44 JackChannelTransactionInterface()
46 virtual ~JackChannelTransactionInterface()
49 virtual int Read(void* data
, int len
) = 0;
50 virtual int Write(void* data
, int len
) = 0;
54 class JackRequestInterface
59 JackRequestInterface()
61 virtual ~JackRequestInterface()
64 virtual int Connect(const char* dir
, const char* name
, int which
) = 0;
65 virtual int Close() = 0;
69 class JackClientRequestInterface
: public JackChannelTransactionInterface
, public JackRequestInterface
74 JackClientRequestInterface()
76 virtual ~JackClientRequestInterface()
79 virtual int Read(void* data
, int len
) { return -1; }
80 virtual int Write(void* data
, int len
) { return -1; }
82 virtual int Connect(const char* dir
, const char* name
, int which
) { return -1; }
83 virtual int Close() { return -1; }
88 \brief Inter process channel for server/client bidirectionnal communication : request and (receiving) notifications.
91 class JackClientChannelInterface
96 JackClientChannelInterface()
98 virtual ~JackClientChannelInterface()
101 // Open the Server/Client connection
102 virtual int Open(const char* server_name
, const char* name
, jack_uuid_t uuid
, char* name_res
, JackClient
* obj
, jack_options_t options
, jack_status_t
* status
)
107 // Close the Server/Client connection
111 // Start listening for messages from the server
117 // Stop listening for messages from the server
121 virtual int ServerCheck(const char* server_name
)
126 virtual void ClientCheck(const char* name
, jack_uuid_t uuid
, char* name_res
, int protocol
, int options
, int* status
, int* result
, int open
)
128 virtual void ClientOpen(const char* name
, int pid
, jack_uuid_t uuid
, int* shared_engine
, int* shared_client
, int* shared_graph
, int* result
)
130 virtual void ClientOpen(const char* name
, int* ref
, JackEngineControl
** shared_engine
, JackGraphManager
** shared_manager
, JackClientInterface
* client
, int* result
)
132 virtual void ClientClose(int refnum
, int* result
)
135 virtual void ClientActivate(int refnum
, int is_real_time
, int* result
)
137 virtual void ClientDeactivate(int refnum
, int* result
)
140 virtual 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
)
142 virtual void PortUnRegister(int refnum
, jack_port_id_t port_index
, int* result
)
145 virtual void PortConnect(int refnum
, const char* src
, const char* dst
, int* result
)
147 virtual void PortDisconnect(int refnum
, const char* src
, const char* dst
, int* result
)
149 virtual void PortConnect(int refnum
, jack_port_id_t src
, jack_port_id_t dst
, int* result
)
151 virtual void PortDisconnect(int refnum
, jack_port_id_t src
, jack_port_id_t dst
, int* result
)
153 virtual void PortRename(int refnum
, jack_port_id_t port
, const char* name
, int* result
)
156 virtual void SetBufferSize(jack_nframes_t buffer_size
, int* result
)
158 virtual void SetFreewheel(int onoff
, int* result
)
160 virtual void ComputeTotalLatencies(int* result
)
163 virtual void ReleaseTimebase(int refnum
, int* result
)
165 virtual void SetTimebaseCallback(int refnum
, int conditional
, int* result
)
168 virtual void GetInternalClientName(int refnum
, int int_ref
, char* name_res
, int* result
)
170 virtual void InternalClientHandle(int refnum
, const char* client_name
, int* status
, int* int_ref
, int* result
)
172 virtual void InternalClientLoad(int refnum
, const char* client_name
, const char* so_name
, const char* objet_data
, int options
, int* status
, int* int_ref
, jack_uuid_t uuid
, int* result
)
174 virtual void InternalClientUnload(int refnum
, int int_ref
, int* status
, int* result
)
177 virtual void SessionNotify(int refnum
, const char* target
, jack_session_event_type_t type
, const char* path
, jack_session_command_t
** result
)
179 virtual void SessionReply(int refnum
, int* result
)
181 virtual void GetUUIDForClientName(int refnum
, const char* client_name
, char* uuid_res
, int* result
)
183 virtual void GetClientNameForUUID(int refnum
, const char* uuid
, char* name_res
, int* result
)
185 virtual void ReserveClientName(int refnum
, const char* client_name
, const char *uuid
, int* result
)
187 virtual void ClientHasSessionCallback(const char* client_name
, int* result
)
190 virtual void PropertyChangeNotify(jack_uuid_t subject
, const char* key
, jack_property_change_t change
, int* result
)
193 virtual bool IsChannelThread()
201 } // end of namespace