From 72d99007c5aca6c6bf23a0a6ce928e986c739fa5 Mon Sep 17 00:00:00 2001 From: Christopher Arndt Date: Mon, 10 Oct 2022 21:01:21 +0200 Subject: [PATCH] fix: minor example tweaks Signed-off-by: Christopher Arndt --- examples/jacket_port_connect_cb.nim | 1 - examples/jacket_port_register.nim | 2 +- examples/jacket_sine.nim | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/jacket_port_connect_cb.nim b/examples/jacket_port_connect_cb.nim index 51e9ffc..ef20e17 100644 --- a/examples/jacket_port_connect_cb.nim +++ b/examples/jacket_port_connect_cb.nim @@ -42,7 +42,6 @@ proc portConnected(portA: PortIdT; portB: PortIdT; connect: cint; arg: pointer) echo "Port B: " echo("Action: ", if connect > 0: "connect" else: "disconnect") - addHandler(log) setErrorFunction(errorCb) diff --git a/examples/jacket_port_register.nim b/examples/jacket_port_register.nim index 7b6d991..8c889b6 100644 --- a/examples/jacket_port_register.nim +++ b/examples/jacket_port_register.nim @@ -33,7 +33,7 @@ debug "JACK server status: " & $status if jclient == nil: error getJackStatusErrorString(status) - quit 1 + quit QuitFailure when defined(windows): setSignalProc(signalCb, SIGABRT, SIGINT, SIGTERM) diff --git a/examples/jacket_sine.nim b/examples/jacket_sine.nim index eb2a318..3c8f591 100644 --- a/examples/jacket_sine.nim +++ b/examples/jacket_sine.nim @@ -79,10 +79,10 @@ debug "JACK server status: " & $status if jclient == nil: error getJackStatusErrorString(status) - quit 1 + quit QuitFailure # Create sine oscillator -let sampleRate =(float) jclient.getSampleRate() +let sampleRate = jclient.getSampleRate.float debug "JACK sample rate: " & $sampleRate var osc = initSineOsc(sampleRate, sineFreq) @@ -96,6 +96,7 @@ else: if jclient.setProcessCallback(processCb, osc.addr) != 0: error "Could not set JACK process callback function." cleanup() + quit QuitFailure jclient.onShutdown(shutdownCb, nil)