|
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
|
|||
|
|||
How can you tell if the SageTV Service is running
Basically does anybody know how to tell if the Service is running from Java?
The IsServerUI API call will tell you that your code is running on a Server PC but I cannot find an API call or combination of calls that will tell me if service mode is running. I can tell if this has been configured to share files with Sage Clients with the IsSageTVServerEnabled but I don't think it will tell me if SERVICE mode is running. Any ideas? |
#2
|
||||
|
||||
Are you trying to determine if the service is in use from any client, or are you trying to determine this only while using the UI on the server?
For checking while using the server UI, see this post. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#3
|
|||
|
|||
Quote:
Edit: Here is what I came up with in case anybody is interested: Code:
public static boolean isService() throws InvocationTargetException { boolean isServerUI = (Boolean) sage.SageTV.apiUI( "SAGETV_PROCESS_LOCAL_UI", "IsServerUI", null); boolean isGUIBoot = findLocalContext(); return isServerUI && !isGUIBoot; } public static boolean isGUIClient() throws InvocationTargetException { boolean isServerUI = (Boolean) sage.SageTV.apiUI( "SAGETV_PROCESS_LOCAL_UI", "IsServerUI", null); boolean isServiceRunning = ((String) sage.SageTV.apiUI( "SAGETV_PROCESS_LOCAL_UI", "GetProperty", new Object[] {"client", ""})).equalsIgnoreCase("true"); return isServerUI && isServiceRunning; } public static boolean isGUIBoot() throws InvocationTargetException { boolean isServerUI = (Boolean) sage.SageTV.apiUI( "SAGETV_PROCESS_LOCAL_UI", "IsServerUI", null); boolean isServiceRunning = ((String) sage.SageTV.apiUI( "SAGETV_PROCESS_LOCAL_UI", "GetProperty", new Object[] {"client", ""})).equalsIgnoreCase("true"); boolean isGUIBoot = findLocalContext(); return isServerUI && !isServiceRunning &&isGUIBoot; } private static boolean findLocalContext() throws InvocationTargetException { String[] contexts = (String[]) sage.SageTV.apiUI( "SAGETV_PROCESS_LOCAL_UI", "GetUIContextNames", null); for (String context : contexts) { if (context.equalsIgnoreCase("SAGETV_PROCESS_LOCAL_UI")) { return true; } } return false; } public static boolean isClient() throws InvocationTargetException { return (Boolean) sage.SageTV.apiUI( "SAGETV_PROCESS_LOCAL_UI", "IsClient", null); } public static String getContext() throws InvocationTargetException { if (isService()) { return "Service"; } else if (isGUIClient()) { return "ClientOnService"; } else if (isGUIBoot()) { return "Server"; } else if (isClient()) { return "Client"; } else { return (String) sage.SageTV.apiUI( "SAGETV_PROCESS_LOCAL_UI", "GetUIContextName", null); } } Last edited by BobPhoenix; 04-17-2008 at 03:40 AM. Reason: Added code |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sage Server as a service in Win2003 drive mapping | eguy | SageTV Software | 9 | 07-27-2007 01:10 PM |
Sage service mode | OverClock | SageTV Software | 4 | 04-08-2007 06:39 PM |
Service mode with MCE problem | MantisRay | SageTV Software | 2 | 01-21-2007 02:57 PM |
Not Connecting When Running as Service? | RAlfieri | SageTV Beta Test Software | 3 | 02-28-2006 06:38 PM |
Can't get SageTV service to work | dflachbart | SageTV Software | 1 | 02-01-2006 07:07 AM |