Media Player Classic Louncher

title says it all

Media Player Classic Louncher

Postby dalanik on Mon Nov 01, 2004 2:49 pm

I've been playing with integrating MPC in XLobby's screen to show movies in "window" - that is, with XMoveWindow, it would look as MPC was part of XLobby's page.

One thing that bothered me was that I couldn't control what would happen if some movie is offline when I lounch Media Player Classic.

What I needed was something that would say "ok, it's online, play it" or "no, it's offline, just play generic clip".

So I made a small script to do that for me. It's pretty transparent, just start it with the usual params, i believe %movies%param%.

Here it is, small and nice:



' --------------------------------------------------------------------------------------
' *** Script : open_mpc.vbs *** created by Dalibor Lanik 2004
' --------------------------------------------------------------------------------------
' *** This script will checkthe existence of film file, and if it exists, play it,
' *** if not, it will play selected generic file.
' *** usage (example): open_mpc.vbs "c:\films\Blade Runner.avi"
' --------------------------------------------------------------------------------------

Option Explicit

Dim FSO, WshShellmov
Dim FileSystemObject
Dim MovExeTool, ReturnVal
Dim MovieFile, GenFile

' *** file, taken from arguments from XLobby
MovieFile = WScript.Arguments(0)

' *** player. Change location to match your system
MovExeTool = "C:\Program Files\MPC\mplayerc.exe"

' *** generic avi, if file in arg(0) doesn't exist (xlobby passed name of offline movie)
GenFile = "D:\HTPC\media\trailers\DivX.avi"

Set FSO = CreateObject("Scripting.FileSystemObject")
Set WshShellmov = WScript.CreateObject("WScript.Shell")

If not FSO.FileExists( MovieFile ) Then
MovieFile = GenFile
End If

ReturnVal = WshShellmov.run (chr(34)&MovExeTool&chr(34)&" "&chr(34)&MovieFile&chr(34)&" "&"/start 500"&chr(34),0,TRUE)

Wscript.quit
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic