BlitzCoder Essentials
Home Page
About BlitzCoder
Contributors
Terms of Use
Email Us
Main Areas
BlitzCoder Chat
Discussions
Articles/Tutorials
Code Database
Link Database
Showcase Area
Worklogs
Competitions
Special Areas
Undocumented
Other Blitz Sites
Blitz Basic Home
Blitz Showcase
BlitzPlay Library
Forum Login
Username:
Password:
Register Now!
BlitzCoder Code Archives Page
Main Codes Page
"Load and Save MS media player playlists"
, by sdf
two functions that create or read from a WPL file into/outof a type array
Code
;****************************** ;Author: Steven Sulley (AKA SDF (of blitzcoder)) ;Date added: 05/Mar/2004 ;Notes: If you have problem with it please Email - steven.sulley1@ntlworld.com OR sdfobc@yahoo.co.uk ; Also, come on you've got to credit me at least a little! :ŽD ; sorry about the comments! :ŽP ;****************************** Type playlist ;this will be needed Field file$ ;the path of the music End Type ;========================= ;Function for opening WPL playlists ;Args: file$=file to open ;desciption: reads a Windows media player playlist into a type, 'playlist' ; : just the file names BTW also changes the current directory ; this is because media player is lazy :-P ;========================= Function openMPplaylist(file$) If file<>"" reading=ReadFile(file$) ;read the playlist For p.playlist=Each playlist ;del. any current stuff in the mem Delete p Next Repeat file2$=ReadLine(reading) If Instr(file2,"
") ;if its the start of the music entries Repeat file2$=ReadLine(reading) ;read the next line If Instr(file2,"
"" Then save=WriteFile(filea$) ;create a new file WriteLine(save,"") ;write in the beginning bit WriteLine(save,"
") WriteLine(save," ") WriteLine(save,"
") WriteLine(save,"
") WriteLine(save,"
"+name$+"
") ;see there's that name bit WriteLine(save," ") WriteLine(save," ") WriteLine(save,"
") For p.playlist=Each playlist ;loop the music WriteLine(save,"
") ;list the entries in the file Next ;end the loop WriteLine(save,"
") ;finish the file off WriteLine(save," ") WriteLine(save,"
") CloseFile(save) ;close the file EndIf End Function
Copyright(c) 2000-2004, BlitzCoder. All Rights Reserved.
Code software created by Krylar's Kreations