15#include <FL/Fl_Check_Button.H>
47 if(pos <= this->
size()-2) {
56 for(
int i=0;
i<160; ++
i)
57 osc->write(
"/bank/slot"+
to_s(
i),
"");
69 align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP);
75 if (Fl::event_inside(
this))
78 if ((event==FL_RELEASE)&&(Fl::event_button()==1))
80 if ((event==FL_RELEASE)&&(Fl::event_button()==3))
84 int tmp=Fl_Button::handle(event);
86 if (what && Fl::event_inside(
this))
97 snprintf(
labelstr, 127,
"%d.", nslot_);
111 color(
empty() ? 46 : 51);
124 return name_.c_str();
170 if(!strcmp(
"Read", label))
172 else if(!strcmp(
"Write", label))
174 else if(!strcmp(
"Clear", label))
176 else if(!strcmp(
"Swap", label))
188 :Fl_Group(
x,
y,
w,
h,label)
195 read =
new Fl_Check_Button(
x+
m+0*W,
y+
m, W-2*
m,
h-2*
m,
"Read");
196 write =
new Fl_Check_Button(
x+
m+1*W,
y+
m, W-2*
m,
h-2*
m,
"Write");
197 clear =
new Fl_Check_Button(
x+
m+2*W,
y+
m, W-2*
m,
h-2*
m,
"Clear");
198 swap =
new Fl_Check_Button(
x+
m+3*W,
y+
m, W-2*
m,
h-2*
m,
"Swap");
199 read->box(FL_BORDER_BOX);
200 write->box(FL_BORDER_BOX);
201 clear->box(FL_BORDER_BOX);
202 swap->box(FL_BORDER_BOX);
222 for(
int i=0;
i<4; ++
i)
236 osc->removeLink(
"/bankview",
this);
237 osc->removeLink(
"/bank/search_results",
this);
249 osc->createLink(
"/bankview",
this);
250 osc->createLink(
"/bank/search_results",
this);
253 const float width =
w()/5.0;
262 for(
int i=0;
i<5; ++
i)
263 for(
int j=0;
j<32; ++
j)
270 for(
int i=0;
i<160; ++
i)
274 for(
int i=0;
i<160; ++
i)
275 osc->createLink(
"/bank/slot"+
to_s(
i),
this);
277 for(
int i=0;
i<160; ++
i)
278 osc->write(
"/bank/slot"+
to_s(
i),
"");
295 const bool isempty = slot.
empty();
299 if (event==2 && !isempty &&
mode!=4) {
300 if(
const char *
name=fl_input(
"Slot (instrument) name:", slot.
name())) {
301 osc->write(
"/bank/rename_slot",
"is", nslot,
name);
302 osc->write(
"/bank/slot"+
to_s(nslot),
"");
307 if ((event==1)&&(
mode==1) && !isempty){
308 printf(
"Loading a part #%d with file '%s'\n", nslot, slot.
filename());
317 if(event==1 &&
mode==2){
319 fl_choice(
"Overwrite the slot no. %d ?",
"No",
"Yes",
NULL,nslot+1)) {
320 osc->write(
"/bank/save_to_slot",
"ii", *
npart, nslot);
321 osc->write(
"/bank/slot"+
to_s(nslot),
"");
328 if(event==1 &&
mode==3) {
330 fl_choice(
"Clear the slot no. %d ?",
"No",
"Yes",
NULL, nslot+1)) {
331 osc->write(
"/bank/clear_slot",
"i", nslot);
332 osc->write(
"/bank/slot"+
to_s(nslot),
"");
341 osc->write(
"/bank/slot"+
to_s(nslot),
"");
352 if(!strcmp(
msg,
"/bank/search_results")) {
356 while (ptr[0] ==
's' && ptr[1] ==
's') {
361 slots[slot]->update(bank, fname);
367 slots[slot++]->update(
"",
"");
373 if(0 <= nslot && nslot < 160)
377 int nslot = atoi(
msg);
381 if(0 <= nslot && nslot < 160)
398 for(
int i=0;
i<160; ++
i)
399 osc->write(
"/bank/slot"+
to_s(
i),
"");
static void modeButtonCb(Fl_Widget *w, void *v)
Definition BankView.cpp:181
static int modeCb(const char *label)
Definition BankView.cpp:168
BankList(int x, int y, int w, int h, const char *label=0)
Definition BankView.cpp:24
void OSC_raw(const char *msg)
Definition BankView.cpp:36
void init(std::string path)
Definition BankView.cpp:28
BankSlot(int x, int y, int w, int h, const char *label=0)
Definition BankView.cpp:62
char labelstr[128]
Definition BankView.h:50
int nslot
Definition BankView.h:51
const char * filename(void) const
Definition BankView.cpp:127
BankView * bv
Definition BankView.h:52
bool empty(void) const
Definition BankView.cpp:117
void init(int nslot_, BankView *bv_)
Definition BankView.cpp:92
std::string name_
Definition BankView.h:48
const char * name(void) const
Definition BankView.cpp:122
std::string filename_
Definition BankView.h:49
void update(const char *name__, const char *fname__)
Definition BankView.cpp:101
int handle(int event)
Definition BankView.cpp:72
int mode(void) const
Definition BankView.cpp:210
int mode_
Definition BankView.h:75
Fl_Check_Button * clear
Definition BankView.h:68
Fl_Check_Button * write
Definition BankView.h:67
BankViewControls(int x, int y, int w, int h, const char *label=0)
Definition BankView.cpp:187
Fl_Check_Button * read
Definition BankView.h:66
Fl_Check_Button * swap
Definition BankView.h:69
void refresh(void)
Definition BankView.cpp:391
void react(int event, int slot)
Definition BankView.cpp:292
BankViewControls * bvc
Definition BankView.h:96
int * npart
Definition BankView.h:101
void cbwig(Fl_Widget *w)
Definition BankView.cpp:386
int nselected
Definition BankView.h:100
Fl_Widget * cbwig_
Definition BankView.h:103
virtual void OSC_raw(const char *msg) override
Definition BankView.cpp:350
BankView(int x, int y, int w, int h, const char *label=0)
Definition BankView.cpp:227
void init(Fl_Osc_Interface *osc_, BankViewControls *bvc_, int *npart_)
Definition BankView.cpp:241
~BankView(void)
Definition BankView.cpp:233
BankSlot * slots[160]
Definition BankView.h:97
Fl_Osc_Choice(int X, int Y, int W, int H, const char *label=NULL)
Definition Fl_Osc_Choice.cpp:26
Definition Fl_Osc_Interface.h:56
UINT_D64 w
Definition inflate.c:942
unsigned * m
Definition inflate.c:1559
register unsigned j
Definition inflate.c:1576
int y
Definition inflate.c:1588
unsigned v[N_MAX]
Definition inflate.c:1584
register unsigned i
Definition inflate.c:1575
unsigned x[BMAX+1]
Definition inflate.c:1586
static PuglViewHint int value
Definition pugl.h:1708
static const char * name
Definition pugl.h:1582
static int int height
Definition pugl.h:1594
static int width
Definition pugl.h:1593
int val
Definition jpeglib.h:956
#define X(str)
Definition juce_LV2Common.h:197
const char * msg
Definition missing_descriptor.c:20
Definition zynaddsubfx-src.cpp:569
std::string to_s(T x)
Definition Util.h:67
#define M
Definition nseel-cfunc.c:37
png_structrp int mode
Definition png.h:1139
const char * rtosc_argument_string(const char *msg)
Definition rtosc.c:11
rtosc_arg_t rtosc_argument(const char *msg, unsigned idx)
Definition rtosc.c:732
int32_t i
Definition rtosc.h:47
const char * s
Definition rtosc.h:54
uch h[RAND_HEAD_LEN]
Definition crypt.c:459