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.

161 lines
5.4KB

  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. // Open the Server/Client connection
  34. virtual int Open(const char* name, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status)
  35. {
  36. return 0;
  37. }
  38. void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result)
  39. {
  40. *result = fEngine->ClientCheck(name, uuid, name_res, protocol, options, status);
  41. }
  42. void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
  43. {
  44. *result = fEngine->ClientInternalOpen(name, ref, shared_engine, shared_manager, client, true);
  45. }
  46. void ClientClose(int refnum, int* result)
  47. {
  48. *result = fEngine->ClientInternalClose(refnum, true);
  49. }
  50. void ClientActivate(int refnum, int is_real_time, int* result)
  51. {
  52. *result = fEngine->ClientActivate(refnum, is_real_time);
  53. }
  54. void ClientDeactivate(int refnum, int* result)
  55. {
  56. *result = fEngine->ClientDeactivate(refnum);
  57. }
  58. void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, unsigned int* port_index, int* result)
  59. {
  60. *result = fEngine->PortRegister(refnum, name, type, flags, buffer_size, port_index);
  61. }
  62. void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
  63. {
  64. *result = fEngine->PortUnRegister(refnum, port_index);
  65. }
  66. void PortConnect(int refnum, const char* src, const char* dst, int* result)
  67. {
  68. *result = fEngine->PortConnect(refnum, src, dst);
  69. }
  70. void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
  71. {
  72. *result = fEngine->PortDisconnect(refnum, src, dst);
  73. }
  74. void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  75. {
  76. *result = fEngine->PortConnect(refnum, src, dst);
  77. }
  78. void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  79. {
  80. *result = fEngine->PortDisconnect(refnum, src, dst);
  81. }
  82. void PortRename(int refnum, jack_port_id_t port, const char* name, int* result)
  83. {
  84. *result = fEngine->PortRename(refnum, port, name);
  85. }
  86. void SetBufferSize(jack_nframes_t buffer_size, int* result)
  87. {
  88. *result = fServer->SetBufferSize(buffer_size);
  89. }
  90. void SetFreewheel(int onoff, int* result)
  91. {
  92. *result = fServer->SetFreewheel(onoff);
  93. }
  94. void ComputeTotalLatencies(int* result)
  95. {
  96. *result = fEngine->ComputeTotalLatencies();
  97. }
  98. void SessionNotify( int refnum, const char *target, jack_session_event_type_t type, const char *path, jack_session_command_t **result )
  99. {
  100. *result = NULL;
  101. }
  102. void ReleaseTimebase(int refnum, int* result)
  103. {
  104. *result = fServer->ReleaseTimebase(refnum);
  105. }
  106. void SetTimebaseCallback(int refnum, int conditional, int* result)
  107. {
  108. *result = fServer->SetTimebaseCallback(refnum, conditional);
  109. }
  110. void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result)
  111. {
  112. *result = fEngine->GetInternalClientName(int_ref, name_res);
  113. }
  114. void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result)
  115. {
  116. *result = fEngine->InternalClientHandle(client_name, status, int_ref);
  117. }
  118. 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)
  119. {
  120. *result = fServer->InternalClientLoad(client_name, so_name, objet_data, options, int_ref, uuid, status);
  121. }
  122. void InternalClientUnload(int refnum, int int_ref, int* status, int* result)
  123. {
  124. *result = fEngine->InternalClientUnload(int_ref, status);
  125. }
  126. };
  127. } // end of namespace
  128. #endif