diff --git a/examples/jacket_list_all_properties.nim b/examples/jacket_list_all_properties.nim new file mode 100644 index 0000000..325847a --- /dev/null +++ b/examples/jacket_list_all_properties.nim @@ -0,0 +1,46 @@ +import std/[logging, strformat] +import jacket + +var + jclient: ClientP + status: cint + descs: ptr UncheckedArray[Description] + +var log = newConsoleLogger(when defined(release): lvlInfo else: lvlDebug) + +proc errorCb(msg: cstring) {.cdecl.} = + # Suppress verbose JACK error messages when server is not available by + # default. Pass ``lvlAll`` when creating the logger to enable them. + debug "JACK error: " & $msg + +addHandler(log) +setErrorFunction(errorCb) +jclient = clientOpen("jacket_property", NullOption.ord, status.addr) +debug "JACK server status: " & $status + +if jclient == nil: + error getJackStatusErrorString(status) + quit 1 + +let numDescs = getAllProperties(descs) + +if numDescs != -1: + var desc: Description + + for i in 0.. 0: + for p in 0..