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.

100 lines
2.4KB

  1. // ----------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2011 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 <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 (jack_client_t *jclient);
  37. ~Jclient (void);
  38. void set_inpbal (float diff)
  39. {
  40. _inpbal0 = diff;
  41. }
  42. void set_hpfilt (float freq)
  43. {
  44. _hpfilt.setparam (freq);
  45. }
  46. void set_loshelf (float gain, float freq)
  47. {
  48. _lshelf.setparam (powf (10.0f, 0.05f * gain), freq, 0.4f);
  49. }
  50. Shuffler *shuffler (void)
  51. {
  52. return (Shuffler *) &_shuffl;
  53. }
  54. private:
  55. void init_jack (void);
  56. void close_jack (void);
  57. void jack_shutdown (void);
  58. int jack_process (int nframes);
  59. virtual void thr_main (void) {}
  60. jack_client_t *_jack_client;
  61. jack_port_t *_inpports [2];
  62. jack_port_t *_outports [2];
  63. bool _active;
  64. unsigned int _fsamp;
  65. int _psize;
  66. int _fragm;
  67. int _nsamp;
  68. float _inpbal0;
  69. float _inpbal1;
  70. float _ga, _gb;
  71. float _da, _db;
  72. HP3filt _hpfilt;
  73. LFshelf2 _lshelf;
  74. Shuffler _shuffl;
  75. static void jack_static_shutdown (void *arg);
  76. static int jack_static_process (jack_nframes_t nframes, void *arg);
  77. };
  78. }
  79. #endif