SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #181  
Old 03-13-2010, 09:51 PM
skiingwiz skiingwiz is offline
Sage Aficionado
 
Join Date: Jan 2005
Posts: 366
I have a question dealing with the Java RMI interface. If I know the IP of a sage client (with the remote api installed) on the network, is there anyway to determine what port the RMI server for that client is using? (rather than just assuming it is the default 1098)

If I understand the datagram request that's being used, it sends a request to the entire network and will just take whoever responds first. I'd like to be able to send a request from one client (or context within the server process) to another, specific client (or context within the server process). It's easy enough to get the IPs of all the clients, but I haven't found a way to get the port the remote apis are using.
Reply With Quote
  #182  
Old 03-13-2010, 10:11 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
If you know the host and port, you can set it either from the commandline or in your code, using,
Code:
System.setProperty("sagex.SageAPI.remoteUrl", "rmi:HOST:PORT")
Alternately, you can write your discovery and accept all replies, which will contain host and port, and the choose the one that is best...

For example, the sage remote apis, use the following code, which only accepts a single reply. You could write something that keeps accepting replies until a particular timeout.

Code:
	public static Properties findRemoteServer(final long timeout) throws Exception {
		final Properties props = new Properties();
		SimpleDatagramClient client = new SimpleDatagramClient();
		client.send("Discover SageTV Remote API Server", DatagramServer.MULTICAST_GROUP, DatagramServer.MULTICAST_PORT, new DatagramPacketHandler() {
			public void onDatagramPacketReceived(DatagramPacket packet) {
				ByteArrayInputStream bais = new ByteArrayInputStream(packet.getData());
				try {
					props.load(bais);
				} catch (IOException e) {
					onFailure(e);
				}
			}

			public void onFailure(Throwable t) {
				throw new RuntimeException(t);
			}
		}, timeout);

		return props;
	}
Reply With Quote
  #183  
Old 03-14-2010, 03:07 PM
skiingwiz skiingwiz is offline
Sage Aficionado
 
Join Date: Jan 2005
Posts: 366
Quote:
Originally Posted by stuckless View Post
Alternately, you can write your discovery and accept all replies, which will contain host and port, and the choose the one that is best...
Thanks for your reply. That is what I'll do.
Reply With Quote
  #184  
Old 05-07-2010, 07:58 PM
skiingwiz skiingwiz is offline
Sage Aficionado
 
Join Date: Jan 2005
Posts: 366
Quote:
Originally Posted by stuckless View Post
Alternately, you can write your discovery and accept all replies, which will contain host and port, and the choose the one that is best...
I noticed that you implemented remote server discovery in a recent revision. This will be really useful for me. Thanks!
Reply With Quote
  #185  
Old 05-07-2010, 08:44 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by skiingwiz View Post
I noticed that you implemented remote server discovery in a recent revision. This will be really useful for me. Thanks!
I'll try to get a build out this weekend. I added the remote discovery because I use it in the web ui for bmt to choose which server I want to manage. While that feature is not available for most people, it's useful for me in development sagex always had remote discovery, but there was no way to get a list of known servers that are available on the network.
Reply With Quote
  #186  
Old 05-07-2010, 11:00 PM
skiingwiz skiingwiz is offline
Sage Aficionado
 
Join Date: Jan 2005
Posts: 366
Quote:
Originally Posted by stuckless View Post
I'll try to get a build out this weekend. I added the remote discovery because I use it in the web ui for bmt to choose which server I want to manage. While that feature is not available for most people, it's useful for me in development sagex always had remote discovery, but there was no way to get a list of known servers that are available on the network.
Don't rush a build out on my account. I'm perfectly happy building it on my own.
Reply With Quote
  #187  
Old 05-08-2010, 09:10 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Sean,

Does sagex support the sage.media.rss package? I don't thing it does but I'm a complete java noob.

If it does support the package what do I put in the "import" statement?

If it does not support it, how do I use the sage.media.rss methods in my java source?

