Compare commits

..

No commits in common. "6db9cc0811028add8df53e8d84a8521c33bb78be" and "aadbd26fabe9f818fe9d6fbcfe31a37a4e91fdd9" have entirely different histories.

8 changed files with 22 additions and 18 deletions

View File

@ -23,11 +23,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
debug "Received signal: " & $sig info "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
warn "JACK server has shut down." info "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc printMidiEvent(event: var MidiEvent) = proc printMidiEvent(event: var MidiEvent) =

View File

@ -22,6 +22,7 @@ let rbSize = 128
var log = newConsoleLogger(when defined(release): lvlInfo else: lvlDebug) var log = newConsoleLogger(when defined(release): lvlInfo else: lvlDebug)
addHandler(log) addHandler(log)
proc cleanup() = proc cleanup() =
debug "Cleaning up..." debug "Cleaning up..."
@ -54,11 +55,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
debug "Received signal: " & $sig info "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
warn "JACK server has shut down." info "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc midiEventPrinterProc() {.thread.} = proc midiEventPrinterProc() {.thread.} =
@ -84,6 +85,7 @@ proc midiEventPrinterProc() {.thread.} =
dataReadyLock.release() dataReadyLock.release()
proc processCb*(nFrames: NFrames, arg: pointer): cint {.cdecl.} = proc processCb*(nFrames: NFrames, arg: pointer): cint {.cdecl.} =
var msgBuf: array[4, uint8] var msgBuf: array[4, uint8]
@ -107,6 +109,7 @@ proc processCb*(nFrames: NFrames, arg: pointer): cint {.cdecl.} =
dataReady.signal() dataReady.signal()
dataReadyLock.release() dataReadyLock.release()
proc main() = proc main() =
# Create JACK client # Create JACK client
setErrorFunction(errorCb) setErrorFunction(errorCb)
@ -151,5 +154,6 @@ proc main() =
debug "Freeing ringbuffer memory." debug "Freeing ringbuffer memory."
ringbufferFree(rb) ringbufferFree(rb)
when isMainModule: when isMainModule:
main() main()

View File

@ -46,11 +46,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
debug "Received signal: " & $sig info "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
warn "JACK server has shut down." info "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc midiEventPrinterProc() = proc midiEventPrinterProc() =

View File

@ -50,11 +50,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
debug "Received signal: " & $sig info "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
warn "JACK server has shut down." info "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc midiEventPrinterProc() = proc midiEventPrinterProc() =

View File

@ -20,11 +20,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
debug "Received signal: " & $sig info "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
warn "JACK server has shut down." info "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc portConnected(portA: PortId; portB: PortId; connect: cint; arg: pointer) {.cdecl.} = proc portConnected(portA: PortId; portB: PortId; connect: cint; arg: pointer) {.cdecl.} =

View File

@ -19,11 +19,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
debug "Received signal: " & $sig info "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
warn "JACK server has shut down." info "JACK server has shut down."
exitSignalled = true exitSignalled = true
addHandler(log) addHandler(log)

View File

@ -54,11 +54,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
debug "JACK error: " & $msg debug "JACK error: " & $msg
proc signalCb(sig: cint) {.noconv.} = proc signalCb(sig: cint) {.noconv.} =
debug "Received signal: " & $sig info "Received signal: " & $sig
exitSignalled = true exitSignalled = true
proc shutdownCb(arg: pointer = nil) {.cdecl.} = proc shutdownCb(arg: pointer = nil) {.cdecl.} =
warn "JACK server has shut down." info "JACK server has shut down."
exitSignalled = true exitSignalled = true
proc processCb(nFrames: NFrames, arg: pointer): cint {.cdecl.} = proc processCb(nFrames: NFrames, arg: pointer): cint {.cdecl.} =

View File

@ -61,7 +61,7 @@ type
SessionID = 0x20 SessionID = 0x20
type type
JackStatus* {.size: sizeof(cint) pure.} = enum JackStatus* {.size: sizeof(cint).} = enum
Success = 0x00, Success = 0x00,
Failure = 0x01, Failure = 0x01,
InvalidOption = 0x02, InvalidOption = 0x02,
@ -97,7 +97,7 @@ type
# Transport # Transport
type type
PositionBits* {.size: sizeof(cint) pure.} = enum PositionBits* {.size: sizeof(cint).} = enum
PositionBBT = 0x10, PositionBBT = 0x10,
PositionTimecode = 0x20, PositionTimecode = 0x20,
BBTFrameOffset = 0x40, BBTFrameOffset = 0x40,
@ -105,7 +105,7 @@ type
VideoFrameOffset = 0x100, VideoFrameOffset = 0x100,
TickDouble = 0x200 TickDouble = 0x200
TransportState* {.size: sizeof(cint) pure.} = enum TransportState* {.size: sizeof(cint).} = enum
TransportStopped = 0, TransportStopped = 0,
TransportRolling = 1, TransportRolling = 1,
TransportLooping = 2, TransportLooping = 2,
@ -191,7 +191,7 @@ type
data*: cstring data*: cstring
`type`*: cstring `type`*: cstring
PropertyChange* {.size: sizeof(cint) pure.} = enum PropertyChange* {.size: sizeof(cint).} = enum
PropertyCreated, PropertyCreated,
PropertyChanged, PropertyChanged,
PropertyDeleted PropertyDeleted