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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // ----------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2010-2014 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 __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 AT1Plugin;
  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 valueChangedCallback(uint, float) = 0;
  36. };
  37. enum { XSIZE = 600, YSIZE = 75 };
  38. Mainwin (X_rootwin *parent, X_resman *xres, int xp, int yp, Jclient *jclient, ValueChangedCallback* valuecb);
  39. ~Mainwin (void);
  40. Mainwin (const Mainwin&);
  41. Mainwin& operator=(const Mainwin&);
  42. void stop (void) { _stop = true; }
  43. int process (void);
  44. void setchan_ui (int chan);
  45. private:
  46. enum { B_MIDI = 12, B_CHAN = 13 };
  47. enum { R_TUNE, R_FILT, R_BIAS, R_CORR, R_OFFS, NROTARY };
  48. virtual void thr_main (void) {}
  49. void handle_time (void);
  50. void handle_stop (void);
  51. void handle_event (XEvent *);
  52. void handle_callb (int type, X_window *W, XEvent *E);
  53. void showval (int k);
  54. void expose (XExposeEvent *E);
  55. void clmesg (XClientMessageEvent *E);
  56. void redraw (void);
  57. void setchan (int d);
  58. Atom _atom;
  59. bool _stop;
  60. bool _ambis;
  61. X_resman *_xres;
  62. Jclient *_jclient;
  63. int _notes;
  64. PushButton *_bmidi;
  65. PushButton *_bnote [12];
  66. RotaryCtl *_rotary [NROTARY];
  67. Tmeter *_tmeter;
  68. X_textip *_textln;
  69. X_tbutton *_bchan;
  70. int _midich;
  71. int _ttimer;
  72. ValueChangedCallback* _valuecb;
  73. friend class ::AT1Plugin;
  74. };
  75. }
  76. #endif