|
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
|
||||
|
||||
Working with enums in Studio
I'm working on an STVi that uses the SRE classes written by Slugger. One of the methods returns an enum, but it may also return null. There is another static method that accepts an enum as a parameter and returns a String. The enum is listed below. (Sluger's code is on google code so I'm assuming it's OK to post it here.) So far so good.
I'm getting an unknown method error from Studio accessing the static method but it looks to me like the parameters are all correct. Here is the Studio code to get the MonitorStatus: (SREDataStore is OK at this point.) Code:
MonitorStatus = com_google_code_sagetvaddons_sre3_server_DataStore_getMonitorStatus(SREDataStore, AiringID) Code:
Status = com_google_code_sagetvaddons_sre3_shared_AiringMonitorStatus_getToolTip(MonitorStatus) Code:
sage.a.e: Error in method reflection of com_google_code_sagetvaddons_sre3_shared_AiringMonitorStatus_getToolTip of sage.a.e: UNKNOWN METHOD ERROR name=com_google_code_sagetvaddons_sre3_shared_AiringMonitorStatus_getToolTip args=[VALID] Edit: It's probably worth noting that if I pass the getToolTip method an invalid enum I get the expected String "Unrecognized status!". PS. I'm sure when Slugger sobers up he will respond to this thread Code:
package com.google.code.sagetvaddons.sre3.shared; /** * @author dbattams * */ public enum AiringMonitorStatus { NO_MONITOR, VALID, UNKNOWN, INVALID, MONITORING; static public String getToolTip(String status) { if(NO_MONITOR.toString().equals(status)) return "Recording not monitored."; else if(VALID.toString().equals(status)) return "Recording will be monitored."; else if(UNKNOWN.toString().equals(status)) return "Monitor status unknown."; else if(INVALID.toString().equals(status)) return "Monitor status is invalid."; else if(MONITORING.toString().equals(status)) return "This recording is currently being monitored."; else return "Unrecognized status!"; } }
__________________
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. Last edited by tmiranda; 09-04-2010 at 01:35 PM. |
#2
|
|||
|
|||
The getToolTip method takes a String, not an AiringMonitorStatus, so you'll have to call the toString method on MonitorStatus and pass that to getToolTip.
I haven't put this into studio, but it should be what you want. (I just took your call and added the toString call) Code:
Status = com_google_code_sagetvaddons_sre3_shared_AiringMonitorStatus_getToolTip(java_lang_Object_toString(MonitorStatus)) |
#3
|
||||
|
||||
Doh!
__________________
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 |
HDPVR working. Dish HD receiver working - Yeeeehaaa | david zero | Hardware Support | 2 | 10-18-2009 07:36 AM |
Where to get Studio? | shill | SageTV Studio | 3 | 09-23-2009 12:53 PM |
any chances of altering the graphics in sage without studio? studio users please read | reboot_this | SageTV Customizations | 1 | 12-03-2004 04:03 AM |