Please respond like you are answering a java idiot, because you are

Tom
__________________

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.
Reply With Quote
  #188  
Old 05-08-2010, 11:05 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by tmiranda View Post
Sean,

Does sagex support the sage.media.rss package? I don't thing it does but I'm a complete java noob.

If it does support the package what do I put in the "import" statement?

If it does not support it, how do I use the sage.media.rss methods in my java source?

Please respond like you are answering a java idiot, because you are

Tom
Tom, the rss apis are not a part of the core sagex apis because they are not sagetv apis. ie, those apis are simply there to assist rss parsing, but they are not actual sagetv apis. ie, a sagetv API can be invoked using the sage api() method, and these cannot be invoked that way.

But, you can probably use these apis directly in you including the Sage.jar in your path. Otherwise, there are lots of other rss parsing apis. Keep in mind that you cannot re-distribute the Sage.jar, so if this is something that has to run outside of the sagetv environment you'll want to use another jar file.

This is a fragment of how you'd use the rss apis included in to the Sage.jar...
Code:
import sage.media.rss.RSSChannel;
import sage.media.rss.RSSHandler;
import sage.media.rss.RSSItem;
import sage.media.rss.RSSParser;
...
public void somemethod() {
                RSSHandler handler = new RSSHandler();
                RSSParser.parseXmlFile(new URL(feedURL), handler, false);
                RSSChannel chan = handler.getRSSChannel();
                LinkedList ll = chan.getItems();
                for (Object o : ll) {
                    RSSItem item = (RSSItem) o;
                }
}
Reply With Quote
  #189  
Old 05-08-2010, 12:46 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Sean,

OK, that makes sense. This is all Sage related so I won't have to worry about redistributing Sage.jar.

Thanks a lot,

Tom
__________________

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.
Reply With Quote
  #190  
Old 05-08-2010, 05:39 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Sean,

A big thanks for the help. I got this working in no time flat thanks to you. It would have taken me hours to figure it out on my own.

Now the only question i have is "Why the heck did I wait so long to start programming directly in Java?"

(Of course my Java code looks like C written in Java so I have a long way to go )

Tom
__________________

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.
Reply With Quote
  #191  
Old 05-08-2010, 05:53 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by tmiranda View Post
A big thanks for the help. I got this working in no time flat thanks to you. It would have taken me hours to figure it out on my own.
Timing is everything... I worked on this a couple of weeks ago, so I had the "knowledge" handy.... otherwise my response may have been a little more vague in details

[/quote]Now the only question i have is "Why the heck did I wait so long to start programming directly in Java?"

(Of course my Java code looks like C written in Java so I have a long way to go )[/QUOTE]

Glad you are having fun with it. My background is in C, and I resisted Java for years because of the FUD surrounding it at the time... but once I started to use it (about 12 years ago), I was quite taken with the language... so much so, that I'm considered a Java evangelist today But, like with any programming language my knowledge changes over time (I'm always learning new stuff, design patterns, language nuances, etc), and I'll look back at stuff that I wrote a year ago, and think, "what the hell was I thinking"
Reply With Quote
  #192  
Old 05-22-2010, 05:47 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Sean,

In the v7 plugin manager the Phoenix API is defined as a Server plugin. How do I get it installed on a SageClient? I tried running it from a Client and it didn't seem to update anything locally.

Thanks,

Tom
__________________

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.
Reply With Quote
  #193  
Old 05-22-2010, 07:06 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by tmiranda View Post
Sean,

In the v7 plugin manager the Phoenix API is defined as a Server plugin. How do I get it installed on a SageClient? I tried running it from a Client and it didn't seem to update anything locally.

Thanks,

Tom
Sorry Tom. I have <Desktop>false</Desktop> in my manifest for some reason (probably copy/paste ). I'll try to get this fixed up today... the problem is that I've been refactoring the code somewhat, so I need to check out an older version and rebuild from that point.
Reply With Quote
  #194  
