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 10-21-2010, 06:03 PM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Detecting UIContext Type?

Is there a way to detect the UIContext type? For example to detect if a certain active UI context is an HD200 or HD300?
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #2  
Old 10-21-2010, 06:16 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Yup look under Global with sagex

for example extender

Code:
String UIContext = sagex.api.Global.GetUIContextName();
sagex.api.global.IsRemoteUI(UIContext)&&!sagex.api.global.IsServerUI(UIConftext)
That is all of the top of my head but should be right

There is also a IsClient call.

For the extender you might need to use the sagex method for creating a new uicontext from the current context name. Or at least I did to get reliable results for extenders

cheers
Reply With Quote
  #3  
Old 10-21-2010, 06:18 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Holy crap I just noticed the


IsEmbeddedSystem()

call I never noticed that so there is a better way to get extender

I have read that probably 100 times don't know how I missed it.
Reply With Quote
  #4  
Old 10-21-2010, 06:32 PM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Plucky -
Thanks. But that seems to only tell me if it is an extender, client or server. I am trying to discern if a specific UI Context is an HD100, HD200 or HD300? Is there a way to tell if an embedded context is a particular type of extender?
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #5  
Old 10-21-2010, 06:37 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by broconne View Post
... to detect if a certain active UI context is an HD200 or HD300?
Look in the default SageTV7 STV for its use of GetRemoteUIType().

Then, under it, see the LocalizeString("HD_Media_Player") branch. For now, there is no direct HD200 vs HD300 API call, see the code below that branch where it calls GetAudioOutputOptions() & uses the result to determine whether it is an HD200 or HD300.

- 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
  #6  
Old 10-21-2010, 06:44 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by broconne View Post
Plucky -
Thanks. But that seems to only tell me if it is an extender, client or server. I am trying to discern if a specific UI Context is an HD100, HD200 or HD300? Is there a way to tell if an embedded context is a particular type of extender?
That's what I get for skimming didn't see you wanted the type sorry Andy already answered you anyhow. Oh well I found that call I somehow missed 100 times I swear it must be new or I am blind
Reply With Quote
  #7  
Old 10-21-2010, 07:00 PM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Cool - Thanks Opus and Plucky!
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #8  
Old 02-09-2011, 11:25 AM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Before I start reinventing the wheel by following Opus4 suggestion, I don't suppose you have some java code snippet doing that?
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
  #9  
Old 02-10-2011, 09:33 PM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
This is code from nielm's web server that's a little old, but has most of the checks. It also has poweroff code for extenders but it's not 100%.

http://sageplugins.cvs.sourceforge.n...va?view=markup
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun.
Extender: STP-HD300, Harmony 550 Remote,
Netgear MCA1001 Ethernet over Coax.
SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client
, Java 1.6.
Plugins: Jetty, Nielm's Web Server, Mobile Web Interface.

Reply With Quote
  #10  
Old 03-26-2011, 11:05 AM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
So I have tried using the code used in NielM web server, but I have someone running the latest SageTV beta where his HD200 is reporting IsRemoteUI() as false, and GetAudioOutputOptions() == null (using the latest GKusnick Studio Tools for SageTV V7)... Anyone else seeing that?
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
  #11  
Old 03-26-2011, 07:29 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
As far as I can tell those functions are working properly on my HD300.

When you say "the latest Sage" and "the latest ToolsLib", have you actually verified this? Or are you just taking his word for it that as far he knows, whatever version he has is the latest? (This is why it's always best to insist on actual version numbers in bug reports.)
__________________
-- Greg
Reply With Quote
  #12  
Old 03-27-2011, 01:22 PM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
I did have access to the sagetv_0.txt to confirm the latest versions being used...

Upon further investigations, I think that all is good. It's just that he was connecting within seconds of a SageTV restart, with the associated reboot of the extender still in progress, and wondering why commands were not working... Had he actually been in front of the extender with the TV/monitor opened, he probably would have realized how silly it was to complain about the power button not working in the middle of a reboot or similar things...
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
  #13  
Old 04-06-2011, 07:10 AM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
So here is a code snippet (using GKusnick Studio Tools library) doing what Opus4 suggested:

Code:
enum ClientType {None, Local, MVP, HD100, HD200, HD300, Placeshifter};
ClientType clientType = ClientType.None;
API sageApi = new API(uiContext);
Global global = sageApi.Global;
Utility utility = new Utility(sageApi);

if (global.GetRemoteUIType().equalsIgnoreCase(utility.LocalizeString("Local")))
	clientType = ClientType.Local;
else if (global.GetRemoteUIType().equalsIgnoreCase(utility.LocalizeString("Placeshifter")))
	clientType = ClientType.Placeshifter;
else if (global.GetRemoteUIType().equalsIgnoreCase(utility.LocalizeString("SD Media Extender")))
	clientType = ClientType.MVP;
else if (global.GetRemoteUIType().equalsIgnoreCase(utility.LocalizeString("HD Media Extender")))
	clientType = ClientType.HD100;
else if (global.GetRemoteUIType().equalsIgnoreCase(utility.LocalizeString("HD Media Player"))){
	clientType = ClientType.HD300;
	for (String option : configuration.GetAudioOutputOptions()){
		if (option.equalsIgnoreCase("HDMIHBR")){
			clientType = ClientType.HD200;
			break;
		}
	}
}
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
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
Detecting and Stopping Unattended Extenders personalt SageTV Customizations 4 01-02-2010 11:20 PM
Getting a valid UIContext from 3rd party apis razrsharpe SageTV Studio 3 12-16-2009 10:05 PM
6.4.8 Broken "new API(uiContext)"? Fonceur SageTV Beta Test Software 10 08-18-2008 10:41 PM
Stop detecting iPod zoundz SageTV Software 4 02-01-2006 11:49 AM
1.4.10 (Demo) not detecting PVR-USB flatline Hardware Support 1 03-14-2004 06:59 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.