Remove freeze functionality
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,12 +37,8 @@ proc main() =
|
|||||||
h = nh
|
h = nh
|
||||||
scope.resize(w, h)
|
scope.resize(w, h)
|
||||||
|
|
||||||
if not scope.frozen:
|
|
||||||
audio.readSamples(scope)
|
audio.readSamples(scope)
|
||||||
|
|
||||||
scope.phosphor.decay()
|
scope.phosphor.decay()
|
||||||
|
|
||||||
if not scope.frozen:
|
|
||||||
scope.renderTrace()
|
scope.renderTrace()
|
||||||
|
|
||||||
tb = newTerminalBuffer(w, h)
|
tb = newTerminalBuffer(w, h)
|
||||||
@@ -65,8 +61,6 @@ proc main() =
|
|||||||
scope.timeDiv = min(scope.timeDiv * 1.5, 16.0)
|
scope.timeDiv = min(scope.timeDiv * 1.5, 16.0)
|
||||||
of Key.LeftBracket:
|
of Key.LeftBracket:
|
||||||
scope.timeDiv = max(scope.timeDiv / 1.5, 0.25)
|
scope.timeDiv = max(scope.timeDiv / 1.5, 0.25)
|
||||||
of Key.Space:
|
|
||||||
scope.frozen = not scope.frozen
|
|
||||||
of Key.G:
|
of Key.G:
|
||||||
scope.grid = if scope.grid == gsGrid: gsOff else: gsGrid
|
scope.grid = if scope.grid == gsGrid: gsOff else: gsGrid
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ type
|
|||||||
sampleCount*: int
|
sampleCount*: int
|
||||||
gain*: float # amplitude scaling (volts/div)
|
gain*: float # amplitude scaling (volts/div)
|
||||||
timeDiv*: float # horizontal zoom (time/div)
|
timeDiv*: float # horizontal zoom (time/div)
|
||||||
frozen*: bool
|
|
||||||
grid*: GridStyle
|
grid*: GridStyle
|
||||||
|
|
||||||
proc initScope*(w, h: int): Scope =
|
proc initScope*(w, h: int): Scope =
|
||||||
@@ -31,7 +30,6 @@ proc initScope*(w, h: int): Scope =
|
|||||||
sampleCount: 0,
|
sampleCount: 0,
|
||||||
gain: 5.0,
|
gain: 5.0,
|
||||||
timeDiv: 2.25,
|
timeDiv: 2.25,
|
||||||
frozen: false,
|
|
||||||
grid: gsOff
|
grid: gsOff
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -128,9 +126,8 @@ proc drawHUD*(tb: var TerminalBuffer, w, h: int, scope: Scope) =
|
|||||||
let tdStr = if scope.mode == ModeYT:
|
let tdStr = if scope.mode == ModeYT:
|
||||||
" T:" & formatFloat(scope.timeDiv, ffDecimal, 1)
|
" T:" & formatFloat(scope.timeDiv, ffDecimal, 1)
|
||||||
else: ""
|
else: ""
|
||||||
let freezeStr = if scope.frozen: " ▌▌" else: ""
|
|
||||||
tb.write(1, 0, fgGreen, styleBright,
|
tb.write(1, 0, fgGreen, styleBright,
|
||||||
" " & modeStr & gainStr & tdStr & freezeStr & " ")
|
" " & modeStr & gainStr & tdStr & " ")
|
||||||
|
|
||||||
let help = " m:mode +/-:gain [/]:time g:grid spc:freeze q:quit "
|
let help = " m:mode +/-:gain [/]:time g:grid q:quit "
|
||||||
tb.write(w - help.len - 1, h - 1, fgGreen, styleDim, help)
|
tb.write(w - help.len - 1, h - 1, fgGreen, styleDim, help)
|
||||||
|
|||||||
Reference in New Issue
Block a user