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 11-30-2005, 09:07 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Arrow MediaPlayer Plugin/STV Import: Winamp Media Player Plugin

MediaPlayer Plugin 1.9: Winamp (deria)

Overview
======

The Winamp MediaPlayer Plugin is a replacement for the default SageTV audio MediaPlayer. It features:

* playback of any file format that Winamp supports; mp3, wma, ogg, aac, cda
mid, midi, rmi, kar, miz, mod, mdz, nst, stm, stz, s3m, s3z, it, itz, xm, xmz,
mtm, ult, 669, far, amf, okt, ptm, mp2, mp1, apl, vlb, m4a, nsa, wav, voc,
au, snd, aif, aiff

* audio manipulation through Winamp DSP/Effect plugins

* support for full-screen Winamp visualizations (Giess, Milkdrop, etc.)

* support for full media navigation while the full-screen visualization is being displayed (play, pause, stop, rewind, fast forward, large rewind, large fast forward, mute, volume up, volume down, and jumping to a specific track)

* complete integration with SageTV

* extremely low resource usage

Download Link
=========

You can download this plugin from the SageTV downloads section, at the following link:

http://forums.sagetv.com/forums/down...?do=file&id=45

Project Status
=========

This project is in "stable" status. It is considered "complete", has received extensive testing, and is expected to be stable on all systems.

System Requirements
==============

SageTV 4.1+ (licensed)
Winamp 5.x
JAVA 1.4.x OR JAVA 1.5.x
.NET Framework 1.1 SP1 (not 2.0; you can install 1.1 and 2.0 side-by-side -- its meant to be that way)

Portability
======

Will this plugin work with SageMC?

Yes! mlbdude (and later flachbar) has added built-in support for the plugin (and its associated visualization component).

Will this plugin work with other STVs (like Meekell)?

The plugin itself will work fine, but the associated visualization component will not unless the STV author integrates support for it.

Are STV authors allowed to integrate this plugin into their STVs?

Yes! STV authors are allowed (encouraged, even) to integrate this plugin into their STVs.

Warranty
======

This software is provided strictly on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND ELECTRIC STORM SOFTWARE, LTD. HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT.

Installation
=======

NOTE: If you have previously installed any version of this plugin, you should remove all traces of it by following the instructions in the "uninstallation" section (below).

Installing a plugin with SageTV is not always a trivial process; it is not complicated, but it is very easy to make a mistake that can render your .STV/.XML unuseable. To avoid such a disaster, be very careful and PLEASE MAKE A BACKUP. The installation instructions guide you through the process of making a backup. This is the only warning you will receive. I accept NO responsibility for ANYTHING that might happen as a result of installing this plugin.

There are two methods you can use to install this plugin.

1) Close SageTV completely (do not use 'sleep'/'standby').
2) Make a backup copy of your .STV/.XML file (typically found in "c:\program files\sage tv\sage tv\stvs\sagetv3" (as sagetv3.stv or sagetv3.xml if you are using the default .STV/.XML file).
3) Make a copy of your sage.properties and/or sageclient.properties files (typically found in "c:\program files\sage tv\sage tv\stvs\sagetv3\ "folder).
4) Unpack the archive attached to this post into your SageTV installation folder (typically "c:\program files\sage tv\sage tv" folder). Please note that the files need to be in the same directory as SageTV.exe / SageTVClient.exe -- they cannot be in a sub-folder.
5) Open your sage.properties file ( *AND* sageclient.properties file) and make the following changes:

a) and add the following lines:

media_player_plugin_class/cda=WinampPlugin
media_player_plugin_class/mid=WinampPlugin
media_player_plugin_class/midi=WinampPlugin
media_player_plugin_class/rmi=WinampPlugin
media_player_plugin_class/kar=WinampPlugin
media_player_plugin_class/miz=WinampPlugin
media_player_plugin_class/mod=WinampPlugin
media_player_plugin_class/mdz=WinampPlugin
media_player_plugin_class/nst=WinampPlugin
media_player_plugin_class/stm=WinampPlugin
media_player_plugin_class/stz=WinampPlugin
media_player_plugin_class/s3m=WinampPlugin
media_player_plugin_class/s3z=WinampPlugin
media_player_plugin_class/it=WinampPlugin
media_player_plugin_class/itz=WinampPlugin
media_player_plugin_class/xm=WinampPlugin
media_player_plugin_class/xmz=WinampPlugin
media_player_plugin_class/mtm=WinampPlugin
media_player_plugin_class/ult=WinampPlugin
media_player_plugin_class/669=WinampPlugin
media_player_plugin_class/far=WinampPlugin
media_player_plugin_class/amf=WinampPlugin
media_player_plugin_class/okt=WinampPlugin
media_player_plugin_class/ptm=WinampPlugin
media_player_plugin_class/mp3=WinampPlugin
media_player_plugin_class/mp2=WinampPlugin
media_player_plugin_class/mp1=WinampPlugin
media_player_plugin_class/aac=WinampPlugin
media_player_plugin_class/apl=WinampPlugin
media_player_plugin_class/vlb=WinampPlugin
media_player_plugin_class/m4a=WinampPlugin
media_player_plugin_class/nsa=WinampPlugin
media_player_plugin_class/ogg=WinampPlugin
media_player_plugin_class/wav=WinampPlugin
media_player_plugin_class/voc=WinampPlugin
media_player_plugin_class/au=WinampPlugin
media_player_plugin_class/snd=WinampPlugin
media_player_plugin_class/aif=WinampPlugin
media_player_plugin_class/aiff=WinampPlugin
media_player_plugin_class/wma=WinampPlugin

