SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-24-2011, 12:37 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
FocusGained Hook

Gents,

I'm seeing something strange and I'm not sure if it's a bug or I am just missing something. The screencap attached is a portion of the menu that is used to display podcasts. I've added some code to the FocusGained hook that saves some information depending on what type of podcast is in focus. The problem I'm seeing is that if I:

1. Select Online -> Channels.com -> Arts. This brings up a menu of all Podcasts in the Arts category.

2. Select the default podcast on the menu (upper left hand corner which happens to be KQED; Spark Video). This changes some menu variables and then reloads the same menu but displays all the the podcasts for "KQED: Spark Video". So far so good.

3. When the list of KQED: podcasts are displayed press the left arrow. This actually changes some menu variables and reloads the same menu, this time displaying the same menu as was displayed in step 2. The issue I'm seeing is that the FocusGained hook is not being fired.

I'm fairly certain that this is the case because I see the following in the debug log:

Code:
Sun 4/24 14:21:12.452 [ReProcessHook@d2bee] PR: FocusGained on Arts

Sun 4/24 14:21:15.995 [ReProcessHook@d2bee] PR: FocusGained on KQED: Spark Art Video Podcast

Sun 4/24 14:21:23.085 [ReProcessHook@d2bee] PR: FocusGained on Artists' Interpretations of the Seder Plate

Sun 4/24 14:21:27.443 [AWT-EventQueue-0@117f31e] PR: FocusGained on National Gallery of Art-Videos

Sun 4/24 14:21:28.531 [AWT-EventQueue-0@117f31e] PR: FocusGained on KQED: Spark Art Video Podcast
The first line gets printed when the Arts category is in focus, as expected.

The second line gets printed when the KQED: podcast is in focus, as expected.

The third line gets printed when the first episode of the KQED: podcasts is in focus, as expected.

The fourth line is where things went wrong. This item is actually the item just to the right of the KQED: podcast. The item was displayed when the focus was actually on the KQED podcast and I pressed the right arrow key.

When I pressed the left arrow key line 5 was printed showing focus was regained on the KQED: podcast. So there is a line missing between lines 3 and 4 showing focus regained on the KQED: podcast.

Sorry for the rambling post, but I wanted to give a lot if detail to make sure it's not me that is making a mistake.

Tom
Attached Images
File Type: jpg studio1.jpg (137.3 KB, 220 views)
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #2  
Old 04-24-2011, 12:57 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Have you tried logging the FocusLost event as well to verify that focus is actually leaving the item in question? If focus never left, that could explain why FocusGained didn't fire when you expected it to.

For instance if item X has focus when menu M is displayed, and then you transition to menu N, and then return to menu M via the Back command (so that the Reloaded to BeforeMenuLoad argument is true), then as far as M is concerned, X still has focus, because focus never left X while M was displayed. So you won't see a FocusGained event in that case.

I'm not sure precisely how this maps onto your example, but it wouldn't surprise me if something similar was happening.
__________________
-- Greg
Reply With Quote
  #3  
Old 04-24-2011, 01:52 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
I understand what you are saying and I'll check it out to see. Right now it's time for Easter dinner
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #4  
Old 04-25-2011, 05:58 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
I "fixed" this issue by checking for the special case of the menu getting reloaded and the focus not changing. To me it would be a lot more intuitive if the FocusGained hook was fired after a reload because although the focus has not physically changed the entire contents of the menu has changed, so it should be treated like loading a brand new menu.

Just my $0.02.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #5  
Old 04-25-2011, 01:51 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
I guess my question then would be what are you doing to cause it to re-enter by the Reloaded path if your intention is to display it as a totally new content? Generally if you get there by direct reference to the menu widget, then the menu is created from scratch and Reloaded is false, whereas if you get there by the Back command, then the existing menu is reused and Reloaded is true.
__________________
-- Greg
Reply With Quote
  #6  
Old 04-25-2011, 02:07 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by GKusnick View Post
I guess my question then would be what are you doing to cause it to re-enter by the Reloaded path if your intention is to display it as a totally new content? Generally if you get there by direct reference to the menu widget, then the menu is created from scratch and Reloaded is false, whereas if you get there by the Back command, then the existing menu is reused and Reloaded is true.
I'm not doing it, it's done by the default STV. It's the menu you see if you go to Online -> Channels.com. When you first get there it displays all of the Categories. Selecting one of them brings up all of the Channels in that category. Selecting one of those brings up the individual podcast episodes. All of this is done using the same menu with different variables.

The problem I was having was after pressing the left arrow (back) so you are probably correct. While I understand the theory, it was not at all intuitive to me.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #7  
Old 04-25-2011, 03:45 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
You can also use the LayoutStarted hook to see if any menu-level or global variables are already set for the item that has focus & if not, set them at that time.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #8  
Old 04-25-2011, 06:38 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by Opus4 View Post
You can also use the LayoutStarted hook to see if any menu-level or global variables are already set for the item that has focus & if not, set them at that time.

- Andy
I hadn't thought of that. Thanks for the tip.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #9  
Old 04-26-2011, 05:49 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Andy, (or Greg or any other UI Guru...)

When exactly is done during the menu "layout" and when is the LayoutStarted hook fired? I'm assuming that the menu is "layed out" just once the first time it is rendered and any subsequent menu updates (like from Refresh(), RefreshArea(), or other UI update passes that Sage does) do not result in the menu be layed out again. Is this correct?

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #10  
Old 04-26-2011, 10:31 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Layout happens whenever any variable state changes that can affect layout. So for instance if you have conditional elements that may or may not be displayed, or displayed with different sizes, depending on some variable values, then layout has to happen again when those variables change. So yes, Refresh() can cause layout to happen, and indeed the whole point of calling Refresh() is generally to re-evaluate all of those conditionals that control menu layout and content.

Layout is not needed when the Sage window is simply repainted as a result of (say) an overlying window going away.

If you're curious, put a DebugLog() call in your LayoutStarted hook and watch the console window to see what happens.
__________________
-- Greg
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to hook up a DVD? mike1961 SageTV HD Theater - Media Player 3 04-14-2010 05:50 AM
A note about using Refresh() in FocusGained/Lost hooks for v6.0 (OK to use in v6.4) Opus4 SageTV Studio 3 11-07-2008 01:48 PM
Help me hook up my new LCD HDTV please? heavylee Hardware Support 8 01-15-2007 12:14 PM
FilePlaybackFinished hook dflachbart SageTV Studio 2 09-06-2006 03:05 PM
Best way to hook my PVR-250MCE up. teamgreen02 Hardware Support 2 04-30-2005 04:55 PM


All times are GMT -6. The time now is 12:57 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.