jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
6.3KB

  1. /*
  2. Copyright (C) 2004-2008 Grame
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2.1 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #ifndef __JackChannel__
  16. #define __JackChannel__
  17. #include "types.h"
  18. #include "JackSession.h"
  19. #include "JackMetadata.h"
  20. namespace Jack
  21. {
  22. class JackClientInterface;
  23. class JackClient;
  24. class JackServer;
  25. struct JackEngineControl;
  26. class JackGraphManager;
  27. namespace detail
  28. {
  29. class JackChannelTransactionInterface
  30. {
  31. public:
  32. JackChannelTransactionInterface()
  33. {}
  34. virtual ~JackChannelTransactionInterface()
  35. {}
  36. virtual int Read(void* data, int len) = 0;
  37. virtual int Write(void* data, int len) = 0;
  38. };
  39. class JackRequestInterface
  40. {
  41. public:
  42. JackRequestInterface()
  43. {}
  44. virtual ~JackRequestInterface()
  45. {}
  46. virtual int Connect(const char* dir, const char* name, int which) = 0;
  47. virtual int Close() = 0;
  48. };
  49. class JackClientRequestInterface : public JackChannelTransactionInterface, public JackRequestInterface
  50. {
  51. public:
  52. JackClientRequestInterface()
  53. {}
  54. virtual ~JackClientRequestInterface()
  55. {}
  56. virtual int Read(void* data, int len) { return -1; }
  57. virtual int Write(void* data, int len) { return -1; }
  58. virtual int Connect(const char* dir, const char* name, int which) { return -1; }
  59. virtual int Close() { return -1; }
  60. };
  61. /*!
  62. \brief Inter process channel for server/client bidirectionnal communication : request and (receiving) notifications.
  63. */
  64. class JackClientChannelInterface
  65. {
  66. public:
  67. JackClientChannelInterface()
  68. {}
  69. virtual ~JackClientChannelInterface()
  70. {}
  71. // Open the Server/Client connection
  72. 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)
  73. {
  74. return 0;
  75. }
  76. // Close the Server/Client connection
  77. virtual void Close()
  78. {}
  79. // Start listening for messages from the server
  80. virtual int Start()
  81. {
  82. return 0;
  83. }
  84. // Stop listening for messages from the server
  85. virtual void Stop()
  86. {}
  87. virtual int ServerCheck(const char* server_name)
  88. {
  89. return -1;
  90. }
  91. virtual void ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
  92. {}
  93. virtual void ClientOpen(const char* name, int pid, jack_uuid_t uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
  94. {}
  95. virtual void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
  96. {}
  97. virtual void ClientClose(int refnum, int* result)
  98. {}
  99. virtual void ClientActivate(int refnum, int is_real_time, int* result)
  100. {}
  101. virtual void ClientDeactivate(int refnum, int* result)
  102. {}
  103. 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)
  104. {}
  105. virtual void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
  106. {}
  107. virtual void PortConnect(int refnum, const char* src, const char* dst, int* result)
  108. {}
  109. virtual void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
  110. {}
  111. virtual void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  112. {}
  113. virtual void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  114. {}
  115. virtual void PortRename(int refnum, jack_port_id_t port, const char* name, int* result)
  116. {}
  117. virtual void SetBufferSize(jack_nframes_t buffer_size, int* result)
  118. {}
  119. virtual void SetFreewheel(int onoff, int* result)
  120. {}
  121. virtual void ComputeTotalLatencies(int* result)
  122. {}
  123. virtual void ReleaseTimebase(int refnum, int* result)
  124. {}
  125. virtual void SetTimebaseCallback(int refnum, int conditional, int* result)
  126. {}
  127. virtual void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result)
  128. {}
  129. virtual void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result)
  130. {}
  131. 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)
  132. {}
  133. virtual void InternalClientUnload(int refnum, int int_ref, int* status, int* result)
  134. {}
  135. virtual void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char* path, jack_session_command_t** result)
  136. {}
  137. virtual void SessionReply(int refnum, int* result)
  138. {}
  139. virtual void GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result)
  140. {}
  141. virtual void GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result)
  142. {}
  143. virtual void ReserveClientName(int refnum, const char* client_name, const char *uuid, int* result)
  144. {}
  145. virtual void ClientHasSessionCallback(const char* client_name, int* result)
  146. {}
  147. virtual void PropertyChangeNotify(jack_uuid_t subject, const char* key, jack_property_change_t change, int* result)
  148. {}
  149. virtual bool IsChannelThread()
  150. {
  151. return false;
  152. }
  153. };
  154. }
  155. } // end of namespace
  156. #endif