|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#161
|
||||
|
||||
I just ran a test on the UIContext() and it does work. So, I guess I need to understand how you guys were using it.
for Example, the following will not work.... SageAPI.setUIContext("MACADDRESS"); Configuration.GetProperty("MyProp", null); ie, just because the UIConext is set "globally" (threadlocal), the apis will not just use it. You still need to specifically tell the api that you want a context... Configuration.GetProperty(null, "MyProp", null) will work, because by forcing it to use an API UI call, it will first use whatever context that you pass (in this case null), then use the threadlocal copy, if your is null... You could also, use, Configuration.GetProperty(SageAPI.getUIContext(), "MyProp", null); or Configuration.GetProperty(new UIContext("MACADDRESS"), "MyProp", null); ie, you have to explicitly call a UI context method in order for the API to pass a context to sagetv. I hope this clarifies the UIContext stuff, as it relates to the sagex.api.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#162
|
|||
|
|||
sean... thanks for the reply and explanation... jeff and i will do some debugging and see what we come up with andwe'll be back if/when we have some more questions
thanks, Aaron
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#163
|
||||
|
||||
I'm a little off topic but since you mentioned it, care to tell us what 'ortus' is? And speaking of secret projects, I haven't heard much about Phoenix lately...
__________________
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. |
#164
|
|||
|
|||
Quote:
Ben (jaminben) has mainly been talking about it in the SageMC screenshot thread. Heres a link to his most recent "leak" (and some discussion following it...) http://forums.sagetv.com/forums/show...&postcount=598
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#165
|
|||
|
|||
Hello,
We are trying to store some objects, that some are global, and a few were going to be unique per extender. The STV calls a setup route that will instantiate the main class to setup the various server processes, and that call passes the current context name and and we were going to use the MAC address as the key for the various data objects inside of a Map. I tried various ways to call the Configuration.SetProperty() so I could store the MAC address for each client that starts since there doesn't seem to be any other way to uniquely identify what client is making the call. I tried it with the UIContext() passed and without, and for some reason it keeps writing to the server's sage.properties file instead of the clients/{mac}.properties file. I am not sure if it is how our design is that is causing it to write to the incorrect properties file or not. I had used the Configuration.SetProperty() before, and I don't remember having this issue. Thanks, Jeff |
#166
|
||||
|
||||
Jeff, I don't know exactly how your code is put together, but from how you explain it, it seems logical.
But, if you call SetProperty() you have to pass the UIContext as well, or else will will never call the apiUI() call in sage. I ran the following code in my environment.... it it passed... Code:
String uiContexts[] = Global.GetUIContextNames(); for (String ui : uiContexts) { System.out.println("Context: " + ui); Configuration.SetProperty(new UIContext(ui), "/test/sagex/api", "TestVal"); String val = Configuration.GetProperty("/test/sagex/api", null); if ("TestVal".equals(val)) { System.out.println("That's not right!! SetProperty with UI context set the server prop!!!"); } val = Configuration.GetProperty(new UIContext(ui), "/test/sagex/api", null); if (!"TestVal".equals(val)) { System.out.println("That's not right!!! GetProperty with client context did not work."); } else { System.out.println("Got Client Val: " + val); } } Code:
Got Client Val: TestVal
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#167
|
|||
|
|||
From your code example, how do you know which context the current calling process is using? I think you had said earlier that the GetUIContextName() doesn't work..
Thanks, Jeff |
#168
|
|||
|
|||
I looked at the source for Greg's code, and I see he calls the GetUIContextNames() and then uses the first array item. I will give that a try and see how that works out...
Thanks, Jeff |
#169
|
||||
|
||||
Quote:
ortus_api_YourAPI(GetUIContext()) where YourAPI() stores a reference to that API, and then passes it down to whatever other api calls that need it. Quote:
The only reliable way to use the UI context is to have the STV call pass it down to your api.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#170
|
|||
|
|||
Yep, every client I connected would write its information to the first clients properties file.
It is strange though, I tried using Greg's api for the property calls and it seem to write to the correct properties file for each client... Do you know what he might be doing that would be different? Thanks, Jeff |
#171
|
|||
|
|||
Can this be run once during stv load and then the UIContext is stored in the api and then all future future references to the UIContext use the stored one from when the stv was loaded or does that not work? ... (so that we do not have to continually pass it down to api from the stv)
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#172
|
|||
|
|||
Quote:
During my testing this morning using Greg's api calls i did not have both clients on at the same time so i can't say for sure that his api worked as expected (unless of course you did further testing with multiple connected clients )
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#173
|
||||
|
||||
Quote:
Quote:
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#174
|
|||
|
|||
That is what I just tested. From looking at his code, I expected it to have the same issue, but it seemed to work fine. I tested with 2 extenders connecting, and the property files for each extender had the correct data, and the information in the STV ( MAC address ) all looked correct...
Thanks, Jeff |
#175
|
|||
|
|||
Quote:
Quote:
Quote:
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#176
|
||||
|
||||
You'd have no way to access the context variable in your java code So you could use AddGlobalContext() to set a "convenient" variable, ie, but you'd still need to pass that variable in the API call from the STV to java.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#177
|
|||
|
|||
Quote:
EDIT: i think ill request a GetGlobalContext() sage api call so you could retrieve it from your java code... EDIT #2: but maybe this wont work for the same reason that GetUIContext() doesnt work from java
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer Last edited by razrsharpe; 12-12-2009 at 04:24 PM. |
#178
|
||||
|
||||
Yeah, I think that ultimately, you should ask the GetUIContext() actually return a valid context when invoked from java... but i'm guessing there's some technical reason as to why that will never happen. Sage could probably add a GetGlobalContext(), but you'd still have to pass the UIContext in order to get the GlobalContext for your UI session
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#179
|
|||
|
|||
Quote:
Quote:
Quote:
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#180
|
|||
|
|||
Quote:
http://forums.sagetv.com/forums/showthread.php?t=45916
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hauppauge Remote Issue | yacht_boy | Hardware Support | 4 | 05-01-2008 09:25 PM |
MCE remote transmitting keypresses twice | arnabbiswas | Hardware Support | 1 | 02-22-2007 10:55 AM |
MCE Remote not work fully with Placeshifter | devinteske | SageTV Placeshifter | 5 | 02-08-2007 11:45 PM |
Harmony Remote IR Reciever Help | brundag5 | Hardware Support | 2 | 01-13-2007 09:08 PM |
How to get SageTV to release focus to NVDVD for remote | IncredibleHat | SageTV Software | 4 | 07-06-2006 07:47 AM |