Opened 11 years ago
Closed 9 years ago
Last modified 7 years ago
#11916 closed Patch - Feature (fixed)
Frontend Services API inconsistent with direct key input, lirc, and network control socket
Reported by: | Owned by: | Bill Meek | |
---|---|---|---|
Priority: | minor | Milestone: | 0.28 |
Component: | MythTV - Services API - Frontend | Version: | 0.27-fixes |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
During playback...
- Keyboard: Hit left, frontend will jump back 5 seconds
- LIRC: Hit left on remote (mapped to left button), frontend will jump back 5 seconds
- Network Control Socket: Send "left", frontend will jump back 5 seconds
- Frontend Services API: send "left" via HTTP, and it will do a stickyrewind
Not exactly sure what other info may be needed to help diagnose, but I'm hoping the developers can replicate easily. Expected behavior would be for all of them to result in the same action, regardless of medium.
Attachments (2)
Change History (10)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
On initial code review, it looks like the code is working properly--though the user interface is, at minimum, confusing to the user or possibly just plain wrong.
When using the keyboard, LIRC, or network control socket, the user is sending keys to MythTV. Those keys are then interpreted by mythfrontend based on how the user has bound those keys to MythTV actions.
However, when using the frontend services API, the user is sending a MythTV action directly--not sending a key that MythTV will interpret based on the user's key bindings. So, the "interpreted" action that Matt is expecting is actually TV Playback/SEEKRWND and can be achieved with: http://frontendip:6547/Frontend/SendAction?Action=SEEKRWND
It seems that the frontend services API just needs a SendKey? method to provide a user-friendly means of direct user interaction.
Whether the frontend services API should expose SendAction? is another question, but 3rd-party applications definitely should not use SendAction? as a means of sending keys to MythTV. Instead, the current design seems to require 3rd-party applications to reconstruct the MythTV keybindings implementation using GetContextList? and GetActionList? to determine the keys the user has bound and attempt to guess how mythfrontend will interpret that key and then send the action to which the key is bound (even though the 3rd-party application doesn't necessarily know which context mythfrontend is currently using to interpret keys and a given key can be bound to different actions in different contexts). Therefore, a SendKey? method, which allows the frontend to interpret whatever key the user sends, makes more sense for creating keyboard/remote functionality in applications.
My initial feeling is that it's fine for us to expose SendAction?, but doing so will be a point of confusion for users (including both 3rd-party application developers and their users)--especially until/unless we have a SendKey? action that is consistent with all the other interface options and all 3rd-party applications are changed to use it for providing user interactivity (remote/keyboard functionality). It seems that already-existing 3rd-party applications have used SendAction? thinking it was a means of providing keyboard/remote control of a frontend, though it is not. The SendAction? method simply allows 3rd party applications to send specific action requests regardless of the user's key bindings; however any direct user interaction in those 3rd party applications should use (the currently non-existent) SendKey? method to provide a means for the user to control the frontend, as if using a keyboard/remote.
However, since we don't allow users to send already-interpreted actions using any other interface, one could argue we should not expose SendAction?.
Changed 11 years ago by
Attachment: | SendKey-Trac-11916-patch.v0 added |
---|
SendKey? addition to Services API
comment:3 Changed 11 years ago by
Attaching patch tested against 0.28-pre-448. Thanks to Mike Dean for the idea. Test with:
curl <FE>:6547/Frontend/SendKey?Key=[keyname|key]
To the original ticket case, use Key=LEFT and a recording will jump back 5 seconds (assumes default key bindings and settings.)
Applies OK against 0.27-fixes, but I didn't test it there.
comment:4 Changed 11 years ago by
Type: | Bug Report - General → Patch - Feature |
---|
Changed 10 years ago by
Attachment: | SendKey-Trac-11916-patch.v1 added |
---|
Updated patch, applies to v0.28-pre-2394-gbe72636 and matches other POST changes
comment:5 Changed 9 years ago by
Milestone: | unknown → 0.28 |
---|---|
Owner: | set to dblain |
Status: | new → assigned |
comment:6 Changed 9 years ago by
Owner: | changed from dblain to Bill Meek |
---|
comment:7 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:8 Changed 7 years ago by
Owner: | changed from Bill Meek to Bill Meek |
---|
FYI - here's the API I used to replicate the issue: http://frontendip:6547/Frontend/SendAction?Action=LEFT