|
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 |
#141
|
|||
|
|||
Are the other api-dependant classes done the same way? Here's how I create the other objects I use...
Code:
sageApiMediaPlayer = new MediaPlayerAPI(sageApi); sageApiMediaFile = new MediaFileAPI(sageApi); sageApiAiring = new AiringAPI(sageApi); sageApiShow = new ShowAPI(sageApi); sageApiGlobal = sageApi.global; sageApiUtility = new Utility(sageApi); |
#142
|
||||
|
||||
First of all, thanks for such a great tool, it makes development so much easier!
If I want to sort a list of channels by Channel number, I simply use: allChannels = allChannels.Sort(false, "GetChannelNumber"); that's fine. Now if instead I want to do it for the Channel number on a lineup, I need to pass that lineup as parameter to the sorting method, according to the Sage API it should be possible to use: allChannels = allChannels.Sort(false, "GetChannelNumberForLineup", lineup); unfortunately that overloading has not been implemented, any chance you could add it? Of course the same applies for SortLexical and not only for the channels, but so far that's the only one I really need... EDIT: I ended up sorting the resulting collection elsewhere, but I still think it would be a nice addition. Last edited by Fonceur; 07-02-2008 at 09:31 AM. |
#143
|
|||
|
|||
Plugin skeleton not working
Hi Greg,
I created the following minimal plugin class: Code:
public class Plugin implements StudioPlugin { private StudioAPI api; public Plugin(StudioAPI api) { this.api = api; } public JMenu GetContextMenu() { return null; } public JMenu GetTopMenu() { JMenu menu = new JMenu("Test"); JMenuItem item = new JMenuItem("Test..."); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { } }); menu.add(item); return menu; } } Thanks, Dirk |
#144
|
|||
|
|||
Never mind, I should have looked at the debug log before posting...
Turns out I used gkusnick.sagetv.api.StudioAPI instead of tv.sage.StudioAPI Dirk |
#145
|
||||
|
||||
According to the Sage API, airing.Record() is not supposed to take any arguments, yet the Studio tools expect a StartTime and StopTime, just like the SetRecordingTimes... Sure, I can always use airing.Record(airing.GetScheduleStartTime(), airing.GetScheduleEndTime()), but this is a bit redundant and duplicates the other method anyway...
|
#146
|
||||
|
||||
The API wrappers are derived automatically from the online docs, so if it's expecting extra arguments, there must at some point have been a version of the docs that erroneously showed it taking those arguments.
I'm out of town right now and away from my Sage system, but I'll try to get a refresh of the wrapper functions up sometime in the not too distant future. Regarding the Sort question, I'm to not too eager to add explicit overloads for every conceivable flavor of Sort, but I can take a look at how hard it might be to pass through any extra arguments in a generic fashion.
__________________
-- Greg |
#147
|
||||
|
||||
Quote:
Quote:
|
#148
|
||||
|
||||
I am trying to loop over the Playlist content and cast the resulting objects appropriately, but it's not working using either cast method that comes to mind...
Code:
Object obj = null; AiringAPI.Airing airing = null; for (int i = 0; i < playlist.GetNumberOfPlaylistItems(); i++) { obj = playlist.GetPlayListItemAt(i); if (playlist.GetPlayListItemTypeAt(i).equalsIgnoreCase("Airing")) { airing = AiringAPI.Airing.class.cast(obj); airing = (AiringAPI.Airing) obj; } } Technically I can extract the information that I want through obj.ToString() and GetPlayListItemTypeAt, but I'd rather use the proper way...
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2 TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad |
#149
|
||||
|
||||
For API functions that return generic Objects, the wrapper functions just return the raw, unwrapped object, since they don't know what type to wrap them with. You can't cast those unwrapped objects to wrapped objects; you have to call the appropriate Wrap function.
(In C++ it would be possible to overload the cast operator to do the wrapping automatically. But that feature was deliberately omitted from Java, so you must use the explicit Wrap methods.)
__________________
-- Greg |
#150
|
||||
|
||||
OK, thanks! That did it.
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2 TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad |
#151
|
||||
|
||||
I've uploaded V0.6 of these tools to the download page. Highlights of this release include:
* API wrappers have been regenerated from the V6.4 API docs. * Hotkeys defined via Studio.hotkeys should now work properly on right-click context menu commands. * Fonceur's Sort wish has been granted; all type-specific Sort and Filter methods now accept extra arguments and pass them through to the underlying APIs. * GetWidgetPath() and GetWidgetFromPath() can now make use of widget UIDs as path roots (so you needn't specify the full path all the way back to menu level). Note that GetWidgetPath() will ignore locally created UIDs (i.e. those matching the UID prefix defined in your instance of Studio) and look for a widget with a non-local UID to root the path, on the theory that the paths will be more universally robust that way. As a consequence of this last change, reference paths generated by Export As STVI also use UIDs if possible. So STVIs generated by this method should be much more robust than previously. It's worth noting that Export As STVI has not been made entirely obsolete by the new built-in Generate STVI function, since that function does not support sharing of implicitly created hooks and themes among multiple STVIs, as Export As STVI does.
__________________
-- Greg |
#152
|
||||
|
||||
Quote:
Now I just need to memorize the keys I've assigned... - 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. |
#153
|
|||
|
|||
Quote:
The API doc doesn't explain this change, and the 3rd parameter in the call doesn't make much sense: public AiringAPI.List SortLexical(boolean Descending, String SortByMethod, Object... rgargExtra) Can you explain what the 3rd parameter is, or at least, how I would use this function again like I did before, which was to sort based on airing times? Do I just pass a "null" in for the 3rd parameter? thanks |
#154
|
|||
|
|||
Well, it's working now just by sending in a new Object() for the 3rd parameter. But it'd still be helpful having something in the docs about what that 3rd parameter is for. I know Fonc knows, but the rest of us....
|
#155
|
||||
|
||||
The third formal is just a placeholder for the variable-length list of optional extra arguments as described in the SageTV API docs. (If you're not familier with the ... notation, see "Arbitrary Number of Arguments".) You're not obliged to pass anything in that position; i.e. you should be able to pass just two arguments, and the third will default to a zero-length array (assuming you're calling it from Java code). If that's not working, it might be helpful to know what your code looks like and what exception you're getting when you run it.
__________________
-- Greg |
#156
|
|||
|
|||
I think I was accidentally referencing 2 of your .jars, and older and a newer. Once I got rid of the older reference, it now accepts just 2 args.
thanks! |
#157
|
|||
|
|||
No API call to delete a favourite
There is no method to delete a favourite. I suspect this is a result of there being no such method documented in the SageTV API docs (that I can find)? Yet, such a method must exist somewhere in the API as favs can obviously be deleted.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#158
|
||||
|
||||
You can remove a Favorite via RemoveFavorite(). Not sure why it seems to be missing from the docs, but example usage is in the default STV.
- 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. |
#159
|
||||
|
||||
If you need to do it from Java with a wrapped Favorite object, this should work until the docs are fixed and a new set of wrappers generated:
Code:
sage.SageTV.apiUI(context, "RemoveFavorite", new Object[] {api.favoriteApi.Unwrap(fav)});
__________________
-- Greg |
#160
|
|||
|
|||
Quote:
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|