[mythtv] [PATCH] Add transcode to OSD menu

Joseph A. Caputo jcaputo1 at comcast.net
Tue Apr 27 14:19:02 EDT 2004


On Tuesday 27 April 2004 13:29, Isaac Richards wrote:
> On Tuesday 27 April 2004 01:05 pm, Joseph A. Caputo wrote:
> > On Monday 26 April 2004 11:57, Joseph A. Caputo wrote:
> > > On Sunday 25 April 2004 19:18, Dan Morphis wrote:
> > > > Yup :-)  All you did was add it to the tree, you didn't add any
> > > > code to handle it :-)
> > > >
> > > > Do a find for "else if (action == "TOGGLEPIPMODE")" and add you
> > > > code to that section to call the function that normally gets
> > > > called when you press "X".  DoQueueTranscode() is the method I
> > > > believe.
> > >
> > > Hmmm, I don't like that... wouldn't it be cleaner to have a
> > > single code path to handle actions?  Having a single path to
> > > handle this might also make it possible to have the OSD menu
> > > configurable by an XML file...
> > >
> > > If there are no arguments against it, I may start working on a
> > > patch to achieve this...
> >
> > ... this should enable us to avoid duplicating code for actions
> > that can be accessed via multiple code paths.  It means that you
> > won't have to put in a new "if ( action == "NEWACTION" )" line
> > specifically to handle an existing action that has been added to
> > the OSD menu.
> >
> > Also, since OSD menu actions will be handled by common existing
> > code, we could potentially remove the hard-coded "BuildOSDMenuTree"
> > code and instead read an XML file describing the OSD menu tree, its
> > levels & actions.
> >
> > What say ye (Isaac/anyone)?  I think I might be able to work on
> > this within the next week.
>
> Don't see the point, myself.  

Well, the point would be to avoid having 2 separate places in the code 
to do the same thing.  Why have 2 separate snippets of code to process 
the "TOGGLEPIPMODE" action, for instance?  In my experience this is 
just a problem waiting to happen, when code gets updated/changed in one 
location but not in the other.

> Additionally, it won't really work that 
> well due to the fact that keypresses are potentially a one->many
> mapping, and the keypress handling code reflects this, but the OSD
> menu actions aren't.

Well, I admit it does present some difficulties that I didn't address in 
my high-level treatment above, but I'm sure a workable solution could 
be developed.

But, if no one else is interested in this, I'll leave it alone for now.  
I've got some MythMusic ideas I want to work on, anyway.

-JAC


More information about the mythtv-dev mailing list