Compare commits

..

2 Commits

Author SHA1 Message Date
b278e686dd add argument for toggling existing options 2024-03-21 13:29:30 -05:00
0f8efdb537 Add option to disable pattern 2024-03-21 13:25:55 -05:00

View File

@ -38,6 +38,7 @@ bool loop;
bool ptnChans = true; bool ptnChans = true;
bool dynamicRoll = true; bool dynamicRoll = true;
bool ptnOrder = true; bool ptnOrder = true;
bool showEffects = true;
std::map<int, char> efxtable; std::map<int, char> efxtable;
std::map<int, bool> efxmemtable; std::map<int, bool> efxmemtable;
@ -48,12 +49,13 @@ int main(int argc, char *argv[]) {
printf("\n"); printf("\n");
printf("Help\n"); printf("Help\n");
printf("-h Show this message.\n"); printf("-h Show this message.\n");
printf("-d <num> Start on the specified panel.\n");
printf("-c <num> Force terminal color mode.\n"); printf("-c <num> Force terminal color mode.\n");
printf(" 0 Auto (default)\n"); printf(" 0 Auto (default)\n");
printf(" 1 Monochrome\n"); printf(" 1 Monochrome\n");
printf(" 2 8bit\n"); printf(" 2 8bit\n");
printf(" 3 Full\n"); printf(" 3 Full\n");
printf("-d <num> Start on the specified panel.\n");
printf("-o <num> Toggle player options\n");
printf("-s <num> Stereo Seperation\n"); printf("-s <num> Stereo Seperation\n");
exit(0); exit(0);
} else if (strcmp(argv[a], "-d") == 0) { } else if (strcmp(argv[a], "-d") == 0) {
@ -68,6 +70,22 @@ int main(int argc, char *argv[]) {
} else if (strcmp(argv[a], "-c") == 0) { } else if (strcmp(argv[a], "-c") == 0) {
colorMode = atoi(argv[a+1]); colorMode = atoi(argv[a+1]);
a++; a++;
} else if (strcmp(argv[a], "-o") == 0) {
switch (atoi(argv[a+1])) {
case 1:
ptnChans = !ptnChans;
break;
case 2:
dynamicRoll = !dynamicRoll;
break;
case 3:
ptnOrder = !ptnOrder;
break;
case 4:
showEffects = !showEffects;
break;
}
a++;
} else if (strcmp(argv[a], "-s") == 0) { } else if (strcmp(argv[a], "-s") == 0) {
int newmix = atoi(argv[a+1]); int newmix = atoi(argv[a+1]);
if (newmix > 100 || newmix < 0) if (newmix > 100 || newmix < 0)
@ -331,6 +349,9 @@ int main(int argc, char *argv[]) {
case '3': case '3':
ptnOrder = !ptnOrder; ptnOrder = !ptnOrder;
break; break;
case '4':
showEffects = !showEffects;
break;
} }
} }
break; break;
@ -472,7 +493,7 @@ void displayInfo(xmp_module_info *mi, xmp_frame_info *fi) {
} }
void displayPatterns(xmp_module_info *mi, xmp_frame_info *fi) { void displayPatterns(xmp_module_info *mi, xmp_frame_info *fi) {
int chnsize = 15; int chnsize = showEffects?15:11;
if (ptnOrder) { if (ptnOrder) {
for (int j = 0; j < mi->mod->len; j++) { for (int j = 0; j < mi->mod->len; j++) {
if (mi->mod->xxo[j] == 0xFF) continue; if (mi->mod->xxo[j] == 0xFF) continue;
@ -503,12 +524,14 @@ void displayPatterns(xmp_module_info *mi, xmp_frame_info *fi) {
if (voll >= 16) wattron(dis, vollo); if (voll >= 16) wattron(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, vollo); wattroff(dis, vollo);
if (showEffects) {
if (voll >= 8) wattron(dis, vollo); if (voll >= 8) wattron(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, vollo); wattroff(dis, vollo);
if (voll > 0) wattron(dis, vollo); if (voll > 0) wattron(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, vollo); wattroff(dis, vollo);
}
wattron(dis, chnvw); wattron(dis, chnvw);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
@ -521,12 +544,14 @@ void displayPatterns(xmp_module_info *mi, xmp_frame_info *fi) {
wattroff(dis, chnvw); wattroff(dis, chnvw);
int volr = (cinfo.volume * cinfo.pan/256); int volr = (cinfo.volume * cinfo.pan/256);
if (showEffects) {
if (volr > 0) wattron(dis, vollo); if (volr > 0) wattron(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, vollo); wattroff(dis, vollo);
if (volr >= 8) wattron(dis, vollo); if (volr >= 8) wattron(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, vollo); wattroff(dis, vollo);
}
if (volr >= 16) wattron(dis, vollo); if (volr >= 16) wattron(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, vollo); wattroff(dis, vollo);
@ -580,10 +605,12 @@ void displayPatterns(xmp_module_info *mi, xmp_frame_info *fi) {
snprintf(vol, 4, "v40"); snprintf(vol, 4, "v40");
else snprintf(vol, 4, "..."); else snprintf(vol, 4, "...");
if (showEffects) {
char f1; char f1;
if ((efxmemtable[event.fxt] || event.fxp != 0) && (f1 = efxtable[event.fxt]) != NULL) snprintf(efx, 4, "%c%02X", f1, event.fxp); if ((efxmemtable[event.fxt] || event.fxp != 0) && (f1 = efxtable[event.fxt]) != NULL) snprintf(efx, 4, "%c%02X", f1, event.fxp);
else snprintf(efx, 4, "..."); else snprintf(efx, 4, "...");
sprintf(lnbuf, "|%s %s %s %s", note, ins, vol, efx); sprintf(lnbuf, "|%s %s %s %s", note, ins, vol, efx);
} else sprintf(lnbuf, "|%s %s %s", note, ins, vol);
for (int z = 0; z < chnsize; z++) { for (int z = 0; z < chnsize; z++) {
if (((i*chnsize)+2+z)-hOffset < 2) continue; if (((i*chnsize)+2+z)-hOffset < 2) continue;
mvwaddch(dis, y, ((i*chnsize)+2+z)-hOffset, lnbuf[z]); mvwaddch(dis, y, ((i*chnsize)+2+z)-hOffset, lnbuf[z]);
@ -683,6 +710,7 @@ void displayPlayer() {
mvwaddstr(dis, 5-vOffset, 1, "1. Pattern Channels"); mvwaddstr(dis, 5-vOffset, 1, "1. Pattern Channels");
mvwaddstr(dis, 6-vOffset, 1, "2. Dynamic Note Roll"); mvwaddstr(dis, 6-vOffset, 1, "2. Dynamic Note Roll");
mvwaddstr(dis, 7-vOffset, 1, "3. Pattern Order"); mvwaddstr(dis, 7-vOffset, 1, "3. Pattern Order");
mvwaddstr(dis, 8-vOffset, 1, "4. Pattern Effects");
wattroff(dis, A_BOLD); wattroff(dis, A_BOLD);
mvwaddstr(dis, 1-vOffset, 20, loop?"[ #] YES":"[# ] NO"); mvwaddstr(dis, 1-vOffset, 20, loop?"[ #] YES":"[# ] NO");
@ -692,6 +720,7 @@ void displayPlayer() {
mvwaddstr(dis, 5-vOffset, 22, ptnChans?"[ #] YES":"[# ] NO"); mvwaddstr(dis, 5-vOffset, 22, ptnChans?"[ #] YES":"[# ] NO");
mvwaddstr(dis, 6-vOffset, 22, dynamicRoll?"[ #] YES":"[# ] NO"); mvwaddstr(dis, 6-vOffset, 22, dynamicRoll?"[ #] YES":"[# ] NO");
mvwaddstr(dis, 7-vOffset, 22, ptnOrder?"[ #] YES":"[# ] NO"); mvwaddstr(dis, 7-vOffset, 22, ptnOrder?"[ #] YES":"[# ] NO");
mvwaddstr(dis, 8-vOffset, 22, showEffects?"[ #] YES":"[# ] NO");
} }
void displayHelp() { void displayHelp() {