* make sure that these lines are placed after any existing media_player_plugin_class lines

b) find the existing line named "seeker/music_library_import_filename_extensions=" and change it to:

seeker/music_library_import_filename_extensions=.cda,.mid,.midi,.rmi,.kar,.miz,.mod,.mdz,.nst,.stm,.stz,.s3m,.s3z,.it,.itz,.xm,.xmz,.mtm,.ult,.669,.far,.amf,.okt,.ptm,.mp3,.mp2,.mp1,.aac,.apl,.vlb,.m4a,.nsa,.ogg,.wav,.voc,.au,.snd,.aif,.aiff,.wma

6) Ensure that Winamp is in your startup folder. If Winamp is not running, audio playback will not work!

7) Ensure that Winamp is configured for use with SageTV. To do this, all you need to do is:

.....a) click "Options --> Preferences --> General Preferences"
.....b) remove the checkmark for the "Taskbar" toggle of the "show Winamp in" section
.....c) ensure that there is a checkmark in the "System Tray" toggle of the "show Winamp in" section
.....d) ensure that there is a checkmark in the "disable always on top while fullscreen applications are focused" toggle
.....e) click on the "Plug-ins" section and REMOVE the checkmark (if there is one) from the "auto execute visualization plugin on playback" toggle
.....f) click on the "Visualization" section of the "Plug-ins" section, and (if you are using Milkdrop or Geiss2) click "Configure" and ensure that:
..........i) in the "fullscreen" section it is set to use "fake fullscreen"
..........ii) in the bottom section it is set to use "start fullscreen"
..........iii) in the bottom section it is NOT set to "minimize winamp when going fullscreen"
.....g) right click the Winamp (lightning bolt) icon in your system tray and ensure that there is a checkmark beside "main window" and "playlist window" (and nothing else)

8) Ensure that Winamp is running. If you made changes to your configuration in step #7, you should exit and restart Winamp.

9) Open SageTV. You are done! When you play a music file, Winamp will play the file instead of SageTV.

Visualization Support
==============

NOTE: Visualization support is not compatible with the SageTV FSE (full-screen exclusive) mode.

If you want visualizations (at all) you will need to make a minor (easy) change to your .STV/.XML file (detailed below). If you do not intend to use visualizations, you can skip this section. The normal "now playing" screen will continue to work (with the sole exception that there will be no visualization shown -- it will just be a black screen).

SageTV 6.x (or higher):

1) Press Control+Shift+F12 to open SageTV Studio.
2) Click "File --> Import".
3) Import the "WinampHelperMenu.xml" file, which (in a default installation) is located in "c:\program files\sagetv\sagetv\stvs\sagetv3").
4) Click "Edit --> Find All".
5) In the search field, type "View Visualizations" and press <enter>.
4) Scroll down to the first match (which will be highlighted in the "Browser - Music, Playlist Details" menu). Right click the "View Visualizations" menu entry, and click "Expand Children".
5) Scroll down to the "WinampHelper Menu" menu and click on it.
6) Drag the "WinampHelper Menu" to the "AddGlobalContext()" command (the screen will scroll as you drag).
7) Highlight the "MediaPlayer OSD" option under the "AddGlobalContext()" menu entry, and then press DELETE to remove it.

Repeat steps 4-7 for the "Detailed Info - Music File" menu.

Default STV (SageTV 5.x or lower):

