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.

99 lines
2.7KB

  1. /*
  2. Copyright (C) 2005 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 __JackServerGlobals__
  16. #define __JackServerGlobals__
  17. #include "driver_interface.h"
  18. #include "JackDriverLoader.h"
  19. #include "JackCompilerDeps.h"
  20. #include "JackServer.h"
  21. #include "JackGlobals.h"
  22. #include <map>
  23. namespace Jack
  24. {
  25. class JackClient;
  26. /*!
  27. \brief Global server static structure: singleton kind of pattern.
  28. */
  29. class SERVER_EXPORT JackServerGlobals : public JackGlobals
  30. {
  31. /* This object is managed by JackGlobalsManager */
  32. friend class JackGlobalsManager;
  33. private:
  34. JackServerGlobals(const std::string &server_name) : JackGlobals(server_name) {}
  35. ~JackServerGlobals() override {}
  36. public:
  37. static JackServer* fInstance;
  38. static unsigned int fUserCount;
  39. static std::map<std::string, JackDriverInfo*> fSlavesList;
  40. static std::map<std::string, int> fInternalsList;
  41. static bool (* on_device_acquire)(const char* device_name);
  42. static void (* on_device_release)(const char* device_name);
  43. static void (* on_device_reservation_loop)(void);
  44. bool Init();
  45. void Deinit();
  46. int Start(const char* server_name,
  47. jack_driver_desc_t* driver_desc,
  48. JSList* driver_params,
  49. int sync,
  50. int temporary,
  51. int time_out_ms,
  52. int rt,
  53. int priority,
  54. int port_max,
  55. int verbose,
  56. jack_timer_type_t clock,
  57. char self_connect_mode);
  58. void Stop();
  59. void Destroy();
  60. bool AddContext(const uint32_t &context_num, const std::string &server_name) override
  61. {
  62. return true;
  63. }
  64. bool DelContext(const uint32_t &context_num) override
  65. {
  66. return true;
  67. }
  68. JackGraphManager* GetGraphManager() override;
  69. JackEngineControl* GetEngineControl() override;
  70. JackSynchro* GetSynchroTable() override;
  71. JackServer* GetServer() override;
  72. };
  73. } // end of namespace
  74. #endif