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
  #121  
Old 03-22-2009, 10:18 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Thanks.. i've added that infor the bug details... when I work on it... that'll probably be route i'll take.
Reply With Quote
  #122  
Old 04-07-2009, 02:55 PM
iolaus iolaus is offline
Sage Advanced User
 
Join Date: Jan 2008
Posts: 83
Quote:
Originally Posted by stuckless View Post
Thanks.. i've added that infor the bug details... when I work on it... that'll probably be route i'll take.
Hey Stuckless, I don't mean to pressure you but I just wanted to check in and see if you've had a chance to work on any of these issues. The only real show-stopper for me right now is the Music serialization issue. If I could get past that I think I could release a useful version of my MediaBridge plugin.

Thanks again for all your hard work.
Reply With Quote
  #123  
Old 04-07-2009, 07:11 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
iolaus, lateley I've been focused on phoenix and the metadata tools. I'll try to take a look at this issue over the next couple of evenings... i hate to be bottleneck in preventing you from releasing a project.
Reply With Quote
  #124  
Old 04-07-2009, 08:02 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
iolaus, here is new build that might fix your issue and adds some support for serializing playlists. Unfornately, i can't test this, since i'm currently in the process of rebuilding my server.
Reply With Quote
  #125  
Old 05-06-2009, 12:18 PM
iolaus iolaus is offline
Sage Advanced User
 
Join Date: Jan 2008
Posts: 83
Quote:
Originally Posted by stuckless View Post
iolaus, here is new build that might fix your issue and adds some support for serializing playlists. Unfornately, i can't test this, since i'm currently in the process of rebuilding my server.
I'm terribly sorry it took me so long to get back to you on this. For some reason I missed the e-mail notification on this thread.

As for the new build, it seems to have exploded things a bit. Now if I try to use GetMediaFiles I get:

Code:
<error>
−
<message>
Failed while Calling MediaFile Method: GetThumbnail
</message>
−
<exception>
java.lang.Exception: Failed while Calling MediaFile Method: GetThumbnail
	at sagex.remote.builder.SimpleXmlBuilder.handleError(SimpleXmlBuilder.java:38)
	at sagex.remote.builder.SageAPIBuilder.buildObject(SageAPIBuilder.java:111)
	at sagex.remote.builder.SageAPIBuilder.buildMediaFile(SageAPIBuilder.java:96)
	at sagex.remote.builder.SageAPIBuilder.build(SageAPIBuilder.java:45)
	at sagex.remote.builder.SageAPIBuilder.buildArray(SageAPIBuilder.java:165)
	at sagex.remote.builder.SageAPIBuilder.build(SageAPIBuilder.java:43)
	at sagex.remote.api.XmlReplyEncoder.encodeReply(XmlReplyEncoder.java:26)
	at sagex.remote.api.ApiHandler.hanleRequest(ApiHandler.java:151)
	at sagex.remote.SagexServlet.doPost(SagexServlet.java:71)
	at sagex.remote.SagexServlet.doGet(SagexServlet.java:49)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.Exception: Unknown Object Type: sage.cq$b
	at sagex.remote.builder.SimpleXmlBuilder.handleError(SimpleXmlBuilder.java:38)
	at sagex.remote.builder.SageAPIBuilder.build(SageAPIBuilder.java:59)
	at sagex.remote.builder.SageAPIBuilder.buildObject(SageAPIBuilder.java:109)
	... 24 more
Caused by: java.lang.Exception: Unknown Object Type: sage.cq$b
	... 26 more
</exception>
</error>
Reply With Quote
  #126  
Old 05-21-2009, 05:28 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
New Release 6.5.15-5

This release includes 3 new features
* PlaylistAPI support
* Media Servlet (for accessing media, posters, backgrounds, etc)
* Custom Server Side Services using Javascript

Please read the Media Handler section for information about this new feature.

Please read the Custom Services section for information on how you provide your own services.

If you have any questions, then feel free to ask.
Reply With Quote
  #127  
Old 08-24-2009, 04:08 PM
iolaus iolaus is offline
Sage Advanced User
 
Join Date: Jan 2008
Posts: 83
Hey Stuckless,

I just noticed that <MediaFile><FileDuration> is returning "1" for DVDs. Do you know if this is a bug or something to do with SageTVs API? Any suggestions for how I can accurately get the duration of a DVD?
Reply With Quote
  #128  
Old 08-24-2009, 09:01 PM
iolaus iolaus is offline
Sage Advanced User
 
