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.

119 lines
3.7KB

  1. /*
  2. Copyright (C) 2004-2006 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 JackClientChannelInterface
  24. {
  25. private:
  26. JackServer* fServer;
  27. JackEngine* fEngine;
  28. public:
  29. JackInternalClientChannel(JackServer* server): fServer(server), fEngine(server->GetEngine())
  30. {}
  31. virtual ~JackInternalClientChannel()
  32. {}
  33. void ClientNew(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
  34. {
  35. *result = fEngine->ClientInternalNew(name, ref, shared_engine, shared_manager, client);
  36. }
  37. void ClientClose(int refnum, int* result)
  38. {
  39. *result = fEngine->ClientInternalClose(refnum);
  40. }
  41. void ClientActivate(int refnum, int* result)
  42. {
  43. //*result = fServer->Activate(refnum);
  44. *result = fEngine->ClientActivate(refnum);
  45. }
  46. void ClientDeactivate(int refnum, int* result)
  47. {
  48. //*result = fServer->Deactivate(refnum);
  49. *result = fEngine->ClientDeactivate(refnum);
  50. }
  51. void PortRegister(int refnum, const char* name, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result)
  52. {
  53. *result = fEngine->PortRegister(refnum, name, flags, buffer_size, port_index);
  54. }
  55. void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
  56. {
  57. *result = fEngine->PortUnRegister(refnum, port_index);
  58. }
  59. void PortConnect(int refnum, const char* src, const char* dst, int* result)
  60. {
  61. *result = fEngine->PortConnect(refnum, src, dst);
  62. }
  63. void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
  64. {
  65. *result = fEngine->PortDisconnect(refnum, src, dst);
  66. }
  67. void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  68. {
  69. *result = fEngine->PortConnect(refnum, src, dst);
  70. }
  71. void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  72. {
  73. *result = fEngine->PortDisconnect(refnum, src, dst);
  74. }
  75. void SetBufferSize(jack_nframes_t buffer_size, int* result)
  76. {
  77. *result = fServer->SetBufferSize(buffer_size);
  78. }
  79. void SetFreewheel(int onoff, int* result)
  80. {
  81. *result = fServer->SetFreewheel(onoff);
  82. }
  83. // A FINIR
  84. virtual void ReleaseTimebase(int refnum, int* result)
  85. {
  86. *result = fEngine->ReleaseTimebase(refnum);
  87. }
  88. virtual void SetTimebaseCallback(int refnum, int conditional, int* result)
  89. {
  90. *result = fEngine->SetTimebaseCallback(refnum, conditional);
  91. }
  92. };
  93. } // end of namespace
  94. #endif