1) Press Control+Shift+F12 to open SageTV Studio.
2) Click "File --> Import".
3) Import the "WinampHelperMenu.xml" file, which (in a default installation) is located in "c:\program files\sagetv\sagetv\stvs\sagetv3").
4) Scroll down to the "SongsbyArtist" menu and expand it.
5) Expand the "MenuContainer" panel.
6) Expand the "Buttons" panel.
7) Expand the "If" statement (the one that reads "IsMusicFile(GetCurrentMediaFile())").
8) Expand the "Visualizations" menu item.
9) Scroll down to the "WinampHelper Menu" menu and click on it.
10) Drag the "WinampHelper Menu" to the "Visualize" menu item (the screen will scroll as you drag).
11) Highlight the "MediaPlayer OSD" option under the "Visualize" menu entry, and then press DELETE to remove it.

Repeat steps 4-11 for the following menus:

"AlbumDetailPage"
"Music by Artist"
"MusicSongTitle"

SageMC:

The SageMC 16x9 STV has built-in support for this module. You should refer to the SageMC thread for instructions on how to use this plugin with that (excellent) STV.

Visualization Notes
============

#1:
Once you start the visualization, you can exit it by using the ALT+LEFT command (which you presumably have mapped to a button on your remote control, since thats the SageTV standard key for going back a screen). If this does not work for you (ie: Winamp gets focus and the ALT+LEFT key combination is ignored) the plugin will ATTEMPT to bring SageTV to the foreground when you close the full-screen visualization (by pressing ESCAPE). If visualizations are problematic for you, please let me know and I'll try to work with you to get them working correctly. You can play, pause, fast forward, rewind, super fast forward, super rewind, stop, mute, raise volume, or lower volume by pressing the appropriate key (just as if SageTV were being used). You can also jump to a specific track number by entering the number and pressing select.

#2:
In theory, any visualization capable of going "full screen" will work fine with this plugin. In practice, I only test with Milkdrop and Geiss 2 (because I use an RPTV and while I want full screen visualizations, I don't want the screen resolution to change when the full screen mode is activated because the flickering is annoying so I use the fake fullscreen mode offered by these two wonderful visualizations.)

Uninstallation
==============

SageTV does not have a simple method of automatic installation/uninstallation for plugins. To remove this plugin and eliminate all traces of it, execute the following procedure:

1) Press Control + Shift + F12 to open SageTV Studio.
2) Scroll down to the "WinampHelperMenu" menu.
3) Right click the "WinampHelperMenu" menu, and click "Expand Children".
4) Scroll down to the bottom of the "WinampHelperMenu" menu and (while holding the SHIFT key) click on the last part of the menu (an action item that reads 'ChannnelSurf = ""'.
5) Press your DELETE key.
6) Scroll up to the "SongbyArtist" menu and expand it.
7) Expand the "MenuContainer" panel.
8) Expand the "Buttons" panel.
9) Expand the "If" statement (the one that reads "IsMusicFile(GetCurrentMediaFile())").
10) Expand the "Visualizations" menu item.
11) Scroll down to the "MediaPlayer OSD" menu.
12) Drag (using the left mouse button) the "MediaPlayer OSD" menu to the "Visualizations" menu item you just opened.
13) Highlight the "WinampHelperMenu" link under the "Visualize" menu entry, and then press DELETE to remove it.
14) Repeat steps 6-11 for the following menus:

"AlbumDetailPage"
"Music by Artist"
"MusicSongTitle"

At this point all traces of this plugin will have been removed from your .STV/.XML.

Troubleshooting
===============

In a perfect world, everything would be... perfect. In the real world, nothing is ever perfect. If you are having difficulty with this plugin, you should go through the following troubleshooting procedures:

1) Setup

There are two diagnostic tools used within this troubleshooting guide.

a) The SageTV Console Window

The SageTV Console Window is a background window to which text is sent describing the current activity of SageTV (and plugins). To activate the SageTV console window, execute the following procedure:

.) Click "Start --> Run".
.) Type "regedit", followed by <enter>.
.) Navigate to "HKEY_LOCAL_MACHINE\Software\Frey Technologies\Common".
.) Right-click in the right-hand pane of the window and click "New --> DWORD Value".
.) For the name of the DWORD value, type "consolewin" and press <enter>.
.) Double-click the new entry, and change its value to "1". This will cause SageTV to open a console window upon startup that will show diagnostic information. To reverse this change, simply set this value to "0" instead of "1".
.) Close regedit.

b) DebugView

DebugView is a tool that allows a plugin to optionally output extremely detailed diagnostic information. This is freely available tool which you simply download and run; there is no installation and it leaves nothing behind on your computer. To obtain this tool, visit:

http://www.sysinternals.com/Files/DebugViewNt.zip

2) Pre-Requisites

Are you using either Java 1.4.2_x or 1.5.0_x?

