SageTV Community  

Go Back   SageTV Community > SageTV Customizations > SageTV Customizations

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-11-2004, 12:07 PM
Alex0230 Alex0230 is offline
Sage Advanced User
 
Join Date: Mar 2004
Location: AZ
Posts: 203
Run class files as executables

For those creating java addons for Sage that are executed outside of the Sage...I created a program that will allow you to give your class file an executable to run from. I am using this for my ffmpeg_pickup program I wrote for MlbDude's new STV.

There are two peices to the package, an EXE and its properties file. I say "an EXE" because you can rename the executable I give you to anything you want. The properties file has to match up with the executable's name. For example if I have test.exe then the properties file is test.properties.

The properties file
Here is a sample props file:
--------------------------------------------------------------------------------
Java_Executable_Path=c:\jdk1.4.2\bin\java.exe
Class_path_to_use=.
Class_to_run=ffmpegPickup
Args_if_any=
Java_run_minimized_no_focus=true
Extern_run_minimized_no_focus=true
---------------------------------------------------------------------------------

The first line would have to be configured by each user, it isn't smart enough (YET) to go out and figure out where java is located on the machine. If there is interest in this (figuring out the java location), I can pursue that option. The other 3 lines, for the most part I envision the author configuring.

If you leave class_path_to_use blank, it will default to ".". This is to compensate for the issues some people have with running the java modules.

Usage
There are two ways to run this program, with and without parameters.

Without parameters, the program will execute the data in the properties file.

With parameters, the program will attempt to execute the parameters, word for word.

In both cases, in your task manager, this program will remain until the calling process has finished. This way if you're using it from your java program, like I am...you can use the .waitFor() method of the Process class if you desire.

[Java_run_minimized_no_focus/Extern_run_minimized_no_focus]
This parameters gives you the ability to run the calling processes minimized without focus.

----------------------------------------------------------------

If there are any questions....just let me know. I wrote this for my ffmpeg_pickup program but tried to make it reusable so that hopefully if anyone has a need for it, they can use it.

Alex
Attached Files
File Type: zip class_exe_wrapper.zip (10.1 KB, 191 views)
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70
250 GB 7200 RPM HD = $160
512 MB Kingston DDR 333 = $80
Hauppage 350 Bundle = $220
SageTv = PriceLess

Last edited by Alex0230; 07-13-2004 at 03:56 PM.
Reply With Quote
  #2  
Old 07-13-2004, 07:56 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Just curious... what are the benefits of using this exe over:
java.exe -cp . ffmpegPickup args
-- this is how I run my getWeather3 class as I don't have a java compiler that can produce an exe.
(note: On all my Java installtions, the java.exe is somewhere in the PATH so adding full path to java.exe is not necessary)
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki

Last edited by nielm; 07-13-2004 at 10:16 AM.
Reply With Quote
  #3  
Old 07-13-2004, 04:05 PM
Alex0230 Alex0230 is offline
Sage Advanced User
 
Join Date: Mar 2004
Location: AZ
Posts: 203
Well I had an issue with ffmpeg being called from java and trying to wait for the process to finish. Basically ffmpeg would sit a 0% cpu utlization until the java program quite. So this app spawned off of trying to fix/workaround that, but I thought why not also run the java program from it too. That way I can have an exe for someone/something to call. I liked it better than a batch file, but essentially that is all it is.

Basically running java.exe -cp . ffmpegPickup args and running my program will run the same thing. I allow the user control to control the window state on run in the props file...but I guess you could accomplish the same with "start /min /wait /low java.exe -cp . ffmpegPickup args".

Ideally when I get time, I'd like to kick it up a notch and have the program figure out where the appropriate java installation is. By default I don't think java.exe is in path when you install, atleast wasn't for me.

I can't really think of any benefits right now other than it got me around my ffmpeg issue and I thought I'd just make it available for others.
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70
250 GB 7200 RPM HD = $160
512 MB Kingston DDR 333 = $80
Hauppage 350 Bundle = $220
SageTv = PriceLess
Reply With Quote
Reply


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

Advanced Search
Display Modes

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


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


Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright 2003-2005 SageTV, LLC. All rights reserved.