Join Date: Jan 2008
Posts: 83
Another quick request. Would it be possible for SageX to parse out the keyword:id tokens even when they're not a discrete parameter? This is the particular call I'm trying to get working:

Code:
http://htpc_livingroom:8080/sagex/api?c=EvaluateExpression&1=phoenix_api_GetFanartPosters(mediafile:189554)

Scratch that request, I found out I can use GetMediaFileForID() within the EvaluateExpression to the same effect.

Last edited by iolaus; 08-24-2009 at 09:22 PM.
Reply With Quote
  #129  
Old 08-25-2009, 12:04 AM
iolaus iolaus is offline
Sage Advanced User
 
Join Date: Jan 2008
Posts: 83
I'm still having some trouble trying to get ahold of the UNC path to music covers (since I'm not able to use the Phoenix API). Is there any chance the media servlet could take an extra parameter that would make it return the UNC path to media rather than the media itself? I need this because the software I'm writing my plug-in for loads the images itself from a specified path.
Reply With Quote
  #130  
Old 08-27-2009, 05:36 PM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Sean,
I have been using your sagex api for awhile now and its awesome. It makes calling the sage API trivial from java. Thanks I am only using it embedded in the SageTV process (not remotely) so if this question is in the wrong place please point me in the right direction.

I am having an issue with some calls that require a UI context. They are not returning what i expect.

The specific Calls i am working with:
-Global.GetFullUIWidth()
-Configuration.GetOverscanOffsetX() -Configuration.GetOverscanScaleWidth()
-Global.GetFullUIHeight()
-Configuration.GetOverscanOffsetY() -Configuration.GetOverscanScaleHeight()

GetFullUI...() always returns 0.
GetOverscanOffset...() always returns 0.
GetOverscanScale...() always returns 1.

This is on a pc client and hd-200 extender. My jar file outputs to the debug log so i can see what it's doing. If i pass GetFullUI..() to my function from studio it passes the correct number, so this leads me to believe that sagex is not correctly interpreting/passing the UI context.

I believe i am using sagex_6.5.20 but am unsure how to check sagex's version (its the version that comes bundles with BMT 3.0 beta 9). I had a look see in your src and it appears that you pass the UI context if one is available and none if it is not... so i would think it should work.

Is there a trick I am missing somewhere? or is this a bug?

Thanks again for all your hard work
__________________
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
Reply With Quote
  #131  
Old 08-30-2009, 01:01 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by razrsharpe View Post
Sean,
I have been using your sagex api for awhile now and its awesome. It makes calling the sage API trivial from java. Thanks I am only using it embedded in the SageTV process (not remotely) so if this question is in the wrong place please point me in the right direction.

I am having an issue with some calls that require a UI context. They are not returning what i expect.

The specific Calls i am working with:
-Global.GetFullUIWidth()
-Configuration.GetOverscanOffsetX() -Configuration.GetOverscanScaleWidth()
-Global.GetFullUIHeight()
-Configuration.GetOverscanOffsetY() -Configuration.GetOverscanScaleHeight()

GetFullUI...() always returns 0.
GetOverscanOffset...() always returns 0.
GetOverscanScale...() always returns 1.

This is on a pc client and hd-200 extender. My jar file outputs to the debug log so i can see what it's doing. If i pass GetFullUI..() to my function from studio it passes the correct number, so this leads me to believe that sagex is not correctly interpreting/passing the UI context.

I believe i am using sagex_6.5.20 but am unsure how to check sagex's version (its the version that comes bundles with BMT 3.0 beta 9). I had a look see in your src and it appears that you pass the UI context if one is available and none if it is not... so i would think it should work.

Is there a trick I am missing somewhere? or is this a bug?

Thanks again for all your hard work
I have to confess.. when I wrote the sage remote apis, I didn't fully understand the UI context stuff... and I assumed that I could use the sage api, GetUIContext(), to get the current UI context, but that's not the case. I then added a threadlocal to store the UI context, that would be used by the UI calls, but even the thread local is not reliable for an operations that happen in the STV ui, since the UI can use multiple threads.

To try the ThreadLocal approach, you'd have to call,
Code:
SageAPI.setUIContext(YourUIContext);
-Global.GetFullUIWidth()
SageAPI.setUIContext(null);
This is not ideal, which is why I "deprecated" the setUIContext() method as soon as I created it.

