Jack2  1.9.8
JackWinNamedPipeClientChannel.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 
00021 #ifndef __JackWinNamedPipeClientChannel__
00022 #define __JackWinNamedPipeClientChannel__
00023 
00024 #include "JackChannel.h"
00025 #include "JackWinNamedPipe.h"
00026 #include "JackPlatformPlug.h"
00027 #include "JackRequest.h"
00028 
00029 namespace Jack
00030 {
00031 
00036 class JackWinNamedPipeClientChannel : public detail::JackClientChannelInterface, public JackRunnableInterface
00037 {
00038 
00039     private:
00040 
00041         JackWinNamedPipeClient fRequestPipe;                    // Pipe to communicate with the server
00042         JackWinNamedPipeServer fNotificationListenPipe; // Pipe listener for server notification
00043         JackThread fThread;                             // Thread to execute the event loop
00044         JackClient*     fClient;
00045 
00046         void ServerSyncCall(JackRequest* req, JackResult* res, int* result);
00047         void ServerAsyncCall(JackRequest* req, JackResult* res, int* result);
00048 
00049     public:
00050 
00051         JackWinNamedPipeClientChannel();
00052         virtual ~JackWinNamedPipeClientChannel();
00053 
00054         int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status);
00055         void Close();
00056 
00057         int Start();
00058         void Stop();
00059 
00060         int ServerCheck(const char* server_name);
00061 
00062         void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open);
00063         void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result);
00064         void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
00065         {}
00066         void ClientClose(int refnum, int* result);
00067 
00068         void ClientActivate(int refnum, int is_real_time, int* result);
00069         void ClientDeactivate(int refnum, int* result);
00070 
00071         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);
00072         void PortUnRegister(int refnum, jack_port_id_t port_index, int* result);
00073 
00074         void PortConnect(int refnum, const char* src, const char* dst, int* result);
00075         void PortDisconnect(int refnum, const char* src, const char* dst, int* result);
00076 
00077         void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result);
00078         void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result);
00079 
00080         void PortRename(int refnum, jack_port_id_t port, const char* name, int* result);
00081 
00082         void SetBufferSize(jack_nframes_t buffer_size, int* result);
00083         void SetFreewheel(int onoff, int* result);
00084         void ComputeTotalLatencies(int* result);
00085 
00086         void ReleaseTimebase(int refnum, int* result);
00087         void SetTimebaseCallback(int refnum, int conditional, int* result);
00088 
00089         void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result);
00090         void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result);
00091         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);
00092         void InternalClientUnload(int refnum, int int_ref, int* status, int* result);
00093 
00094         void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result);
00095         void SessionReply(int refnum, int* result);
00096         void GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result);
00097         void GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result);
00098         void ReserveClientName(int refnum, const char* client_name, const char *uuid, int* result);
00099         void ClientHasSessionCallback(const char* client_name, int* result);
00100 
00101         // JackRunnableInterface interface
00102         bool Init();
00103         bool Execute();
00104 
00105         bool IsChannelThread() { return fThread.IsThread(); }
00106 };
00107 
00108 } // end of namespace
00109 
00110 #endif
00111