OSD: Configurable status socket + instant channel confirm - #649
Open
ekalkst wants to merge 2 commits into
Open
Conversation
StatusDisplay panels were hardcoded to always read runtime/play_status.socket. This adds an optional socket_file field (defaults to the existing socket, so all current osd.json configs behave unchanged) so a panel can be pointed at any other JSON status socket instead. Motivating use case: remote_controller.py already writes each in-progress digit press to runtime/press.socket while building up a channel number. With this change a panel can display that live input (e.g. "CH 42") while tuning, then auto-hide via the existing display_time behavior. Also guards against the socket file being empty (remote_controller.py truncates press.socket once a channel change is sent) - without this, StatusDisplay would try to json.loads an empty string on every frame and spam the log. Adds osd/examples/channel_number_entry.json demonstrating the new field alongside the existing channel/network panel.
number_pressed() already buffers digits and auto-submits after a 1s pause (or instantly at 3 digits). This adds an explicit confirm: pressing Enter or the numpad Enter cancels the pending debounce timer and sends the channel change immediately, so a 1-2 digit channel (e.g. "1" then Enter) doesn't require waiting out the full timeout. Pairs with the new osd/examples/channel_number_entry.json - the live digit-entry overlay disappears as soon as Enter confirms instead of lingering for the timeout duration.
Owner
|
Starting review today. |
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 this adds
1.
StatusDisplaycan read from any socket, not justplay_status.socketStatusDisplayConfiggets a new optionalsocket_filefield (defaults tothe existing
play_status.socket, so every currentosd.jsonkeeps workingunchanged). This lets a panel be pointed at any other JSON status socket,
for example
runtime/press.socket, whichremote_controller.pyalreadywrites to on every digit press while a channel number is being entered.
Also guards
check_status()against an empty socket file.press.socketgets truncated back to empty once a channel change is sent, and the OSD
polls at ~30fps, so without this guard it would spam
Unable to parse player status,to the log every frame while idle.2. Enter/KP_Enter confirms channel entry immediately
number_pressed()already buffers digits and auto-submits after a ~1spause (or instantly once 3 digits are entered). This adds an explicit
confirm path: pressing Enter or numpad Enter cancels the pending debounce
timer and sends the channel change right away, so tuning to e.g. channel 1
or 42 does not require waiting out the full timeout.
3.
osd/examples/channel_number_entry.jsonNew example showing the two changes together: the normal channel/network
panel plus a second panel wired to
runtime/press.socketthat displaysCH {digits}live while typing, then auto-hides shortly after Enter (orthe timeout) confirms the change.
Motivation
Built this for a Flirc remote setup where number pad buttons tune channels
directly. Wanted on screen feedback while typing a multi-digit channel and
a way to confirm immediately instead of always waiting out the debounce.
Both changes are additive and backward compatible; no existing
osd.jsonor remote mapping behavior changes.
Testing
evdev) tuning tomultiple 1-2 digit channels with both timeout-based and Enter-confirmed
entry.
socket_fileset) still readplay_status.socketas before.