fix: minor example tweaks

Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
Christopher Arndt 2022-10-10 21:01:21 +02:00
parent 1127b1ec09
commit 72d99007c5
3 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,6 @@ proc portConnected(portA: PortIdT; portB: PortIdT; connect: cint; arg: pointer)
echo("Action: ", if connect > 0: "connect" else: "disconnect") echo("Action: ", if connect > 0: "connect" else: "disconnect")
addHandler(log) addHandler(log)
setErrorFunction(errorCb) setErrorFunction(errorCb)
jclient = clientOpen("jacket_port_connect_cb", NoStartServer.ord, status.addr) jclient = clientOpen("jacket_port_connect_cb", NoStartServer.ord, status.addr)

View File

@ -33,7 +33,7 @@ debug "JACK server status: " & $status
if jclient == nil: if jclient == nil:
error getJackStatusErrorString(status) error getJackStatusErrorString(status)
quit 1 quit QuitFailure
when defined(windows): when defined(windows):
setSignalProc(signalCb, SIGABRT, SIGINT, SIGTERM) setSignalProc(signalCb, SIGABRT, SIGINT, SIGTERM)

View File

@ -79,10 +79,10 @@ debug "JACK server status: " & $status
if jclient == nil: if jclient == nil:
error getJackStatusErrorString(status) error getJackStatusErrorString(status)
quit 1 quit QuitFailure
# Create sine oscillator # Create sine oscillator
let sampleRate =(float) jclient.getSampleRate() let sampleRate = jclient.getSampleRate.float
debug "JACK sample rate: " & $sampleRate debug "JACK sample rate: " & $sampleRate
var osc = initSineOsc(sampleRate, sineFreq) var osc = initSineOsc(sampleRate, sineFreq)
@ -96,6 +96,7 @@ else:
if jclient.setProcessCallback(processCb, osc.addr) != 0: if jclient.setProcessCallback(processCb, osc.addr) != 0:
error "Could not set JACK process callback function." error "Could not set JACK process callback function."
cleanup() cleanup()
quit QuitFailure
jclient.onShutdown(shutdownCb, nil) jclient.onShutdown(shutdownCb, nil)