scope adjustments
This commit is contained in:
parent
5cc62a1bfc
commit
86557d9cf4
29
src/main.cpp
29
src/main.cpp
|
@ -607,7 +607,7 @@ void displayPatterns(xmp_module_info *mi, xmp_frame_info *fi) {
|
||||||
|
|
||||||
if (showEffects) {
|
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])) 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);
|
} else sprintf(lnbuf, "|%s %s %s", note, ins, vol);
|
||||||
|
@ -631,11 +631,12 @@ int lerp (int a, int b, float f) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
std::vector<int> bufbuf;
|
||||||
void displayScope(xmp_module_info *mi, xmp_frame_info *fi) {
|
void displayScope(xmp_module_info *mi, xmp_frame_info *fi) {
|
||||||
const char* xbuf = (char*)fi->buffer;
|
const char* xbuf = (char*)fi->buffer;
|
||||||
int percol = (fi->buffer_size/(COLS-2));
|
int percol = (fi->buffer_size/(COLS-2));
|
||||||
|
bufbuf.resize(COLS-2);
|
||||||
|
|
||||||
wmove(dis, 0, 0);
|
|
||||||
for (int s = 0; s < COLS-2; s++) {
|
for (int s = 0; s < COLS-2; s++) {
|
||||||
int colsum = 0;
|
int colsum = 0;
|
||||||
for (int v = 0; v < percol; v++) {
|
for (int v = 0; v < percol; v++) {
|
||||||
|
@ -644,14 +645,24 @@ void displayScope(xmp_module_info *mi, xmp_frame_info *fi) {
|
||||||
int l = (colsum / percol)*2;
|
int l = (colsum / percol)*2;
|
||||||
if (l >= 0x80) l = 0x80;
|
if (l >= 0x80) l = 0x80;
|
||||||
else if (l <= -0x80) l = -0x80;
|
else if (l <= -0x80) l = -0x80;
|
||||||
int r = (1.0*(l+0x80)/0xFF)*(LINES-4);
|
bufbuf[s] = l;
|
||||||
|
|
||||||
for (int j = 0; j != l; j+=(l>0?1:-1)) {
|
|
||||||
wmove(dis, (1.0*(j+0x80)/0xFF)*(LINES-4), s);
|
|
||||||
waddch(dis, '#');
|
|
||||||
}
|
}
|
||||||
wmove(dis, r, s);
|
wmove(dis, 0, 0);
|
||||||
waddch(dis, '=');
|
wprintw(dis, "%i", percol);
|
||||||
|
for (int t = 0; t < COLS-2; t++) {
|
||||||
|
//int r = (1.0*(bufbuf[t]+0x80)/0xFF)*(LINES-4);
|
||||||
|
int r = (1.0*(lerp(bufbuf[t-1], bufbuf[t], 0.5f)+0x80)/0xFF)*(LINES-4);
|
||||||
|
|
||||||
|
wmove(dis, r, t);
|
||||||
|
chtype pixpair = COLOR_PAIR(10);
|
||||||
|
if (std::abs(bufbuf[t-1] - bufbuf[t]) > 64)
|
||||||
|
pixpair = COLOR_PAIR(12);
|
||||||
|
else if (std::abs(bufbuf[t-1] - bufbuf[t]) > 32)
|
||||||
|
pixpair = COLOR_PAIR(11);
|
||||||
|
|
||||||
|
wattron(dis, pixpair);
|
||||||
|
waddch(dis, ' ');
|
||||||
|
wattroff(dis, pixpair);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user