plac

Roon remote in GTK4

Commits at v0.2.0

  1. 7dc7622b v0.2.0 Shota FUJI authored at Shota FUJI comitted at
  2. e16bdad7 Fix error banner does not go away on successful reconnection Shota FUJI authored at Shota FUJI comitted at
  3. 94fb3354 Handle connection close Shota FUJI authored at Shota FUJI comitted at
  4. 36a122b8 Simplify connection process This patch refactors and simplifies connection process, which has been messy as it was designed for C API. This refactor also removed the unnecessary short-lived WebSocket connection on startup. That unorganized `try_listen` / `start` methods have been pain point for me. It was unclear how the class calls methods one by another, by looking at class. Elimination of startup short-lived WebSocket connection reduces startup time. It was not a bothering one, but there is no technical reason to close the established connection so this is good. Shota FUJI authored at Shota FUJI comitted at
  5. 413b89ae v0.1.0 Shota FUJI authored at Shota FUJI comitted at
  6. b42254f9 Use C Macro for embedding application ID Shota FUJI authored at Shota FUJI comitted at
  7. 74b16223 Embed version string from "build.zig.zon" Shota FUJI authored at Shota FUJI comitted at
  8. 42bdb450 Remove third-party copyright notice Plac for GTK4 no longer statically links to libraries. Shota FUJI authored at Shota FUJI comitted at
  9. 8ca06f40 Fix extension registration errors in short time Request handler at registration does not ignore ping request from Roon server and tried to parse it as register response. Shota FUJI authored at Shota FUJI comitted at
  10. 417fbfc7 Use SOOD parsing written in Vala For faster compilation in Nix build (no downloading) and pure-Vala challenge. Shota FUJI authored at Shota FUJI comitted at
  11. 9cbd39e2 Cleanup build script Removed legacy crufts. Shota FUJI authored at Shota FUJI comitted at
  12. 0d19d03e Fix debug log not describing what the number is Shota FUJI authored at Shota FUJI comitted at
  13. d1962e17 Fix seekbar behavior being flaky Sometimes the seekbar remains disabled (`sensitive = false`) and sometime it keeps previous tracks seek location after track changed. These are due to mishandling of `seek_position`'s nullability. Shota FUJI authored at Shota FUJI comitted at
  14. 61dd1427 Use Zone class directly for view model `Zone` class became GObject. Shota FUJI authored at Shota FUJI comitted at
  15. 28bbf5cf Use json-glib instead of Zig module To integrate to GLib ecosystem more. I rejected json-glib before due to poor API, but the lure of "Vala only codebase" was too attractive. While the new codebase is quite verbose, overall line counts are lower than the before. Due to C API deserializing and serializing code is not readable and error-prone. I created `JsonHelper` module to mitigate the shitty API but it's nowhere near perfect. These code seriously need unit tests, but that would take a while. For now, this is good enough. Shota FUJI authored at Shota FUJI comitted at
  16. 1550d119 Remove unused dependencies (Zig packages) Shota FUJI authored at Shota FUJI comitted at
  17. 7ad3f9fe Put space after type parameter's close angle It was so ugly and stupid but I had no idea which uncrustify property is the culprit. Shota FUJI authored at Shota FUJI comitted at
  18. 19824f68 Rename namespace "Plac.V2" to "Plac" V1 code is no longer there. Shota FUJI authored at Shota FUJI comitted at
  19. 7bd484b9 Rewrite WS connection and messaging in Vala (GLib) The added overheads, especially cognitive overhead, had been bothering me long time. Communicating via plain C FFI also means the Zig part has to take care of thread-safety *outside of* GLib main-loop, which comes with noticeable performance penalty. By implementing (almost) everything in Vala, thread unsafety and performance penalty caused by locking have gone. Browser navigations are much quicker and I'm yet to see a single unresponsed request. JSON serializing and deserializing module is the only remaining Zig code. Although I'd much like to this part to Vala as well, JSON handling in Vala is horrible shit so I doubt the migration will happen in a foreseeable future. This patch just replaces the C API (in Zig) by Vala counterpart. I did not application restructure or refactor or whatever. Those will make this patch more difficult to view. The only difference (regression?) is the connection object cannot withstand WebSocket connection closing. However, in my limited testing, libsoup seems to keep WebSocket connection even when computer is sleeping... so the chance of disconnection will be lower than before therefore that's not a huge problem. Shota FUJI authored at Shota FUJI comitted at
  20. 23e3c3b1 Fix constructor functions for seriealizer use uint8[] rather than string Shota FUJI authored at Shota FUJI comitted at
  21. 1beb90b5 Fix typo Shota FUJI authored at Shota FUJI comitted at
  22. 28086d81 Fix Browse.Load.Response leaks memory Shota FUJI authored at Shota FUJI comitted at
  23. 9783dfaa Create transport response objects Shota FUJI authored at Shota FUJI comitted at
  24. c8f2e26f Create transport request objects Shota FUJI authored at Shota FUJI comitted at
  25. 1f8846d0 JSON API for register request and response This got individual commit because the request needs additional change to API builder code. Shota FUJI authored at Shota FUJI comitted at
  26. 5e58e356 Rewrite server resolve process in Vala Shota FUJI authored at Shota FUJI comitted at
  27. 798ecc52 Create Roon request and response handle library in Zig Vala's (GTK ecosystem's) JSON parsing is dogshit. Although I'd like to write an entire codebase in Vala, this is necessary to maintain readability and quality. This commit only contains browse request/response for brevity. Shota FUJI authored at Shota FUJI comitted at
  28. 6c1c34ed Create helper class for body extracting This does not have actual JSON parsing, as parsing JSON in Vala is totally mess, nightmare. The only (?) seemingly-reliable library is json-glib. Documentation is unorganized mess as usual in GTK-related project, so it does not dismiss the value. Extremely imperative and quite verbose API is tolerable if it's used for rare case such as string-to-enum conversion. The problem is the library is not well integrated GLib ecosystem, despite it being under GLib project. It has GObject serialization and deserialization functionality, and they are bare minimum. No array support, top-level MUST be an object... Imperative API also is full of footgun, such as getting a data from node in mismatching type returns "NULL" or "0"... In addition to that, I see no mention of "null or field omit" in methods I checked. That may okay as a C library, but definetely does not meet a quality required to be used in high-level languages, Vala. Little bit cumbersome, but seriealize and deserialize in Zig via FFI is much much much cleaner and better. Considering how widespread JSON is, I can't recommend Vala as a sole application development language to anyone, especially the application involves networking. For GTK application development, Rust would be the best choice nowadays? Shota FUJI authored at Shota FUJI comitted at
  29. c0fd3c85 Create MOO headers parser in Vala Shota FUJI authored at Shota FUJI comitted at
  30. e2d16abd Create MOO metadata parser in Vala The first and primary reason is better integration to GTK ecosystem. GObject, GString (null-terminated strings,) GError, etc... Bridging Zig (or any other system language with C API export) to those are tedious and error-prone task. If the extra allocations (copy) are necessary due to the fucking null-terminated strings, why not writing the whole logic in Vala? The burden of bridges outweighs the ergonomics of using Zig with copy-every-string approach. The second reason is I wanted to see what is like to write non-GUI code in Vala, including unit testing. It turns out really bad, because of null-terminated fucking string and lack of converting it to/from length specified bytes. Shota FUJI authored at Shota FUJI comitted at