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.

69 lines
1.8KB

  1. // ----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2012-2018 Fons Adriaensen <fons@linuxaudio.org>
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation; either version 3 of the License, or
  8. // (at your option) any later version.
  9. //
  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. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. //
  18. // ----------------------------------------------------------------------------
  19. #ifndef __ALSATHREAD_H
  20. #define __ALSATHREAD_H
  21. #include <zita-alsa-pcmi.h>
  22. #include "jack/jack.h"
  23. #include "pxthread.h"
  24. #include "lfqueue.h"
  25. class Alsathread : public Pxthread
  26. {
  27. public:
  28. enum { INIT, WAIT, PROC, TERM };
  29. enum { PLAY, CAPT };
  30. Alsathread (Alsa_pcmi *alsadev, int mode);
  31. virtual ~Alsathread (void);
  32. virtual void thr_main (void);
  33. int start (Lfq_audio *audioq, Lfq_int32 *commq, Lfq_adata *alsaq, int rtprio);
  34. private:
  35. void send (int k, double t);
  36. int capture (void);
  37. int playback (void);
  38. Alsa_pcmi *_alsadev;
  39. int _mode;
  40. int _state;
  41. int _nfail;
  42. int _fsize;
  43. Lfq_audio *_audioq;
  44. Lfq_int32 *_commq;
  45. Lfq_adata *_alsaq;
  46. bool _first;
  47. // double _jtmod;
  48. double _t0;
  49. double _t1;
  50. double _dt;
  51. double _w1;
  52. double _w2;
  53. };
  54. #endif