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.

106 lines
3.1KB

  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 "JackExports.h"
  19. #include "driver_interface.h"
  20. #include "JackDriverLoader.h"
  21. #include "JackConnectionManager.h"
  22. #include "jslist.h"
  23. #include "JackGlobals.h"
  24. #include "JackPlatformSynchro.h"
  25. #include "JackPlatformServerChannel.h"
  26. namespace Jack
  27. {
  28. class JackGraphManager;
  29. class JackDriverClientInterface;
  30. struct JackEngineControl;
  31. class JackLockedEngine;
  32. class JackLoadableInternalClient;
  33. /*!
  34. \brief The Jack server.
  35. */
  36. class EXPORT JackServer
  37. {
  38. private:
  39. jack_driver_info_t* fDriverInfo;
  40. JackDriverClientInterface* fAudioDriver;
  41. JackDriverClientInterface* fFreewheelDriver;
  42. JackDriverClientInterface* fLoopbackDriver;
  43. JackLockedEngine* fEngine;
  44. JackEngineControl* fEngineControl;
  45. JackGraphManager* fGraphManager;
  46. JackServerChannel fChannel;
  47. JackConnectionManager fConnectionState;
  48. JackSynchro fSynchroTable[CLIENT_NUM];
  49. bool fFreewheel;
  50. long fLoopback;
  51. int InternalClientLoadAux(JackLoadableInternalClient* client, const char* client_name, int options, int* int_ref, int* status);
  52. public:
  53. JackServer(bool sync, bool temporary, long timeout, bool rt, long priority, long loopback, bool verbose, const char* server_name);
  54. ~JackServer();
  55. int Open(jack_driver_desc_t* driver_desc, JSList* driver_params);
  56. int Close();
  57. int Start();
  58. int Stop();
  59. // RT thread
  60. void Notify(int refnum, int notify, int value);
  61. // Command thread : API
  62. int SetBufferSize(jack_nframes_t buffer_size);
  63. int SetFreewheel(bool onoff);
  64. int InternalClientLoad(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int* status);
  65. int InternalClientLoad(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int* status);
  66. void ClientKill(int refnum);
  67. // Transport management
  68. int ReleaseTimebase(int refnum);
  69. int SetTimebaseCallback(int refnum, int conditional);
  70. // Object access
  71. JackLockedEngine* GetEngine();
  72. JackEngineControl* GetEngineControl();
  73. JackSynchro* GetSynchroTable();
  74. JackGraphManager* GetGraphManager();
  75. static JackServer* fInstance; // Unique instance
  76. };
  77. } // end of namespace
  78. #endif