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.

BankUI.fl 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0302
  3. header_name {.h}
  4. code_name {.cc}
  5. decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {private local
  6. }
  7. decl {//License: GNU GPL version 2 or later} {private local
  8. }
  9. decl {\#include <cstdlib>} {public local
  10. }
  11. decl {\#include <cstdio>} {public local
  12. }
  13. decl {\#include <cstring>} {public local
  14. }
  15. decl {\#include <FL/Fl_Button.H>} {public local
  16. }
  17. decl {\#include <FL/Fl_File_Chooser.H>} {public local
  18. }
  19. decl {\#include <FL/Fl_Input.H>} {public local
  20. }
  21. decl {\#include "Fl_Osc_Interface.h"} {public local
  22. }
  23. decl {\#include "Fl_Osc_Check.H"} {public local
  24. }
  25. decl {\#include "Fl_Osc_Pane.H"} {public local
  26. }
  27. decl {\#include "../Misc/Util.h"} {public local
  28. }
  29. decl {\#include "BankView.h"} {public local
  30. }
  31. class BankUI {open
  32. } {
  33. Function {make_window()} {open
  34. } {
  35. Fl_Window bankuiwindow {
  36. label Bank open
  37. xywh {492 406 785 575} type Double
  38. class Fl_Osc_Window
  39. } {
  40. Fl_Box {} {
  41. xywh {0 0 0 0}
  42. code0 {bankuiwindow->init(osc, "/");}
  43. }
  44. Fl_Button {} {
  45. label Close
  46. callback {bankuiwindow->hide();}
  47. xywh {705 546 70 24} box THIN_UP_BOX
  48. }
  49. Fl_Group bankview {open
  50. xywh {5 34 772 491} box ENGRAVED_FRAME
  51. class BankView
  52. } {}
  53. Fl_Group modeselect {open
  54. xywh {5 528 425 42} box ENGRAVED_BOX
  55. class BankViewControls
  56. code0 {o->box(FL_UP_BOX);}
  57. } {}
  58. Fl_Button {} {
  59. label {New Bank...}
  60. callback {const char *dirname;
  61. dirname=fl_input("New empty Bank:");
  62. if (dirname==NULL) return;
  63. osc->write("/bank/newbank", "s", dirname);
  64. refreshmainwindow();}
  65. xywh {685 5 93 25} labelfont 1 labelsize 11 align 128
  66. }
  67. Fl_Check_Button {} {
  68. label {auto close}
  69. tooltip {automatically close the bank window if the instrument is loaded} xywh {705 529 60 15} down_box DOWN_BOX labelsize 10
  70. code0 {o->init("config/cfg.BankUIAutoClose");}
  71. class Fl_Osc_Check
  72. }
  73. Fl_Choice banklist {
  74. callback {refreshmainwindow();}
  75. xywh {5 8 220 20} down_box BORDER_BOX labelfont 1 align 0 textfont 1 textsize 11
  76. code0 {bankview->init(osc, modeselect, npart);}
  77. code1 {o->init("bank/bank_select");}
  78. class BankList
  79. } {}
  80. Fl_Button {} {
  81. label {Refresh bank list}
  82. callback {rescan_for_banks();
  83. banklist->value(0);}
  84. tooltip {Refresh the bank list (rescan)} xywh {230 8 105 20} box THIN_UP_BOX color 50 labelsize 11
  85. }
  86. Fl_Input {} {
  87. label {Search by name: }
  88. code0 {o->when(FL_WHEN_CHANGED);}
  89. callback {
  90. std::string str = o->value();
  91. update_search(str)}
  92. tooltip {Enter text to search for}
  93. xywh {460 8 105 20} box THIN_UP_BOX color 50 labelsize 11
  94. }
  95. }
  96. }
  97. Function {BankUI(int *npart_, Fl_Osc_Interface *osc_)} {open
  98. } {
  99. code {npart=npart_;
  100. osc =osc_;
  101. make_window();
  102. } {}
  103. }
  104. Function {~BankUI()} {open return_type virtual
  105. } {
  106. code {bankuiwindow->hide();
  107. delete bankuiwindow;} {}
  108. }
  109. Function {show()} {open
  110. } {
  111. code {bankuiwindow->show();} {}
  112. }
  113. Function {hide()} {open
  114. } {
  115. code {bankuiwindow->hide();} {}
  116. }
  117. Function {init(Fl_Valuator *cbwig_)} {open
  118. } {
  119. code {cbwig=cbwig_;
  120. bankview->cbwig(cbwig);
  121. rescan_for_banks();} {}
  122. }
  123. Function {process()} {open return_type void
  124. } {
  125. code {} {}
  126. }
  127. Function {refreshmainwindow()} {open
  128. } {
  129. code {
  130. bankview->refresh();} {}
  131. }
  132. Function {rescan_for_banks()} {open
  133. } {
  134. code {banklist->clear();
  135. osc->write("/bank/rescan");
  136. if (banklist->size() == 0)
  137. banklist->add(" ");} {}
  138. }
  139. Function {update_search(std::string search_string)} {open
  140. } {
  141. code {if (search_string.empty()) {
  142. refreshmainwindow();
  143. } else {
  144. osc->write("/bank/search", "s", search_string.c_str());
  145. }
  146. } {}
  147. }
  148. decl {Fl_Osc_Interface *osc;} {private local
  149. }
  150. decl {Fl_Valuator *cbwig;} {public local
  151. }
  152. decl {int *npart;} {private local
  153. }
  154. }