{"id":8151260,"url":"https://github.com/SpotlightKid/jacket","last_synced_at":"2025-07-25T08:31:56.376Z","repository":{"id":151391068,"uuid":"549090162","full_name":"SpotlightKid/jacket","owner":"SpotlightKid","description":" A Nim wrapper for the JACK client-side C API aka libjack","archived":false,"fork":false,"pushed_at":"2024-10-17T14:57:42.000Z","size":98,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-25T17:25:49.324Z","etag":null,"topics":["audio","beta","jackaudio","library","midi","nim","nim-binding","nim-lang","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpotlightKid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-10T16:53:48.000Z","updated_at":"2024-09-12T13:20:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"62bbddd2-508a-4829-9982-4a8fc41e632b","html_url":"https://github.com/SpotlightKid/jacket","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpotlightKid%2Fjacket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpotlightKid%2Fjacket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpotlightKid%2Fjacket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpotlightKid%2Fjacket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpotlightKid","download_url":"https://codeload.github.com/SpotlightKid/jacket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227549346,"owners_count":17786011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","beta","jackaudio","library","midi","nim","nim-binding","nim-lang","wrapper"],"created_at":"2024-04-18T06:42:32.791Z","updated_at":"2025-07-25T08:31:56.314Z","avatar_url":"https://github.com/SpotlightKid.png","language":"Nim","funding_links":[],"categories":["Multimedia"],"sub_categories":["Audio"],"readme":"# jacket\n\nA [Nim] wrapper for the JACK Audio Connection Kit ([JACK]) client side [C API]\naka **libjack**.\n\n\n## Project status\n\nThis software is in *beta status*.\n\nThe majority of JACK client API functions have been wrapped and are functional\n(see [examples]), but some API parts (e.g. threading) still need wrapping.\nOthers, like the server control or the deprecated session API, will probably\nnot be covered by these bindings. While this project is in beta stage, symbol\nnames may still be changed and things moved around before the first stable\nrelease.\n\n\n## Installation\n\n* Clone this repository.\n* Change into the `jacket` directory.\n* Run [`nimble install`] (or `nimble develop`).\n* Build the [examples] with `nimble examples`.\n\n   (Some examples need `--threads:on` with Nim \u003c 2.0).\n\n\n## Usage\n\nHere is a very minimal JACK client application, which just passes audio through\nfrom its single input port to its output port. Any error checking and handling\nhas been omitted for brevity's sake. See the files in the [examples] directory\nfor more robust example code.\n\n```nim\nimport std/os\nimport system/ansi_c\nimport jacket\n\nvar\n    status: cint\n    exitSignalled = false\n    inpPort, outPort: Port\n\ntype SampleBuffer = ptr UncheckedArray[DefaultAudioSample]\n\nproc signalCb(sig: cint) {.noconv.} =\n    exitSignalled = true\n\nproc shutdownCb(arg: pointer = nil) {.cdecl.} =\n    exitSignalled = true\n\nproc processCb(nFrames: NFrames, arg: pointer): cint {.cdecl.} =\n    let inpbuf = cast[SampleBuffer](portGetBuffer(inpPort, nFrames))\n    let outbuf = cast[SampleBuffer](portGetBuffer(outPort, nFrames))\n    # copy samples from input to output buffer\n    for i in 0 ..\u003c nFrames:\n        outbuf[i] = inpbuf[i]\n\n# Create JACK Client ptr\nvar jackClient = clientOpen(\"passthru\", NullOption, status.addr)\n# Register audio input and output ports\ninpPort = jackClient.portRegister(\"in_1\", JackDefaultAudioType, PortIsInput, 0)\noutPort = jackClient.portRegister(\"out_1\", JackDefaultAudioType, PortIsOutput, 0)\n# Set JACK callbacks\njackClient.onShutdown(shutdownCb)\njackClient.setProcessCallback(processCb, nil)\n# Handle POSIX signals\nc_signal(SIGINT, signalCb)\nc_signal(SIGTERM, signalCb)\n# Activate JACK client ...\njackClient.activate()\n\nwhile not exitSignalled:\n    sleep(50)\n\njackClient.clientClose()\n```\n\n\n## License\n\nThis software is released under the **MIT License**. See the file\n[LICENSE.md](./LICENSE.md) for more information.\n\nPlease note that the JACK client library (libjack), which this project wraps,\nis licensed under the [LGPL-2.1]. This wrapper does not statically or\ndynamically link to libjack at build time, but only loads it via [dynlib] at\nrun-time.\n\nSoftware using this wrapper is, in the opinion of its author, not considered a\nderivative work of libjack and not required to be released under the LGPL, but\nno guarantees are made in this regard and users are advised to employ\nprofessional legal counsel when in doubt.\n\n\n## Author\n\n**jacket** is written by [Christopher Arndt].\n\n\n[C API]: https://jackaudio.org/api/\n[Christopher Arndt]: mailto:info@chrisarndt.de\n[dynlib]: https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-import\n[examples]: ./examples\n[JACK]: https://jackaudio.org/\n[LGPL-2.1]: https://spdx.org/licenses/LGPL-2.1-or-later.html\n[`nimble install`]: https://github.com/nim-lang/nimble#nimble-usage\n[Nim]: https://nim-lang.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSpotlightKid%2Fjacket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSpotlightKid%2Fjacket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSpotlightKid%2Fjacket/lists"}