Old 05-22-2010, 09:02 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
No rush, I've got plenty of other things to work on!
__________________

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.
Reply With Quote
  #195  
Old 05-22-2010, 11:10 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by tmiranda View Post
No rush, I've got plenty of other things to work on!
Tom... i need more information Apparently the fact that I have <desktop>false<desktop> should not prevent the apis from being installed on a client machine. When you are browsing the plugins from the client, it is not allowing your to install the phoenix apis...if so, what the exact error message.

Thanks,
Sean.
Reply With Quote
  #196  
Old 05-23-2010, 12:59 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Sean,

There was no error, but I thought it got downloaded to the server instead of the client. It's on the client now, but I'm not sure how it got there.... Probably user error on my part.

Tom
__________________

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.
Reply With Quote
  #197  
Old 06-04-2010, 02:27 AM
alon24 alon24 is offline
Sage Aficionado
 
Join Date: Jun 2004
Posts: 351
Is there a way to run code from java to run on streamer

I want to develop a screen for use in sage.
This needs to open a window, and have a few options in it.

I want to do this from java using segez api, because I do not need to reload sage every time, so I figured I want to develop on my desktop, and have the ui open on my HD200.

Is that doable? can I get the context of the hd200 while not running in a sage env?

and then open screens on it?
__________________
Server
SageTv 6.3.5, Core2Duo 6300 ,2Gigs ,Saphire x1650, PVR250, 2*320GB + 160GB, java 1.6.1
Client
SageTV Client 6.3.5 , AMD 3000, 1024Mb, Saphire x1600Pro256HDMI, java 1.6.1

Using Nielm's Web server 2.22
Reply With Quote
  #198  
Old 06-04-2010, 05:39 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by alon24 View Post
I want to develop a screen for use in sage.
This needs to open a window, and have a few options in it.

I want to do this from java using segez api, because I do not need to reload sage every time, so I figured I want to develop on my desktop, and have the ui open on my HD200.

Is that doable? can I get the context of the hd200 while not running in a sage env?

and then open screens on it?
I do this all the time using placeshifters, so yeah, it should be doable. Typically what I do is called GetUIContextNames() which returns a list of connected clients context names. If there is a more than one, then you might need to test each of them until you find the HD200. Once you have that ID, then it should never change for that client.
Reply With Quote
  #199  
Old 06-04-2010, 02:38 PM
alon24 alon24 is offline
Sage Aficionado
 
Join Date: Jun 2004
Posts: 351
question is:

Can you add GUI elements not in the STVI. ike panel and such...

I want to write a new screen ui but I hate doing it with studio (and stvi)

If so, can you give an example for ui not from studio?
__________________
Server
SageTv 6.3.5, Core2Duo 6300 ,2Gigs ,Saphire x1650, PVR250, 2*320GB + 160GB, java 1.6.1
Client
SageTV Client 6.3.5 , AMD 3000, 1024Mb, Saphire x1600Pro256HDMI, java 1.6.1

Using Nielm's Web server 2.22
Reply With Quote
  #200  
Old 06-04-2010, 04:16 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by alon24 View Post
question is:

Can you add GUI elements not in the STVI. ike panel and such...

I want to write a new screen ui but I hate doing it with studio (and stvi)

If so, can you give an example for ui not from studio?
In theory, yes, you can create and add widgets using the WidgetAPI. But in reality, I'd avoid doing this. These are just some of the reasons why...
1. It requires a tremendous knowledge of STV xml structure, attributes, etc.
2. Changes would not be persisted unless you explicity save the STV
3. If you run the plugin more than once, and the changes accidentally got saved (or intentionally saved), then you'd run into problems.

I understand your frustrations with Studio. As a Java developer, I don't find it very user friendly... that being said, I have tried what you are intending to do, and I must admit, that Studio is a better choice. Once you do your changes in studio, you can export a stvi diff file that can easily be imported.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 01:01 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.