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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. BankView.h - View of Bank Widgets
  4. Copyright (C) 2016 Mark McCurry
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. */
  10. #ifndef BANKVIEW_H
  11. #define BANKVIEW_H
  12. #include "Fl_Osc_Widget.H"
  13. #include "Fl_Osc_Choice.H"
  14. #include <FL/Fl_Group.H>
  15. #include <FL/Fl_Check_Button.H>
  16. #include <string>
  17. #include "common.H"
  18. class Bank;
  19. class BankView;
  20. class Fl_Check_Button;
  21. class BankList : public Fl_Osc_Choice
  22. {
  23. public:
  24. BankList(int x,int y, int w, int h, const char *label=0);
  25. void init(std::string path);
  26. void OSC_raw(const char *msg);
  27. };
  28. class BankSlot : public Fl_Button
  29. {
  30. public:
  31. BankSlot(int x,int y, int w, int h, const char *label=0);
  32. int handle(int event);
  33. void init(int nslot_, BankView *bv_);
  34. void update(const char *name__, const char *fname__);
  35. bool empty(void) const;
  36. const char *name(void) const;
  37. const char *filename(void) const;
  38. private:
  39. std::string name_;
  40. std::string filename_;
  41. char labelstr[128];
  42. int nslot;
  43. BankView *bv;
  44. };
  45. class BankViewControls: public Fl_Group
  46. {
  47. public:
  48. BankViewControls(int x,int y, int w, int h, const char *label=0);
  49. void init(BankView *bv_);
  50. int mode(void) const;
  51. void mode(int);
  52. private:
  53. Fl_Check_Button *read;
  54. Fl_Check_Button *write;
  55. Fl_Check_Button *clear;
  56. Fl_Check_Button *swap;
  57. //1 -> read
  58. //2 -> write
  59. //3 -> clear
  60. //4 -> swap
  61. int mode_;
  62. static void cb_clearbutton(Fl_Check_Button*, void*);
  63. static void cb_readbutton(Fl_Check_Button*, void*);
  64. static void cb_writebutton(Fl_Check_Button*, void*);
  65. };
  66. class BankView: public Fl_Group, public Fl_Osc_Widget
  67. {
  68. public:
  69. BankView(int x,int y, int w, int h, const char *label=0);
  70. ~BankView(void);
  71. void init(Fl_Osc_Interface *osc_, BankViewControls *bvc_, int *npart_);
  72. void react(int event, int slot);
  73. virtual void OSC_raw(const char *msg) override;
  74. void cbwig(Fl_Widget *w);
  75. void refresh(void);
  76. private:
  77. BankViewControls *bvc;
  78. BankSlot *slots[160];
  79. //XXX TODO locked banks...
  80. int nselected;
  81. int *npart;
  82. Fl_Widget *cbwig_;
  83. };
  84. #endif