plac-for-apple-platform

Unofficial Roon client for Apple devices

Commits at b2b447f17ed952a2e4927a6eb8399ab402ea8d51

  1. b2b447f1 cli: Fix memory leak Shota FUJI authored at Shota FUJI comitted at
  2. 00258b0e core: Remove obsolete TODO comment Shota FUJI authored at Shota FUJI comitted at
  3. 5c7effd2 core: Release unhandled response bytes on deinit Shota FUJI authored at Shota FUJI comitted at
  4. f3fa46a4 core: Return result code and token from connect method Shota FUJI authored at Shota FUJI comitted at
  5. ab47cb29 cli: Escape server name and version in TSV output Shota FUJI authored at Shota FUJI comitted at
  6. 49d86a77 cli: Create exit code for stdout write error Shota FUJI authored at Shota FUJI comitted at
  7. 6ac67e0a cli: Create exit code for OOM Shota FUJI authored at Shota FUJI comitted at
  8. ebb7ce2e gtk-adwaita: Fix runtime library error on macOS libadwaita depends on gtk4 but devbox cannot resolve to same package as the root one, so there are duplicated "gtk4" package therefore symbol duplication error happens. I have no idea why this is not a problem on Linux, though. Shota FUJI authored at Shota FUJI comitted at
  9. ed3b9ab8 gtk-adwaita: Init core app I have no idea what to do next. Flux-like state-action API? Simple struct with state properties and callback functions like GObject? Completely lost. Shota FUJI authored at Shota FUJI comitted at
  10. c7269fdd core: Setup debug logs Shota FUJI authored at Shota FUJI comitted at
  11. 31fe7e9b core: Use proper logging Shota FUJI authored at Shota FUJI comitted at
  12. 8d7910f5 cli: Use proper logging Shota FUJI authored at Shota FUJI comitted at
  13. 248e9669 core/cli: Get list of available zones Shota FUJI authored at Shota FUJI comitted at
  14. 4f914150 core/cli: Register extension to Roon Code is messy. Logs should be proper logs not debug one. Few places leaks memory. WebSocket read timeout should be configurable. CLI should also store IP address and TCP port. Error handling is nonexistent. However, it works (TM). And if I optimize or tidy I/F up at this point, there is high chance of the resulted code would be difficult to use. Tidying I/F by seeing only one implementation (in this case, CLI) brings other client hard time integrating. This project's main focus is native GUI clients, not CLI. Thus, I should refactor/optimize at the time of writing GTK or SwiftUI code. Let it evolve from worse state. Shota FUJI authored at Shota FUJI comitted at
  15. 190d510d core: Move server discovery code to "server/" dir I could not put playback related functionality to "lib.h" safely. Shota FUJI authored at Shota FUJI comitted at
  16. f5785163 gtk-adwaita: Loading state for server discovery window Shota FUJI authored at Shota FUJI comitted at
  17. 9bebfb66 gtk-adwaita: Loading screen for server discovery Shota FUJI authored at Shota FUJI comitted at
  18. e97495e7 gtk-adwaita: Generic error dialog class To eliminate the duplication. Shota FUJI authored at Shota FUJI comitted at
  19. 0c6835fc gtk-adwaita: Improve writing and styles of error dialogs Shota FUJI authored at Shota FUJI comitted at
  20. dc5a9a93 gtk-adwaita: Server discovery error handling Loading is still work-in-progress, but error handling is okay. There must be better way to disconnect a signal (error_detail_hid) though. Shota FUJI authored at Shota FUJI comitted at
  21. 96c37943 gtk-adwaita: Use Gnome UI components Shota FUJI authored at Shota FUJI comitted at
  22. 9423b7c4 gtk-adwaita: Rename from "gtk" I'm not going to do "pure GTK", as the primary reason to use GTK is creating native looking GUI. If I freely build styles using GTK components, it would then look alien due to web-by styles. Shota FUJI authored at Shota FUJI comitted at
  23. fdd1d11a core: Find Roon Server by unique ID Except the very initial setup, clients have previously connected Server's unique ID. There is virtually no reason to perform enumerate servers on a network in that case. Shota FUJI authored at Shota FUJI comitted at
  24. 0255a14a core: Fix memory leaks Thanks, valgrind. You're awesome. Shota FUJI authored at Shota FUJI comitted at
  25. 29e4e7f8 cli: Fix memory leak Shota FUJI authored at Shota FUJI comitted at
  26. 762ad37d cli: Fix failing to build Shota FUJI authored at Shota FUJI comitted at
  27. 488e6c8c core/cli: Drop Zig API The primary purpose of cli is to test C API. However, Zig's ideal API design and one of C API is drastically different (esp. allocation), and that makes designing C API difficult. This simplifies the process and hopefully brings better C API with less memory mis-managements. Shota FUJI authored at Shota FUJI comitted at
  28. 38f47e6c core: Fix memory access violation on macos app I forgot C enum is platform int. No idea why this wasn't a problem on Vala, though. Shota FUJI authored at Shota FUJI comitted at
  29. 88a3effa macos: Display Roon Servers on network Shota FUJI authored at Shota FUJI comitted at
  30. 627429da core/macos: Import core from macos https://mitchellh.com/writing/zig-and-swiftui This blog post hugely helped me writing build scripts... I could not do this without that blog post. Shota FUJI authored at Shota FUJI comitted at
  31. e92280ed Remove vala-language-server from tool installation It requires Meson (no way) or Clang's `compile_commands.json` to understand dependencies. While the latter looks simple, I'm not willing to maintain duplicated compile command. If bug or unconvenience or frustration or whatever reaches certain threshold, I'll reconsider re-introducing the LS. Shota FUJI authored at Shota FUJI comitted at
  32. 319cb3a3 macos: macOS app development setup Shota FUJI authored at Shota FUJI comitted at
  33. 7a323e0e gtk: Display scanned Roon Servers No empty state, no error handling, though. Shota FUJI authored at Shota FUJI comitted at
  34. ff30d4c7 core: Fix build fails on macOS Interestingly, Zig smartly assigns `u31` as the type of `usec`. ```zig @compileLog(@typeName(@TypeOf(usec))); ``` yields, ``` @as(*const [3:0]u8, "u31") ``` Shota FUJI authored at Shota FUJI comitted at
  35. 647bb5b2 Don't install Valgrind on macOS It's marked as broken on darwin, despite search.nixos.org lists darwin platforms at "Platforms" section. Shota FUJI authored at Shota FUJI comitted at
  36. 9b785fff core/gtk: C API and use it from Vala Shota FUJI authored at Shota FUJI comitted at
  37. a079c8cd core: Simpler memory management for "Server" Although this increases memory allocation, API is simple and easier to build C API. Shota FUJI authored at Shota FUJI comitted at
  38. eefc813d gtk: Build GTK app using Zig build system It's convenient, consistent, and reliable. Goodbye, system CC's bullshit warnings. Shota FUJI authored at Shota FUJI comitted at
  39. 62d9a8b8 cli: JSONL output for "server ls" ``` ./zig-out/bin/plac server ls -f jsonl | jq ``` Shota FUJI authored at Shota FUJI comitted at
  40. 9fc8db70 core: Set HTTP port to ip_addr field Having separate HTTP port and keeping UDP source port is wasteful and not user friendly. Shota FUJI authored at Shota FUJI comitted at
  41. 9498d876 cli: Improve memory debuggability Now DebugAllocator can detect memory leaks. Shota FUJI authored at Shota FUJI comitted at
  42. 995d035e core: Fix server list not deduped due to double free ``` valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --num-callers=15 -s ./zig-out/bin/plac server ls -c 10 ``` When a same Roon Server responds more than one time, servers hashmap gets corrupted entry due to having a free-d key. Shota FUJI authored at Shota FUJI comitted at
  43. ce738568 cli: Replace "calloc" build option with "memcheck" option For more enriched debugging. Valgrind is super useful but Zig's DebugAllocator displays more friendly message. It does not catch all errors so Valgrind is still necessary. Shota FUJI authored at Shota FUJI comitted at
  44. eac279a7 cli: Fix main not executing defer statements Shota FUJI authored at Shota FUJI comitted at
  45. 482b779c Add valgrind debugging Shota FUJI authored at Shota FUJI comitted at
  46. eec7b07a core/cli: Roon Server discovery It works (TM) quality though. Shota FUJI authored at Shota FUJI comitted at
  47. b4642ced cli: register "server list" command Not doing anything useful for now, though. Shota FUJI authored at Shota FUJI comitted at
  48. 96b2faf4 cli: Basic CLI setup Shota FUJI authored at Shota FUJI comitted at
  49. 88ae701c cli: Zig project setup Shota FUJI authored at Shota FUJI comitted at
  50. 621870cd gtk: Fix build error on macOS ``` error: Failed to execute child process “pkg-config” (No such file or directory) ``` Shota FUJI authored at Shota FUJI comitted at
  51. 5260c3be gtk: GTK4 application project setup I still have no idea how "libadwaita" alone supplies required dependencies such as pango and glib. Without that, even adding those to "packages" section, ld complains files are missing. Ghostty has "libadwaita" and "gtk4" as dependencies for GTK4 so I simply did the same. Shota FUJI authored at Shota FUJI comitted at
  52. f11a7f77 Manage tools using Devbox rather than mise-en-place/asdf Vala, a programming language often(?) used in GTK world, is missing from mise/asdf registries. I've been feeling itches while using mise/asdf due to lack of packages. For example, REUSE tool, which I use for most of my recent projects, does not exist in their registries. I choose Devbox among the three options: * devenv * Nix Flake (without helper tools) * Devbox ## devenv This is the first tool I tried. Their website looks good, features sounds good, and sample Nix file looks okay. Their getting started guide starts with "devenv init", which creates not only their config file but touches other toolings' files (`.gitignore` and `.envrc`). "init" command without manual setup step, especially touching others' files is big sign of shitty tooling design, but I continued hoping other parts would be "okay". Unfortunately they weren't. CLI "search" command emits hundres of warnings, and outputs table does not check terminal width so it badly wraps and border characters gets in a way that the output is nearly unreadable. When I ran its shell command, it paused the execution with a warning message about binary cache. So devenv by default uses creator's own paid SaaS? I don't think just using devenv requires paid subscription, but unclear writing and CLI tries to push Cachix service into users' Nix config is no-no for me. The tool seems to be a thin wrapper around Nix: it inherits some of upstream's bad designs (e.g. absolutely worst error trace, "nix develop" invokes "bash" regardless of the current shell). Their website advertise "Version support." but very few selected packages have that. Everything else relies on Nix's "use latest or die" versioning schema. Considering devenv's "Language support" is just import helpers for nixpkgs, this "Version support." feels like a false advertising. Half-baked YAML/Nix architecture prevents users from using overlays or other flakes with "follows" input to reduce duplications. And using Flake requires running Flake command ("nix develop --no-pure-eval") instead of their CLI, which completely dismissed the value of their tool for me. Also reading their docs are uncomfortable given the tool is not good quality one: > Many experienced Nix users prefer to use Nix flakes, although devenv > is considered a superior interface since it's way simpler, but lacks > integration with existing tooling. Superior, huh? There are still features not present in bare Nix/Flake, but I find those scripts/tasks/tests not useful. If every developer has access to same toolchains, why not simply write script? (JS or Python or Go or whatever) Overall, I see no benefits over bare Nix/Flake or mise/asdf. ## Nix Flake Nix the language is ugly and readability is mediocre (I maintain my machines using Home Manager and still hard time *parsing* program.) It's not good at handling toolchain versions and I don't believe people not using Nix regularly can understand/write even *okay* quality code. Combined with its worst of the worst debuggability, I mean error trace, this is not something I'd like to maintain alongside application development. But most importantly, they still runs "bash" on "nix develop" even a user uses zsh or fish. Hard pass. ## Devbox Actually this was not in my radar initially, but found during figuring best way to write Flake for monorepo. It's not a kind of software I like: docs are next to a cloud offering, docs site hosted on Vercel, corporate site calling nonsense-text- generators-having-high-chance-of-makes-sense-response "AI" without defining intelligence or artifical one, allowing JSONC for ".json" file extension (fuck you M$ for starting this fucking tradition) and not supporting ".jsonc" file extension. But the tool itself is good actually. * Config file is JSON rather than YAML. * Config schema is concise and straightforward. * CLI works great. No wrapping tables. * CLI is fast. * Structure of their docs website is *great*. I should steal from that. * Supports versions, really. It's hard to describe... UX for Devbox is similar to or better than mise-en-place. Simplicity? No bullshit API design? I don't know. I find this tool to be simpler to use and easier to understand compared to other tools, even including non-Nix ones such as asdf, nvm, and mise. I may encounter problems rooted to Devbox in a future. I may get frustrated due to mistyping "debvoc" or something. But for now, I believe Devbox is the best suited for this project (and my other projects too.) Shota FUJI authored at Shota FUJI comitted at
  53. e7e581ad core: Zig project setup Shota FUJI authored at Shota FUJI comitted at
  54. e2a91fa9 README.md and Markdown authoring setup Shota FUJI authored at Shota FUJI comitted at
  55. 4b704338 Create a license file I don't care someone using this for profit or whatever. This project started because the status quo is terrible. Shota FUJI authored at Shota FUJI comitted at