Media Player Classic Home Cinema Library

Post your working scripts, libraries and tools
x32
Posts: 101
Joined: 25 Nov 2016, 16:44

Media Player Classic Home Cinema Library

17 Mar 2018, 08:08

Since it was brought up in another thread I thought I would repost my Media Player Classic Home Cinema library from the old forums. Uses SendMessage so the player does not need to be active to receive commands. A list of all available commands, at least at the time it was written, are located at the bottom of the library. This player is very powerful and provides many commands for it.


Code: Select all

; Media Player Classic Home Cinema Function Library by Specter333
; http://www.autohotkey.com/forum/viewtopic.php?p=490310#490310
; A complete list of functions can be found at the bottom of the page.
; Use Send functions to control Media Player Classic Home Cinema 
; with out it being active.
; Home page, http://mpc-hc.sourceforge.net/
; If being used on a local machine this function responds faster than MPCHTTP


MediaPlayerClassicHC(msg) 
	{
	; For "msg" use a number from the list of commands at the bottom of the page.
	SendMessage,0x0111,msg,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_Play()
	{
	SendMessage,0x0111,887,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_Pause()
	{
	SendMessage,0x0111,888,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_PlayPause()
	{
	SendMessage,0x0111,889,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_Stop()
	{
	SendMessage,0x0111,890,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_FullScreen()
	{
	SendMessage,0x0111,830,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_JumpForward()
	{
	SendMessage,0x0111,902,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_JumpBackward()
	{
	SendMessage,0x0111,901,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_PlayFaster()
	{
	SendMessage,0x0111,895,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_PlaySlower()
	{
	SendMessage,0x0111,894,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_PlayNormal()
	{
	SendMessage,0x0111,896,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_VolumeUp()
	{
	SendMessage,0x0111,907,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_VolumeDown()
	{
	SendMessage,0x0111,908,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_Mute()
	{
	SendMessage,0x0111,909,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_RootMenu()
	{
	SendMessage,0x0111,923,,,ahk_class MediaPlayerClassicW
	}
MediaPlayerClassicHC_Exit()
	{
	SendMessage,0x0111,816,,,ahk_class MediaPlayerClassicW
	}

/*	
Use one of the numbers from the commands below with the MediaPlayerClassicHC(msg)
function to call commands not included in this library.  

Use only the number, example the Open File function = MediaPlayerClassicHC(800)

800 Open File
801 Open DVD
802 Open Device
805 Save As
806 Save Image
807 Save Image (auto)
809 Load Subtitle
810 Save Subtitle
804 Close
814 Properties
816 Exit
889 Play/Pause
887 Play
888 Pause
890 Stop
891 Framestep
892 Framestep back
893 Go To
895 Increase Rate
894 Decrease Rate
896 Reset Rate
905 Audio Delay +10ms
906 Audio Delay -10ms
900 Jump Forward (small)
899 Jump Backward (small)
902 Jump Forward (medium)
901 Jump Backward (medium)
904 Jump Forward (large)
903 Jump Backward (large)
898 Jump Forward (keyframe)
897 Jump Backward (keyframe)
921 Next
920 Previous
919 Next Playlist Item
918 Previous Playlist Item
817 Toggle Caption&Menu
818 Toggle Seeker
819 Toggle Controls
820 Toggle Information
821 Toggle Statistics
822 Toggle Status
823 Toggle Subresync Bar
824 Toggle Playlist Bar
825 Toggle Capture Bar
826 Toggle Shader Editor Bar
827 View Minimal
828 View Compact
829 View Normal
830 Fullscreen
831 Fullscreen (w/o res.change)
832 Zoom 50`%
833 Zoom 100`%
834 Zoom 200`%
967 Zoom Auto Fit
860 Next AR Preset
835 VidFrm Half
836 VidFrm Normal
837 VidFrm Double
838 VidFrm Stretch
839 VidFrm Inside
840 VidFrm Outside
884 Always On Top
861 PnS Reset
862 PnS Inc Size
864 PnS Inc Width
866 PnS Inc Height
863 PnS Dec Size
865 PnS Dec Width
867 PnS Dec Height
876 PnS Center
868 PnS Left
869 PnS Right
870 PnS Up
871 PnS Down
872 PnS Up/Left
873 PnS Up/Right
874 PnS Down/Left
875 PnS Down/Right
877 PnS Rotate X+
878 PnS Rotate X-
879 PnS Rotate Y+
880 PnS Rotate Y-
881 PnS Rotate Z+
882 PnS Rotate Z-
907 Volume Up
908 Volume Down
909 Volume Mute
969 Volume boost increase
970 Volume boost decrease
971 Volume boost Min
972 Volume boost Max
922 DVD Title Menu
923 DVD Root Menu
924 DVD Subtitle Menu
925 DVD Audio Menu
926 DVD Angle Menu
927 DVD Chapter Menu
928 DVD Menu Left
929 DVD Menu Right
930 DVD Menu Up
931 DVD Menu Down
932 DVD Menu Activate
933 DVD Menu Back
934 DVD Menu Leave
943 Boss key
948 Player Menu (short)
949 Player Menu (long)
950 Filters Menu
886 Options
951 Next Audio
952 Prev Audio
953 Next Subtitle
954 Prev Subtitle
955 On/Off Subtitle
2302 Reload Subtitles
956 Next Audio (OGM)
957 Prev Audio (OGM)
958 Next Subtitle (OGM)
959 Prev Subtitle (OGM)
960 Next Angle (DVD)
961 Prev Angle (DVD)
962 Next Audio (DVD)
963 Prev Audio (DVD)
964 Next Subtitle (DVD)
965 Prev Subtitle (DVD)
966 On/Off Subtitle (DVD)
32769 Tearing Test
32778 Remaining Time
32770 Toggle Pixel Shader
32779 Toggle Direct3D fullscreen
32780 Goto Prev Subtitle
32781 Goto Next Subtitle
32782 Shift Subtitle Left
32783 Shift Subtitle Right
32784 Display Stats
24000 Subtitle Delay -
24001 Subtitle Delay +
808 Save thumbnails
*/
Bubo_Bubo
Posts: 3
Joined: 03 Oct 2014, 01:47

Re: Media Player Classic Home Cinema Library

07 Feb 2019, 05:44

The handy list of messages is always at your service in options of MPC HC or MPC BE:
screenshot
r2997790
Posts: 50
Joined: 02 Feb 2017, 02:46

Re: Media Player Classic Home Cinema Library

07 Feb 2019, 08:46

Bubo_Bubo wrote:
07 Feb 2019, 05:44
The handy list of messages is always at your service in options of MPC HC or MPC BE:
screenshot
What tool is that Bubo? Looks interesting!

Thanks, R
x32
Posts: 101
Joined: 25 Nov 2016, 16:44

Re: Media Player Classic Home Cinema Library

07 Feb 2019, 10:06

Just go to "view", "options", then click on "keys".
Smurth
Posts: 2
Joined: 09 Feb 2019, 06:07

Re: Media Player Classic Home Cinema Library

09 Feb 2019, 06:19

Nice ;)

Is there a way to retrieve the file position ?
I mean: PlayPos / Length ?
wolf_II
Posts: 2683
Joined: 08 Feb 2015, 20:55

Re: Media Player Classic Home Cinema Library

09 Feb 2019, 08:54

I discovered some mistakes in the numbers, most likely they changed from when your script was written.
I then changed the setup, such that you can use MPC_HC("Options") to keep up to date, when including new commands.
Thx for sharing!!

I hope you don't mind me sharing this fork:

Code: Select all

; send messages to control Media Player Classic Home Cinema
; a complete list of functions can be found by MPC_HC("Options")
; home page: http://mpc-hc.sourceforge.net/

MPC_HC(cmd) { ; cmd is a sting in the list of supported commands
    static Supported
    :=  { Play: 887, Pause: 888, PlayPause: 889, Stop: 890
        , FullScreen: 830, JumpForward: 902, JumpBackward: 901
        , PlayFaster: 895, PlaySlower: 894, PlayNormal: 896
        , VolumeUp: 907, VolumeDown: 908, Mute: 909
        , DVDMenu: 923, Exit: 816, Options: 815}

	SendMessage, 0x111, % Supported[cmd],,, ahk_class MediaPlayerClassicW
}

F1:: MPC_HC("Options")
F2:: MPC_HC("PlayPause")
F3:: MPC_HC("Stop")
F4:: MPC_HC("FullScreen")
User avatar
jeeswg
Posts: 6543
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Media Player Classic Home Cinema Library

09 Feb 2019, 09:24

To get the elapsed time/duration.
From:
jeeswg's Media Player Classic tutorial - AutoHotkey Community
https://www.autohotkey.com/boards/viewtopic.php?f=7&t=41683

Code: Select all

;get elapsed time/duration (assuming it's set to elapsed time, not remaining time)
ControlGetText, vTime, Static2, ahk_class MediaPlayerClassicW
vPos := InStr(vTime, "/")
vElapsed := SubStr(vTime, 1, vPos-2)
vDuration := SubStr(vTime, vPos+2)
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Smurth
Posts: 2
Joined: 09 Feb 2019, 06:07

Re: Media Player Classic Home Cinema Library

11 Feb 2019, 12:46

jeeswg wrote:
09 Feb 2019, 09:24
To get the elapsed time/duration..
Thank you.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: TAC109 and 56 guests