I think the best approach is for the remote apis to have a UI aware set of classes/calls, that accept a UI context as the first parameters, ie, something like,
Code:
GlobalUI.GetFullUIWidth(YourUIContext)
or
Global.UI.GetFullUIWidth(YourUIContext)
or
Global.GetFullUIWidthUI(YourUIContext)
or, if I make the UI Context a Type (ie, class instead of a string), then I could provide overloaded methods in the main generated classes that also accept a UIContext, ie,
Code:
Global.GetFullUIWidth()
Global.GetFullUIWidth(new UIContext(YourUIContext))
I like the latter approach myself.
Reply With Quote
  #132  
Old 08-30-2009, 01:09 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by iolaus View Post
I'm still having some trouble trying to get ahold of the UNC path to music covers (since I'm not able to use the Phoenix API). Is there any chance the media servlet could take an extra parameter that would make it return the UNC path to media rather than the media itself? I need this because the software I'm writing my plug-in for loads the images itself from a specified path.
Why are you not able to use the phoenix api for this? I basically do this in the WebUI, where I use the phoenix api to return the "real" file locations, and then I serve them up to the web ui using a custom servlet.
Reply With Quote
  #133  
Old 08-30-2009, 04:07 PM
iolaus iolaus is offline
Sage Advanced User
 
Join Date: Jan 2008
Posts: 83
Quote:
Originally Posted by stuckless View Post
Why are you not able to use the phoenix api for this? I basically do this in the WebUI, where I use the phoenix api to return the "real" file locations, and then I serve them up to the web ui using a custom servlet.
Is the Phoenix API able to provide Music CD Covers? I thought it only supported TV and Movies. When I try phoenix_api_GetFanartPoster() on a Music media file Id I get a blank result back.

Also, any suggestions on the <FileDuration> being "1" for DVDs?

Thanks!
Reply With Quote
  #134  
Old 08-30-2009, 05:11 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by iolaus View Post
Is the Phoenix API able to provide Music CD Covers? I thought it only supported TV and Movies. When I try phoenix_api_GetFanartPoster() on a Music media file Id I get a blank result back.

Also, any suggestions on the <FileDuration> being "1" for DVDs?

Thanks!
you are right... phoenix doesn't support music... yet

As for the file duration... I'm not sure if that's a sagetv bug or a bmt bug. I've noticed the same thing with my dvds... yet the metadata (.properties) will have a valid value for duration.
Reply With Quote
  #135  
Old 08-30-2009, 05:28 PM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by stuckless View Post
I have to confess.. when I wrote the sage remote apis, I didn't fully understand the UI context stuff... and I assumed that I could use the sage api, GetUIContext(), to get the current UI context, but that's not the case.
that's strange i would think this would work.... how come it doesn't?
Quote:
I think the best approach is for the remote apis to have a UI aware set of classes/calls, that accept a UI context as the first parameters
agreed.... my only worry is then the programmer (aka me) would have to be aware of when a UI context would have to be passed to sagex. It's unfortunate that sagex can not figure out the UI context on its own and then always pass it(i assume that this is what its trying to do now and it doesn't work reliably)

Quote:
or, if I make the UI Context a Type (ie, class instead of a string), then I could provide overloaded methods in the main generated classes that also accept a UIContext, ie,
Code:
Global.GetFullUIWidth()
Global.GetFullUIWidth(new UIContext(YourUIContext))
this approach makes sense to me... in this scenerario YourUIContext would be something that would be passed from studio correct? because sagex can not reliably call GetUIContext?... maybe thats not the case and im not fully understanding

In the above approach... hypothetically speaking if the function also required arguments would you call
Code:
SomeSageAPI.SomeSageFunction(new UIContext(YourUIContext), Args)
or would it be something different?
__________________
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
Reply With Quote
  #136  
Old 09-01-2009, 06:04 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I've uploaded version 6.6.1 of the sagex apis.

I've added the UIContext object and all methods can accept an optional UIContext as the first parameter.

ie, like you wrote...
Code:
SomeSageAPI.SomeSageFunction(new UIContext(YourUIContext), Args)
Also there is static constant for the SAGETV_LOCAL context in the UIContext object.

Originally, I had hoped and thought that the GetUIContext() call when invoked inside of Java, would return the current UIContext, but that is not the case. GetUIContext() is meant to be called from the STV and passed to Java code. The java code may or may not be executed in the same UI context thread as the STV. I'm attempting to create a SageAPI.getUIContext() method will try to auto-discover the current UI context from the current thread id... as a last resort, but that's not in there yet.

FYI... 6.6.1 will also go out with the next bmt/phoenix release.
Reply With Quote
  #137  
