refactor: minor example simplification
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
parent
1870734ae6
commit
67f2f79961
|
@ -2,7 +2,6 @@ import std/[logging, strformat]
|
||||||
import jacket
|
import jacket
|
||||||
|
|
||||||
var
|
var
|
||||||
jclient: ClientP
|
|
||||||
status: cint
|
status: cint
|
||||||
descs: ptr UncheckedArray[Description]
|
descs: ptr UncheckedArray[Description]
|
||||||
|
|
||||||
|
@ -15,7 +14,7 @@ proc errorCb(msg: cstring) {.cdecl.} =
|
||||||
|
|
||||||
addHandler(log)
|
addHandler(log)
|
||||||
setErrorFunction(errorCb)
|
setErrorFunction(errorCb)
|
||||||
jclient = clientOpen("jacket_property", NullOption.ord, status.addr)
|
let jclient = clientOpen("jacket_property", NullOption.ord, status.addr)
|
||||||
debug "JACK server status: " & $status
|
debug "JACK server status: " & $status
|
||||||
|
|
||||||
if jclient == nil:
|
if jclient == nil:
|
||||||
|
@ -25,10 +24,8 @@ if jclient == nil:
|
||||||
let numDescs = getAllProperties(descs)
|
let numDescs = getAllProperties(descs)
|
||||||
|
|
||||||
if numDescs != -1:
|
if numDescs != -1:
|
||||||
var desc: Description
|
|
||||||
|
|
||||||
for i in 0..<numDescs:
|
for i in 0..<numDescs:
|
||||||
desc = descs[i]
|
var desc = descs[i]
|
||||||
echo fmt"Subject: {desc.subject}"
|
echo fmt"Subject: {desc.subject}"
|
||||||
|
|
||||||
if desc.property_cnt > 0:
|
if desc.property_cnt > 0:
|
||||||
|
|
Loading…
Reference in New Issue