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.

131 lines
3.4KB

  1. /*
  2. Copyright (C) 2001 Paul Davis
  3. Copyright (C) 2004-2008 Grame
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #ifndef __JackInternalClient__
  17. #define __JackInternalClient__
  18. #include "JackClient.h"
  19. #include "JackClientControl.h"
  20. #include "JackServerGlobals.h"
  21. #include "driver_interface.h"
  22. namespace Jack
  23. {
  24. struct JackEngineControl;
  25. /*!
  26. \brief Internal clients in the server.
  27. */
  28. class JackInternalClient : public JackClient
  29. {
  30. private:
  31. JackClientControl fClientControl; /*! Client control */
  32. public:
  33. JackInternalClient(JackServerGlobals *globals);
  34. virtual ~JackInternalClient();
  35. int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
  36. void ShutDown(jack_status_t code, const char* message);
  37. JackGraphManager* GetGraphManager() const;
  38. JackEngineControl* GetEngineControl() const;
  39. JackClientControl* GetClientControl() const;
  40. static JackGraphManager* fGraphManager; /*! Shared memory Port manager */
  41. static JackEngineControl* fEngineControl; /*! Shared engine control */
  42. };
  43. /*!
  44. \brief Loadable internal clients in the server.
  45. */
  46. typedef int (*InitializeCallback)(jack_client_t*, const char*);
  47. typedef int (*InternalInitializeCallback)(jack_client_t*, const JSList* params);
  48. typedef void (*FinishCallback)(void *);
  49. class JackLoadableInternalClient : public JackInternalClient
  50. {
  51. protected:
  52. JACK_HANDLE fHandle;
  53. FinishCallback fFinish;
  54. JackDriverDescFunction fDescriptor;
  55. public:
  56. JackLoadableInternalClient(JackServerGlobals* global)
  57. :JackInternalClient(global), fHandle(NULL), fFinish(NULL), fDescriptor(NULL)
  58. {}
  59. virtual ~JackLoadableInternalClient();
  60. virtual int Init(const char* so_name);
  61. };
  62. class JackLoadableInternalClient1 : public JackLoadableInternalClient
  63. {
  64. private:
  65. InitializeCallback fInitialize;
  66. char fObjectData[JACK_LOAD_INIT_LIMIT];
  67. public:
  68. JackLoadableInternalClient1(JackServerGlobals *global, const char* object_data);
  69. virtual ~JackLoadableInternalClient1()
  70. {}
  71. int Init(const char* so_name);
  72. int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
  73. };
  74. class JackLoadableInternalClient2 : public JackLoadableInternalClient
  75. {
  76. private:
  77. InternalInitializeCallback fInitialize;
  78. const JSList* fParameters;
  79. public:
  80. JackLoadableInternalClient2(JackServerGlobals *global, const JSList* parameters);
  81. virtual ~JackLoadableInternalClient2()
  82. {}
  83. int Init(const char* so_name);
  84. int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
  85. };
  86. } // end of namespace
  87. #endif