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.

97 lines
2.7KB

  1. /*
  2. Copyright (C) 2001 Paul Davis
  3. Copyright (C) 2004 Grame
  4. Copyright (C) 2007 Pieter Palmers
  5. Copyright (C) 2012 Adrian Knoth
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. #ifndef __JackFFADODriver__
  19. #define __JackFFADODriver__
  20. #include "JackAudioDriver.h"
  21. #include "JackThreadedDriver.h"
  22. #include "JackTime.h"
  23. #include "ffado_driver.h"
  24. namespace Jack
  25. {
  26. /*!
  27. \brief The FFADO driver.
  28. */
  29. class JackFFADODriver : public JackAudioDriver
  30. {
  31. private:
  32. // enable verbose messages
  33. int g_verbose;
  34. jack_driver_t* fDriver;
  35. int ffado_driver_attach (ffado_driver_t *driver);
  36. int ffado_driver_detach (ffado_driver_t *driver);
  37. int ffado_driver_read (ffado_driver_t * driver, jack_nframes_t nframes);
  38. int ffado_driver_write (ffado_driver_t * driver, jack_nframes_t nframes);
  39. jack_nframes_t ffado_driver_wait (ffado_driver_t *driver,
  40. int extra_fd, int *status,
  41. float *delayed_usecs);
  42. int ffado_driver_start (ffado_driver_t *driver);
  43. int ffado_driver_stop (ffado_driver_t *driver);
  44. int ffado_driver_restart (ffado_driver_t *driver);
  45. ffado_driver_t *ffado_driver_new (const char *name, ffado_jack_settings_t *params);
  46. void ffado_driver_delete (ffado_driver_t *driver);
  47. void jack_driver_init (jack_driver_t *driver);
  48. void jack_driver_nt_init (jack_driver_nt_t * driver);
  49. void UpdateLatencies();
  50. public:
  51. JackFFADODriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
  52. : JackAudioDriver(name, alias,engine, table)
  53. {}
  54. virtual ~JackFFADODriver()
  55. {}
  56. int Open(ffado_jack_settings_t *cmlparams);
  57. int Close();
  58. int Attach();
  59. int Detach();
  60. int Start();
  61. int Stop();
  62. int Read();
  63. int Write();
  64. // BufferSize can be changed
  65. bool IsFixedBufferSize()
  66. {
  67. return false;
  68. }
  69. int SetBufferSize(jack_nframes_t nframes);
  70. };
  71. } // end of namespace
  72. #endif