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.

BankView.h 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #ifndef BANKVIEW_H
  2. #define BANKVIEW_H
  3. #include "Fl_Osc_Widget.H"
  4. #include "Fl_Osc_Choice.H"
  5. #include <FL/Fl_Group.H>
  6. #include <FL/Fl_Check_Button.H>
  7. #include <string>
  8. #include "common.H"
  9. class Bank;
  10. class BankView;
  11. class Fl_Light_Button;
  12. class BankList : public Fl_Osc_Choice
  13. {
  14. public:
  15. BankList(int x,int y, int w, int h, const char *label=0);
  16. void init(std::string path);
  17. void OSC_raw(const char *msg);
  18. };
  19. class BankSlot : public Fl_Button
  20. {
  21. public:
  22. BankSlot(int x,int y, int w, int h, const char *label=0);
  23. int handle(int event);
  24. void init(int nslot_, BankView *bv_);
  25. void update(const char *name__, const char *fname__);
  26. bool empty(void) const;
  27. const char *name(void) const;
  28. const char *filename(void) const;
  29. private:
  30. std::string name_;
  31. std::string filename_;
  32. char labelstr[128];
  33. int nslot;
  34. BankView *bv;
  35. };
  36. class BankViewControls: public Fl_Group
  37. {
  38. public:
  39. BankViewControls(int x,int y, int w, int h, const char *label=0);
  40. void init(BankView *bv_);
  41. int mode(void) const;
  42. void mode(int);
  43. private:
  44. Fl_Check_Button *read;
  45. Fl_Check_Button *write;
  46. Fl_Check_Button *clear;
  47. Fl_Check_Button *swap;
  48. //1 -> read
  49. //2 -> write
  50. //3 -> clear
  51. //4 -> swap
  52. int mode_;
  53. static void cb_clearbutton(Fl_Light_Button*, void*);
  54. static void cb_readbutton(Fl_Light_Button*, void*);
  55. static void cb_writebutton(Fl_Light_Button*, void*);
  56. };
  57. class BankView: public Fl_Group, public Fl_Osc_Widget
  58. {
  59. public:
  60. BankView(int x,int y, int w, int h, const char *label=0);
  61. ~BankView(void);
  62. void init(Fl_Osc_Interface *osc_, BankViewControls *bvc_, int *npart_);
  63. void react(int event, int slot);
  64. virtual void OSC_raw(const char *msg) override;
  65. void cbwig(Fl_Widget *w);
  66. void refresh(void);
  67. private:
  68. BankViewControls *bvc;
  69. BankSlot *slots[160];
  70. Fl_Osc_Interface *osc;
  71. std::string loc;
  72. //XXX TODO locked banks...
  73. int nselected;
  74. int *npart;
  75. Fl_Widget *cbwig_;
  76. };
  77. #endif