Compare commits
2 Commits
aadbd26fab
...
6db9cc0811
Author | SHA1 | Date |
---|---|---|
Christopher Arndt | 6db9cc0811 | |
Christopher Arndt | f0c036c686 |
|
@ -23,11 +23,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
|
|||
debug "JACK error: " & $msg
|
||||
|
||||
proc signalCb(sig: cint) {.noconv.} =
|
||||
info "Received signal: " & $sig
|
||||
debug "Received signal: " & $sig
|
||||
exitSignalled = true
|
||||
|
||||
proc shutdownCb(arg: pointer = nil) {.cdecl.} =
|
||||
info "JACK server has shut down."
|
||||
warn "JACK server has shut down."
|
||||
exitSignalled = true
|
||||
|
||||
proc printMidiEvent(event: var MidiEvent) =
|
||||
|
|
|
@ -22,7 +22,6 @@ let rbSize = 128
|
|||
var log = newConsoleLogger(when defined(release): lvlInfo else: lvlDebug)
|
||||
addHandler(log)
|
||||
|
||||
|
||||
proc cleanup() =
|
||||
debug "Cleaning up..."
|
||||
|
||||
|
@ -55,11 +54,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
|
|||
debug "JACK error: " & $msg
|
||||
|
||||
proc signalCb(sig: cint) {.noconv.} =
|
||||
info "Received signal: " & $sig
|
||||
debug "Received signal: " & $sig
|
||||
exitSignalled = true
|
||||
|
||||
proc shutdownCb(arg: pointer = nil) {.cdecl.} =
|
||||
info "JACK server has shut down."
|
||||
warn "JACK server has shut down."
|
||||
exitSignalled = true
|
||||
|
||||
proc midiEventPrinterProc() {.thread.} =
|
||||
|
@ -85,7 +84,6 @@ proc midiEventPrinterProc() {.thread.} =
|
|||
|
||||
dataReadyLock.release()
|
||||
|
||||
|
||||
proc processCb*(nFrames: NFrames, arg: pointer): cint {.cdecl.} =
|
||||
var msgBuf: array[4, uint8]
|
||||
|
||||
|
@ -109,7 +107,6 @@ proc processCb*(nFrames: NFrames, arg: pointer): cint {.cdecl.} =
|
|||
dataReady.signal()
|
||||
dataReadyLock.release()
|
||||
|
||||
|
||||
proc main() =
|
||||
# Create JACK client
|
||||
setErrorFunction(errorCb)
|
||||
|
@ -154,6 +151,5 @@ proc main() =
|
|||
debug "Freeing ringbuffer memory."
|
||||
ringbufferFree(rb)
|
||||
|
||||
|
||||
when isMainModule:
|
||||
main()
|
||||
|
|
|
@ -46,11 +46,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
|
|||
debug "JACK error: " & $msg
|
||||
|
||||
proc signalCb(sig: cint) {.noconv.} =
|
||||
info "Received signal: " & $sig
|
||||
debug "Received signal: " & $sig
|
||||
exitSignalled = true
|
||||
|
||||
proc shutdownCb(arg: pointer = nil) {.cdecl.} =
|
||||
info "JACK server has shut down."
|
||||
warn "JACK server has shut down."
|
||||
exitSignalled = true
|
||||
|
||||
proc midiEventPrinterProc() =
|
||||
|
|
|
@ -50,11 +50,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
|
|||
debug "JACK error: " & $msg
|
||||
|
||||
proc signalCb(sig: cint) {.noconv.} =
|
||||
info "Received signal: " & $sig
|
||||
debug "Received signal: " & $sig
|
||||
exitSignalled = true
|
||||
|
||||
proc shutdownCb(arg: pointer = nil) {.cdecl.} =
|
||||
info "JACK server has shut down."
|
||||
warn "JACK server has shut down."
|
||||
exitSignalled = true
|
||||
|
||||
proc midiEventPrinterProc() =
|
||||
|
|
|
@ -20,11 +20,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
|
|||
debug "JACK error: " & $msg
|
||||
|
||||
proc signalCb(sig: cint) {.noconv.} =
|
||||
info "Received signal: " & $sig
|
||||
debug "Received signal: " & $sig
|
||||
exitSignalled = true
|
||||
|
||||
proc shutdownCb(arg: pointer = nil) {.cdecl.} =
|
||||
info "JACK server has shut down."
|
||||
warn "JACK server has shut down."
|
||||
exitSignalled = true
|
||||
|
||||
proc portConnected(portA: PortId; portB: PortId; connect: cint; arg: pointer) {.cdecl.} =
|
||||
|
|
|
@ -19,11 +19,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
|
|||
debug "JACK error: " & $msg
|
||||
|
||||
proc signalCb(sig: cint) {.noconv.} =
|
||||
info "Received signal: " & $sig
|
||||
debug "Received signal: " & $sig
|
||||
exitSignalled = true
|
||||
|
||||
proc shutdownCb(arg: pointer = nil) {.cdecl.} =
|
||||
info "JACK server has shut down."
|
||||
warn "JACK server has shut down."
|
||||
exitSignalled = true
|
||||
|
||||
addHandler(log)
|
||||
|
|
|
@ -54,11 +54,11 @@ proc errorCb(msg: cstring) {.cdecl.} =
|
|||
debug "JACK error: " & $msg
|
||||
|
||||
proc signalCb(sig: cint) {.noconv.} =
|
||||
info "Received signal: " & $sig
|
||||
debug "Received signal: " & $sig
|
||||
exitSignalled = true
|
||||
|
||||
proc shutdownCb(arg: pointer = nil) {.cdecl.} =
|
||||
info "JACK server has shut down."
|
||||
warn "JACK server has shut down."
|
||||
exitSignalled = true
|
||||
|
||||
proc processCb(nFrames: NFrames, arg: pointer): cint {.cdecl.} =
|
||||
|
|
|
@ -61,7 +61,7 @@ type
|
|||
SessionID = 0x20
|
||||
|
||||
type
|
||||
JackStatus* {.size: sizeof(cint).} = enum
|
||||
JackStatus* {.size: sizeof(cint) pure.} = enum
|
||||
Success = 0x00,
|
||||
Failure = 0x01,
|
||||
InvalidOption = 0x02,
|
||||
|
@ -97,7 +97,7 @@ type
|
|||
# Transport
|
||||
|
||||
type
|
||||
PositionBits* {.size: sizeof(cint).} = enum
|
||||
PositionBits* {.size: sizeof(cint) pure.} = enum
|
||||
PositionBBT = 0x10,
|
||||
PositionTimecode = 0x20,
|
||||
BBTFrameOffset = 0x40,
|
||||
|
@ -105,7 +105,7 @@ type
|
|||
VideoFrameOffset = 0x100,
|
||||
TickDouble = 0x200
|
||||
|
||||
TransportState* {.size: sizeof(cint).} = enum
|
||||
TransportState* {.size: sizeof(cint) pure.} = enum
|
||||
TransportStopped = 0,
|
||||
TransportRolling = 1,
|
||||
TransportLooping = 2,
|
||||
|
@ -191,7 +191,7 @@ type
|
|||
data*: cstring
|
||||
`type`*: cstring
|
||||
|
||||
PropertyChange* {.size: sizeof(cint).} = enum
|
||||
PropertyChange* {.size: sizeof(cint) pure.} = enum
|
||||
PropertyCreated,
|
||||
PropertyChanged,
|
||||
PropertyDeleted
|
||||
|
|
Loading…
Reference in New Issue