refactor: minor example tweaks

Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
Christopher Arndt 2023-05-25 18:01:56 +02:00
parent 1027a2e1dd
commit 05ec305a04
1 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,6 @@
import std/logging
import jacket
var jclient: ClientP
var status: cint
var log = newConsoleLogger(when defined(release): lvlInfo else: lvlDebug)
@ -12,7 +11,7 @@ proc errorCb(msg: cstring) {.cdecl.} =
addHandler(log)
setErrorFunction(errorCb)
jclient = clientOpen("jacket_info", NullOption.ord, status.addr)
var jclient = clientOpen("jacket_info", NullOption.ord, status.addr)
debug "JACK server status: " & $status
if jclient == nil:
@ -22,9 +21,9 @@ if jclient == nil:
echo("JACK version: ", getVersionString())
echo("Sample rate: ", jclient.getSampleRate)
echo("Buffer size: ", jclient.getBufferSize)
echo("RT enabled: ", if jclient.isRealtime > 0: "yes" else: "no")
echo("DSP load: ", jclient.cpuLoad, "%")
echo("Server time: ", getTime())
echo("Client name: ", jclient.getClientName)
echo("RT enabled: ", if jclient.isRealtime > 0: "yes" else: "no")
discard jclient.clientClose