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) 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 __JackServer__
  17. #define __JackServer__
  18. #include "JackCompilerDeps.h"
  19. #include "driver_interface.h"
  20. #include "JackDriverLoader.h"
  21. #include "JackDriverInfo.h"
  22. #include "JackConnectionManager.h"
  23. #include "JackGlobals.h"
  24. #include "JackPlatformPlug.h"
  25. #include "jslist.h"
  26. namespace Jack
  27. {
  28. class JackGraphManager;
  29. class JackDriverClientInterface;
  30. struct JackEngineControl;
  31. class JackLockedEngine;
  32. class JackLoadableInternalClient;
  33. class JackMetadata;
  34. /*!
  35. \brief The Jack server.
  36. */
  37. class SERVER_EXPORT JackServer
  38. {
  39. private:
  40. JackDriverInfo* fDriverInfo;
  41. JackDriverClientInterface* fAudioDriver;
  42. JackDriverClientInterface* fFreewheelDriver;
  43. JackDriverClientInterface* fThreadedFreewheelDriver;
  44. JackLockedEngine* fEngine;
  45. JackEngineControl* fEngineControl;
  46. JackGraphManager* fGraphManager;
  47. JackMetadata* fMetadata;
  48. JackServerChannel fRequestChannel;
  49. JackConnectionManager fConnectionState;
  50. JackSynchro fSynchroTable[CLIENT_NUM];
  51. bool fFreewheel;
  52. int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, jack_uuid_t uuid, int* status);
  53. public:
  54. JackServer(bool sync, bool temporary, int timeout, bool rt, int priority, int port_max, bool verbose, jack_timer_type_t clock, char self_connect_mode, const char* server_name);
  55. ~JackServer();
  56. // Server control
  57. int Open(jack_driver_desc_t* driver_desc, JSList* driver_params);
  58. int Close();
  59. int Start();
  60. int Stop();
  61. bool IsRunning();
  62. // RT thread
  63. void Notify(int refnum, int notify, int value);
  64. // From request thread : API
  65. int SetBufferSize(jack_nframes_t buffer_size);
  66. int SetFreewheel(bool onoff);
  67. // Internals clients
  68. int InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, jack_uuid_t uuid, int* status);
  69. int InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, jack_uuid_t uuid, int* status);
  70. // Internal session file
  71. int LoadInternalSessionFile(const char* file);
  72. // Transport management
  73. int ReleaseTimebase(int refnum);
  74. int SetTimebaseCallback(int refnum, int conditional);
  75. // Backend management
  76. JackDriverInfo* AddSlave(jack_driver_desc_t* driver_desc, JSList* driver_params);
  77. void RemoveSlave(JackDriverInfo* info);
  78. int SwitchMaster(jack_driver_desc_t* driver_desc, JSList* driver_params);
  79. // Object access
  80. JackLockedEngine* GetEngine();
  81. JackEngineControl* GetEngineControl();
  82. JackSynchro* GetSynchroTable();
  83. JackGraphManager* GetGraphManager();
  84. JackMetadata* GetMetadata();
  85. };
  86. } // end of namespace
  87. #endif