Media Player Classic Home Cinema Library

Post your working scripts, libraries and tools for AHK v1.1 and older
x32
Posts: 177
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.
Last edited by x32 on 06 Mar 2023, 18:02, edited 1 time in total.
Bubo_Bubo
Posts: 8
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: 71
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: 177
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: 2688
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: 6902
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 (v1)”

Who is online

Users browsing this forum: No registered users and 226 guests