[mythtv] Triggering Menu Actions Through Command Line

William Bond potsofdirt at yahoo.com
Wed Aug 24 02:32:12 UTC 2005


Recently I have been working to customize MythTV with
my remote. I would like to be able to use buttons on
my remote to automatically open MythTV and tigger a
menu option. I have gotten the code to work so that I
can trigger "EXEC xine" to play DVDs via comannd line,
however when I try to "TV_WATCH_LIVE" I run into some
problems. 

TV_WATCH_LIVE ends up calling startTV() in main.cpp of
mythfrontend. This works and will start the TV fine.
If I exit TV to the menu and then try watching TV
again I get a black screen and mythfrontend stops
responding to keypresses. It says it is chaning from
"None to None" instead of the normal "None to
WatchingLiveTV".

Unfortunately I do not understand exactly how the
whole menuing system works, or what exactly I am
breaking by calling an action before the
"menu->exec();" line.  

Here is what I am doing:

programs/mythfrontend/main.cpp
I added code to handle an extra argument on the
command line named "-action" it takes the next
argument after that as the action to execute. It then
calls a custom version of RunMenu() that calls 

menu->HandleAction(action);
// An accessor I added to ThemedMenu to allow access
// to ThemedMenuPrivate->handleAction();

just before the

do { menu->exec(); } while()

block. Any help would be greatly appreciated!

--Will


More information about the mythtv-dev mailing list