Do you have .NET 1.1 SP1 installed? Please note that .NET 2.0 is not sufficient. You may have .NET 1.1 and .NET 2.0 installed on the same computer (in fact, you -should- have both).

Are you using Winamp 5.x? No other version of Winamp is supported.

3) Winamp Running

In order for this plugin to work, Winamp must be running. It must also be started BEFORE SageTV. It is a good idea to place a shortcut to Winamp in your startup folder.

4) Files

In order for this plugin to work, the following files need to be in your SageTV installation folder (typically "c:\program files\sagetv\sagetv"):

WinampPlugin.class
WinampHelper.class
WinampJNI.dll
WinampHelperJNI.dll

If these files are not present, copy them from the archive you downloaded for this plugin.

5) Properties

For each file type that you want this plugin to handle, you must have a line in BOTH your Sage.properties and SageClient.properties files in the following format:

media_player_plugin_class/mp3=WinampPlugin

There should be exactly ONE line for each file type. If there is more than one line for a file type, remove the undesirable line. Remember, all editing of Sage.properties or SageClient.properties requires SageTV to be completely closed -- including the service, if you are running SageTV in service mode. Using standby mode is not sufficient.

For each type of file that you want to see in your SageTV library, its extension must be specified in the seeker/music_library_import_filename_extensions property. For example:

seeker/music_library_import_filename_extensions=.cda,.mid,.midi,.rmi,.kar,.miz,.mod,.mdz,.nst,.stm,.stz,.s3m,.s3z,.it,.itz,.xm,.xmz,.mtm,.ult,.669,.far,.amf,.okt,.ptm,.mp3,.mp2,.mp1,.aac,.apl,.vlb,.m4a,.nsa,.ogg,.wav,.voc,.au,.snd,.aif,.aiff,.wma

6) MediaPlayer Loading

To determine whether or not SageTV sees the mediaplayer component of this plugin, execute the following procedure:

(the console window is required for this procedure; refer to part 1 of this section)

a) Open SageTV.
b) Select a .mp3 file from your library and start it playing.

If SageTV sees the mediaplayer component of this plugin, you will see (somewhere in the chaos that is the console window) the following messages:

Message #1: "The WinampPlugin class is attempting to load the WinampJNI.dll library."

........This message indicates that SageTV has found and opened the WinampPlugin.class file.

........If this message is followed by (perhaps not on the next line, but before message #2):

................"The WinampJNI.dll library could not be loaded due to an unsatisfied link error (ie: the file was not found)."

................then it means that SageTV was unable to find the WinampPlugin.dll library which is essential to the functionality of this plugin.

........If this message is followed by (perhaps not on the next line, but before message #2):

................"The WinampJNI.dll library could not be loaded due to a security exception."

................then it means that SageTV was unable to load the WinampPlugin.dll library which is essential to the functionality of this plugin.

Message #2: "A new instance of the WinampPlugin class is being instantiated."

........This message indicates that SageTV has created a new instance of this plugin -- a prelude to playing a file.

Message #3: "In load() now. This function has no return value (void). The name of the file to play is 'xxx.mp3'. The hostname where the file is located is 'null'.

........This message indicates that SageTV has instructed this plugin to play a file.

If you do not see ANY of these messages, SageTV is not using this plugin at all. If your properties are set correctly, and the plugin is still not being used, you can try adding the following registry entry:

HKEY_LOCAL_MACHINE\Software\Frey Technologies\Common\NativeLibPath

The NativeLibPath registry setting should be set to the path containing the two .dll files distributed with this plugin.

You can also try copying the two .dll files distributed with this plugin to your %WINDIR%\system32 directory.

7) Try using the default .STV/.XML file shipped with SageTV. Does your issue happen with that?

8) If your issue is related to visualizations, ensure that Winamp is configured correctly:

a) click "Options --> Preferences --> General Preferences"
b) remove the checkmark for the "Taskbar" toggle of the "show Winamp in" section
c) ensure that there is a checkmark in the "System Tray" toggle of the "show Winamp in" section
d) ensure that there is a checkmark in the "disable always on top while fullscreen applications are focused" toggle
e) right click the Winamp (lightning bolt) icon in your system tray and ensure that there is a checkmark beside "main window" and "playlist window" (and nothing else)
f) click on the "Visualization" section of the "Plug-ins" section, and (if you are using Milkdrop or Geiss2) click "Configure" and ensure that:
........i) in the "fullscreen" section it is set to use "fake fullscreen"
........ii) in the bottom section it is set to use "start fullscreen"
........iii) in the bottom section it is NOT set to "minimize winamp when going fullscreen"

9) If you have progressed through the previous eight troubleshooting steps and not resolved your issue, send a PM to "deria" with the following information:

