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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // ----------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2011 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 <inttypes.h>
  24. #include <stdlib.h>
  25. #include <math.h>
  26. #include <clthreads.h>
  27. #include "CarlaNativeJack.h"
  28. #include "hp3filt.h"
  29. #include "shuffler.h"
  30. #include "lfshelf2.h"
  31. #include "global.h"
  32. namespace BLS1 {
  33. class Jclient : public A_thread
  34. {
  35. public:
  36. Jclient (const char *jname, jack_client_t *jclient);
  37. ~Jclient (void);
  38. const char *jname (void) const { return _jname; }
  39. void set_inpbal (float diff)
  40. {
  41. _inpbal0 = diff;
  42. }
  43. void set_hpfilt (float freq)
  44. {
  45. _hpfilt.setparam (freq);
  46. }
  47. void set_loshelf (float gain, float freq)
  48. {
  49. _lshelf.setparam (powf (10.0f, 0.05f * gain), freq, 0.4f);
  50. }
  51. Shuffler *shuffler (void)
  52. {
  53. return (Shuffler *) &_shuffl;
  54. }
  55. private:
  56. void init_jack (const char *jname);
  57. void close_jack (void);
  58. void jack_shutdown (void);
  59. int jack_process (int nframes);
  60. virtual void thr_main (void) {}
  61. jack_client_t *_jack_client;
  62. jack_port_t *_inpports [2];
  63. jack_port_t *_outports [2];
  64. bool _active;
  65. const char *_jname;
  66. unsigned int _fsamp;
  67. int _psize;
  68. int _fragm;
  69. int _nsamp;
  70. float _inpbal0;
  71. float _inpbal1;
  72. float _ga, _gb;
  73. float _da, _db;
  74. HP3filt _hpfilt;
  75. LFshelf2 _lshelf;
  76. Shuffler _shuffl;
  77. static void jack_static_shutdown (void *arg);
  78. static int jack_static_process (jack_nframes_t nframes, void *arg);
  79. };
  80. }
  81. #endif