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.

214 lines
5.8KB

  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 "JackError.h"
  19. namespace Jack
  20. {
  21. class JackClientInterface;
  22. class JackClient;
  23. class JackServer;
  24. struct JackEngineControl;
  25. class JackGraphManager;
  26. /*!
  27. \brief Inter process channel for server/client bidirectionnal communication : request and (receiving) notifications.
  28. */
  29. class JackClientChannelInterface
  30. {
  31. public:
  32. JackClientChannelInterface()
  33. {}
  34. virtual ~JackClientChannelInterface()
  35. {}
  36. // Open the Server/Client connection
  37. virtual int Open(const char* server_name, const char* name, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status)
  38. {
  39. return 0;
  40. }
  41. // Close the Server/Client connection
  42. virtual void Close()
  43. {}
  44. // Start listening for messages from the server
  45. virtual int Start()
  46. {
  47. return 0;
  48. }
  49. // Stop listening for messages from the server
  50. virtual void Stop()
  51. {}
  52. virtual int ServerCheck(const char* server_name)
  53. {
  54. return -1;
  55. }
  56. virtual void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result)
  57. {}
  58. virtual void ClientOpen(const char* name, int* shared_engine, int* shared_client, int* shared_graph, int* result)
  59. {}
  60. virtual void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
  61. {}
  62. virtual void ClientClose(int refnum, int* result)
  63. {}
  64. virtual void ClientActivate(int refnum, int* result)
  65. {}
  66. virtual void ClientDeactivate(int refnum, int* result)
  67. {}
  68. virtual void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, unsigned int* port_index, int* result)
  69. {}
  70. virtual void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
  71. {}
  72. virtual void PortConnect(int refnum, const char* src, const char* dst, int* result)
  73. {}
  74. virtual void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
  75. {}
  76. virtual void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  77. {}
  78. virtual void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  79. {}
  80. virtual void SetBufferSize(jack_nframes_t buffer_size, int* result)
  81. {}
  82. virtual void SetFreewheel(int onoff, int* result)
  83. {}
  84. virtual void ReleaseTimebase(int refnum, int* result)
  85. {}
  86. virtual void SetTimebaseCallback(int refnum, int conditional, int* result)
  87. {}
  88. virtual void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result)
  89. {}
  90. virtual void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result)
  91. {}
  92. 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* result)
  93. {}
  94. virtual void InternalClientUnload(int refnum, int int_ref, int* status, int* result)
  95. {}
  96. };
  97. /*!
  98. \brief Inter process channel for server to client notifications.
  99. */
  100. class JackNotifyChannelInterface
  101. {
  102. public:
  103. JackNotifyChannelInterface()
  104. {}
  105. virtual ~JackNotifyChannelInterface()
  106. {}
  107. // Open the Server/Client connection
  108. virtual int Open(const char* name)
  109. {
  110. return 0;
  111. }
  112. // Close the Server/Client connection
  113. virtual void Close()
  114. {}
  115. /*
  116. The "sync" parameter allows to choose between "synchronous" and "asynchronous" notification
  117. */
  118. virtual void ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2, int* result)
  119. {}
  120. };
  121. /*!
  122. \brief Entry point channel for client/server communication.
  123. */
  124. class JackServerChannelInterface
  125. {
  126. public:
  127. JackServerChannelInterface()
  128. {}
  129. virtual ~JackServerChannelInterface()
  130. {}
  131. // Open the Server/Client connection
  132. virtual int Open(const char* server_name, JackServer* server)
  133. {
  134. return 0;
  135. }
  136. // Close the Server/Client connection
  137. virtual void Close()
  138. {}
  139. };
  140. /*!
  141. \brief Channel for server RT thread to request server thread communication.
  142. */
  143. class JackServerNotifyChannelInterface
  144. {
  145. public:
  146. JackServerNotifyChannelInterface()
  147. {}
  148. virtual ~JackServerNotifyChannelInterface()
  149. {}
  150. // Open the Server RT/Server connection
  151. virtual int Open(const char* server_name)
  152. {
  153. return 0;
  154. }
  155. // Close the Server RT/Server connection
  156. virtual void Close()
  157. {}
  158. virtual void Notify(int refnum, int notify, int value)
  159. {}
  160. };
  161. } // end of namespace
  162. #endif