|
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
|
|||
|
|||
access SageAPI from standalone application
is it possible to access the sageAPI from a standalone java application? I'm looking to write a standalone application that would replace sage's front-end.
|
#2
|
||||
|
||||
Short answer is no. The API is accessible only from classes running within the SageTV (or SageTVClient) process.
What you could do is write a class that runs within SageTVService and listens on a TCP port for API requests that it then executes. Essentially writing your own RCP wrapper for the Sage API. Then you could make API calls remotely from any process on any machine. (This is more or less what Niel's webserver does.) You could use this to access the wiz.bin database and schedule recordings and such, but you'd have to provide your own media playback engine. I'm curious, though, how replacing SageTVClient with a homebrew frontend app would offer a significantly different user experience than running SageTVClient with a homebrew STV.
__________________
-- Greg |
#3
|
|||
|
|||
Quote:
|
#4
|
|||
|
|||
Quote:
|
#5
|
|||
|
|||
... or call into your own class to start new threads in java
Dirk |
#6
|
||||
|
||||
Quote:
__________________
-- Greg |
#7
|
|||
|
|||
Thanks for the fork info, didn't know that existed.
as for calling my own class, what packages should I then import to get my class compiled. If for instance I want a widget instance inside of my java code (to change position+transparency), can that be done? is there a tutorial written somewhere on how to get started writing external modules and how to call on them? |
#8
|
||||
|
||||
Chapter 9 of the Studio manual has sections on "Using Java code" and "Calling SageTV API methods from Java". You might also want to look at my Studio Tools package (see the sticky thread at the top of the forum), which includes strongly-typed wrapper functions for the SageTV API.
You can use the WidgetAPI to manipulate widgets from Java code. My Tools package does this to implement custom editing commands in Studio, and you might also want to do things like this at STVI import time to alter widgets in the standard STV. However using the WidgetAPI to change widget properties on the fly as part of normal UI execution is probably not a good idea, since it causes Sage to think the STV has been edited and leads to spurious "Do you want to save changes?" prompts. A better solution is to program the widgets themselves with dynamic property expressions (including calls to Java functions if you like) instead of fixed property values. This is covered in the "General Widget Properties" section of Chapter 3.
__________________
-- Greg |
#9
|
||||
|
||||
Forgot to mention that there's source code in my Tools package if you want to see how it's done. Niel has also published the source to many of his plugins.
__________________
-- Greg |
#10
|
|||
|
|||
thanks Greg, i'll take a look at them.
cheers, |
#11
|
||||
|
||||
I am also not sure what you are trying to do...
Do you want to create a pure-java STV-independant GUI that calls the Sage API to get program info, schedule recordings, etc? If so have a look at my webserver and Gkusnick's java wrappers for Sage API functions. These call studio API's from Java, and are started by the sage core on startup. Do you want to create a new STV (Sage User Interface) with Sage widgets, that uses Java as 'helper' code for advanced data manipulation? If so look at several of my STVI plugins (rss news, dynamic menu, IMDB) -- these call java code from Studio. Either way there should be some example code to work with.
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
#12
|
|||
|
|||
Quote:
My original post did include both of those options (too many ideas, so much brain space). I was toying with either create a new Sage front-end or create a lib to ease widget animations/transitions. All I wanted to do is customize the interface for it to be more dynamic (i decided to do something about http://forums.sagetv.com/forums/showthread.php?t=23369), so I believe creating a lib for widget animations/transitions would be my best option. |
#13
|
||||
|
||||
The V6 Music Browser includes several examples of scrolling animation. I've used Studio to implement zooming and fading items, and lap-dissolve panel transitions.
What sort of animations did you have in mind? Maybe they're already possible in Studio and you just don't know it. Remember that most widget properties, including position, size, color, transparency, etc., can be set to dynamic expressions that can include time-varying terms.
__________________
-- Greg |
#14
|
|||
|
|||
Quote:
the menu scrolls (up/down) while increasing/decreasing the opacity and position. I've used the RenderStarted hook to increment the position/transparency but I'm not very happy with the way it's implemented. It requires 3 attributes + up/down listeners modification + RenderStarted hooks + Refresh calls into each menu. Not to mention the dynamic attributes for each menuitem manually inputed. I was hoping to offloaded this manual operation into a class. p.s. what do yo mean by "time-varying terms" Last edited by matrix35; 02-21-2007 at 01:50 PM. |
#15
|
||||
|
||||
Quote:
- 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. |
#16
|
||||
|
||||
By "time-varying terms" I mean expressions that include time in their calculations. Instead of counting Render cycles, set your property expressions to calculate position and transparency based on the elapsed time in milliseconds since the item was selected (or whatever).
Similarly, you shouldn't need to be calling Refresh for animations. Use the Animation property of the widget to schedule regular redraws, or to redraw continuously while some boolean condition is true. And if you find yourself typing in the same property expressions in widget after widget, consider using a theme to abtract those common properties for widgets of that type. Themes are to widgets as classes are to Java objects. If you want to use Java functions for some of these calculations, there's nothing wrong with that. Property expressions can include Java calls. But you generally want to keep the widget machinery in the driver's seat and restrict the Java code to pure calculation, i.e. value-returning functions without side-effects, rather than having the Java code try to actively trigger refresh cycles or alter widget properties directly.
__________________
-- Greg |
#17
|
|||
|
|||
wow , thanks Greg, Andy that clears up alot of things... for instance the update of the menu is MUCH better and more fluid since I've used LayoutStarted hook and removed the Refresh() command. I'll be looking into the studio manual in more detail and take more advantage of the Animation attribute. will post back with questions if there are any... well i kinda feel silly for not looking into the manual first for answers
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to access remote UNC paths using service w\ v6.0.18 | MeInMaui | SageTV Software | 7 | 12-30-2006 10:18 AM |
sage tv won't work when java access bridge is installed, arg!!! (hairpulling!!) | whocrazy | SageTV Software | 7 | 11-20-2006 12:16 AM |
Cannot access SageMC folders | Alwayslearnin | SageMC Custom Interface | 1 | 11-08-2006 10:44 PM |
Access .NET (dll) From Studio? | deria | SageTV Studio | 5 | 11-04-2005 01:55 AM |
BDA Tuner Test Application | Stealth1971 | Hardware Support | 17 | 04-19-2005 10:50 AM |