refactor: minor example tweaks
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
parent
1027a2e1dd
commit
05ec305a04
|
@ -1,7 +1,6 @@
|
||||||
import std/logging
|
import std/logging
|
||||||
import jacket
|
import jacket
|
||||||
|
|
||||||
var jclient: ClientP
|
|
||||||
var status: cint
|
var status: cint
|
||||||
var log = newConsoleLogger(when defined(release): lvlInfo else: lvlDebug)
|
var log = newConsoleLogger(when defined(release): lvlInfo else: lvlDebug)
|
||||||
|
|
||||||
|
@ -12,7 +11,7 @@ proc errorCb(msg: cstring) {.cdecl.} =
|
||||||
|
|
||||||
addHandler(log)
|
addHandler(log)
|
||||||
setErrorFunction(errorCb)
|
setErrorFunction(errorCb)
|
||||||
jclient = clientOpen("jacket_info", NullOption.ord, status.addr)
|
var jclient = clientOpen("jacket_info", NullOption.ord, status.addr)
|
||||||
debug "JACK server status: " & $status
|
debug "JACK server status: " & $status
|
||||||
|
|
||||||
if jclient == nil:
|
if jclient == nil:
|
||||||
|
@ -22,9 +21,9 @@ if jclient == nil:
|
||||||
echo("JACK version: ", getVersionString())
|
echo("JACK version: ", getVersionString())
|
||||||
echo("Sample rate: ", jclient.getSampleRate)
|
echo("Sample rate: ", jclient.getSampleRate)
|
||||||
echo("Buffer size: ", jclient.getBufferSize)
|
echo("Buffer size: ", jclient.getBufferSize)
|
||||||
|
echo("RT enabled: ", if jclient.isRealtime > 0: "yes" else: "no")
|
||||||
echo("DSP load: ", jclient.cpuLoad, "%")
|
echo("DSP load: ", jclient.cpuLoad, "%")
|
||||||
echo("Server time: ", getTime())
|
echo("Server time: ", getTime())
|
||||||
echo("Client name: ", jclient.getClientName)
|
echo("Client name: ", jclient.getClientName)
|
||||||
echo("RT enabled: ", if jclient.isRealtime > 0: "yes" else: "no")
|
|
||||||
|
|
||||||
discard jclient.clientClose
|
discard jclient.clientClose
|
||||||
|
|
Loading…
Reference in New Issue