diff --git a/jacket.nim b/jacket.nim index 159e5d1..2bdb028 100644 --- a/jacket.nim +++ b/jacket.nim @@ -1,27 +1,22 @@ # jacket.nim -# Possible names/install locations of libjack, according to +# Possible names/install locations of libjack, according to: # https://github.com/x42/weakjack/blob/master/weak_libjack.c#L108 -# -# MacOS: -# * /usr/local/lib/libjack.dylib -# * /opt/homebrew/lib/libjack.dylib -# * /opt/local/lib/libjack.dylib -# Win: -# * libjack64.dll -# * libjack.dll -# Unix: -# * libjack.so.0 proc getJackLibName: string = when system.hostOS == "windows": - result = "libjack.dll" + when sizeof(int) == 4: + result = "libjack.dll" + else: + result = "libjack64.dll" elif system.hostOS == "macosx": - result = "libjack.dylib" + result = "(|/usr/local/lib/|/opt/homebrew/lib/|/opt/local/lib/)libjack.dylib" else: result = "libjack.so.0" {.push dynlib: getJackLibName().} +# ------------------------------ Constants -------------------------------- + const JACK_MAX_FRAMES* = (4294967295'i64) JACK_LOAD_INIT_LIMIT* = 1024 @@ -43,7 +38,6 @@ type PortT = distinct object PortTPtr* = ptr PortT - type JackOptions* {.size: sizeof(cint) pure.} = enum NullOption = 0x00, @@ -455,6 +449,8 @@ proc setInfoFunction*(infoCallback: JackInfoCallback) {.importc: "jack_set_info_ {.pop.} +# --------------------------- Helper functions ---------------------------- + proc getJackStatusErrorString*(status: cint): string = # Get JACK error status as string. if status == Success.ord: