It is currently March 28th, 2024, 7:42 pm

NowPlaying plugin - Multiple Media Player Support

Share and get help with Plugins and Addons
User avatar
Schlayer
Posts: 4
Joined: September 7th, 2013, 7:34 pm

Re: NowPlaying plugin: Super simple 'time remaining' MM:SS t

Post by Schlayer »

Just thought this would be some place to post this since I can't find a related thread an it took me forever to figure this out on my own. This is a really simple way to make a countdown timer for a song with minutes:seconds. I found in the code for another player that you can get the seconds count without minutes but using the '% 60' operation on any number that represents total seconds. (or I suppose, to get the minutes without hours from any number representing total minutes)
I was looking at the WindowMessage operations for getting a HH:MM:SS countdown and they were possibly the most convoluted set of formulas I've ever seen, requiring 3 separate formula plugins to get each of seconds, minutes, and hours, not to mention the fact that WindowMessage outputs values in milliseconds instead of seconds. I figured it might be helpful to throw this out there such as to avoid wrestling with numbers to that degree.
The way this works is fairly simple: No truncating (TRUNC) is involved. Lets say we are dealing with a track that is at the 2:34 mark. This is numerically represented by (60*2[minutes]=120+34[seconds])= 154(seconds). If I were to use the %60 operation we would get 154 %60 = 34[seconds]. From here it is easy to see that we can subtract this number from the total number of seconds and divide by 60 to get the number of minutes alone! Sticking with the original example we get: (154 - [154 %60]) /60 = 2.
Here is an example of how I used this in my own Windows Media Player gadget.

Code: Select all

[MeasureWMPPos]
Measure=Plugin
Plugin=NowPlaying
PlayerName=WMP
PlayerType=Position

[MeasureWMPDur]
Measure=Plugin
Plugin=NowPlaying
PlayerName=WMP
PlayerType=Duration

[MeasureWMPRemainSec]
Measure=Calc
Formula=(MeasureWMPDur-MeasureWMPPos) % 60

[MeasureWMPRemainMin]
Measure=Calc
Formula=((MeasureWMPDur-MeasureWMPPos)- MeasureWMPRemainSec) /60

[MeterWMPRemain]
Meter=String
MeasureName=MeasureWMPRemainMin
Measurename2=MeasureWMPRemainSec
MeterStyle=MeterTimeStyle
X=345
Y=62
Text=- %1:%2
Hidden=0
Crest
Posts: 113
Joined: August 16th, 2013, 12:47 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by Crest »

Schlayer wrote:Just thought this would be some place to post this since I can't find a related thread an it took me forever to figure this out on my own. This is a really simple way to make a countdown timer for a song with minutes:seconds.
That is awesome, will try it out sometime soon :D Thanks for sharing.
thatsIch wrote:I habe a problem with Foobar2000, my NowPlaying Plugin doesnt re-send the correct state

to reproduce
  • Start Player (state 1)
  • Pause Player (state 2)
  • Next Track (now change)
the player will start again, but the state won't change. Is this a bug in foobar (latest) or the plugin (latest) or me
It's not just you, I've experienced the same bug + other play/pause state changes oddities with Foobar2000 using latest foo_cad and Rainmeter.

Another apparent bug I've noticed is the toggle repeat command doesn't turn off after being turned on with Foobar. Maybe someone else could confirm the repeat toggle bug, as it works fine testing with Winamp.
FdL 1899
Posts: 1
Joined: September 25th, 2013, 1:23 am

Re: NowPlaying plugin - Multiple Media Player Support

Post by FdL 1899 »

Guess that someone has already been asked this before, but i'm kinda curious from which site the nowplaying.dll fetch lyrics? I know that it is impossible to change the source at the moment, but i just want to know from where the plugin get the information. Probably i can add my own lyric on that site/lyrics database

BTW i'm now using SCaLPI skin, which built based on Soita's work if i'm not mistaken. I play my tunes using AIMP3 now.

thanks in advance
leezer3
Posts: 3
Joined: June 17th, 2012, 7:25 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by leezer3 »

A small note/ documentation update request:
As of version 19.0.58, JRiver Media Center has implemented native CAD support.

JRiver topic on this:
http://yabb.jriver.com/interact/index.php?topic=84508.0

This replaces the prior CAD plugin by Poiru (Many thanks for your previous work on this!), which should be uninstalled to prevent conflicts.

Cheers :)
slightlyobsessive
Posts: 4
Joined: October 17th, 2013, 10:46 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by slightlyobsessive »

Am hugely liking this plugin, and having fun customizing the Soita player. I have a question (I hope this is the right place!):

I have a MouseUpAction assigned to the Cover art, which works fine all the while music is playing. I'm using foobar, so it's fully supported via the plugin. However when the track finishes and the player stops, it seems that whatever value held by [MeasureCover] expires, and a left click with the mouse now brings up an error window ("this file does not have a program associated with it....")

Can anyone tell me if there's code that can be added to the measure and/or the meter such that it will store the last played cover (or in fact "now playing" of course) once the player has stopped, thus maintaining the function of the mouse over action? I did try storing the current value of the cover, but presumably that's not a valid variable (as the manual says that Strings are valid variables).
Trizarro
Posts: 1
Joined: January 17th, 2014, 12:09 am

Re: NowPlaying plugin - Multiple Media Player Support

Post by Trizarro »

One question:

¿Will this plugin ever support jaangle?

Thanks :)
decode
Posts: 1
Joined: January 23rd, 2014, 12:52 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by decode »

ichbtm wrote:hi,
i worked on a mod that implement a squeezebox controler.
i think it's not really bullet proof but it works for me since december...
here is the files to add :
- PlayerSQBOX.cpp -> http://pastebin.com/wrbVCXym
- PlayerSQBOX.h -> http://pastebin.com/uQW17CTC
and below are the 2 modifications to do to "NowPlaying.cpp" :

Code: Select all

#include "PlayerWMP.h"
//START SQBOX mod
#include "PlayerSQBOX.h"
//END SQBOX mod

Code: Select all

		else if (_wcsicmp(L"WMP", str) == 0)
		{
			parent->player = CPlayerWMP::Create();
		}
//START SQBOX mod
		else if (_wcsicmp(L"SQBOX", str) == 0)
			{
				parent->playerPath = RmReadString(rm, L"PlayerPath", L"", TRUE);
				parent->player = CPlayerSQBOX::Create(parent->playerPath);
			}
//END SQBOX mod
		else
		{
The controller is used with a plugin measure as under :

Code: Select all

[MeasurePlayer]
Measure=Plugin
Plugin=NowPlaying.dll
; Set to AIMP, foobar2000, iTunes, MediaMonkey, MusicBee, Spotify, Winamp, WMP
PlayerName=SQBOX
;for squeezebox PlayerPath=server_ip:webport player (ex : PlayerPath=192.168.0.255:9000 receiver)
PlayerPath=192.168.0.255:9002 SqueezeBox Controller
i hope it will be of some interest :)
how is this working? i'm very interested in this as squeezebox is an awesome music-system!
please, please make that happen in nowplaying.dll! pleeeaze (with cats)!
User avatar
Schlayer
Posts: 4
Joined: September 7th, 2013, 7:34 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by Schlayer »

Could it be possible to add support for the Elpis app? I have been using Elpis for a long time now and I like it a lot better as a light pandora app than OpenPandora. I can't even seem to be able to run the latter program on my computer properly for some reason. If there could be even just monitoring support with NowPlaying for Elpis that would be great. Because it is a pandora app the only feasible controls would be as follows: Play, Pause, Skip, Open Elpis, Close Elpis, and Volume. The information available would potentially be Playing/Paused, Volume, Song title, Artist, and Album. Elpis can be controlled with "global media keys" if that option is selected so I'm positive there will be ways to add a skip control and a pause/play toggle at the very least.
User avatar
Schlayer
Posts: 4
Joined: September 7th, 2013, 7:34 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by Schlayer »

slightlyobsessive wrote: I have a MouseUpAction assigned to the Cover art, which works fine all the while music is playing. I'm using foobar, so it's fully supported via the plugin. However when the track finishes and the player stops, it seems that whatever value held by [MeasureCover] expires, and a left click with the mouse now brings up an error window ("this file does not have a program associated with it....")

Can anyone tell me if there's code that can be added to the measure and/or the meter such that it will store the last played cover (or in fact "now playing" of course) once the player has stopped, thus maintaining the function of the mouse over action? I did try storing the current value of the cover, but presumably that's not a valid variable (as the manual says that Strings are valid variables).
Interesting question. Looking at Soita's code it appears that the "default.png" image is substituted for "" so that when the song playing has no cover it displays this image. However, when the player stops it also displays this image. I bet using a bit of logical use of variables you could code in a workaround so that, for instance, you have a variable that always equals the name of the cover picture EXCEPT if the "state" measure ([mState] by default) is set to 'stopped', in which case it stays as what it most previously was, and the cover meter displays that variable's name instead of [mCover]. Let me know if that seems possible/you need any help.
Skymil
Posts: 24
Joined: July 19th, 2011, 9:44 am
Location: France

Re: NowPlaying plugin - Multiple Media Player Support

Post by Skymil »

The plugin seems to not work (anymore?) with Media Player Classic - Home Cinema. Is it because in the latest version of MPC-HC, "Send Now Playing information to MSN Messenger" has been replaced by "Display "Now Playing" information in Skype's mood message"?