|
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 |
#21
|
||||
|
||||
Quote:
Ok, I did not realize that a UI context was needed for each of these calls. I am very new to writing against Sage, so I am learning as I go. As far as your suggestions, I would be totally fine with any of the proposed implementations. I think that #1 would ensure that the programmer consciously specifies the correct context, opposed to #2 where a programmer could get a little careless and lose track of which context is currently set. The wrapper option would be nice, but if that is not a design goal for your API then ..... By the way, thank you for your API. The remoting capability is one thing I was looking for. Soon, I will be looking into playing with the REST based client implementation. Thanks again, shadeBlue
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB Operating System: Windows XP Professional HTPC/DVR Software: SageTV 7 Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200 Signals/Providers: AT&T UVerse, OTA ATSC Set-Top-Box: 2 @ Motorola Box VIP 1200 |
#22
|
||||
|
||||
Quote:
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#23
|
||||
|
||||
New Release 6.4.8-2
I just upated the Remote APIs to include a way to set the UI context for a call. I decided to go with the ThreadLocal method until I decide there is a better way, or until someone else points out it's critical flaw
The core API, sagex.SageAPI now contains a deprecated method, setUIContext(String context). The method is deprecated because I haven't tested how it will function if the code is embedded in a SageTV JVM. The method is perfectly safe to use for any remote calls as long your are running in a single thread or your code is thread safe. So, for the most part, you should have no issues setting the context for remote applications. To set the context, you can use a convenience method that is generated for each API (ie, WidgetAPI, Global, MediaFile, etc). Here is an example that gets all the contexts and then prints out the stv file being used for each context. Code:
String uiContexts[] = Global.GetUIContextNames(); for (String ui : uiContexts) { System.out.println("Context: " + ui); WidgetAPI.setUIContext(ui); System.out.printf("Current STV File: %s\n", WidgetAPI.GetCurrentSTVFile()); } you can get the latest release from the downloads section.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#24
|
||||
|
||||
Quote:
API calls that interact only with the database, recording engine, or global configuration can generally get away without specifying a UI context.
__________________
-- Greg |
#25
|
||||
|
||||
Quote:
One question about the widget symbols. If a STVi plugin is deployed and it adds Widgets to other persons instance of Sage, does it generate new Widget symbols or does it maintain the consistent assigned Widget symbol? I guess what I am gettting at is if I use 'GetWidgetSymbol' to find a specific menu item, can I rely on that lookup to work on everybody's instance of SageTV provided that the menu item exists or was imported via STVi? Thank again for your help, shadeBlue
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB Operating System: Windows XP Professional HTPC/DVR Software: SageTV 7 Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200 Signals/Providers: AT&T UVerse, OTA ATSC Set-Top-Box: 2 @ Motorola Box VIP 1200 |
#26
|
||||
|
||||
Yes, that's the whole point of widget symbols: to be the globally unique handle by which you can address a widget in any instance of Sage. (However this does require the STV/STVI author to correctly configure their copy of Studio with a unique symbol prefix to avoid collisions with widgets created by other developers.)
__________________
-- Greg |
#27
|
||||
|
||||
Quote:
Thanks again, shadeBlue
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB Operating System: Windows XP Professional HTPC/DVR Software: SageTV 7 Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200 Signals/Providers: AT&T UVerse, OTA ATSC Set-Top-Box: 2 @ Motorola Box VIP 1200 |
#28
|
||||
|
||||
Hi Sean,
I have been using the latest version of your sagex.api with great success. However, I have run into one minor issue that maybe you could provide some insight on. I am using the REST based api on my current project and I am looking to submit a request like this: http://sagetv:8080/sagex/rpcXml/Global/SageCommand/Channel%20Down%2CPage%20Down/context:SAGETV_PROCESS_LOCAL_UI Where "Channel Down/Page Down" is the command parameter for the 'SageCommand' method. I can't send the raw text version of the command parameter because of the "/" character in the string, I think this would be interpreted as part of the url resources in the REST processing. So I URL encoded the character as "%2C", but this does not seem to work either. So I guess my question is ... how do I encode special characters like this one for the REST server to interpret it correctly? Is there a REST encoding format? Thank You, shadeBlue
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB Operating System: Windows XP Professional HTPC/DVR Software: SageTV 7 Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200 Signals/Providers: AT&T UVerse, OTA ATSC Set-Top-Box: 2 @ Motorola Box VIP 1200 |
#29
|
||||
|
||||
Hi Sean,
On another project I am using the sagex SageAPI java client. How do I set the address of the sage server I want to connect to? The api is automatically connecting to a sage server, but not the one that I want it to.... SageAPI Provider is not set, will try to find the server... Sage Provider Implementation: sagex.remote.SageAPIRemote; http://192.168.10.14:80/sagex/rpcJava Thanks, shadeBlue
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB Operating System: Windows XP Professional HTPC/DVR Software: SageTV 7 Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200 Signals/Providers: AT&T UVerse, OTA ATSC Set-Top-Box: 2 @ Motorola Box VIP 1200 |
#30
|
||||
|
||||
Quote:
Code:
sagex.SageAPI.setProvider(new SageAPIRemote(YOUR_SERVER_URL)); I may look at adding a -DpreferredSageSage=URL to the API, so that you could pass the preferred server on java command line. As for your Rest Issues... I will consider that a bug in my Rest API... and I'll try to have a fix sometime tonight or tomorrow. The api allows for the arguments and context to be passed as reqular url parameters, but I forgot to allow the command to be passed as a url parameter... ie., in the existing API Code:
rpcXML/Command/Arg1/Arg1/context:CONTEXT Code:
rpcXML/Command?1=Arg1&2=Arg2&context=CONTEXT Code:
rpcXML?command=command&1=Arg1&2=Arg2&context=CONTEXT
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#31
|
||||
|
||||
Quote:
shadeBlue
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB Operating System: Windows XP Professional HTPC/DVR Software: SageTV 7 Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200 Signals/Providers: AT&T UVerse, OTA ATSC Set-Top-Box: 2 @ Motorola Box VIP 1200 |
#32
|
||||
|
||||
6.4.8-3 now supports being able to pass the command as a url paramter,
Example Code:
http://mediaserver:8080/sagex/rpcXml/Global?command=RunLibraryImportScan&1=false
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#33
|
||||
|
||||
Quote:
When trying to send the "SageCommand" with argument "Skip Fwd #2" http://sagetv:8080/sagex/rpcXml/Global?command=SageCommand&1=Skip Fwd #2&context=SAGETV_PROCESS_LOCAL_UI I think it does not like the pound "#" character. I tried URL encoding this character, but that did not work either. I did verify that via the Java API this command works fine, just not the REST API. Sorry to keep pestering you with these minor issues :-) Thanks, shadeBlue
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB Operating System: Windows XP Professional HTPC/DVR Software: SageTV 7 Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200 Signals/Providers: AT&T UVerse, OTA ATSC Set-Top-Box: 2 @ Motorola Box VIP 1200 |
#34
|
||||
|
||||
Quote:
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun. Extender: STP-HD300, Harmony 550 Remote, Netgear MCA1001 Ethernet over Coax. SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client, Java 1.6. Plugins: Jetty, Nielm's Web Server, Mobile Web Interface. |
#35
|
||||
|
||||
Quote:
I did do some quick tests this morning... enought to confirm that SageComannd works with "Pause" and "Play", but not with "Skip Fwd #2". I'll do testing tonight (i'm at work now ) to see if it's a result of the REST api.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#36
|
||||
|
||||
I think that your problem is that the parameter was not URL encoded correctly. "Skip Fwd #2" url encodes to Skip+Fwd+%232. When I passed that URL encoded parameter, my sage did process the Skip command correctly.
Here's an online tool for URL Encoding.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#37
|
||||
|
||||
Quote:
You are correct, I was being lazy on the URL encode. The spaces seem to work in the other commands when no url encoding is performed, but I guess if I url encode one character, I need to properly url encode the whole string. I have updated my code to properly url encode the whole string and it works great! Sorry for the false alarm :-) Thank You!
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB Operating System: Windows XP Professional HTPC/DVR Software: SageTV 7 Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200 Signals/Providers: AT&T UVerse, OTA ATSC Set-Top-Box: 2 @ Motorola Box VIP 1200 |
#38
|
||||
|
||||
Hi Sean,
I have posted a project to the community that is based on your remoting API: SageTV Remote Control Thanks for all your help! Cheers, shadeBlue.com
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB Operating System: Windows XP Professional HTPC/DVR Software: SageTV 7 Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200 Signals/Providers: AT&T UVerse, OTA ATSC Set-Top-Box: 2 @ Motorola Box VIP 1200 |
#39
|
||||
|
||||
Sean,
I've been working with the remote Java RPC API and ran into an issue. It looks like the payload on the request is being sent as part of the URL, and once that exceeds a certain length (a few kbytes) it fails. Here's the code to reproduce the problem. I added the "copyOfRange" function to reduce the size of the array for troubleshooting. Code:
String[] titles = (String[]) sagex.SageAPI.call("GetAllTitles", null); // change the size of the array to test the URL size limit //titles = Arrays.copyOfRange(titles, 0, 100); Object[] params = new Object[] {titles, true, null}; titles = (String[]) sagex.SageAPI.call("Sort", params); for (String title : titles) { System.out.println(title); }
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun. Extender: STP-HD300, Harmony 550 Remote, Netgear MCA1001 Ethernet over Coax. SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client, Java 1.6. Plugins: Jetty, Nielm's Web Server, Mobile Web Interface. Last edited by jreichen; 11-22-2008 at 10:53 AM. Reason: EDIT: fix variable name in 'for' loop |
#40
|
||||
|
||||
Quote:
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hauppauge Remote Issue | yacht_boy | Hardware Support | 4 | 05-01-2008 09:25 PM |
MCE remote transmitting keypresses twice | arnabbiswas | Hardware Support | 1 | 02-22-2007 10:55 AM |
MCE Remote not work fully with Placeshifter | devinteske | SageTV Placeshifter | 5 | 02-08-2007 11:45 PM |
Harmony Remote IR Reciever Help | brundag5 | Hardware Support | 2 | 01-13-2007 09:08 PM |
How to get SageTV to release focus to NVDVD for remote | IncredibleHat | SageTV Software | 4 | 07-06-2006 07:47 AM |