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.

186 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 General Public License as published by
  5. the Free Software Foundation; either version 2 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 General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14. */
  15. #ifndef __JackInternalClientChannel__
  16. #define __JackInternalClientChannel__
  17. #include "JackChannel.h"
  18. namespace Jack
  19. {
  20. /*!
  21. \brief JackClientChannel for server internal clients.
  22. */
  23. class JackInternalClientChannel : public detail::JackClientChannelInterface
  24. {
  25. private:
  26. JackServer* fServer;
  27. JackLockedEngine* fEngine;
  28. public:
  29. JackInternalClientChannel(JackServer* server): fServer(server), fEngine(server->GetEngine())
  30. {}
  31. virtual ~JackInternalClientChannel()
  32. {}
  33. void ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
  34. {
  35. *result = fEngine->ClientCheck(name, uuid, name_res, protocol, options, status);
  36. }
  37. void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
  38. {
  39. *result = fEngine->ClientInternalOpen(name, ref, shared_engine, shared_manager, client, true);
  40. }
  41. void ClientClose(int refnum, int* result)
  42. {
  43. *result = fEngine->ClientInternalClose(refnum, true);
  44. }
  45. void ClientActivate(int refnum, int is_real_time, int* result)
  46. {
  47. *result = fEngine->ClientActivate(refnum, is_real_time);
  48. }
  49. void ClientDeactivate(int refnum, int* result)
  50. {
  51. *result = fEngine->ClientDeactivate(refnum);
  52. }
  53. void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, unsigned int* port_index, int* result)
  54. {
  55. *result = fEngine->PortRegister(refnum, name, type, flags, buffer_size, port_index);
  56. }
  57. void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
  58. {
  59. *result = fEngine->PortUnRegister(refnum, port_index);
  60. }
  61. void PortConnect(int refnum, const char* src, const char* dst, int* result)
  62. {
  63. *result = fEngine->PortConnect(refnum, src, dst);
  64. }
  65. void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
  66. {
  67. *result = fEngine->PortDisconnect(refnum, src, dst);
  68. }
  69. void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  70. {
  71. *result = fEngine->PortConnect(refnum, src, dst);
  72. }
  73. void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  74. {
  75. *result = fEngine->PortDisconnect(refnum, src, dst);
  76. }
  77. void PortRename(int refnum, jack_port_id_t port, const char* name, int* result)
  78. {
  79. *result = fEngine->PortRename(refnum, port, name);
  80. }
  81. void SetBufferSize(jack_nframes_t buffer_size, int* result)
  82. {
  83. *result = fServer->SetBufferSize(buffer_size);
  84. }
  85. void SetFreewheel(int onoff, int* result)
  86. {
  87. *result = fServer->SetFreewheel(onoff);
  88. }
  89. void ComputeTotalLatencies(int* result)
  90. {
  91. *result = fEngine->ComputeTotalLatencies();
  92. }
  93. void ReleaseTimebase(int refnum, int* result)
  94. {
  95. *result = fServer->ReleaseTimebase(refnum);
  96. }
  97. void SetTimebaseCallback(int refnum, int conditional, int* result)
  98. {
  99. *result = fServer->SetTimebaseCallback(refnum, conditional);
  100. }
  101. void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result)
  102. {
  103. *result = fEngine->GetInternalClientName(int_ref, name_res);
  104. }
  105. void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result)
  106. {
  107. *result = fEngine->InternalClientHandle(client_name, status, int_ref);
  108. }
  109. 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)
  110. {
  111. *result = fServer->InternalClientLoad1(client_name, so_name, objet_data, options, int_ref, uuid, status);
  112. }
  113. void InternalClientUnload(int refnum, int int_ref, int* status, int* result)
  114. {
  115. *result = fEngine->InternalClientUnload(int_ref, status);
  116. }
  117. void SessionNotify(int refnum, const char *target, jack_session_event_type_t type, const char *path, jack_session_command_t** result)
  118. {
  119. JackSessionNotifyResult* res;
  120. fEngine->SessionNotify(refnum, target, type, path, NULL, &res);
  121. if (res == NULL) {
  122. *result = NULL;
  123. return;
  124. }
  125. *result = res->GetCommands();
  126. delete(res);
  127. }
  128. void SessionReply(int refnum, int* result)
  129. {
  130. *result = fEngine->SessionReply(refnum);
  131. }
  132. void GetUUIDForClientName(int refnum, const char* client_name, char* uuid_res, int* result)
  133. {
  134. *result = fEngine->GetUUIDForClientName(client_name, uuid_res);
  135. }
  136. void GetClientNameForUUID(int refnum, const char* uuid, char* name_res, int* result)
  137. {
  138. *result = fEngine->GetClientNameForUUID(uuid, name_res);
  139. }
  140. void ReserveClientName(int refnum, const char* client_name, const char *uuid, int* result)
  141. {
  142. *result = fEngine->ReserveClientName(client_name, uuid);
  143. }
  144. void ClientHasSessionCallback(const char* client_name, int* result)
  145. {
  146. *result = fEngine->ClientHasSessionCallback(client_name);
  147. }
  148. };
  149. } // end of namespace
  150. #endif