[mythtv] Some questions about the code

Carl Reynolds mythtv-dev at hyperbole-software.com
Fri Nov 17 17:56:26 UTC 2006


young boy wrote:

> <action> Jump Play DVD </action>
>
> Question 1: How do I handle in the code differently if used "JUMP".. ??
>
>
> Assuming that, I will need to change the code in setUpKey() and called 
> it in  MythTV init()
>
I don't know what you mean by setUpKey(). I haven't any idea what 
"MythTV init()" is.

> REG_JUMP("Play DVD", "DVD", "", printMessage);
>
> I then used MythThemedMenu * dialog = new MythThemedMenu(.......)
> dialog->setCalling(DVDCallback, NULL)
> GetMythMainWindow()->GetMainStack()->AddScreen(diag);

In mythdvd/mythdvd/main.cpp (under the plug-ins directory) you will see 
that "initKeys()" calls
REG_JUMP("Play DVD", "Play a DVD", "", playDVD);

This call tells myth to use a line in one of the *.xml files like the 
following:
<action>JUMP Play DVD</action>.

When the user selects the menu item with this action line, 
mythThemedMenu will jump to the function playDVD (specified as the last 
argument of the REG_JUMP call). You don't need to set the callback or 
AddScreen.

>
> Question 2: is this how the dialog wil be added to the screen. I could 
> not tell that is the case.. because this function DVDCallback() was 
> never called when I select the menu. thanks

If you're using a jump, the program will not call the callback function. 
That uses a different mechanism in the *.xml file.

The jump function works better than the callback because you need to 
modify mythfrontend and re-compile it in addition to creating your 
plug-in and adding the callback action to the *.xml file to use the 
callback. You only have to modify the *.xml file and create your plug-in 
to use the Jump action.



Carl.





More information about the mythtv-dev mailing list