Page 1 of 1

Media PLayer Classic status plugin

Posted: July 18th, 2008, 9:25 am
by herak
I just completed version 1 of a new plug-in to display information from media player classic.

bellow is the readme, any comments or suggestions just leave them in the thread.


---------
mpcstatus version 1

1. To set up the plugin copy mpcstats.dll, mpcstats.xml, and mpcstats.dll.config to the lcd smartie plugin directory.

2.start media player classic and enable the web interface
view > options > webinterface check the box "listen on port" and make sure that "13579" is in the port box (the rest of the settings don't matter) and click ok.

3. Launch Lcdsmartie and test the plugin.


This plugin is designed to be used with the latest version of Media Player Classic - Homecinema (v1.1.0.0 at time of writing) but it should work with any version of media player classic with a web interface.

http://mpc-hc.sourceforge.net/

The .net framework 3.5 is required to run the plugin

http://www.microsoft.com/downloads/deta ... laylang=en




The plugin has 6 functions called with $dll(mpcstats,[function_number],[parameter],) the second parameter is ignored


function 1 status

parameter 1 - returns the status of media player classic ie playing, paused, closed
parameter 2 - returns a number representing the status as above to use in actions
closed = 0, playing = 1, paused = 2, stoped = 3, opening = 4.
parameter 3 - returns 0 if media player classic is closed and 1 if it's open.

function 2 title

parameter 1 - returns the file name no parsing done. tv_show - eppisode-name.s2e05.xvid.avi becomes tvshow - eppisode-name.s2e05.xvid.avi
parameter 2 - removes the punctuation and spaces from the file name. Helps legability on displays tv_show - eppisode-name.s2e05.xvid.avi => tvshow eppisode name s2e05 xvid avi
parameter 3 - removes the file extention as well tv_show - eppisode-name.s2e05.xvid.avi => tvshow eppisode name s2e05 xvid
parameter 4 - removes the unneeded scene tags so tv_show - eppisode-name.s2e05.xvid.avi => tvshow eppisode name s2e05


function 3 position and length
parameter 1 - returns the length of the loaded file for a 45min file => 00:45:00
parameter 2 - same as above but will only return the needed portion 45min file => 45:00
parameter 3 - position in the file
parameter 4 - position in the file to match parameter 2
parameter 5 - percent of the file played to ease building a bar graph
parameter 6 - time remaining
function 4 volume
parameter 1 - volume level 0 to 100
parameter 2 - mute status 0 = unmuted 1 = muted

function 5 diagnostics
parameter 1 - the url the program is querying for the information the default is "http://localhost:13579/status.html" media player classic does not need to be on the same computer as lcdsmartie though i have not yet done through testing of this.
parameter 2 - the original string receievd from media player classic

function 6 credits
call it with any parameter to see the credits

so an example screen would be (for a 40x4 lcd)

line1:$dll(mpcstats,2,4,)
line2:$dll(mpcstats,3,4,)/$dll(mpcstats,3,2,) $dll(mpcstats,1,1,)
line3:volume:$dll(mpcstats,4,1,)
line4:$Bar($dll(mpcstats,3,5,),100,40)

will give the output wile playing this file "rain_of_madness_h720p.mov"

Image

Posted: July 31st, 2008, 5:19 pm
by caesar
Nice plugin, will test it soon.

Thank you and keep up the good work!

Posted: August 4th, 2008, 10:54 pm
by herak
Thanks for the testing, i've just updated the plug-in to add a function to display the time remaining the file attached to the first post is the latest version.

Posted: August 25th, 2008, 11:02 am
by pestilenc
Great plugin, works really well. Thanks for the hard work!

Posted: October 4th, 2008, 5:11 pm
by housemaster
RESPECT :D :D :D :D :D
for this very nice plugin.
That has always been missing me.
For me it works very well.

But it lacks a function to screen out other connection.

thanks for your great work.

:D :D :D :D :D

Posted: October 5th, 2008, 5:19 pm
by herak
housemaster wrote: But it lacks a function to screen out other connection.
I'm coming up on some more free time. I might be able to add this to the plug-in what is it you actually want? i'm not sure i understand what you mean?

Re: Media PLayer Classic status plugin

Posted: July 11th, 2010, 4:47 pm
by mr_duplo
Started using this for my current project PC. It's a great plugin!

My only problem is that it returns status:0 when using DXVA. Anyone who knows a fix for this?

Re: Media PLayer Classic status plugin

Posted: August 15th, 2010, 9:24 pm
by fisnils
works fine for me :)

a request, can u fix so that swedish characters ( å ä ö) is displayed ..thanx

Re: Media PLayer Classic status plugin

Posted: August 6th, 2012, 2:10 am
by droid
It crashes with MPC-HC 1.5.2 and newer versions and the progress bar says "[Bar: Too many parameters]" with any version.

Is there anyone who can fix this?

Re: Media PLayer Classic status plugin

Posted: August 10th, 2012, 1:57 pm
by Martinique
@droid: The parameter error probably happens when Windows is configured for a locale that uses comma as decimal separator, which fools Bar and just about every LCD Smartie function. I tried replacing the comma with a dot using another plugin, but it didn't help, as Bar once again expects a number format matching the current locale. LCD Smartie seriously needs an escape character or – even better – a way to set a different separator character inline, to get rid of these comma problems.

As the comma and the digits following it are not really needed, I decided to remove them using the regexp.dll plugin:
$Bar($dll(regexp.dll,3,$Chr(44).*$#,$dll(mpcstats,3,5,)),100,20)

Re: Media PLayer Classic status plugin

Posted: August 26th, 2012, 10:33 am
by torminator
droid wrote:It crashes with MPC-HC 1.5.2 and newer versions and the progress bar says "[Bar: Too many parameters]" with any version.
Is there anyone who can fix this?
I had the exact same problem, so I stayed with MPC-HC 1.5.1 for a long time without upgrading. The guy who wrote the plugin was good enough to provide the source code though, and now I finally got around to have a look at the issue.

Problem was, the newer MPC-HC versions changed slightly the formatting in the web interface, and the plugin didn't parse the new format correctly.

I converted the original source from VB.NET to C# using a tool, and fixed the data parsing. It should now work correctly! Please see attachment.

Note that I've only tested this with the very latest version of MPC-HC (1.6.3)

Re: Media PLayer Classic status plugin

Posted: March 10th, 2013, 10:55 am
by Arpad
Not running the media player classic. How to skipping the plugin?

Re: Media PLayer Classic status plugin

Posted: March 10th, 2013, 12:22 pm
by torminator
Arpad wrote:Not running the media player classic. How to skipping the plugin?
There's probably a few ways to do it, I use the following rules in the 'Actions' tab:
If $dll(mpcstats,1,3,) = 0 then GotoScreen(4)
If $dll(mpcstats,1,3,) = 1 then GotoScreen(1)

(In my setup, screen 1 is the main screen I use for Media Player Classic. Screen 4 is a blank screen)