VideoLister

General Computer Utilities
ValorSolo
Posts: 16
Joined: Thu Dec 23, 2010 6:02 pm

VideoLister

Post by ValorSolo » Thu Jan 13, 2011 9:20 pm

Lists all video files in the specified directory and plays them in the specified player, with a single click.
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

Last edited by ValorSolo on Mon Jan 17, 2011 12:39 am, edited 1 time in total.
Yoda: No. Try not. Do... or do not. There is no try.

tsh73
Posts: 42
Joined: Fri May 04, 2007 12:03 pm

false positive on Movies.exe

Post by tsh73 » Fri Jan 14, 2011 8:43 pm

On my job, TrendMicro antivirus blocked this archive as suspictious.
I velieve this is false positive and file is harmless.
Here is results of checking on VirusTotal, http://www.virustotal.com/

Code: Select all

File name:
Movies.exe
Submission date: 
2011-01-14 20:37:21 (UTC)
Current status: 
finished
Result: 
4/ 43 (9.3%)

Antivirus	Version	Last Update	Result
AhnLab-V3	2011.01.15.00	2011.01.14	-
AntiVir	7.11.1.144	2011.01.14	-
Antiy-AVL	2.0.3.7	2011.01.14	-
Avast	4.8.1351.0	2011.01.14	-
Avast5	5.0.677.0	2011.01.14	-
AVG	10.0.0.1190	2011.01.14	-
BitDefender	7.2	2011.01.14	-
CAT-QuickHeal	11.00	2011.01.14	-
ClamAV	0.96.4.0	2011.01.14	-
Command	5.2.11.5	2011.01.14	-
Comodo	7392	2011.01.14	-
DrWeb	5.0.2.03300	2011.01.14	-
Emsisoft	5.1.0.1	2011.01.14	-
eSafe	7.0.17.0	2011.01.13	-
eTrust-Vet	36.1.8100	2011.01.14	-
F-Prot	4.6.2.117	2011.01.14	-
F-Secure	9.0.16160.0	2011.01.14	-
Fortinet	4.2.254.0	2011.01.14	-
GData	21	2011.01.14	-
Ikarus	T3.1.1.97.0	2011.01.14	-
Jiangmin	13.0.900	2011.01.14	Trojan/Banker.Qhost.ms
K7AntiVirus	9.75.3548	2011.01.14	-
Kaspersky	7.0.0.125	2011.01.14	-
McAfee	5.400.0.1158	2011.01.14	-
McAfee-GW-Edition	2010.1C	2011.01.14	Heuristic.BehavesLike.Win32.ModifiedUPX.J!87
Microsoft	1.6402	2011.01.14	-
NOD32	5788	2011.01.14	-
Norman	6.06.12	2011.01.14	-
nProtect	2011-01-14.01	2011.01.14	-
Panda	10.0.2.7	2011.01.14	-
PCTools	7.0.3.5	2011.01.14	-
Prevx	3.0	2011.01.14	-
Rising	22.82.04.04	2011.01.14	-
Sophos	4.61.0	2011.01.14	-
SUPERAntiSpyware	4.40.0.1006	2011.01.14	-
Symantec	20101.3.0.103	2011.01.14	-
TheHacker	6.7.0.1.115	2011.01.14	-
TrendMicro	9.120.0.1004	2011.01.14	PAK_Generic.001
TrendMicro-HouseCall	9.120.0.1004	2011.01.14	-
VBA32	3.12.14.2	2011.01.14	TrojanBanker.BAT.Qhost.v
VIPRE	8068	2011.01.14	-
ViRobot	2011.1.14.4254	2011.01.14	-
VirusBuster	13.6.147.0	2011.01.14	-

ValorSolo
Posts: 16
Joined: Thu Dec 23, 2010 6:02 pm

Post by ValorSolo » Mon Jan 17, 2011 12:41 am

Updated. No external file required.
Yoda: No. Try not. Do... or do not. There is no try.

ValorSolo
Posts: 16
Joined: Thu Dec 23, 2010 6:02 pm

Post by ValorSolo » Mon Feb 07, 2011 8:53 pm

I've tested with WMP, it works great.
Also I've added support for the following.
avi, flv, mkv, mp4, mpg, wmv, vob, swf, rm, rmvb, mov, asf, w4v, m2v, m2t, ts, m2ts, mts, avc, ogm, ogv, qt, avc

Am I still missing any commonly used formats?

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)
     l = len(f$)
    for j = 1 to l
        if mid$(f$, j, 1) = "." then
            lastDot = j
        end if
    next j
     e$ = right$(f$, l-(lastDot-1))
      if e$ = ".avi" or e$ = ".flv" or e$ = ".mkv" or e$ = ".mp4" or e$ = ".mpg" _
       or e$ = ".wmv" or e$ = ".vob" or e$ = ".swf" or e$ = ".rm" or e$ = ".rmvb" _
       or e$ = ".mov" or e$ = ".asf" or e$ = ".w4v" or e$ = ".m2v" or e$ = ".m2t" _
       or e$ = ".ts" or e$ = ".m2ts" or e$ = ".mts" or e$ = ".avc" or e$ = ".ogm" _
       or e$ = ".ogv" or e$ = ".qt" or e$ = ".avc" 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
Yoda: No. Try not. Do... or do not. There is no try.