Compare commits
No commits in common. "9def17c07c908c4c126b49badcd5b09a4d9c6292" and "1127b1ec097ad0bf113334de7761938173dceb68" have entirely different histories.
9def17c07c
...
1127b1ec09
|
@ -14,9 +14,9 @@ before the first public release.
|
||||||
|
|
||||||
Also, I plan to add a higher-level abstraction on top of the direct mapping
|
Also, I plan to add a higher-level abstraction on top of the direct mapping
|
||||||
from Nim procs and types to C functions and types, probably in the form of
|
from Nim procs and types to C functions and types, probably in the form of
|
||||||
a JACK client object, which takes care of creating a JACK client instance,
|
a JACk client object, which takes care of a JACK client instance, registering
|
||||||
registering ports and setting up all the callbacks necessary for a well-behaved
|
ports and setting up all the callbacks necessary for a well-behaved JACK
|
||||||
JACK application.
|
application.
|
||||||
|
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
|
@ -43,6 +43,7 @@ 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)
|
||||||
|
|
|
@ -33,7 +33,7 @@ debug "JACK server status: " & $status
|
||||||
|
|
||||||
if jclient == nil:
|
if jclient == nil:
|
||||||
error getJackStatusErrorString(status)
|
error getJackStatusErrorString(status)
|
||||||
quit QuitFailure
|
quit 1
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
setSignalProc(signalCb, SIGABRT, SIGINT, SIGTERM)
|
setSignalProc(signalCb, SIGABRT, SIGINT, SIGTERM)
|
||||||
|
|
|
@ -79,10 +79,10 @@ debug "JACK server status: " & $status
|
||||||
|
|
||||||
if jclient == nil:
|
if jclient == nil:
|
||||||
error getJackStatusErrorString(status)
|
error getJackStatusErrorString(status)
|
||||||
quit QuitFailure
|
quit 1
|
||||||
|
|
||||||
# Create sine oscillator
|
# Create sine oscillator
|
||||||
let sampleRate = jclient.getSampleRate.float
|
let sampleRate =(float) jclient.getSampleRate()
|
||||||
debug "JACK sample rate: " & $sampleRate
|
debug "JACK sample rate: " & $sampleRate
|
||||||
var osc = initSineOsc(sampleRate, sineFreq)
|
var osc = initSineOsc(sampleRate, sineFreq)
|
||||||
|
|
||||||
|
@ -96,7 +96,6 @@ 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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue