Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 58422c1dc7 | |||
| 07cd2af3de | |||
| ce9d82dc0d |
190
src/main.cpp
190
src/main.cpp
@@ -41,93 +41,6 @@ bool ptnOrder = true;
|
||||
std::map<int, char> efxtable;
|
||||
std::map<int, bool> efxmemtable;
|
||||
|
||||
bool colorMonochrome() {
|
||||
// Primary Background
|
||||
init_pair(1, COLOR_BLACK, COLOR_BLACK);
|
||||
// Inactive Section
|
||||
init_pair(2, COLOR_WHITE, COLOR_BLACK);
|
||||
// Active Section
|
||||
init_pair(3, COLOR_BLACK, COLOR_WHITE);
|
||||
// Display
|
||||
init_pair(4, COLOR_WHITE, COLOR_BLACK);
|
||||
// Display Row#
|
||||
init_pair(5, COLOR_WHITE, COLOR_BLACK);
|
||||
// Display Playhead
|
||||
init_pair(6, COLOR_BLACK, COLOR_WHITE);
|
||||
// Display Playhead Row#
|
||||
init_pair(7, COLOR_BLACK, COLOR_WHITE);
|
||||
// Display Stopped Playhead
|
||||
init_pair(8, COLOR_WHITE, COLOR_BLACK);
|
||||
// Display Stopped Playhead Row#
|
||||
init_pair(9, COLOR_WHITE, COLOR_BLACK);
|
||||
// Display VU Bar Low
|
||||
init_pair(10, COLOR_WHITE, COLOR_WHITE);
|
||||
// Display VU Bar Medium
|
||||
init_pair(11, COLOR_WHITE, COLOR_WHITE);
|
||||
// Display VU Bar High
|
||||
init_pair(12, COLOR_WHITE, COLOR_WHITE);
|
||||
// Inverted Text
|
||||
init_pair(13, COLOR_WHITE, COLOR_BLACK);
|
||||
}
|
||||
|
||||
bool colorLimited() {
|
||||
// Primary Background
|
||||
init_pair(1, COLOR_BLACK, 8);
|
||||
// Inactive Section
|
||||
init_pair(2, COLOR_BLACK, COLOR_WHITE);
|
||||
// Active Section
|
||||
init_pair(3, COLOR_BLACK, COLOR_CYAN);
|
||||
// Display
|
||||
init_pair(4, COLOR_WHITE, COLOR_BLACK);
|
||||
// Display Row#
|
||||
init_pair(5, COLOR_YELLOW, COLOR_BLACK);
|
||||
// Display Playhead
|
||||
init_pair(6, COLOR_WHITE, COLOR_BLUE);
|
||||
// Display Playhead Row#
|
||||
init_pair(7, COLOR_YELLOW, COLOR_BLUE);
|
||||
// Display Stopped Playhead
|
||||
init_pair(8, COLOR_WHITE, COLOR_RED);
|
||||
// Display Stopped Playhead Row#
|
||||
init_pair(9, COLOR_YELLOW, COLOR_RED);
|
||||
// Display VU Bar Low
|
||||
init_pair(10, COLOR_WHITE, COLOR_GREEN);
|
||||
// Display VU Bar Medium
|
||||
init_pair(11, COLOR_WHITE, COLOR_YELLOW);
|
||||
// Display VU Bar High
|
||||
init_pair(12, COLOR_WHITE, COLOR_RED);
|
||||
// Inverted Text
|
||||
init_pair(13, COLOR_WHITE, COLOR_BLACK);
|
||||
}
|
||||
|
||||
void colorFull() {
|
||||
// Primary Background
|
||||
init_pair(1, COLOR_BLACK, 8);
|
||||
// Inactive Section
|
||||
init_pair(2, 8, 7);
|
||||
// Active Section
|
||||
init_pair(3, 0, 12);
|
||||
// Display
|
||||
init_pair(4, 7, COLOR_BLACK);
|
||||
// Display Row#
|
||||
init_pair(5, 3, COLOR_BLACK);
|
||||
// Display Playhead
|
||||
init_pair(6, COLOR_WHITE, COLOR_BLUE);
|
||||
// Display Playhead Row#
|
||||
init_pair(7, COLOR_YELLOW, COLOR_BLUE);
|
||||
// Display Stopped Playhead
|
||||
init_pair(8, COLOR_WHITE, COLOR_RED);
|
||||
// Display Stopped Playhead Row#
|
||||
init_pair(9, COLOR_YELLOW, COLOR_RED);
|
||||
// Display VU Bar Low
|
||||
init_pair(10, COLOR_WHITE, COLOR_GREEN);
|
||||
// Display VU Bar Medium
|
||||
init_pair(11, COLOR_WHITE, COLOR_YELLOW);
|
||||
// Display VU Bar High
|
||||
init_pair(12, COLOR_WHITE, COLOR_RED);
|
||||
// Inverted Text
|
||||
init_pair(13, COLOR_WHITE, COLOR_BLACK);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
printf("TRAKKER %s (using XMP %s)\n", TRAKKER_VERSION, xmp_version);
|
||||
for (int a = 1; a < argc; ++a) {
|
||||
@@ -221,12 +134,87 @@ int main(int argc, char *argv[]) {
|
||||
start_color();
|
||||
if ((has_colors() == TRUE && colorMode == 0) || colorMode >= 2) {
|
||||
if ((can_change_color() == TRUE && colorMode == 0) || colorMode == 3) {
|
||||
colorFull();
|
||||
// Primary Background
|
||||
init_pair(1, COLOR_BLACK, 8);
|
||||
// Inactive Section
|
||||
init_pair(2, 8, 7);
|
||||
// Active Section
|
||||
init_pair(3, 0, 12);
|
||||
// Display
|
||||
init_pair(4, 7, COLOR_BLACK);
|
||||
// Display Row#
|
||||
init_pair(5, 3, COLOR_BLACK);
|
||||
// Display Playhead
|
||||
init_pair(6, COLOR_WHITE, COLOR_BLUE);
|
||||
// Display Playhead Row#
|
||||
init_pair(7, COLOR_YELLOW, COLOR_BLUE);
|
||||
// Display Stopped Playhead
|
||||
init_pair(8, COLOR_WHITE, COLOR_RED);
|
||||
// Display Stopped Playhead Row#
|
||||
init_pair(9, COLOR_YELLOW, COLOR_RED);
|
||||
// Display VU Bar Low
|
||||
init_pair(10, COLOR_WHITE, COLOR_GREEN);
|
||||
// Display VU Bar Medium
|
||||
init_pair(11, COLOR_WHITE, COLOR_YELLOW);
|
||||
// Display VU Bar High
|
||||
init_pair(12, COLOR_WHITE, COLOR_RED);
|
||||
// Inverted Text
|
||||
init_pair(13, COLOR_WHITE, COLOR_BLACK);
|
||||
} else {
|
||||
colorLimited();
|
||||
// Primary Background
|
||||
init_pair(1, COLOR_BLACK, 8);
|
||||
// Inactive Section
|
||||
init_pair(2, COLOR_BLACK, COLOR_WHITE);
|
||||
// Active Section
|
||||
init_pair(3, COLOR_BLACK, COLOR_CYAN);
|
||||
// Display
|
||||
init_pair(4, COLOR_WHITE, COLOR_BLACK);
|
||||
// Display Row#
|
||||
init_pair(5, COLOR_YELLOW, COLOR_BLACK);
|
||||
// Display Playhead
|
||||
init_pair(6, COLOR_WHITE, COLOR_BLUE);
|
||||
// Display Playhead Row#
|
||||
init_pair(7, COLOR_YELLOW, COLOR_BLUE);
|
||||
// Display Stopped Playhead
|
||||
init_pair(8, COLOR_WHITE, COLOR_RED);
|
||||
// Display Stopped Playhead Row#
|
||||
init_pair(9, COLOR_YELLOW, COLOR_RED);
|
||||
// Display VU Bar Low
|
||||
init_pair(10, COLOR_WHITE, COLOR_GREEN);
|
||||
// Display VU Bar Medium
|
||||
init_pair(11, COLOR_WHITE, COLOR_YELLOW);
|
||||
// Display VU Bar High
|
||||
init_pair(12, COLOR_WHITE, COLOR_RED);
|
||||
// Inverted Text
|
||||
init_pair(13, COLOR_WHITE, COLOR_BLACK);
|
||||
}
|
||||
} else {
|
||||
colorMonochrome();
|
||||
// Primary Background
|
||||
init_pair(1, COLOR_BLACK, COLOR_BLACK);
|
||||
// Inactive Section
|
||||
init_pair(2, COLOR_WHITE, COLOR_BLACK);
|
||||
// Active Section
|
||||
init_pair(3, COLOR_BLACK, COLOR_WHITE);
|
||||
// Display
|
||||
init_pair(4, COLOR_WHITE, COLOR_BLACK);
|
||||
// Display Row#
|
||||
init_pair(5, COLOR_WHITE, COLOR_BLACK);
|
||||
// Display Playhead
|
||||
init_pair(6, COLOR_BLACK, COLOR_WHITE);
|
||||
// Display Playhead Row#
|
||||
init_pair(7, COLOR_BLACK, COLOR_WHITE);
|
||||
// Display Stopped Playhead
|
||||
init_pair(8, COLOR_WHITE, COLOR_BLACK);
|
||||
// Display Stopped Playhead Row#
|
||||
init_pair(9, COLOR_WHITE, COLOR_BLACK);
|
||||
// Display VU Bar Low
|
||||
init_pair(10, COLOR_WHITE, COLOR_WHITE);
|
||||
// Display VU Bar Medium
|
||||
init_pair(11, COLOR_WHITE, COLOR_WHITE);
|
||||
// Display VU Bar High
|
||||
init_pair(12, COLOR_WHITE, COLOR_WHITE);
|
||||
// Inverted Text
|
||||
init_pair(13, COLOR_WHITE, COLOR_BLACK);
|
||||
}
|
||||
|
||||
cbreak();
|
||||
@@ -465,23 +453,21 @@ void displayHeader(xmp_module_info *mi, xmp_frame_info *fi) {
|
||||
void displayInfo(xmp_module_info *mi, xmp_frame_info *fi) {
|
||||
wattron(dis, A_BOLD);
|
||||
mvwaddstr(dis, 1-vOffset, 1, "Format:");
|
||||
mvwaddstr(dis, 2-vOffset, 1, "Stereo Mix:");
|
||||
mvwaddstr(dis, 3-vOffset, 1, "Channels:");
|
||||
mvwaddstr(dis, 5-vOffset, 1, "Instruments:");
|
||||
mvwaddstr(dis, (7+mi->mod->ins)-vOffset, 1, "Samples:");
|
||||
mvwaddstr(dis, 2-vOffset, 1, "Channels:");
|
||||
mvwaddstr(dis, 4-vOffset, 1, "Instruments:");
|
||||
mvwaddstr(dis, (6+mi->mod->ins)-vOffset, 1, "Samples:");
|
||||
wattroff(dis, A_BOLD);
|
||||
|
||||
mvwprintw(dis, 1-vOffset, 16, mi->mod->type);
|
||||
mvwprintw(dis, 2-vOffset, 16, "%i%%", smix);
|
||||
mvwprintw(dis, 3-vOffset, 16, "%i", mi->mod->chn);
|
||||
mvwprintw(dis, 5-vOffset, 16, "%i", mi->mod->ins);
|
||||
mvwprintw(dis, (7+mi->mod->ins)-vOffset, 16, "%i", mi->mod->smp);
|
||||
mvwprintw(dis, 2-vOffset, 16, "%i", mi->mod->chn);
|
||||
mvwprintw(dis, 4-vOffset, 16, "%i", mi->mod->ins);
|
||||
mvwprintw(dis, (6+mi->mod->ins)-vOffset, 16, "%i", mi->mod->smp);
|
||||
|
||||
for (int xi = 0; xi < mi->mod->ins; xi++) {
|
||||
mvwprintw(dis, xi+6-vOffset, 1, "[%02X] %s", xi, mi->mod->xxi[xi].name);
|
||||
mvwprintw(dis, xi+5-vOffset, 1, "[%02X] %s", xi, mi->mod->xxi[xi].name);
|
||||
}
|
||||
for (int xs = 0; xs < mi->mod->smp; xs++) {
|
||||
mvwprintw(dis, xs+(8+mi->mod->ins)-vOffset, 1, "[%02X] %s", xs, mi->mod->xxs[xs].name);
|
||||
mvwprintw(dis, xs+(7+mi->mod->ins)-vOffset, 1, "[%02X] %s", xs, mi->mod->xxs[xs].name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -507,7 +493,7 @@ void displayPatterns(xmp_module_info *mi, xmp_frame_info *fi) {
|
||||
wmove(dis, 0, cxpos);
|
||||
for (int i = 0; i < mi->mod->chn; i++) {
|
||||
struct xmp_channel_info cinfo = fi->channel_info[i];
|
||||
int voll = cinfo.volume * (255-cinfo.pan)/255;
|
||||
int voll = (cinfo.volume * (256-cinfo.pan)/256)*2;
|
||||
if (voll >= 64) wattron(dis, volhi);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, volhi);
|
||||
@@ -534,7 +520,7 @@ void displayPatterns(xmp_module_info *mi, xmp_frame_info *fi) {
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, chnvw);
|
||||
|
||||
int volr = cinfo.volume * cinfo.pan/255;
|
||||
int volr = (cinfo.volume * cinfo.pan/256)*2;
|
||||
if (volr > 0) wattron(dis, vollo);
|
||||
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
|
||||
wattroff(dis, vollo);
|
||||
|
||||
Reference in New Issue
Block a user