Old 09-01-2009, 06:58 PM
Ikarius's Avatar
Ikarius Ikarius is offline
Sage Advanced User
 
Join Date: Aug 2008
Posts: 84
On the question about DVDs and length-
DVDs and Blu-rays can both have multiple versions of the same film, with differing lengths on the same disc- it's all how the segments on the disc get linked together. Also, without traversing the DVD menuing structure, you can't tell what segments will get linked together. So- it's pretty darn hard to actually specify a time handed a bundle of DVD, HD-DVD, or Blu-ray files.

What comes in via the scraper is "running time", probably of the version of the movie which was released in theaters. So, if you have an uncut version DVD, or a director's cut, that time may be off. However, it's good enough for most end-user purposes.

Cheers
Ikarius
__________________

SageTV 6.6.2, SageMC+CenterSage Theme
Server: Intel Core2 Q6600, 8gb memory, 3x 1tb WD EACS drives, software RAID5 2tb capacity, 4gb Flash boot drive, Ubuntu 8.0.4 Server edition
Capture: 1x HD-PVR -> Motorola DTC6200
Clients: 1x STX-HD100 1x STX-HD200, Windows & OSX Clients
Reply With Quote
  #138  
Old 09-01-2009, 08:46 PM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by stuckless View Post
I've uploaded version 6.6.1 of the sagex apis.
wowowowo you rock, thanks works like a charm... well almost... GetFullUI... still isnt returning what I expect, OverscanOffset and OverscanHeight both are... so progress I'm not sure what the problem is but i havent dug too much into it yet.

EDIT: fixed it.... rather then setting the UIContext to a variable in my STV code once and then passing the constant i needed to pass GetUIContextName() to my java code. Works great

Quote:
I've added the UIContext object and all methods can accept an optional UIContext as the first parameter.

ie, like you wrote...
Code:
SomeSageAPI.SomeSageFunction(new UIContext(YourUIContext), Args)
Also there is static constant for the SAGETV_LOCAL context in the UIContext object.
Just a point of reference if other people are following this your java code needs to have this in its header
Code:
import sagex.UIContext;
or at least mine did...

Quote:
Originally, I had hoped and thought that the GetUIContext() call when invoked inside of Java, would return the current UIContext, but that is not the case. GetUIContext() is meant to be called from the STV and passed to Java code. The java code may or may not be executed in the same UI context thread as the STV. I'm attempting to create a SageAPI.getUIContext() method will try to auto-discover the current UI context from the current thread id... as a last resort, but that's not in there yet.
Look forward to it thanks
__________________
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; 09-01-2009 at 08:58 PM.
Reply With Quote
  #139  
Old 09-07-2009, 03:09 AM
shadeblue.com's Avatar
shadeblue.com shadeblue.com is offline
Sage Aficionado
 
Join Date: Jun 2008
Posts: 435
Hi Sean,

I'm starting to use your latest rev of the API on a new project. Very nice!

I was working with the Custom Services provided in JavaScript files, very cool. However, is it possible to tie in a custom JAR to custom services? I have some data heavy processing to do and the .JS processing may be a little sluggish.

Thanks, SB
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB
Operating System: Windows XP Professional
HTPC/DVR Software: SageTV 7
Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun
Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200
Signals/Providers: AT&T UVerse, OTA ATSC
Set-Top-Box: 2 @ Motorola Box VIP 1200
Reply With Quote
  #140  
Old 09-07-2009, 07:07 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by shadeblue.com View Post
I was working with the Custom Services provided in JavaScript files, very cool. However, is it possible to tie in a custom JAR to custom services? I have some data heavy processing to do and the .JS processing may be a little sluggish.
The problem with jar services is that you'll need to restart sagetv in order to pick up the jar. Out of the box, the services model in the api doesn't support dynamic services in jars because it would have required that I build a new classloader and then manage that, which was something that I didn't want to do.

But, if you are ok with having to restart sagetv once a jar is deployed, then you can still use js services and call your jar file. ie, your .js file simply defines the service and then calls into the code that is in the jar. the js services has access to ALL classes that is in the classpath.

So, if you have a shadeblue.jar then you can use that in the js services like...

Code:
function ShadyService(myobject) {
    var mystuf = new Packages.com.shadeblue.MyCustomJavaObject();
    return mystuff.process(myobject);
}
The above assumes that you have a java call MyCustomJavaObject with a method called pocess();

Keep in mind that if you are using javascript services, then it will require java 6, since I'm just leveraging the scripting engine in java 6.
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
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


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


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