a) your version of Java
b) your version of .NET
c) your version of SageTV
d) your version of Winamp
e) your email address
f) the output of your SageTV console window (everything you see in the console window)
g) the diagnostic messages shown in DebugView (everything you see in the DebugView window)

Configuration
=========

There is NO configuration for this plugin.

Change Log
========

1.0 (initial release/deria)

1.1 (bug fixes) / 1-dec-2005

NOTE: The STV has not changed. To upgrade, simply unzip the new package into your SageTV installation folder (typically c:\program files\sagetv\sagetv) while Sage TV is -not- running (close it completely; do not use sleep mode).

-There is no longer a gap between tracks in playlists.

-When stopping playback, the stop is instant now instead of a gradual fadeout.

-Tried to improve the code that detects if Winamp gains focus after a full-screen visualization closes. Make sure that you have the latest version of Winamp 5 (www.winamp.com).

1.2 (bug fixes) / 1-dec-2005

NOTE: The STV has not changed. To upgrade, simply unzip the new package into your SageTV installation folder (typically c:\program files\sagetv\sagetv) while Sage TV is -not- running (close it completely; do not use sleep mode).

-The MediaPlayer will no longer report negative elapsed times (this would happen if Winamp was in-between songs or not playing a song when SageTV asked for the current elapsed time). The main result of this is that SageMC will not show "-0:00" in its now playing area.

1.3 (bug fixes) / 2-dec-2005

NOTE: The STV has not changed. To upgrade, simply unzip the new package into your SageTV installation folder (typically c:\program files\sagetv\sagetv) while Sage TV is -not- running (close it completely; do not use sleep mode).

