Jack2 1.9.10

JackChannel.h

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 Lesser General Public License as published by
00006 the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
00013 
00014 You should have received a copy of the GNU Lesser General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 
00018 */
00019 
00020 #ifndef __JackChannel__
00021 #define __JackChannel__
00022 
00023 #include "types.h"
00024 #include "JackSession.h"
00025 
00026 namespace Jack
00027 {
00028 
00029 class JackClientInterface;
00030 class JackClient;
00031 class JackServer;
00032 struct JackEngineControl;
00033 class JackGraphManager;
00034 
00035 namespace detail
00036 {
00037 
00038 class JackChannelTransactionInterface
00039 {
00040 
00041     public:
00042 
00043         JackChannelTransactionInterface()
00044         {}
00045         virtual ~JackChannelTransactionInterface()
00046         {}
00047 
00048         virtual int Read(void* data, int len) = 0;
00049         virtual int Write(void* data, int len) = 0;
00050 
00051 };
00052 
00053 class JackRequestInterface
00054 {
00055 
00056     public:
00057 
00058         JackRequestInterface()
00059         {}
00060         virtual ~JackRequestInterface()
00061         {}
00062 
00063         virtual int Connect(const char* dir, const char* name, int which) = 0;
00064         virtual int Close() = 0;
00065 
00066 };
00067 
00068 class JackClientRequestInterface : public JackChannelTransactionInterface, public JackRequestInterface
00069 {
00070 
00071     public:
00072 
00073         JackClientRequestInterface()
00074         {}
00075         virtual ~JackClientRequestInterface()
00076         {}
00077         
00078         virtual int Read(void* data, int len) { return -1; }
00079         virtual int Write(void* data, int len) { return -1; }
00080         
00081         virtual int Connect(const char* dir, const char* name, int which) { return -1; }
00082         virtual int Close() { return -1; }
00083 
00084 };
00085 
00090 class JackClientChannelInterface
00091 {
00092 
00093     public:
00094 
00095         JackClientChannelInterface()
00096         {}
00097         virtual ~JackClientChannelInterface()
00098         {}
00099 
00100         // Open the Server/Client connection
00101         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)
00102         {
00103             return 0;
00104         }
00105 
00106         // Close the Server/Client connection
00107         virtual void Close()
00108         {}
00109 
00110         // Start listening for messages from the server
00111         virtual int Start()
00112         {
00113             return 0;
00114         }
00115 
00116         // Stop listening for messages from the server
00117         virtual void Stop()
00118         {}
00119 
00120         virtual int ServerCheck(const char* server_name)
00121         {
00122             return -1;
00123         }
00124 
00125         virtual void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
00126         {}
00127         virtual void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
00128         {}
00129         virtual void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
00130         {}
00131         virtual void ClientClose(int refnum, int* result)
00132         {}
00133 
00134         virtual void ClientActivate(int refnum, int is_real_time, int* result)
00135         {}
00136         virtual void ClientDeactivate(int refnum, int* result)
00137         {}
00138 
00139         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)
00140         {}
00141         virtual void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
00142         {}
00143 
00144         virtual void PortConnect(int refnum, const char* src, const char* dst, int* result)
00145         {}
00146         virtual void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
00147         {}
00148         virtual void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
00149         {}
00150         virtual void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
00151         {}
00152         virtual void PortRename(int refnum, jack_port_id_t port, const char* name, int* result)
00153         {}
00154 
00155         virtual void SetBufferSize(jack_nframes_t buffer_size, int* result)
00156         {}
00157         virtual void SetFreewheel(int onoff, int* result)
00158         {}
00159         virtual void ComputeTotalLatencies(int* result)
00160         {}
00161 
00162         virtual void ReleaseTimebase(int refnum, int* result)
00163         {}
00164         virtual void SetTimebaseCallback(int refnum, int conditional, int* result)
00165         {}
00166 
00167         virtual void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result)
00168         {}
00169         virtual void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result)
00170         {}
00171         virtual 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)
00172         {}
00173         virtual void InternalClientUnload(int refnum, int int_ref, int* status, int* result)
00174         {}
00175 
00176         virtual void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result)
00177         {}
00178         virtual void SessionReply(int refnum, int* result)
00179         {}
00180         virtual void GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result)
00181         {}
00182         virtual void GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result)
00183         {}
00184         virtual void ReserveClientName(int refnum, const char* client_name, const char *uuid, int* result)
00185         {}
00186         virtual void ClientHasSessionCallback(const char* client_name, int* result)
00187         {}
00188 
00189         virtual bool IsChannelThread()
00190         {
00191             return false;
00192         }
00193 };
00194 
00195 }
00196 
00197 } // end of namespace
00198 
00199 #endif
00200