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 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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_Osc_Interface.h"} {public local
  20. }
  21. decl {\#include "Fl_Osc_Check.H"} {public local
  22. }
  23. decl {\#include "Fl_Osc_Pane.H"} {public local
  24. }
  25. decl {\#include "../Misc/Util.h"} {public local
  26. }
  27. decl {\#include "BankView.h"} {public local
  28. }
  29. class BankUI {open
  30. } {
  31. Function {make_window()} {open
  32. } {
  33. Fl_Window bankuiwindow {
  34. label Bank open
  35. xywh {492 406 785 575} type Double
  36. class Fl_Osc_Window
  37. } {
  38. Fl_Box {} {
  39. xywh {0 0 0 0}
  40. code0 {bankuiwindow->init(osc, "/");}
  41. }
  42. Fl_Button {} {
  43. label Close
  44. callback {bankuiwindow->hide();}
  45. xywh {705 546 70 24} box THIN_UP_BOX
  46. }
  47. Fl_Group bankview {open
  48. xywh {5 34 772 491} box ENGRAVED_FRAME
  49. class BankView
  50. } {}
  51. Fl_Group modeselect {open
  52. xywh {5 528 425 42} box ENGRAVED_BOX
  53. class BankViewControls
  54. code0 {o->box(FL_UP_BOX);}
  55. } {}
  56. Fl_Button {} {
  57. label {New Bank...}
  58. callback {const char *dirname;
  59. dirname=fl_input("New empty Bank:");
  60. if (dirname==NULL) return;
  61. osc->write("/newbank", "s", dirname);
  62. /*if (result!=0) fl_alert("Error: Could not make a new bank (directory)..");*/
  63. refreshmainwindow();}
  64. xywh {685 5 93 25} labelfont 1 labelsize 11 align 128
  65. }
  66. Fl_Check_Button {} {
  67. label {auto close}
  68. tooltip {automatically close the bank window if the instrument is loaded} xywh {705 529 60 15} down_box DOWN_BOX labelsize 10
  69. code0 {o->init("config/cfg.BankUIAutoClose");}
  70. class Fl_Osc_Check
  71. }
  72. Fl_Choice banklist {
  73. callback {refreshmainwindow();}
  74. xywh {5 8 220 20} down_box BORDER_BOX labelfont 1 align 0 textfont 1 textsize 11
  75. code0 {bankview->init(osc, modeselect, npart);}
  76. code1 {o->init("bank/bank_select");}
  77. class BankList
  78. } {}
  79. Fl_Button {} {
  80. label {Refresh bank list}
  81. callback {rescan_for_banks();
  82. banklist->value(0);}
  83. tooltip {Refresh the bank list (rescan)} xywh {230 8 105 20} box THIN_UP_BOX color 50 labelsize 11
  84. }
  85. }
  86. }
  87. Function {BankUI(int *npart_, Fl_Osc_Interface *osc_)} {open
  88. } {
  89. code {npart=npart_;
  90. osc =osc_;
  91. make_window();
  92. } {}
  93. }
  94. Function {~BankUI()} {open return_type virtual
  95. } {
  96. code {bankuiwindow->hide();
  97. delete bankuiwindow;} {}
  98. }
  99. Function {show()} {open
  100. } {
  101. code {bankuiwindow->show();} {}
  102. }
  103. Function {hide()} {open
  104. } {
  105. code {bankuiwindow->hide();} {}
  106. }
  107. Function {init(Fl_Valuator *cbwig_)} {open
  108. } {
  109. code {cbwig=cbwig_;
  110. bankview->cbwig(cbwig);
  111. rescan_for_banks();} {}
  112. }
  113. Function {process()} {open return_type void
  114. } {
  115. code {} {}
  116. }
  117. Function {refreshmainwindow()} {open
  118. } {
  119. code {
  120. bankview->refresh();} {}
  121. }
  122. Function {rescan_for_banks()} {open
  123. } {
  124. code {banklist->clear();
  125. osc->write("/bank/rescan");
  126. if (banklist->size() == 0)
  127. banklist->add(" ");} {}
  128. }
  129. decl {Fl_Osc_Interface *osc;} {private local
  130. }
  131. decl {Fl_Valuator *cbwig;} {public local
  132. }
  133. decl {int *npart;} {private local
  134. }
  135. }