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.

mainwin.h 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // ----------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2010-2014 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 __MAINWIN_H
  22. #define __MAINWIN_H
  23. #include <clxclient.h>
  24. #include "guiclass.h"
  25. #include "jclient.h"
  26. #include "tmeter.h"
  27. #include "global.h"
  28. class ZitaPipeClient;
  29. namespace AT1 {
  30. class Mainwin : public A_thread, public X_window, public X_callback
  31. {
  32. public:
  33. struct ValueChangedCallback {
  34. virtual ~ValueChangedCallback() {}
  35. virtual void noteMaskChangedCallback(int) = 0;
  36. virtual void valueChangedCallback(uint, float) = 0;
  37. };
  38. enum { XSIZE = 580, YSIZE = 75 };
  39. Mainwin (X_rootwin *parent, X_resman *xres, int xp, int yp, ValueChangedCallback* valuecb);
  40. ~Mainwin (void);
  41. Mainwin (const Mainwin&);
  42. Mainwin& operator=(const Mainwin&);
  43. void stop (void) { _stop = true; }
  44. int process (void);
  45. void setdata_ui (float error, int noteset, int midiset);
  46. void setchan_ui (int chan);
  47. void setmask_ui (int mask);
  48. private:
  49. enum { B_MIDI = 12, B_CHAN = 13 };
  50. enum { R_TUNE, R_FILT, R_BIAS, R_CORR, R_OFFS, NROTARY };
  51. virtual void thr_main (void) {}
  52. void handle_time (void);
  53. void handle_stop (void);
  54. void handle_event (XEvent *);
  55. void handle_callb (int type, X_window *W, XEvent *E);
  56. void showval (int k);
  57. void expose (XExposeEvent *E);
  58. void clmesg (XClientMessageEvent *E);
  59. void redraw (void);
  60. void setchan (int d);
  61. Atom _atom;
  62. bool _stop;
  63. bool _ambis;
  64. X_resman *_xres;
  65. int _notes;
  66. PushButton *_bmidi;
  67. PushButton *_bnote [12];
  68. RotaryCtl *_rotary [NROTARY];
  69. Tmeter *_tmeter;
  70. X_textip *_textln;
  71. X_tbutton *_bchan;
  72. int _midich;
  73. int _ttimer;
  74. float z_error;
  75. int z_noteset, z_midiset;
  76. ValueChangedCallback* _valuecb;
  77. friend class ::ZitaPipeClient;
  78. };
  79. }
  80. #endif