Opened 15 years ago

Closed 14 years ago

#5954 closed enhancement (wontfix)

Proposed patch to allow dynamic menus

Reported by: andrei@… Owned by: Isaac Richards
Priority: trivial Milestone: unknown
Component: MythTV - General Version: head
Severity: low Keywords: dynamic menus
Cc: Ticket locked: no

Description

I'd like to propose a simple piece of functionality that allows to generate dynamic menus. I'm using it successfully to dynamically build menus for an online streaming service.

The idea is simple: if the <action> tag inside the menu <button> defines a MENU, but the parameter starts with the '`' character (same as bash shell command substitution), rather than treating this as a path to another menu file, we execute the external process, capture its standard output stream, and use the result to load the menu.

Example:

<button>

<type>TV_WATCH_TV</type> <text>9.90552641912621</text> <action>MENU `/home/mythtv/somemenuscript</action>

</button>

The script in /home/mythtv/somemenuscript is expected to generate output in mythtv menu format.

Attachments (5)

dynamic_menus.patch (3.8 KB) - added by andrei@… 15 years ago.
dynamic_menus.2.patch (6.7 KB) - added by andrei@… 15 years ago.
MENUEXEC version
dynamic_menus_h.patch (972 bytes) - added by andrei@… 15 years ago.
MENUEXEC part of the patch for the header file
dynamic_menus-r19940.patch (7.2 KB) - added by Nigel 15 years ago.
Tidyup, test script, against recent SVN
dynamic-menus-r24003.patch (6.2 KB) - added by andrei@… 14 years ago.
Current (Apr 2010) version of the patch

Download all attachments as: .zip

Change History (14)

Changed 15 years ago by andrei@…

Attachment: dynamic_menus.patch added

Changed 15 years ago by andrei@…

Attachment: dynamic_menus.2.patch added

MENUEXEC version

Changed 15 years ago by andrei@…

Attachment: dynamic_menus_h.patch added

MENUEXEC part of the patch for the header file

comment:1 Changed 15 years ago by andrei@…

The MENUEXEC version uses this syntax:

<action>MENUEXEC /path/to/script/file</action>

instead of the originally proposed MENU with '`' character.

comment:2 Changed 15 years ago by Nigel

(In [19940]) Different style of member initialisation (to simplify a future patch - see #5954). Warning for garbage in menu action.

comment:3 Changed 15 years ago by stuartm

I'd like to go on record now as saying this is a ugly hack and that the proper way to offer menus for an "online streaming service" would be to create a proper themable plugin.

Changed 15 years ago by Nigel

Attachment: dynamic_menus-r19940.patch added

Tidyup, test script, against recent SVN

comment:4 Changed 15 years ago by Nigel

Tidier patch attached. Using it for a list of content is an ugly use, but having the ability to easily add a page of dynamic menus may be handy.
The challenge of writing a plugin - the semantic gap between MythUI C++ and a shell script - is huge. The ability to at least create buttons, if only for prototyping, is all many people need to start along the correct path?

comment:5 Changed 15 years ago by stuartm

Milestone: 0.22unknown

comment:6 Changed 15 years ago by stuartm

Component: mythtvMythTV - General
Priority: minortrivial
Severity: mediumlow

comment:7 Changed 14 years ago by Dibblah

Resolution: fixed
Status: newclosed

Please see http://www.mythtv.org/wiki/MythNetvision

for the supported implementation of this.

comment:8 Changed 14 years ago by andrei@…

Resolution: fixed
Status: closednew

The "supported implementation" does not do quite what this patch was intended to do (and still does). Specifically, it expects the script to return the XML containing "full" list of media URLs, even when tree structure is used. I think it's important do be able to generate branches and leafs of the tree structure as user makes choices, "drilling down" based on the selection made in higher tree levels.

Changed 14 years ago by andrei@…

Attachment: dynamic-menus-r24003.patch added

Current (Apr 2010) version of the patch

comment:9 Changed 14 years ago by sphery

Resolution: wontfix
Status: newclosed

Patches against MythNetVision? would be preferred over sticking random playback stuff into the main menus. See http://svn.mythtv.org/trac/ticket/8300#comment:1

Note: See TracTickets for help on using tickets.