taut: fancier UI

This commit is contained in:
minjaesong
2026-04-26 23:09:32 +09:00
parent e47e9e1259
commit b44d9c6b68
2 changed files with 43 additions and 21 deletions

View File

@@ -537,7 +537,7 @@ function loadTaud(filePath, songIndex) {
const [SCRH, SCRW] = con.getmaxyx() const [SCRH, SCRW] = con.getmaxyx()
const PTNVIEW_OFFSET_X = 3 const PTNVIEW_OFFSET_X = 3
const PTNVIEW_OFFSET_Y = 9 const PTNVIEW_OFFSET_Y = 5
const PTNVIEW_HEIGHT = SCRH - PTNVIEW_OFFSET_Y const PTNVIEW_HEIGHT = SCRH - PTNVIEW_OFFSET_Y
const TIMELINE_COLSIZES = [15, 7, 5] const TIMELINE_COLSIZES = [15, 7, 5]
@@ -563,6 +563,10 @@ const colStatus = 253
const colVoiceHdr = 230 const colVoiceHdr = 230
const colSep = 252 const colSep = 252
const colPushBtnBack = 143 const colPushBtnBack = 143
const colTabBarBack = 187
const colTabBarOrn = 135
const colBrand = 211
// protip: avoid using colour zero // protip: avoid using colour zero
const colWHITE = 239 const colWHITE = 239
@@ -589,8 +593,8 @@ function fillLine(y, c, back) {
} }
} }
const TAB_GAP = 2 const TAB_GAP = 3
const PANEL_NAMES = ['Timeline', 'Orders', 'Patterns', 'Samples', 'Instruments', 'Project', 'File'] const PANEL_NAMES = ['Timeline', 'Cues', 'Patterns', 'Samples', 'Instrmnt', 'Project', 'File']
function drawAlwaysOnElems() { function drawAlwaysOnElems() {
drawStatusBar() drawStatusBar()
@@ -624,7 +628,7 @@ function drawStatusBar() {
else else
con.color_pair(colStatus, 255) con.color_pair(colStatus, 255)
con.move(1, SCRW - 5*(j+1)) con.move(1, SCRW - 5*(j+1) + 1)
print(` ${transportControlSymbol[j]} `) print(` ${transportControlSymbol[j]} `)
if (active) if (active)
@@ -632,7 +636,7 @@ function drawStatusBar() {
else else
con.color_pair(colVoiceHdr, 255) con.color_pair(colVoiceHdr, 255)
con.move(2, SCRW - 5*(j+1)) con.move(2, SCRW - 5*(j+1) + 1)
print(` ${transportControlHint[j]} `) print(` ${transportControlHint[j]} `)
}) })
@@ -660,23 +664,37 @@ function drawStatusBar() {
con.color_pair(colStatus, 255); print(` Tickspeed `) con.color_pair(colStatus, 255); print(` Tickspeed `)
con.color_pair(colEffOp, 255); print(`${sSpd}`) con.color_pair(colEffOp, 255); print(`${sSpd}`)
// app title
let s1 = "Microtone"
let s2 = "tracker for tsvm"
con.move(1, (SCRW - (s1.length & 254)) >>> 1)
con.color_pair(colBrand, 255); print('Micro')
con.color_pair(colStatus, 255); print('tone')
con.move(2, (SCRW - (s2.length & 254)) >>> 1)
con.color_pair(colSep, 255); print('tracker for ')
con.color_pair(74, 255); print('tsvm')
} }
function drawTabBar() { function drawTabBar() {
con.color_pair(colStatus, 255) con.color_pair(colTabBarOrn, colTabBarBack)
con.move(3,1)
print(`\u00FB`.repeat(SCRW))
const XOFF = 2 const XOFF = 2
const YOFF = PTNVIEW_OFFSET_Y - 4 const YOFF = 3
// TODO make it fancier
con.move(YOFF, XOFF) con.move(YOFF, XOFF)
for (let i = 0; i < PANEL_NAMES.length; i++) { for (let i = 0; i < PANEL_NAMES.length; i++) {
if (i > 0) con.curs_right(TAB_GAP); if (i > 0) con.curs_right(TAB_GAP);
let panStr = PANEL_NAMES[i] let tabName = PANEL_NAMES[i]
print((currentPanel === i) ? `[${panStr}]` : ` ${panStr} `)
let col = (currentPanel === i) ? 161 : 240
con.color_pair(col, colTabBarBack); print(` ${tabName} `)
} }
con.color_pair(colStatus, 255)
} }
/** /**
@@ -794,20 +812,23 @@ function drawControlHint() {
let hintElemTimeline = [ let hintElemTimeline = [
[`\u008428u\u008429u`,'Nav'], [`\u008428u\u008429u`,'Nav'],
[`Pg\u008418u`,'Cue'], [`Pg\u008418u`,'Cue'],
['sep'],
['WER','ViewMode'],
['sep'], ['sep'],
['m','Mute'], ['m','Mute'],
['s','Solo'], ['s','Solo'],
['sep'], ['sep'],
['Tab','Panel'], ['Tab','Panel'],
['q','Quit'], // ['sep'],
// ['q','Quit'],
] ]
let hintElemOrders = [ let hintElemOrders = [
[`\u008428u\u008429u`,'Nav'], [`\u008428u\u008429u`,'Nav'],
[`Ent`,'Go to cue'], [`Ent`,'Go to cue'],
['sep'], ['sep'],
['Tab','Panel'], ['Tab','Panel'],
['sep'], // ['sep'],
['q','Quit'], // ['q','Quit'],
] ]
let hintElemPatterns = [ let hintElemPatterns = [
@@ -815,8 +836,8 @@ function drawControlHint() {
[`Pg\u008418u`,'Ptn'], [`Pg\u008418u`,'Ptn'],
['sep'], ['sep'],
['Tab','Panel'], ['Tab','Panel'],
['sep'], // ['sep'],
['q','Quit'], // ['q','Quit'],
] ]
let hintElems = [hintElemTimeline, hintElemOrders, hintElemPatterns] let hintElems = [hintElemTimeline, hintElemOrders, hintElemPatterns]
@@ -902,11 +923,10 @@ function drawVoiceDetail(isVerticalLayout = false, ptn = null, activeRow = -1, c
const fxName = fxNames[fx] || '? ' const fxName = fxNames[fx] || '? '
if (!isVerticalLayout) { if (!isVerticalLayout) {
con.move(6, 1) return
print(`Pitch $${note.hex04()}\tInst $${inst.hex02()}\t${sym.vx} ${voleffop}.$${voleffarg.hex02()}\t` + con.move(PTNVIEW_OFFSET_Y-2, 1)
`${sym.px} ${paneffop}.$${paneffarg.hex02()}`) print(`Pitch $${note.hex04()} Inst $${inst.hex02()} ${sym.vx} ${voleffop}.$${voleffarg.hex02()} ` +
con.move(7, 1) `${sym.px} ${paneffop}.$${paneffarg.hex02()} ${sym.fx} ${fxName} $${effarg.hex04()}`)
print(`${sym.fx} ${fxName}\t$${effarg.hex04()} `)
} else { } else {
const dx = PATEDITOR_DETAIL_X const dx = PATEDITOR_DETAIL_X
const detailW = SCRW - dx + 1 const detailW = SCRW - dx + 1
@@ -1928,6 +1948,8 @@ while (!exitFlag) {
audio.stop(PLAYHEAD) audio.stop(PLAYHEAD)
resetAudioDevice() resetAudioDevice()
sys.free(SCRATCH_PTR) sys.free(SCRATCH_PTR)
font.resetLowRom()
font.resetHighRom()
con.clear() con.clear()
con.move(1, 1) con.move(1, 1)
con.curs_set(1) con.curs_set(1)