|
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 |
#1
|
||||
|
||||
Some coding questions
So, I'm digging into the Sage development, and I've run into a couple of questions, as I'm brand-new to Java as well as to Sage development. Hopefully some folks will help me out, as it's tough getting up to speed on a new language at the same time as trying to figure out how it's properly called through the Sage Studio environment.
In the long run, I know I can make these things work, but I'm picky about trying to do things the "right" way, and I'm also eager to get results faster 1. I'm working with a list of Genre's I've fetched via "GetAllCategories". What comes back from that function is an array. I want to add a few virtual genre's to the list; All, Uncategorized, and New Releases. Is converting the array to a java ArrayList the right way to go... and is the following code likely to work in studio? x = java_lang_ArrayList_New( java_lang_Arrays_AsList( GetAllCategories(MediaMask) ) ) 2. I'd like to alter the sorting of my list of mediafiles so that "The" and "A" are ignored if they are at the beginning of a title. Should I be able to code a java function, pass it's name into a call to the Sage database API "Sort" function, and have it work, or am I going to have to make use of the Java sort routines (sorting a list of vectors or somesuch)? 3. Can I use casting in the Studio-modified form of Java syntax... and if so, what's the modified syntax look like? 3. Last, a more pure Sage question; from my list of genres, I can pull image icons if they exist, but if I don't have an image for a genre, I would like to represent it as text. Should I be placing a text widget on top of the image widget, and filling in a value for one and setting the other to null, or should I attempt to render some text to an image and drop it into the image widget? Thanks 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 |
#2
|
||||
|
||||
1. Use new_package_Class (per p. 151 of the Studio manual), not package_Class_New.
2. Yes, you can pass the name of any Java method into the Sort API. 3. No, there's no casting in Widget expression syntax (which is not really Java, so don't get fooled into thinking it is). There are some automatic conversions that get applied to expressions of mixed type, e.g. "1" + 1 = "11". You can also do explicit conversions via Java methods such as package_Class_toString or java_lang_Integer_parseInt. 3 (again). I'd use an If widget to test whether the image file exists and then branch to either an Image widget or a Text widget as appropriate.
__________________
-- Greg |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SageTV Alarm Clock - Who's up to coding one for a kickback? | chris123 | SageTV Customizations | 19 | 05-28-2009 12:50 PM |
grouping and color coding categories in guide? | Mtlca401 | SageTV Software | 3 | 08-18-2007 02:34 PM |
coding help | sundansx | SageTV Studio | 8 | 07-22-2006 09:20 PM |
More PQ Questions... | quaffapint | SageTV Software | 5 | 01-18-2004 03:04 PM |