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.

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