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.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // -----------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2010 Fons Adriaensen <fons@linuxaudio.org>
  4. // Modified by falkTX on Jan 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 (const char *jname, jack_client_t *jclient);
  31. ~Jclient (void);
  32. const char *jname (void) { return _jname; }
  33. unsigned int fsize (void) const { return _fsize; }
  34. unsigned int fsamp (void) const { return _fsamp; }
  35. Retuner *retuner (void) { return _retuner; }
  36. void set_notemask (int m) { _notemask = m; }
  37. void set_midichan (int c) { _midichan = c; }
  38. void clr_midimask (void);
  39. int get_noteset (void) { return _retuner->get_noteset (); }
  40. int get_midiset (void) { return _midimask; }
  41. private:
  42. virtual void thr_main (void) {}
  43. void init_jack (const char *jname);
  44. void close_jack (void);
  45. void jack_shutdown (void);
  46. int jack_process (int nframes);
  47. void midi_process (int nframes);
  48. jack_client_t *_jack_client;
  49. jack_port_t *_ainp_port;
  50. jack_port_t *_aout_port;
  51. jack_port_t *_midi_port;
  52. bool _active;
  53. const char *_jname;
  54. unsigned int _fsamp;
  55. unsigned int _fsize;
  56. Retuner *_retuner;
  57. int _notes [12];
  58. int _notemask;
  59. int _midimask;
  60. int _midichan;
  61. static void jack_static_shutdown (void *arg);
  62. static int jack_static_process (jack_nframes_t nframes, void *arg);
  63. };
  64. }
  65. #endif