Add option to disable pattern

This commit is contained in:
Wirlaburla 2024-03-21 13:25:55 -05:00
parent 05b44db876
commit 0f8efdb537

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;
@ -331,6 +332,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 +476,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 +507,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 (voll >= 8) wattron(dis, vollo); if (showEffects) {
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); if (voll >= 8) wattron(dis, vollo);
wattroff(dis, vollo); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
if (voll > 0) wattron(dis, vollo); wattroff(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); if (voll > 0) wattron(dis, vollo);
wattroff(dis, vollo); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, vollo);
}
wattron(dis, chnvw); wattron(dis, chnvw);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
@ -521,12 +527,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 (volr > 0) wattron(dis, vollo); if (showEffects) {
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); if (volr > 0) wattron(dis, vollo);
wattroff(dis, vollo); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
if (volr >= 8) wattron(dis, vollo); wattroff(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' '); if (volr >= 8) wattron(dis, vollo);
wattroff(dis, vollo); mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
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 +588,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, "...");
char f1; if (showEffects) {
if ((efxmemtable[event.fxt] || event.fxp != 0) && (f1 = efxtable[event.fxt]) != NULL) snprintf(efx, 4, "%c%02X", f1, event.fxp); char f1;
else snprintf(efx, 4, "..."); if ((efxmemtable[event.fxt] || event.fxp != 0) && (f1 = efxtable[event.fxt]) != NULL) snprintf(efx, 4, "%c%02X", f1, event.fxp);
sprintf(lnbuf, "|%s %s %s %s", note, ins, vol, efx); else snprintf(efx, 4, "...");
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 +693,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 +703,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() {