Tested with VLC and MPC - Home Cinema.
The external file is no longer used.
Just compile the code.
Code: Select all
dim info$(10, 10)
dim a$(1)
dim c$(10, 10)
nomainwin
UpperLeftX = 25
UpperLeftY = 30
WindowWidth = 800
WindowHeight = 600
BackgroundColor$ = "buttonface"
ForegroundColor$ = "red"
ListboxColor$ = "black"
TextboxColor$ = "white"
button #flix.update,"Update",[update], UL, 15, 15, 60, 25
textbox #flix.path, 145, 15, 250, 25
button #flix.go,"Go",[go], UL, 720, 15, 25, 25
textbox #flix.vlcpath, 465, 15, 250, 25
statictext #flix.pathnow, "Movies", 90, 20, 50, 20
statictext #flix.VLCpathnow, "Player", 415, 20, 50, 20
listbox #flix.list, a$(, [selectionMade], 5, 60, WindowWidth - 20, WindowHeight - 125
statictext #flix.label, "", 15, WindowHeight - 50, WindowWidth - 20, 20
open "VideoLister" for window as #flix
#flix "trapclose [quit]"
print #flix, "font arial 0 16"
print #flix.list, "font arial 0 22"
print #flix.pathnow, "!font arial 0 18"
print #flix.VLCpathnow, "!font arial 0 18"
print #flix.label, "!font arial 0 18"
print #flix.list, "singleclickselect"
[start]
print #flix.list, "enable"
print #flix.list, "setfocus"
if fileExists(DefaultDir$, "Movies.dat") <> 0 then
open "Movies.dat" for input as #play
input #play, vlcpath$
input #play, MoviesPath$
count = 0
while eof(#play)=0
count = count + 1
input #play, anything$
wend
close #play
redim a$(count)
open "Movies.dat" for input as #play
input #play, vlcpath$
input #play, MoviesPath$
total = 0
while eof(#play)=0
input #play, a$(total)
total = total + 1
wend
close #play
for i = 1 to total
print a$(i)
next i
end if
print #flix.list, "reload"
print #flix.vlcpath, vlcpath$
print #flix.path, MoviesPath$
print #flix.label, "Files: " + str$(count)
wait
[go]
filedialog "Open path to Video Player", "*.exe", vlcpath$
if vlcpath$ > "" then
print #flix.vlcpath, vlcpath$
end if
wait
[update]
print #flix.path, "!contents?"
input #flix.path, MoviesPath$
files MoviesPath$, c$()
count = val(c$(0, 0))
open "Movies.dat" for output as #vlc
print #vlc, vlcpath$
print #vlc, MoviesPath$
for i = 1 to count
f$ = c$(i,0)
e$ = right$(f$, 4)
if e$ = ".avi" or e$ = ".flv" or e$ = ".mkv" or e$ = ".mp4" or e$ = ".mpg" or e$ = ".wmv" then
print #vlc, f$
end if
next
close #vlc
redim a$(1)
goto [start]
wait
[selectionMade]
print #flix.list, "selection? selection$"
print #flix.label, "You selected " + chr$(34) + selection$ + chr$(34)
run vlcpath$ + " " + chr$(34) + MoviesPath$ + "\" + selection$ + chr$(34)
wait
[quit]
close #flix
end
function fileExists(path$, filename$)
files path$, filename$, info$()
fileExists = val(info$(0, 0)) 'non zero is true
end function