

Par n : Active audio track // // if no audio track present, returns -1 // if no file loaded, returns -2 Global Const $CMD_LISTAUDIOTRACKS = 0x50000005 // List of files in the playlist // Par 1 : file path 0 // Par 2 : file path 1 //. Par n : Active subtitle track, -1 if subtitles disabled // // if no subtitle track present, returns -1 // if no file loaded, returns -2 Global Const $CMD_LISTSUBTITLETRACKS = 0x50000004 // List of audio tracks // Par 1 : Audio track name 0 // Par 2 : Audio track name 1 //. For commands or notifications with multiple parameters, values are ~ // separated by | ~ // If a string contains a |, it will be escaped with a \ so a \| is not a separator ~ // ~ // Ex : When a file is openned, mpc-hc send to host the "now playing" notification : ~ // - dwData : CMD_NOWPLAYING ~ // - lpData : title|author|description|filename|duration ~ #pragma once ~ typedef enum MPC_LOADSTATE ~ = Commands from MPC to host // Send after connection // Par 1 : MPC window handle (command should be send to this HWnd) Global Const $CMD_CONNECT = 0x50000000 // Send when opening or closing file // Par 1 : current state (see MPC_LOADSTATE enum) Global Const $CMD_STATE = 0x50000001 // Send when playing, pausing or closing file // Par 1 : current play mode (see MPC_PLAYSTATE enum) Global Const $CMD_PLAYMODE = 0x50000002 // Send after opening a new file // Par 1 : title // Par 2 : author // Par 3 : description // Par 4 : complete filename (path included) // Par 5 : duration in seconds Global Const $CMD_NOWPLAYING = 0x50000003 // List of subtitle tracks // Par 1 : Subtitle track name 0 // Par 2 : Subtitle track name 1 //.

All messages should be ~ // formatted as Unicode strings. \bin\mplayerc /slave 125421 ~ // ~ // After startup, mpc-hc send a WM_COPYDATA message to host with COPYDATASTRUCT struct filled with : ~ // - dwData : CMD_CONNECT ~ // - lpData : Unicode string containing mpc-hc main window Handle ~ // ~ // To pilot mpc-hc, send WM_COPYDATA messages to Hwnd provided on connection. To send commands ~ // to mpc-hc, and receive playback notifications, first launch process with the /slave command line ~ // argument follow by an HWnd handle use to receive notification : ~ // ~ //. Expand collapse popup #include #include #include #include #include #Include FROM MpcApi.h : ~ // This file define commands used for "Media Player Classic - Homecinema" API.
