Breaking it down...
**Fade In Video**
Code:
mpc := new Process(A_ScriptDir . "\Module Extensions\mpc-hc64.exe")
Creates a new process object for the MPC-HC64 executable.
Code:
fadeIn := new File(A_ScriptDir . "\Media\Fade\" . systemName . "\" . romName . "\fade_in.*")
Defines a file object for the fade_in video specific to the system and ROM.
Code:
fadeEnabled := moduleIni.Read(romName . "|Fade Video", "Enable Fade Videos", "false",,1)
Reads the configuration setting for enabling fade videos from an INI file.
Code:
if (fadeEnabled == "true" && !fadeIn.Exist())
Checks if fade is enabled and fade_in video exists.
If fade is enabled but the fade_in video doesn't exist for the specific ROM, it sets `fadeIn` to a default fade_in video.
If fade is enabled and there's a video available, it runs MPC-HC64 in fullscreen mode to play the fade_in video.
**If you want the video to play first BEFORE loading the game, then use the RunWait command instead of just run:
Plays video while emulator/rom is loading:
Code:
mpc.Run("/fullscreen /play /close " . """" . fadeIn.FileFullPath . """")
Plays video first before emulator/rom is loaded:
Code:
mpc.RunWait("/fullscreen /play /close " . """" . fadeIn.FileFullPath . """")
**Fade Out Video**
Code:
fadeOut := new File(A_ScriptDir . "\Media\Fade\" . systemName . "\" . romName . "\fade_out.*")
Defines a file object for the fade_out video specific to the system and ROM.
Code:
if (fadeEnabled = "true" && !fadeOut.Exist())
Checks if fade is enabled and fade_out video exists.
If fade is enabled but the fade_out video doesn't exist for the specific ROM, it sets `fadeOut` to a default fade_out video.
If fade is enabled and there's a video available, it runs MPC-HC64 in fullscreen mode to play the fade_out video and waits for it to finish before continuing.
Example of the directory used for the Fade videos:
Code:
RocketLauncher
│
└── Media
└── Fade
├── Arcade
│ ├── term2
│ │ ├── fade_in.*
│ │ └── fade_out.*
│ └── ROM2
│ ├── fade_in.*
│ └── fade_out.*
├── Sega Naomi
│ ├── ninjaslt
│ │ ├── fade_in.*
│ │ └── fade_out.*
│ └── hotd2
│ ├── fade_in.*
│ └── fade_out.*
└── _Default
├── _fade_in.*
└── _fade_out.*
This directory tree represents the structure of the `RocketLauncher\Media\Fade` directory, where fade_in and fade_out videos are stored for different systems and ROMs. The `_Default` directory contains default videos to be used when a specific ROM's video is not available.
Here are a list of the parameters that can be used with the MPC-H64 media player:
Code:
Usage: mpc-hc.exe "pathname" [switches]
"pathname" The main file or directory to be loaded
(wildcards allowed, "-" denotes standard input)
/dub "dubname" Load an additional audio file
/dubdelay "file" Load an additional audio file shifted with XXms
(if the file contains "...DELAY XXms...")
/d3dfs Start rendering in D3D fullscreen mode
/sub "subname" Load an additional subtitle file
/filter "filtername" Load DirectShow filters from a dynamic link library (wildcards allowed)
/dvd Run in DVD mode, "pathname" means the DVD folder (optional)
/dvdpos T#C Start playback at title T, chapter C
/dvdpos T#P Start playback at title T, position P (hh:mm:ss)
/cd Load all the tracks of an Audio CD or (S)VCD,
"pathname" means the drive path (optional)
/device Open the default video device
/open Open the file, don't automatically start playback
/play Start playing the file as soon the player is launched
/close Close the player after playback (only works when used with /play)
/shutdown Shutdown the operating system after playback
/standby Put the operating system in standby mode after playback
/hibernate Hibernate operating system after playback
/logoff Log off after playback
/lock Lock workstation after playback
/monitoroff Turn off the monitor after playback
/playnext Open next file in the folder after playback
/fullscreen Start in fullscreen mode
/viewpreset N Start with specific preset,
where N is either "1" Minimal, "2" Compact or "3" Normal
/minimized Start in minimized mode
/new Use a new instance of the player
/add Add "pathname" to playlist, can be combined with /open and /play
/randomize Randomize the playlist
/volume N Set Volume, where N is a range from 0 to 100
/regvid Create file associations for video files
/regaud Create file associations for audio files
/regpl Create file associations for playlist files
/regall Create file associations for all supported file types
/unregall Remove all file associations
/start ms Start playing at "ms" (= milliseconds)
/startpos hh:mm:ss Start playing at position hh:mm:ss
/fixedsize w,h Set a fixed window size
/monitor N Start player on monitor N, where N starts from 1
/audiorenderer N Start using audiorenderer N, where N starts from 1 (see "Output" settings)
/shaderpreset "Pr" Start using "Pr" shader preset
/pns "name or values" Specify Pan & Scan preset name to use or direct position and zoom values in format "px,py,zx,zy"
/iconsassoc Reassociate format icons
/nofocus Open MPC-HC in background
/webport N Start web interface on specified port
/debug Show debug information in OSD
/nocrashreporter Disable the crash reporter
/slave "hWnd" Use MPC-HC as slave
/hwgpu "index" Set the index of the GPU used for hardware decoding.
Only available for CUVID and DXVA2 (copy-back)
/reset Restore default settings
/mute Mute the audio
/help /h /? Show help about command line switches