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.

130 lines
3.5KB

  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 "driver_interface.h"
  21. namespace Jack
  22. {
  23. struct JackEngineControl;
  24. /*!
  25. \brief Internal clients in the server.
  26. */
  27. class JackInternalClient : public JackClient
  28. {
  29. private:
  30. JackClientControl fClientControl; /*! Client control */
  31. public:
  32. JackInternalClient(JackServer* server, JackSynchro* table);
  33. virtual ~JackInternalClient();
  34. int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
  35. void ShutDown(jack_status_t code, const char* message);
  36. JackGraphManager* GetGraphManager() const;
  37. JackEngineControl* GetEngineControl() const;
  38. JackClientControl* GetClientControl() const;
  39. static JackGraphManager* fGraphManager; /*! Shared memory Port manager */
  40. static JackEngineControl* fEngineControl; /*! Shared engine control */
  41. };
  42. /*!
  43. \brief Loadable internal clients in the server.
  44. */
  45. typedef int (*InitializeCallback)(jack_client_t*, const char*);
  46. typedef int (*InternalInitializeCallback)(jack_client_t*, const JSList* params);
  47. typedef void (*FinishCallback)(void *);
  48. class JackLoadableInternalClient : public JackInternalClient
  49. {
  50. protected:
  51. JACK_HANDLE fHandle;
  52. FinishCallback fFinish;
  53. JackDriverDescFunction fDescriptor;
  54. public:
  55. JackLoadableInternalClient(JackServer* server, JackSynchro* table)
  56. :JackInternalClient(server, table), fHandle(NULL), fFinish(NULL), fDescriptor(NULL)
  57. {}
  58. virtual ~JackLoadableInternalClient();
  59. virtual int Init(const char* so_name);
  60. };
  61. class JackLoadableInternalClient1 : public JackLoadableInternalClient
  62. {
  63. private:
  64. InitializeCallback fInitialize;
  65. char fObjectData[JACK_LOAD_INIT_LIMIT];
  66. public:
  67. JackLoadableInternalClient1(JackServer* server, JackSynchro* table, const char* object_data);
  68. virtual ~JackLoadableInternalClient1()
  69. {}
  70. int Init(const char* so_name);
  71. int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
  72. };
  73. class JackLoadableInternalClient2 : public JackLoadableInternalClient
  74. {
  75. private:
  76. InternalInitializeCallback fInitialize;
  77. const JSList* fParameters;
  78. public:
  79. JackLoadableInternalClient2(JackServer* server, JackSynchro* table, const JSList* parameters);
  80. virtual ~JackLoadableInternalClient2()
  81. {}
  82. int Init(const char* so_name);
  83. int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
  84. };
  85. } // end of namespace
  86. #endif