SageTV Community  

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

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #81  
Old 05-04-2009, 02:00 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
the Create apis take a filepath as the first parameter... ie phoenix_api_CreateReflection("images/myimage.png") and the output is a sage metaimage which is consumed by the sage Image node in the stv.
The sage Image component will use an image loaded in the previous call to the image node, if you leave the image name blank for the image control. (See the tutorials if that doesn't make sense )

---- Action: phoenix_api_CreateReflection("myimage.png")
------- Image: (no properties set)
okay so there is no way to use this to call fanart? like
here is my thinking I want am wanting to scale and cache a reflected image so it doesn't have to be turned and reflected everytime

imag2= pheonix_api_CreateReflection(phoenix_api_GetFanartPoster(file))
----pheonix_api_CreateScaledImage(image2,200,-1)

Is this not possible?
Does it have to be a file cale in the pheonix api as I am able to call attributes in the default api

thanks again.
Reply With Quote
  #82  
Old 05-04-2009, 02:20 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
The code is possible... but imag2 will be cached on the filesystem after the CreateReflection call, but the call to CreateScaledImage will not create a cached scaled image since the input to create scaled image is a sage meta image.
Reply With Quote
  #83  
Old 05-04-2009, 02:26 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
The code is possible... but imag2 will be cached on the filesystem after the CreateReflection call, but the call to CreateScaledImage will not create a cached scaled image since the input to create scaled image is a sage meta image.
OKay that was my question.

So there is no way to scale a reflected image bummer as that is what is slowing things down for me is have to get the image and reflect it everytime.

Works fine when there is only one but when you get up to 8 items with a reflection it slows it down a bit. Even though I am scaling the images before hand to like 5k sizez (they are small reflections) still slows down drawing the reflection

So I don't know if it is possible but I will add it to my request to be able to scale and cache the reflections

Also I can't get the phoenix calls to work at all doing this just fyi I can get the standard calls of imageutils to work but not the phoenix calls.
Reply With Quote
  #84  
Old 05-05-2009, 01:16 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Got another questio for you stuckless Hope you are not tired of me yet

Is is possible to call the phoenix scaling to scale a entire library such as

phoenix_api_CreateScaledImage(phoenix_api_GetFanArtPoster(IsDVD),200,-1)
Reply With Quote
  #85  
Old 05-05-2009, 02:11 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
no... the apis are a single file input, single scaled file output. Batch processing may be added in later builds, but it's not on the critcal path at the moment.
Reply With Quote
  #86  
Old 05-05-2009, 02:40 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
no... the apis are a single file input, single scaled file output. Batch processing may be added in later builds, but it's not on the critcal path at the moment.

Understand worth asking and noted
Reply With Quote
  #87  
Old 05-12-2009, 05:35 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Stuckless,

I am letting users change the default fanart and posters in my movie wall (using the same code as Ben)

When scaling is turned on/used the scaling does not scale the new selected poster/background it still grabs the original.

Is this an issue in the api or in my coding?
Reply With Quote
  #88  
Old 05-12-2009, 07:44 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by PLUCKYHD View Post
I am letting users change the default fanart and posters in my movie wall (using the same code as Ben)
I know i worked with ben on this, but i forget exactly what that does... Does it rename the selected image to the default image name? If, so then yeah, the cached scaled image will still point to the old image, so it's bug in the caching code.

Keep in mind the SetXXXPoster method was more of a POC and it didn't really pan out. I'd hold off on implementing that portion, since I don't know if that api will remain, as is.

That being said, there are a number of bugs/enhancements in the image/caching apis that i'm working on, so I'll try to do something about this particular issue as well.
Reply With Quote
  #89  
Old 05-13-2009, 06:44 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
I know i worked with ben on this, but i forget exactly what that does... Does it rename the selected image to the default image name? If, so then yeah, the cached scaled image will still point to the old image, so it's bug in the caching code.

Keep in mind the SetXXXPoster method was more of a POC and it didn't really pan out. I'd hold off on implementing that portion, since I don't know if that api will remain, as is.

That being said, there are a number of bugs/enhancements in the image/caching apis that i'm working on, so I'll try to do something about this particular issue as well.
Sean,

Yes it renames the selected image to the default image (0). It works great exceept for when scaling is on I am wondering if I set an attribute to pull fanart,0 and then tell that to scale if that will get around it may try it out.

I hope the Setxxxposter calls don't go away they are nice as fanart cycling can slow things down a bit so being able to select posters and backgrounds is nice.

Look foward to seeing the next build.

thanks again.
Reply With Quote
  #90  
Old 05-13-2009, 07:30 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Got another do you have to use .my files to be able to pull the metadata infomormation from your scraper or are there phoenix calls I am not aware of.

I am trying to get userrating and runtime.

I can see this information on my screen as well as in the .my files BMI generates.

I am trying to pull it into my app by pulling it out of the metadata using

UserRating1 = GetMediaFileMetadata(FirstElement, "UserRating")
--iPos = StringLastIndexOf(UserRating1, ".")
-----UserRatingB = ImageDirectory + "\\Ratings\\" + Substring(UserRating1, 0 , iPos) + ".png"

The image directory of cours is specified elsewhere. Is there are phoenix call I should be using here?
Reply With Quote
  #91  
Old 05-13-2009, 08:42 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
To elaborate on above I am thinking maybe it is BMI

I have attached two .my properties. Cars is showing the ratings correctly. The video_ts is not

properties file.

I noticed on the cars it addes the user rating again at the bottom?
Reply With Quote
  #92  
Old 05-13-2009, 09:51 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I don't know what .my files are... so bmt does not use them.

As for userating... it's a arbitrary user rating (int or float), depending on how the provider passes it along.

When you call user rating, UserRating1 = GetMediaFileMetadata(FirstElement, "UserRating"), you'll get get back 7, or 7.25, etc. It looks like in your code that you are simply using indexOf(".") assuming that it's a float. But when it's not a float, then the next call will likely fail, since indexOf() return -1 when it isn't found.

WHat you should be be doing is... (pseudocode)
UserRating = GetMediaFileMetadata(FirstElement, "UserRating")
--- if UserRating==null
------ UserRating = "0";
--- ipos = StringLastIndexOf(UserRating1, ".")
--- if ipos >= 0
------ UserRating = Substring(UserRating, 0 , iPos)
--- UserRating = java_lang_Math_min(UserRating, 10)
--- UserRating = java_lang_Math_max(0, UserRating)
--- UserRatingImage = ImageDirectory + java_io_File_separator + "Ratings" + java_io_File_separator + UserRating + ".png"
------ ImageWidget

THere are number of things that you need to do...
1. if you get a value and you intend to do work on it... check for null... Failing to check for null will result in a lot of sage exceptions in the log file and it will have a negative impact on performance
2. if are using sage function calls, like StringLastIndexOf(), then you need to check for the possiblitliy that it could fail, ie, return -1 in this case. The way the code was setup, assumes the all user ratings were floats (8.25), but would fail with an exception if the userrating is an int (8).
3. If you are going to specify paths, then use the File.separator, so that Non-Windows users can enjoy your plugin as well. As it stands, only a windows user can actually use your plugin, since it has a hard coded \\ in the path.

I don't think that there is anything in the phoenix apis that will help you here, i think that you just need to add better error checking around your existing code.

As for the .properties... you will see some fields like UserRating repeated becaouse of how Sage handles the updates to the file. ie, when the sage api, SetMediaFileMetadata() is called, they open the file, append the line, and then close it. Because of java reads the properties files, then the last entry int he file for any given field will result in it's current value. So, don't get alarmed by the multiple entries.

good luck

Last edited by stuckless; 05-13-2009 at 09:53 AM.
Reply With Quote
  #93  
Old 05-13-2009, 10:30 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
I figured out the "." just before reading this I have been messing with it all morning. Thanks for your further example of the if didn't think of that one.

Now the problem is I get a null returned allot even when there is a user rating in the properties file.

The mpegs are working fine but the video_ts are not.
Reply With Quote
  #94  
Old 05-13-2009, 10:35 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
i think the release notes for 6.5.15 stated that there was fix in that build where dvds were not storing the extra metadata fields.

So, you'll need the 6.5.15 build and you'll need to reimport the metadta for dvds. the GetMediaFileMetadata() doesn't actually read the .properties files... those files are only created so that when the video is import/re-imported, then sage will read the file at that time and then store the metadata in it's internal container. Once a video is imported, you can delete the properties, but I tend to keep them around, so that when I re-import the videos, it doesn't have to do all the lookups again.

Likewise, you can turn off the Sage's ability to update the .properties files as well, since sage is only doing that so when a video get re-imported, all the changes to the metadata will be re-imported as well.
Reply With Quote
  #95  
Old 05-13-2009, 11:28 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Thanks I a @$@#@ sometimes that was it. I swear I read those release notes but don't remember reading it as I wasn't using that call at the time.

Thanks again.
Reply With Quote
  #96  
Old 05-17-2009, 10:57 AM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
I am working on a new STV, and wanted to use the phoenix dynamic menu class. Is that code pretty stable and going to change much?

Thanks,
Jeff
Reply With Quote
  #97  
Old 05-17-2009, 11:38 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Jeff,

Phoenix has 2 sets of APIs... those that are publicly released, and those that are not The first group of apis is the list of apis that is listed in the first post of this thread. As new releases are built, then I update that post to include those APIs that are public. Every attempt will we made to ensure that a public API does not change, or if it does, then it will deprecated first, and not removed until some time later.

Those apis that are not public (yet), ie, the phoenix dynamic menus, etc, may change, and I can't make any promises that they wont, until they have been utilzed more in the general phoenix project, and are deemed to be stable.

I hope that answers your question.
Reply With Quote
  #98  
Old 05-18-2009, 05:34 AM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
I will hold of a bit and see how it develops..

Thanks,
Jeff
Reply With Quote
  #99  
Old 06-25-2009, 02:43 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Stuckless got another one for you trying to use imageutils to create a image and thing I have the path expression wrong

Code:
phoenix_api_CreateImage("\\SageMCE\\PLuckyhdSMWScreens\\Themes\\Joker\\kingspade.png","[{name:reflection}]",false)
Do I need to put the main sagetv\sagetv\stvs in front of the filepath as well?
Reply With Quote
  #100  
Old 06-25-2009, 03:22 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by PLUCKYHD View Post
Stuckless got another one for you trying to use imageutils to create a image and thing I have the path expression wrong

Code:
phoenix_api_CreateImage("\\SageMCE\\PLuckyhdSMWScreens\\Themes\\Joker\\kingspade.png","[{name:reflection}]",false)
Do I need to put the main sagetv\sagetv\stvs in front of the filepath as well?
if you start a path with "\\" then you are telling java that you want to find the image at the "root" of the filesystem. You can try NOT starting your path with \\ and see what happens. When you call CreateImage, it simply passes the string off the the Sage API LoadImage().
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
Phoenix card reader gravis12 Hardware Support 0 03-30-2008 01:38 PM
Missing API? GKusnick SageTV Studio 0 01-16-2007 08:48 PM
API Changes in 5.0 ? dflachbart SageTV Studio 11 05-09-2006 03:21 PM


All times are GMT -6. The time now is 02:23 AM.


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