|
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 |
#301
|
|||
|
|||
Quote:
|
#302
|
||||
|
||||
I'm doing it in Java code that is called from any Sage UI.
__________________
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. |
#303
|
|||
|
|||
Then yeah I have had better consistency using the new uicontext method.
|
#304
|
||||
|
||||
SAGETV_PROCESS_LOCAL_UI is specific context, and should only be used if you really mean to use that context. I think the client runs as that context.
If you need to set a property using the current ui context, then you can use SetProperty(UIContext.getCurrentContext(), Key, Value) UIContext.getCurrentContext() will return the current ui context by checking a few things such as GetUIContextName(), thread names, etc, to return a valid ui context name.
__________________
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 |
#305
|
||||
|
||||
Thanks Sean, that's what I needed to know.
__________________
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. |
#306
|
||||
|
||||
Just keep in mind, as Plucky noted as well, that sometimes, depending on when you are calling UIContent.GetCurrentContext(), you may not get the context you want (or think you are getting). This happens primarily if you call this during a plugin start/stop. This is because when aplugin is started, it doesn't have context, other than the local/server context.
__________________
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 |
#307
|
||||
|
||||
I'm not using it from the Plugin Implementation class, I'm using it in Java code that gets called from the STV. That should be OK, correct?
__________________
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. |
#308
|
||||
|
||||
That should be fine. But, if you find that you are a losing context... then you can always have your methods accept a context name. Calling GetUICotextName from the STV always returns the correct context. In phoenix, there are very few apis that accept a context... actually the only one that I can think of is the Play(MediaFile) api, since I want to be sure that it plays on the right context so normally i just rely on the underlying apis to return the correct one.
__________________
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 |
#309
|
|||
|
|||
Quote:
__________________
-Craig |
#310
|
||||
|
||||
Cool... Just know that the latest sagex-api release will force http user authentication by default, so you'll want to store the username/password in your app, or have the user disable user/pass authentication on the server.
__________________
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 |
#311
|
|||
|
|||
Fortunately the current/first version already stores login info since it uses the web server interface but thanks for the heads up.
__________________
-Craig |
#312
|
||||
|
||||
Sean,
I've got something strange going on and I don't know if it's me doing something wrong, me not understanding something, or a bug. I've been experimenting with UIContext.getCurrentContext() and the results seem to change during execution. I've got the following code that I call multiple times during execution: Code:
System.out.println("LOGGED IN USER " + Configuration.GetProperty(UIContext.getCurrentContext(), Plugin.PROPERTY_LAST_LOGGEDIN_USER, null)); System.out.println("UIContextName 1 " + Global.GetUIContextName()); System.out.println("UIContextName 2 " + Global.GetUIContextName(UIContext.getCurrentContext())); Code:
Thu 2/24 20:09:27.246 [Fork-BASE-55376@1b0d8fc] LOGGED IN USER Sue Thu 2/24 20:09:27.246 [Fork-BASE-55376@1b0d8fc] UIContextName 1 0015170d8410 Thu 2/24 20:09:27.246 [Fork-BASE-55376@1b0d8fc] UIContextName 2 0015170d8410 Code:
Thu 2/24 20:09:42.588 [EventRouter-0015170d8410@1324aea] LOGGED IN USER Sue Thu 2/24 20:09:42.588 [EventRouter-0015170d8410@1324aea] UIContextName 1 0015170d8410 Thu 2/24 20:09:42.588 [EventRouter-0015170d8410@1324aea] UIContextName 2 SAGETV_PROCESS_LOCAL_UI Code:
Thu 2/24 20:11:17.213 [ReProcessHook@1a6ee94] LOGGED IN USER Sue Thu 2/24 20:11:17.213 [ReProcessHook@1a6ee94] UIContextName 1 SAGETV_PROCESS_LOCAL_UI Thu 2/24 20:11:17.213 [ReProcessHook@1a6ee94] UIContextName 2 SAGETV_PROCESS_LOCAL_UI Thanks, 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. |
#313
|
||||
|
||||
Tom, I can't really explain that. UIContext.getCurrentContext() uses a number of methods to discover the context, the first of which is GetUIContextName().
If you are calling GetUIContextName() from a non ui thread, then it will not return the current context. If you are calling GetUIContextName() from the UI thread, the it should return current context.
__________________
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 |
#314
|
|||
|
|||
Just wanted to say if you are calling from a non ui thread you can pass the context to the thread when you start it and keep that variable in the thread.
|
#315
|
||||
|
||||
I'm calling the code from a UI thread which makes it all the more puzzling. What causes the UIContext to change (besides the obvious)?
I can't believe this is so difficult, all I am trying to do is read and write a property to the correct .property file from within Java using the sagex APIs. I'm not even using the sagex remote capabilities, this is all being done locally. I tried using Get/SetProperty() without the UIContext and I tried using the methods with the UIContext. I tried using UIContext.getCurrentContext() new UIContext(getUIContextName()). What am I doing wrong? Plucky - I can't easily pass a UI Context to the methods, it would be a major pain in the butt and that seems an overkill for what should be a simple issue.
__________________
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. |
#316
|
||||
|
||||
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 |
#317
|
||||
|
||||
Quote:
I did find the API specification here: http://download.sage.tv/api/index.html But I'm still a novice at Java and can't really figure out how to invoke the methods in Java. Is it as simple as using SageTV.api.("methodNameHere", parm1, parm2)
__________________
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. |
#318
|
||||
|
||||
Any chance you could simply save the initial value and reuse it, instead of constantly querying for it?
__________________
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 |
#319
|
|||
|
|||
you should be able to do sagex.api.Global.GetUIContextName() as well... unless stuckless is rerouting that to his own ui context logic....
__________________
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 |
#320
|
||||
|
||||
I thought about that but I don't know how I'd actually do it. All of the methods called from the STV must be public static (and can be invoked by different UIContexts simultaneously) which implies the only way to pass data to them is as a parameter and I can't easily add a parameter. (I'll explain why is you are interested.) If I am missing something obvious please let me know.
__________________
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. |
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 |