-The MediaPlayer will no longer end playback of a track in the playlist before it actually starts (or within a few seconds of starting). This issue was caused by a race condition between two threads (one thread was starting playback, and the other stopping playback because Winamp wasn't actually in its "playing" state when it was expected to be which would normally mean the end of the file had been reached).

-The MediaPlayer should now move to the next track in the playlist instantly (ie: no more gaps between tracks).

-The MediaPlayer will no longer attempt to seek past the end of a track. It now faithfully does bounds checking, and returns the actual new seek position to SageTV.

1.4 (bug-fixes) / 3-dec-2005:

-The MediaPlayer will now play DRM'd WMA files (and any other slowly loading file) without freaking out and using the entire CPU. This was caused by a race condition between two threads (basically I was reporting that the file was "loaded" before it actually was, so when SageTV asked for the duration of the track it would return 0 if the track loading in the background loaded too slowly.)

-The MediaPlayer will now no longer allow SageTV to instruct it to seek to a negative position.

-The (ridiculous amounts of) tracing code added to diagnose the problems detected so far has been removed (gives an overall minor performance increase).

-The "track duration" calculation done by SageTV (which is displayed on the "now playing" screen) does not seem to be the duration returned by the MediaPlayer and is therefore not very accurate (and always 0 for a audio file type that SageTV cannot work with natively) -- two new methods have been added to the WinampHelper class to allow STV developers to get the correct track elapsed time and track duration when using this plugin. To use these methods, do the following:

1. In the "BeforeMenuLoad" hook of your menu, add the following items:

-an "if" statement with the text "GlobalWinampHelper == null"
-a branch statement with the text "true" (as a child of the "if" statement)
-an action statement with the text "AddGlobalContext("GlobalWinampHelper", new_WinampHelper())" (as a child of the "true" branch)

2. When you want to get the elapsed time for the track, add an action with the text "WinampHelper_WHElapsed(GlobalWinampHelper)".

3. When you want to get the total track duration, add an action with the text "WinampHelper_WHDuration(GlobalWinampHelper)".

Note that these two functions are only valid for files that are being handled by this plugin and only valid WHILE the plugin is playing a file.

1.5 (bug fixes) / 5-dec-2005

1. The mechanism used to load files has been changed. Due to the way Winamp functions (it does not block; if you tell it to load a file, it returns immediately even though the file is not yet loaded) the new plan is to load the file, mute the winamp volume, start playback, pause playback, restore the volume, and then repeatedly poll Winamp for the song duration (which will only result in a value >= 0 when the song is fully loaded and ready to go). Argh.

1.6 (bug fixes) / 6-dec-2005

NOTE: The STV has not changed. To upgrade, simply unzip the new package into your SageTV installation folder (typically c:\program files\sagetv\sagetv) while Sage TV is -not- running (close it completely; do not use sleep mode).

1. The plugin should now handle filenames with special international characters (thanks to forum member rydberg).

2. The visualization focus auto-recovery functionality (which is designed to detect situations where the visualization exits without returning control to SageTV) is now only activated after the visualization has been running for 8 seconds. This was necessary to prevent a race condition in which the visualization would be told to start, but the GUI would check whether or not the visualization was running before it even had a chance to start and decide that it had exited and consequently try to "recover" (which would, when all was said and done, leave you with a visualization running and no easy way to stop it).

3. Added a bunch of direct winamp control functions to the WinampHelper class for a possible future project.

1.7 (bug fixes) / 7-dec-2005

NOTE: The STV has not changed. To upgrade, simply unzip the new package into your SageTV installation folder (typically c:\program files\sagetv\sagetv) while Sage TV is -not- running (close it completely; do not use sleep mode).

1. The .class files have had improved diagnostic messages added to them to make troubleshooting easier.

2. Added a troubleshooting section to the documentation.

1.8 (enhancements) / 17-dec-2005

NOTE: If you installed a previous version of this plugin, you should execute the instructions in the "uninstallation" section of this document.

-added support for play, pause, rewind, fast foward, large rewind, large fast forward, stop, mute, volume up, volume down while a full screen visualization is being displayed.
-added support for jumping to a specific track in a playlist by entering the track number and pressing select while a full-screen visualization is being displayed.

1.9 (bug fixes) / 21-dec-2005

NOTE: The STV has not changed. To upgrade, simply unzip the new package into your SageTV installation folder (typically c:\program files\sagetv\sagetv) while Sage TV is -not- running (close it completely; do not use sleep mode).

1. Temporarily removed code that handles international characters to rule it out as a possible cause of crashing.
2. In the free() method, the mediaplayer now explicitly releases its reference to the java.awt.file object that SageTV provides it.
3. Improved the diagnostic code such that all entry and exit into the java class is traced, as well as all entry and exit into the C++ .dll file.
4. The mediaplayer now creates one java.awt.dimension object during its construction and always returns that one instead of creating one each time getVideoDimensions() is called.
5. The code that was used to wait for a valid file duration in the getDurationMillis() function has been removed since it is no longer needed; the delay to wait for the file to be fully loaded is already present in the C++ .DLL function called by load().
Attached Images
File Type: jpg vis1.jpg (82.5 KB, 1413 views)
File Type: jpg vis2.jpg (136.3 KB, 1202 views)

Last edited by deria; 11-21-2006 at 12:15 PM.
Reply With Quote
  #2  
Old 11-30-2005, 09:08 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Placeholder.
Reply With Quote
  #3  
Old 11-30-2005, 09:22 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: Near Grand Rapids, MI
Posts: 1,101
umm, can any one say wow??!

nicely done, i'll have to try this out...are you going to post a link to the import?
Reply With Quote
  #4  
Old 11-30-2005, 09:35 PM
ToxMox's Avatar
ToxMox ToxMox is offline
Sage Icon
 
Join Date: Oct 2003
Location: NJ
Posts: 1,979
Talking

I can't wait to try this either when the file is attached or linked. Great to have you around Deria! I'm sure this plugin will please quite a few people.

EDIT: silly me...didn't occur to me that it is posted in the downloads section.
Reply With Quote
  #5  
Old 11-30-2005, 09:52 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: Near Grand Rapids, MI
Posts: 1,101
Quote:
Originally Posted by ToxMox
didn't occur to me that it is posted in the downloads section.
whoops, yeah, me too. that's a new section to me.
Reply With Quote
  #6  
Old 11-30-2005, 10:28 PM
insomniac's Avatar
insomniac insomniac is offline
Sage Icon
 
Join Date: May 2003
Location: Concord, Ca.
Posts: 1,104
awesome!
__________________
If you're not cheating, your not trying...

My sage rigs:
Server - Windows 2003, Intel 865 PERLL w/ P4 3.2g 1gb ram, 3-PVR250, 3-PVRUSB's, 1 Skystar2, 1 twinhan 102g, 1 starbox DVB-S Cards. Evo network QAM encoder. 1.2TB storage 6.x server + MTSAGE for DVB
Client 1/Master BR - MediaMVP running a 30" Olevia LCD TV.
Client 2/Front Room - Shuttle ST61G4 XPC 1gig ram, 60gb HD, BTC9019 wireless keyboard/mouse & Harmony 880. 6.x client. GF6600GT driving a Sony WEGA 55" rear projection tv.
Reply With Quote
  #7  
Old 11-30-2005, 10:56 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Oops, I can't believe I forgot to post the link the in the first post. I'll edit the psot.

As you've noticed already, though, yes its in the downloads section.
Reply With Quote
  #8  
Old 12-01-2005, 12:38 AM
PGPfan's Avatar
PGPfan PGPfan is offline
Sage Fanatic
 
Join Date: Apr 2003
Location: Oldtown, Idaho USA
Posts: 862
Wow Deria! This sounds AWESOME!

Just out of curiousity, do you (or anyone) know if this plugin will support visuals displayed by an MVP, if this plugin is on the server?

-PGPfan
Reply With Quote
  #9  
Old 12-01-2005, 01:17 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally Posted by PGPfan
Just out of curiousity, do you (or anyone) know if this plugin will support visuals displayed by an MVP, if this plugin is on the server?
Extrememly unlikely -- for several reasons: an MVP has to play the audio file itself, so Winamp cannot play it, and the visualisation is displayed by DirectX on the server, with no way of piping the visualisation to the MVP...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #10  
Old 12-01-2005, 01:27 AM
abasu2003's Avatar
abasu2003 abasu2003 is offline
Sage Expert
 
Join Date: Jul 2004
Posts: 551
I am assuming that you have milkdrop set to start in full screen?

I having trouble exiting with Alt+Left. I have to hit Esc (which is with a keyboard which is a pain), then Alt+Tab to Sage and then hit the back command. I think the problem is that Winamp steals focus (?).

Also, is there no way to somehow control the song via sage while you are watching the visualization. I guess its near impossible to maybe overlay a statusbar but it would be nice if the fast forward/rewind buttons worked while you were within the winamp plugin. Maybe a quick fix would be to map some of the keycommands of winamp to the same as the ones in sage.
Reply With Quote
  #11  
Old 12-01-2005, 01:42 AM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Quote:
Originally Posted by nielm
Extrememly unlikely -- for several reasons: an MVP has to play the audio file itself, so Winamp cannot play it, and the visualisation is displayed by DirectX on the server, with no way of piping the visualisation to the MVP...
As Nielm said, it will not work with a MediaMVP. Theres just no way to make that happen.
Reply With Quote
  #12  
Old 12-01-2005, 02:00 AM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Quote:
Originally Posted by abasu2003
I am assuming that you have milkdrop set to start in full screen?

I having trouble exiting with Alt+Left. I have to hit Esc (which is with a keyboard which is a pain), then Alt+Tab to Sage and then hit the back command. I think the problem is that Winamp steals focus (?).

Also, is there no way to somehow control the song via sage while you are watching the visualization. I guess its near impossible to maybe overlay a statusbar but it would be nice if the fast forward/rewind buttons worked while you were within the winamp plugin. Maybe a quick fix would be to map some of the keycommands of winamp to the same as the ones in sage.
A lot of this has to do with how your remote control is setup. If your remote control software only sends keystrokes to the top application, you'll have a frustrating experience. If your remote control sends messages directly to SageTV you'll be able to use all of the SageTV media commands (ff, rw, next track, etc.)

That being said, I don't think that the code that I added that is supposed to cause SageTV to move to the foreground (and close the black visualization screen) if Winamp somehow gets focus is working based on what you said. What -should- happen is that about one second after Winamp gets focus, SageTV should come to the foreground again. In the code it looks like I assumed that the window I am sending control messages to for Winamp would be the same window that got focus when the visualization closed. Apparently that isn't the case. I'll have to instead try getting the window title text of the active window and then taking action based on that.

I'll work on it some more tomorrow.

The purpose of the beta is to reveal problems like this. I'm also finding that in a playlist playback, some songs get skipped (or there is a long delay between songs) which I think is a problem being caused because in trying to tell SageTV that song A has finished I'm actually accidentally telling it that song B has finished too. I didn't notice it during development, but now I am seeing it on my regular-use machine.
Reply With Quote
  #13  
Old 12-01-2005, 07:12 AM
heffe2001's Avatar
heffe2001 heffe2001 is offline
Sage Icon
 
Join Date: Mar 2004
Location: Conover, NC
Posts: 1,269
I plan on trying this tonight when I get home, has anybody tried it with FSE to see if it has problems switching between the Winamp Visualizations and Sage? If not I could always just turn off FSE (I don't really see much difference between it running and not).
__________________
Server: AMD Phenom 2 920 2.8ghz Quad, 16gb Ram, 4tb Storage, 1xHVR-2250, 1 Ceton Cable Card adapter, Windows 7 SP1
Reply With Quote
  #14  
Old 12-01-2005, 08:28 AM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,680
Hell yeah! Fantastic work buddy!
Reply With Quote
  #15  
Old 12-01-2005, 10:29 AM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
I have released version 1.1 of this plugin.

1.1 (bug fixes) / 1-dec-2005

NOTE: The STV has not changed. To upgrade, simply unzip the new package into your SageTV installation folder (typically c:\program files\sagetv\sagetv) while Sage TV is -not- running (close it completely; do not use sleep mode).

NOTE #2: I had some trouble uploading the file. The proper 1.1 file should be ~250kb (not 55kb).

-There is no longer a gap between tracks in playlists.

-When stopping playback, the stop is instant now instead of a gradual fadeout.

-Tried to improve the code that detects if Winamp gains focus after a full-screen visualization closes. Make sure that you have the latest version of Winamp 5 (www.winamp.com).
Reply With Quote
  #16  
Old 12-01-2005, 11:29 AM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
I have released version 1.2 of this plugin.

1.2 (bug fixes) / 1-dec-2005

NOTE: The STV has not changed. To upgrade, simply unzip the new package into your SageTV installation folder (typically c:\program files\sagetv\sagetv) while Sage TV is -not- running (close it completely; do not use sleep mode).

-The MediaPlayer will no longer report negative elapsed times (this would happen if Winamp was in-between songs or not playing a song when SageTV asked for the current elapsed time). The main result of this is that SageMC will not show "-0:00" in its now playing area.

-deria
Reply With Quote
  #17  
Old 12-01-2005, 11:57 AM
rydberg rydberg is offline
New Member
 
Join Date: Nov 2005
Posts: 3
Great work Deria!

I only have one problem, the player don't handle filenames with national characters like åäö here in Sweden.

I have also played around with the MediaPlayer interface and got the same problem if I used the GetStringUTFChars function in JNIEnv (don't know if you are using this).

The code I have written is all in C++ but contact me if you want the code for converting a jstring to char *xxx in C++.
Reply With Quote
  #18  
Old 12-01-2005, 12:03 PM
abasu2003's Avatar
abasu2003 abasu2003 is offline
Sage Expert
 
Join Date: Jul 2004
Posts: 551
I just downloaded the latest version and it seems quite buggy with the playlists. It basically plays 3 seconds of a song and then moves on to the next song.

And I am still getting the focus errors I was getting earlier. I updated to the latest version of winamp (5.112)
Reply With Quote
  #19  
Old 12-01-2005, 01:00 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Quote:
Originally Posted by abasu2003
I just downloaded the latest version and it seems quite buggy with the playlists. It basically plays 3 seconds of a song and then moves on to the next song.

And I am still getting the focus errors I was getting earlier. I updated to the latest version of winamp (5.112)
Hmm... that doesn't happen for me at all. Some questions:

1. What STV are you using?

2. Does it only happen on playlists, or does it also happen just playing a single track?

3. There is a program named DebugView which you can get at:

http://www.sysinternals.com/Files/DebugViewNt.zip

If you unzip and run that program (there is no installer and it leaves nothing behind on your system), then start SageTV and try playing a playlist someoutput will be shown in the window. Can you PM me that output?

4. Are your music files stored locally? If not, are they accessed through a UNC path or a mapped drive?

5. Are you using SageTV or the SageTV Client?

I'm not sure how I could have made things worse with the changes -- it went from being totally unreliable on my system to working 100% of the time.

The DebugView output will also help me understand whats going on with the visualization window on your system. The visualization stuff is pretty hack-ish, but the playlist stuff should really be spot-on. In any case, perhaps the answers to these questions will help get things sorted. When testing the playlist though, avoid the visualizations. It should really be two separate runs in order for me to be able to understand whats going on without confusing the issue.

Last edited by deria; 12-01-2005 at 01:06 PM.
Reply With Quote
  #20  
Old 12-01-2005, 01:06 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Quote:
Originally Posted by rydberg
Great work Deria!

I only have one problem, the player don't handle filenames with national characters like едц here in Sweden.

I have also played around with the MediaPlayer interface and got the same problem if I used the GetStringUTFChars function in JNIEnv (don't know if you are using this).

The code I have written is all in C++ but contact me if you want the code for converting a jstring to char *xxx in C++.
Well, this is the code that I'm using currently to handle the filename:

const char *str = env->GetStringUTFChars(TheFile, 0);
PlayFile(str);

then in PlayFile():

COPYDATASTRUCT cds;

cds.dwData = IPC_PLAYFILE;
cds.lpData = (char *)filename;
cds.cbData = (unsigned int)strlen((char*)cds.lpData) + 1;

SendMessage(WinampHWND,WM_USER,0,CLEAR_PLAYLIST);
SendMessage(WinampHWND, WM_COPYDATA, WPARAM(NULL), (LPARAM)&cds);

I would have expected that to handle Unicode. If you have a function that will work out better, I'd be happy to try it out. Just PM me your code snippet and I'll take a look.
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 04:25 AM.


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