Repository navigation
feat: add state variables per-app - #7
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Gives every app listed as an instance its own copy of the state variables. The
system_media_*variables follow whatever is playing, so a "Now Playing" text bound to them jumps to a YouTube tab while VLC plays music. Closes #6.system_media_vlc_media_player_artist, shown as "VLC media player: Artist".system_media_firefox_1a2b3c4d_artist.system_media_*variables don't change.IsContainer). The host only shows folders for a catalog that supports search, soDiscoverAsyncalso answers a search: every word typed must appear in the variable's name or its app's name.system-media-<instance id>-<variable>, e.g.system-media-app-vlc-exe-2900ecd1-artist. The host stores the id of every linked variable, so AGENTS.md lists them as public API.AppVariablePublisherreads the subscribed variables once a second and sends the ones that changed. Each known app has its ownStateSnapshotCache, so one read covers all of an app's variables.Variables.App.Artist={app}: Artist). A localized argument nested inside another doesn't reach the host, which showed{variable}.make conformancesetsSYSTEM_MEDIA_DEMO, and demo mode also leaves out the mpv/SMPlayer source. The suite runs actions and writes variables, which paused, skipped and seeked whatever was playing on the machine. MDC0801 now skips, because demo actions write no log line.Checklist
make buildandmake testpass locally (0 warnings, 257 tests; 274 with-p:SystemMediaWindows=false).make conformancepasses (32 passed, 0 failed; MDC0802 is inconclusive, as onmain).Tested on
Macro Deck 3 host, Windows 11, with VLC and Firefox playing at once: