PDA

View Full Version : pls file


bobbie
04-15-2006, 08:19 PM
How could you use a pls file with ams like shoutcast uses.
[playlist]
numberofentries=3
File1=http://209.51.162.170:9002
Title1=(#1 - 47/700) [9412] 9412 - The Rock Station. More Live DJs than any other station on the Internet!
Length1=-1
File2=http://216.110.12.110:8100
Title2=(#2 - 9/100) [9412] 9412 - The Rock Station. More Live DJs than any other station on the Internet!
Length2=-1
File3=http://195.225.46.202:9000
Title3=(#3 - 111/1000) [9412] 9412 - The Rock Station. More Live DJs than any other station on the Internet!
Length3=-1
Version=2
Thats a pls file .

Corey
04-15-2006, 08:38 PM
One idea would be to convert it to an .m3u file on the fly and serve it in the Windows Media Player...

http://www.scvi.net/pls.htm

bobbie
04-15-2006, 09:04 PM
How would you convert it?

Corey
04-15-2006, 09:31 PM
Based upon what that link says they are both just plain text files with a slightly different format so I'd just figure it out the long way personally.

bobbie
04-15-2006, 11:11 PM
Thanks Corey, I'm looking for some converter right now but if I can't find one I may try to do one in autohotkey.

azmanar
04-15-2006, 11:18 PM
Thanks Corey, I'm looking for some converter right now but if I can't find one I may try to do one in autohotkey.

Bobbie,

I think you can use http.download for the PLS file somewhere to a Temp folder, and then parse the data to your ListBox, Tree or Combo.

Intrigued
04-16-2006, 02:21 PM
INI Actions use time on that file?

Intrigued
04-16-2006, 02:41 PM
Here is a very basic (but working) example using the Debug ('ger) object for output.

http://www.amsuser.com/ams/examples/INI-AMS6-Intrigued.apz

What I did:

I copied the data you posted into a text file and saved it with the .ini extension.

Then I put that file into a blank AMS 6 project's Docs folder.

Then I put the following code in the On Show event area:

Debug.ShowWindow(true)

Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "numberofentries").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "File1").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Title1").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Length1").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "File2").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Title2").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Length2").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "File3").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Title3").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Length3").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Version").."\r\n")

Intrigued
04-16-2006, 02:58 PM
Updated!

I just included the MediaPlayer (no error checking though) to show how to play one of the ('File1') file paths supplied in the config. file you posted.

:yes

(redownload the .apz if needed)

Updated code:

Debug.ShowWindow(true)

Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "numberofentries").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "File1").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Title1").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Length1").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "File2").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Title2").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Length2").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "File3").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Title3").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Length3").."\r\n")
Debug.Print(INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "Version").."\r\n")

MediaPlayer.Load("Plugin1", INIFile.GetValue("AutoPlay\\Docs\\test.ini", "playlist", "File1"))

MediaPlayer.Play("Plugin1")

bobbie
04-16-2006, 05:55 PM
Thank you, will have a look at this.

Intrigued
04-16-2006, 06:35 PM
NP. If you need too... just make a copy of the .pls (?) file and rename it with a .ini extension to use this project's code.

:yes