7 Commits
0.5.0 ... 0.5.2

Author SHA1 Message Date
876efb2e8f Update AUR pkgbuild 2024-02-27 21:19:41 -06:00
3b09077e4c Fixed my goddamn rebasing 2024-02-27 21:16:00 -06:00
b57095ead6 Add octaves to Piano Roll 2024-02-27 18:02:49 -06:00
b57f03f963 Alter Pattern VU meters 2024-02-26 20:16:24 -06:00
58422c1dc7 Amplify pattern volume bars 2024-02-26 01:03:19 -06:00
07cd2af3de Remove stereo mixing from track info tab 2024-02-25 23:53:18 -06:00
ce9d82dc0d Fix color issues when unable to use full colors. 2024-02-25 23:51:51 -06:00
2 changed files with 122 additions and 124 deletions

View File

@@ -1,12 +1,12 @@
# Maintainer: wirlaburla <wirlaburla@worlio.com>
# Maintainer: Nick G. <wirlaburla@worlio.com>
pkgname=trakker-git
pkgver=0.3.0.r1.ge275e29
pkgver=0.5.1
pkgrel=1
pkgdesc=''
arch=('x86_64' 'aarch64')
url='https://codeberg.org/Wirlaburla/trakker'
license=(GPL3)
pkgdesc='A terminal-based tracker interface for libxmp.'
arch=('x86_64')
url='https://git.worlio.com/Wirlaburla/trakker'
license=('GPL3')
depends=('alsa-lib' 'libxmp' 'ncurses')
makedepends=('git' 'cmake')
provides=('trakker')
@@ -15,8 +15,8 @@ source=("$pkgname::git+$url.git#branch=master")
sha256sums=('SKIP')
pkgver() {
cd $pkgname
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
cd "$pkgname"
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {

View File

@@ -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,17 +493,17 @@ 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;
if (voll >= 64) wattron(dis, volhi);
int voll = (cinfo.volume * (256-cinfo.pan)/256);
if (voll >= 48) wattron(dis, volhi);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, volhi);
if (voll >= 48) wattron(dis, volmd);
if (voll >= 32) wattron(dis, volmd);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, volmd);
if (voll >= 32) wattron(dis, vollo);
if (voll >= 16) wattron(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, vollo);
if (voll >= 16) wattron(dis, vollo);
if (voll >= 8) wattron(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, vollo);
if (voll > 0) wattron(dis, vollo);
@@ -534,20 +520,20 @@ 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);
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);
if (volr >= 32) wattron(dis, vollo);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, vollo);
if (volr >= 48) wattron(dis, volmd);
if (volr >= 32) wattron(dis, volmd);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, volmd);
if (volr >= 64) wattron(dis, volhi);
if (volr >= 48) wattron(dis, volhi);
mvwaddch(dis, 0, (cxpos++)-hOffset, ' ');
wattroff(dis, volhi);
@@ -635,12 +621,24 @@ void displayVolumes(xmp_module_info *mi, xmp_frame_info *fi) {
void displayNoteRoll(xmp_module_info *mi, xmp_frame_info *fi) {
int ins = mi->mod->ins;
chtype no_pair = COLOR_PAIR(5);
if (dynamicRoll) {
for (int l = 0; l < (96/12); l++) {
int cnote = (l*12);
if (cnote < prMin && l == (prMin / 12)) {
wmove(dis, 0, 0);
wprintw(dis, "<%i", l);
} else if (cnote <= prMax && cnote >= prMin) {
wmove(dis, 0, (((cnote - prMin) * (COLS - 5)) / (prMax - prMin))+3);
wprintw(dis, "%i", l);
}
}
}
for (int y = vOffset; y < ins; y++) {
if (!dynamicRoll) { prMin = 0; prMax = 144; }
if (y > (LINES - 5)+vOffset || y < 0) continue;
wmove(dis, y-vOffset, 0);
wmove(dis, (y-vOffset)+1, 0);
wattron(dis, no_pair);
wprintw(dis, "%02X", y);
wprintw(dis, "%02X", y+1);
wattroff(dis, no_pair);
wclrtoeol(dis);
for (int c = 0; c < mi->mod->chn; c++) {
@@ -656,12 +654,12 @@ void displayNoteRoll(xmp_module_info *mi, xmp_frame_info *fi) {
int note = ((cinfo.note - prMin) * (COLS - 5)) / (dynamicRoll?(prMax - prMin):96);
if (cinfo.instrument != y) continue;
wmove(dis, y-vOffset, note+3);
wmove(dis, (y-vOffset)+1, note+3);
if (cinfo.volume >= 32)
waddstr(dis, "#");
else if (cinfo.volume >= 16 && (char)mvwinch(dis, y-vOffset, note+3) != '#')
else if (cinfo.volume >= 16 && (char)mvwinch(dis, (y-vOffset)+1, note+3) != '#')
waddstr(dis, "=");
else if (cinfo.volume > 0 && ((char)mvwinch(dis, y-vOffset, note+3) != '-' || (char)mvwinch(dis, y-vOffset, note+3) != '#'))
else if (cinfo.volume > 0 && ((char)mvwinch(dis, (y-vOffset)+1, note+3) != '-' || (char)mvwinch(dis, (y-vOffset)+1, note+3) != '#'))
waddstr(dis, "-");
}
wmove(dis, y, COLS-4);