Add option to disable pattern
This commit is contained in:
parent
05b44db876
commit
0f8efdb537
48
src/main.cpp
48
src/main.cpp
|
@ -38,6 +38,7 @@ bool loop;
|
|||
bool ptnChans = true;
|
||||
bool dynamicRoll = true;
|
||||
bool ptnOrder = true;
|
||||
bool showEffects = true;
|
||||
std::map<int, char> efxtable;
|
||||
std::map<int, bool> efxmemtable;
|
||||
|
||||
|
@ -331,6 +332,9 @@ int main(int argc, char *argv[]) {
|
|||
case '3':
|
||||
ptnOrder = !ptnOrder;
|
||||
break;
|
||||
case '4':
|
||||
showEffects = !showEffects;
|
||||
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) {
|
||||
int chnsize = 15;
|
||||
int chnsize = showEffects?15:11;
|
||||
if (ptnOrder) {
|
||||
for (int j = 0; j < mi->mod->len; j++) {
|
||||
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);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
if (voll >= 8) wattron(dis, vollo);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
if (voll > 0) wattron(dis, vollo);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
if (showEffects) {
|
||||
if (voll >= 8) wattron(dis, vollo);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
if (voll > 0) wattron(dis, vollo);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
}
|
||||
|
||||
wattron(dis, chnvw);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
|
@ -521,12 +527,14 @@ void displayPatterns(xmp_module_info *mi, xmp_frame_info *fi) {
|
|||
wattroff(dis, chnvw);
|
||||
|
||||
int volr = (cinfo.volume * cinfo.pan/256);
|
||||
if (volr > 0) wattron(dis, vollo);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
if (volr >= 8) wattron(dis, vollo);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
if (showEffects) {
|
||||
if (volr > 0) wattron(dis, vollo);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
if (volr >= 8) wattron(dis, vollo);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
}
|
||||
if (volr >= 16) wattron(dis, vollo);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
|
@ -579,11 +587,13 @@ void displayPatterns(xmp_module_info *mi, xmp_frame_info *fi) {
|
|||
else if (event.note > 0 && event.note <= 0x80)
|
||||
snprintf(vol, 4, "v40");
|
||||
else snprintf(vol, 4, "...");
|
||||
|
||||
char f1;
|
||||
if ((efxmemtable[event.fxt] || event.fxp != 0) && (f1 = efxtable[event.fxt]) != NULL) snprintf(efx, 4, "%c%02X", f1, event.fxp);
|
||||
else snprintf(efx, 4, "...");
|
||||
sprintf(lnbuf, "|%s %s %s %s", note, ins, vol, efx);
|
||||
|
||||
if (showEffects) {
|
||||
char f1;
|
||||
if ((efxmemtable[event.fxt] || event.fxp != 0) && (f1 = efxtable[event.fxt]) != NULL) snprintf(efx, 4, "%c%02X", f1, event.fxp);
|
||||
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++) {
|
||||
if (((i*chnsize)+2+z)-hOffset < 2) continue;
|
||||
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, 6-vOffset, 1, "2. Dynamic Note Roll");
|
||||
mvwaddstr(dis, 7-vOffset, 1, "3. Pattern Order");
|
||||
mvwaddstr(dis, 8-vOffset, 1, "4. Pattern Effects");
|
||||
wattroff(dis, A_BOLD);
|
||||
|
||||
mvwaddstr(dis, 1-vOffset, 20, loop?"[ #] YES":"[# ] NO");
|
||||
|
@ -692,6 +703,7 @@ void displayPlayer() {
|
|||
mvwaddstr(dis, 5-vOffset, 22, ptnChans?"[ #] YES":"[# ] NO");
|
||||
mvwaddstr(dis, 6-vOffset, 22, dynamicRoll?"[ #] YES":"[# ] NO");
|
||||
mvwaddstr(dis, 7-vOffset, 22, ptnOrder?"[ #] YES":"[# ] NO");
|
||||
mvwaddstr(dis, 8-vOffset, 22, showEffects?"[ #] YES":"[# ] NO");
|
||||
}
|
||||
|
||||
void displayHelp() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user