Open theGreatWhiteShark opened 6 years ago
You can do it by executing jack.client_open
with pcall
and checking the error message on failure, e.g.:
c, errmsg = pcall(jack.client_open, "myclientname", { no_start_server=true })
if not c and string.find(errmsg, 'server_failed') then error("server not running") end
...
The error message contains the status flags returned by jack_client_open
, snake-cased and without the leading Jack, so 'server_failed' stands for JackServerFailed.
(I'll add this to the documentation as soon as possible...)
Thanks a lot!
You're welcome.
Let's keep this issue open for the missing documentation and for the segmentation fault in jack.time
(which is a direct binding to jack_get_time
and I cannot find anywhere in the JACK documentation that it must not be called before connecting to the server).
Alright
Is there a way of checking whether or not the JACK server is already running before opening a client (which causes an error)?
Most functions do require the JACK client as first argument. Among those which do not
jack.port_name_size
andjack.port_type_size
still return the correct integer andjack.time
results in a segmentation fault.