View Single Post
Old 26th March 2006, 16:23   #357
breakhead
Junior Member
 
Join Date: Mar 2006
Posts: 3
nice plugin

just found this plugin, very nice!

whipped this up last night, will find and display nfos for all unique folders in selection, please excuse any bugs or bad code, very rusty on vb!

code:

x = playlist.getselection

for i = 1 to ubound(x)
n = ""
d = split(x(i).filename,"\")
if ubound(d) > 0 Then
for s = 0 to ubound(d)-1
n = n + d(s) + "\"
next
end if
if n <> lastn then
set ofs = createobject("scripting.filesystemobject")
nf = locatefilebyext(n,"nfo")
if len(nf) > 0 then
txt = ofs.opentextfile(nf).readall
set ie = startIE()
ie.document.title = "NFO: " & nf
ie.document.body.style.backgroundColor = "black"
set pre = ie.document.createelement("PRE")
pre.innerText = txt
pre.style.color = "DADADA"
pre.style.fontSize = "10px"
ie.document.body.appendChild(pre)
ie.visible = true
ie.document.body.focus()
end if
lastn = n
end if
set ie = nothing
set nf = nothing
set ofs = nothing
next

function locateFileByExt(sFolder,sExt)
set d = ofs.GetFolder(sFolder)
for each f in d.files
name = f.name
aext = split(name,".")
if ubound(aext) <> -1 then ext = aext(ubound(aext))
if ucase(ext) = ucase(sExt) then locateFileByExt = f.path
next
set d = nothing
end function

function startIE()
set ie = createobject("internetexplorer.application")
ie.addressbar = false
ie.menubar = false
ie.resizable = false
ie.statusbar = false
ie.toolbar = false
ie.width = 535
ie.height = 550
ie.navigate("about:blank")
set startIE = ie
end function



oh and this quick one appends a cue file for the currently playing file at the end of the playlist (if u have a cue handler like ape cue it can then be expanded by playing it)

code:

x = playlist.getselection

for i = 1 to ubound(x)
f = ""
a = split(x(i).filename,".")
if ubound(a) <> -1 then
a(ubound(a)) = "cue"
f = join(a,".")
set ofs = createobject("scripting.filesystemobject")
if ofs.FileExists(f) then loaditem(cstr(f)).enqueue
end if
next



is there a workaround for playlist.position because id like to be able to insert items immediately after the currently selection?

thanks again!


edit: sorry forgot to ask. i know u can create a fake playlist entry with "X:blah", are there any other playlist commands like this?
breakhead is offline   Reply With Quote