bool32.rising trigger
bool32.rising delete
int32.positive index
charptr32 OUT1
charptr32 out2
charptr32 out3
charptr32 out4
bool32 trig
int32 test
table filter
bool trig;
bool dtrig;
bool test;
bool redraw;
int count;
char out1[9];
char out2[9];
char out3[9];
char out4[9];
uint8_t pre;
char wrk[3];
char del[16];
uint8_t *fout;
static uint8_t _fout[attr_poly][512] __attribute__((section(".sdram")));
fout = &_fout[parent->polyIndex][0];
int i;
for (i = 0; i < 512; i++)
fout[i] = 0;
char att[4];
strcpy(&att[0], "attr_filter");
strncpy(&wrk[0], &att[1], 1);
strncpy(&wrk[1], &att[2], 1);
strncpy(&wrk[2], &att[3], 1);
outlet_trig = 0;
// FS_RPATH = 0;
FIL FileObject;
FRESULT res;
FILINFO fno;
DIR dir;
#if _USE_LFN
fno.lfname = 0;
fno.lfsize = 0;
#endif
if ((inlet_getDir && !trig) || redraw) {
memset(&fout[0], 0, 512);
trig = 1;
count = 0;
f_opendir(&dir, "/");
for (;;) {
res = f_readdir(&dir, &fno);
if (res != FR_OK || fno.fname[0] == 0)
break;
if (count < 128) {
int len = strlen(fno.fname);
if ((fno.fname[len - 3] == wrk[0]) && (fno.fname[len - 2] == wrk[1]) &&
(fno.fname[len - 1] == wrk[2])) {
memcpy(&fout[count << 3], fno.fname, ((len - 4) > 0) ? (len - 4) : 1);
count++;
}
}
}
}
if (!inlet_getDir)
trig = 0;
outlet_test = count;
if ((inlet_index != pre) || redraw) {
redraw = 0;
pre = inlet_index;
memcpy(&out1[0], &fout[(pre + 0) << 3], 8);
memcpy(&out2[0], &fout[(pre + 1) << 3], 8);
memcpy(&out3[0], &fout[(pre + 2) << 3], 8);
memcpy(&out4[0], &fout[(pre + 3) << 3], 8);
outlet_trig = 1;
}
outlet_OUT1 = &out1[0];
outlet_out2 = &out2[0];
outlet_out3 = &out3[0];
outlet_out4 = &out4[0];
if (inlet_delete && !dtrig) {
redraw = 1;
dtrig = 1;
del[0] = '/';
strcpy(&del[1], &out1[0]);
strcat(&del[0], "attr_filter");
f_unlink(&del[0]);
}
if (!inlet_delete)
dtrig = 0;