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.

117 lines
3.6KB

  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. }
  45. void ClientDeactivate(int refnum, int* result)
  46. {
  47. *result = fServer->Deactivate(refnum);
  48. }
  49. void PortRegister(int refnum, const char* name, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result)
  50. {
  51. *result = fEngine->PortRegister(refnum, name, flags, buffer_size, port_index);
  52. }
  53. void PortUnRegister(int refnum, jack_port_id_t port_index, int* result)
  54. {
  55. *result = fEngine->PortUnRegister(refnum, port_index);
  56. }
  57. void PortConnect(int refnum, const char* src, const char* dst, int* result)
  58. {
  59. *result = fEngine->PortConnect(refnum, src, dst);
  60. }
  61. void PortDisconnect(int refnum, const char* src, const char* dst, int* result)
  62. {
  63. *result = fEngine->PortDisconnect(refnum, src, dst);
  64. }
  65. void PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  66. {
  67. *result = fEngine->PortConnect(refnum, src, dst);
  68. }
  69. void PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst, int* result)
  70. {
  71. *result = fEngine->PortDisconnect(refnum, src, dst);
  72. }
  73. void SetBufferSize(jack_nframes_t nframes, int* result)
  74. {
  75. *result = fServer->SetBufferSize(nframes);
  76. }
  77. void SetFreewheel(int onoff, int* result)
  78. {
  79. *result = fServer->SetFreewheel(onoff);
  80. }
  81. // A FINIR
  82. virtual void ReleaseTimebase(int refnum, int* result)
  83. {
  84. *result = fEngine->ReleaseTimebase(refnum);
  85. }
  86. virtual void SetTimebaseCallback(int refnum, int conditional, int* result)
  87. {
  88. *result = fEngine->SetTimebaseCallback(refnum, conditional);
  89. }
  90. };
  91. } // end of namespace
  92. #endif