Audio plugin host https://kx.studio/carla
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.

jclient.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // -----------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2010 Fons Adriaensen <fons@linuxaudio.org>
  4. // Modified by falkTX on Jan-Apr 2015 for inclusion in Carla
  5. //
  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. //
  11. // This program is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU General Public License
  17. // along with this program; if not, write to the Free Software
  18. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. //
  20. // -----------------------------------------------------------------------
  21. #ifndef __JCLIENT_H
  22. #define __JCLIENT_H
  23. #include "CarlaNativeJack.h"
  24. #include <clthreads.h>
  25. #include "retuner.h"
  26. namespace AT1 {
  27. class Jclient : public A_thread
  28. {
  29. public:
  30. Jclient (jack_client_t *jclient);
  31. ~Jclient (void);
  32. unsigned int fsize (void) const { return _fsize; }
  33. unsigned int fsamp (void) const { return _fsamp; }
  34. Retuner *retuner (void) { return _retuner; }
  35. void set_notemask (int m) { _notemask = m; }
  36. void set_midichan (int c) { _midichan = c; }
  37. void clr_midimask (void);
  38. int get_noteset (void) { return _retuner->get_noteset (); }
  39. int get_midiset (void) { return _midimask; }
  40. private:
  41. virtual void thr_main (void) {}
  42. void init_jack (void);
  43. void close_jack (void);
  44. void jack_shutdown (void);
  45. int jack_process (int nframes);
  46. void midi_process (int nframes);
  47. jack_client_t *_jack_client;
  48. jack_port_t *_ainp_port;
  49. jack_port_t *_aout_port;
  50. jack_port_t *_midi_port;
  51. bool _active;
  52. unsigned int _fsamp;
  53. unsigned int _fsize;
  54. Retuner *_retuner;
  55. int _notes [12];
  56. int _notemask;
  57. int _midimask;
  58. int _midichan;
  59. static void jack_static_shutdown (void *arg);
  60. static int jack_static_process (jack_nframes_t nframes, void *arg);
  61. };
  62. }
  63. #endif