PDA

View Full Version : convert pls to m3u


synistics
04-26-2007, 02:12 PM
Checking to see if this thought is the right way

using the media plugin, I can only playback m3u files without calling in a web object, which is not what I want to do. I have a series of events that will occur

search drives for file format
list files in listbox (LB1)
select singles or multiples from the listbox
on button run command line for the following script

@echo off
rem pls2wpl.bat written by ************ http://www.*******.org.uk/
rem based on catalog.bat found in dos batch examples at http://www.*********.com
rem This batch file converts XMMS .PLS files into .wpl playlists for use
rem with windows media player
rem suggested batch location = My Documents\My Music\My Playlists
echo ^<?wpl version="1.0"?^>>%TEMP%\convert.wpl
echo ^<smil^>>>%TEMP%\convert.wpl
echo ^<head^>>>%TEMP%\convert.wpl
echo ^<meta name="Generator" content="PLS to WPL playlist conversion"/^>>>%TEMP%\convert.wpl
echo ^<title^>Playlist^</title^>>>%TEMP%\convert.wpl
echo ^<body^>>>%TEMP%\convert.wpl
echo ^<seq^>>>%TEMP%\convert.wpl
for /f "tokens=1,2* delims==" %%A in ('type %*') do (
for /f "tokens=1 delims=i" %%U in ("%%A") do (
if [%%U]==[F] (
echo ^<media src="%%B"/^>>>%TEMP%\convert.wpl
)
)
)
echo ^</seq^>>>%TEMP%\convert.wpl
echo ^</body^>>>%TEMP%\convert.wpl
echo ^</head^>>>%TEMP%\convert.wpl
echo ^</smil^>>>%TEMP%\convert.wpl
start %TEMP%\convert.wpl

this new file name and location sent to listbox2 (LB2)

where the file can be selected and played in the MPplugin.

First

Is this doable?

Second

Is there a better way?

Thanks