Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

Jump points and local overrides

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


roo.watt at gmail

Jun 12, 2007, 5:35 AM

Post #1 of 2 (839 views)
Permalink
Jump points and local overrides

After some discussion on the mailing list (re Ticket #3363) about the
local context keybindings overriding jumppoints I have made an attempt
at a patch.

I would like to seek some advice.

*** Having had a poke around under the bonnet I thought an appropriate
approach to disabling jump points from particular contexts would be to
enhance TranslateKeyPress() to take a list of jump points to exclude
from the translation. The exclude list can then be specified for each
context from where TranslateKeyPresses.

bool TranslateKeyPress(
const QString &context,
QKeyEvent *e,
QStringList &actions,
bool allowJumps = true,
const QStringList &excludedJumpDestinations = QStringList()
);

The default value for the excludedJumpDestinations parameter means
that all current instances of TranslateKeyPress() will continue to
work OK.

Is this a suitable approach?


*** The attached patch DOESN'T work completely, it is a work in
progress. Due to the compile time and I do the development on my only
mythtv machine I thought I might ask a friendly dev to have a look.

* Without the patch if the jump point and guide keybinding are the
same (S) I see a flash of the live tv in guide screen then it jumps to
the program guide jump point.

* It seems the patch does block the "Program Guide" jump point but the
live tv in guide preview video doesn't show, it just says waiting for
preview or similar.

* When you exit the live tv in guide it exits to the program guide
(although it was launched from live tv)

* Occasioanlly I saw what looked like multiple calls to
TranslateKeyPress for a single keypress. I had some debug print
statements that printed the excludedJumpDestinations. I saw the
expected debug messages and occasionally other messages that had a
excludedJumpDestinations list from a different context (the default
empty list).

Any thoughts from would be appreciated.

Cheers,

Roo
Attachments: translate-key-presses.diff (2.89 KB)


roo.watt at gmail

Jun 16, 2007, 11:43 PM

Post #2 of 2 (740 views)
Permalink
Re: Jump points and local overrides [In reply to]

After having a bit more of a poke around in the code I have a bit
better understanding, please correct me if I am wrong ;)

* It seems that a TRUE return from MythMainWindow::TranslateKeyPress
indicates that an action has been found for the key in the context
passed or the global context.

* Global actions override "context" actions if they exist.

* Jump points override both local and global context mappings.

* A return of FALSE indicates that a jumppoint was found or no mapping
was found in the local or global context.

* A jump point is "fired" by using a callback set when the jump point
was registered with MythMainWindow::RegisterJump

If the above is accurate then...

This is why, when watching live tv and with the "Program Guide" jump
point and "GUIDE" in TV Playback context are both set to 'S' I see a
flash of the live tv in guide screen before the "Program Guide" page
renders?

I have placed some debug VERBOSE statements in tv_play.cpp and
mythmainwindow.cpp and have noticed that:

* when watching live tv and I hit 'S' that ignoreKeys is false when
TV::ProcessKeypress() is called.

* this means the first TranslateKeyPress()@2188 won't be run

* the jump point is scheduled by TranslateKeyPress("ITV Menu"
,...)@2257 and the return is false and program flow continues.

* the call gContext->GetMainWindow()->TranslateKeyPress("TV
Playback",...)@2266 return true so program flow continues and the
GUIDE action is launched @3072

* it is slightly after the GUIDE is displayed (the video isn;t painted
yet) that the jump point kicks in and switches to the Program Guide.


So, I have two questions:

Q1/ Should MythMainWindow::TranslateKeyPress first check to see if a
jump point is currently queued (d->exitmenucallback != NULL) and
simply return false if it is?

Q2/ Should there be a test for jump points at the start of
TV::ProcessKeypress() so they are handled before all the other stuff,
with a if (!ignoreJumpPoints) or similar?

I am not not a programmer (just hacking) so please be kind if I am way
off base ;)

Cheers,

Roo
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.