It is currently October 3rd, 2024, 4:28 pm

NowPlaying plugin - Multiple Media Player Support

Share and get help with Plugins and Addons
windowns
Posts: 2
Joined: August 4th, 2011, 7:27 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by windowns »

Heyo, originally posted this in the Engima skin help forum, and then talked with Kaelri in the IRC channel. We did some troubleshooting and tried various things. Ultimately it was suggested that I post the issue over here.

The issue is that the image art is not displaying for me. I'm using WMP. We tried to embed the artwork into a song file and play it, but the artwork still didn't display. Also when i click on the image to "View Full Size" it actually just opens the Rainmeter program files directory. I even tried to use Zune.

I'll be ghosting in the IRC channel if you all need anything quickly. I'll be at the computer to try stuff during the week.

Forgot to mention, i'm on Win7 32 bit and WMP version is 12.0.7601.17514
poiru
Developer
Posts: 2873
Joined: April 17th, 2009, 12:18 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by poiru »

windowns wrote:Heyo, originally posted this in the Engima skin help forum, and then talked with Kaelri in the IRC channel. We did some troubleshooting and tried various things. Ultimately it was suggested that I post the issue over here.

The issue is that the image art is not displaying for me. I'm using WMP. We tried to embed the artwork into a song file and play it, but the artwork still didn't display. Also when i click on the image to "View Full Size" it actually just opens the Rainmeter program files directory. I even tried to use Zune.
Could you upload the file in question somewhere and PM the link?
TerraNola
Posts: 1
Joined: August 21st, 2011, 11:44 am

Re: NowPlaying plugin - Multiple Media Player Support

Post by TerraNola »

hi

i'm looking into writing a songbird addon to implement a CAD interface, for use in rainmeter.

since i can't seem to find info on the CAD api, i wanted to take a look at your vlc-libcad source as refernce, but i can't seem to find it?
on your google code theres only the already compiled dll? :uhuh:

*cheers*
poiru
Developer
Posts: 2873
Joined: April 17th, 2009, 12:18 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by poiru »

TerraNola wrote:hi

i'm looking into writing a songbird addon to implement a CAD interface, for use in rainmeter.

since i can't seem to find info on the CAD api, i wanted to take a look at your vlc-libcad source as refernce, but i can't seem to find it?
on your google code theres only the already compiled dll? :uhuh:
Hey,

I just uploaded the source for libcad: cad.c.

If you are going to write this in C/C++, here is a header with the contants: cad_sdk.h

The official CAD SDK is available here: cad-sdk-2.1.zip. For full compatibility with NowPlaying, I suggest you also implement the following messages (not listed in the CAD SDK, but implemented in the VLC libcad plugin linked above).

- IPC_PLAY (lParam = 100): Play when received
- IPC_PAUSE (lParam = 102): Pause when received
- IPC_SET_CALLBACK_HWND (lParam = 120, wParam = HWND): After Songbird receives this message, it should send all further notifications to the window specified by wParam.
- IPC_SHUTDOWN_NOTIFICATION (lParam = 129): Send this to CAD when closing Songbird. When you receive this message, you should stop sending notifications (until you receive a IPC_SET_CALLBACK_HWND message)

If possible, you should register the "CD Art Display IPC Class" class and create a window named "Songbird" to handle the IPC messages. This will ease the initial detection for NowPlaying.

To resolve issues with Songbird running as admin and Rainmeter (or CAD) as standard user (or vice versa), you need to use something like this (also implemented in the VLC libcad plugin):

Code: Select all

// g_Window is handle to window that handles the IPC messages
	// Need to remove WM_USER from filtered messages
	HMODULE hUser32 = LoadLibrary(L"user32.dll");
	if (hUser32)
	{
		// Try ChangeWindowMessageFilterEx first (Win7+)
		FPCHANGEWINDOWMESSAGEFILTEREX ChangeWindowMessageFilterEx = (FPCHANGEWINDOWMESSAGEFILTEREX)GetProcAddress(hUser32, "ChangeWindowMessageFilterEx");
		if (ChangeWindowMessageFilterEx)
		{
			ChangeWindowMessageFilterEx(g_Window, WM_USER, MSGFLT_ALLOW, NULL);
		}
		else
		{
			// Try ChangeWindowMessageFilter (Vista)
			FPCHANGEWINDOWMESSAGEFILTER ChangeWindowMessageFilter = (FPCHANGEWINDOWMESSAGEFILTER)GetProcAddress(hUser32, "ChangeWindowMessageFilter");
			if (ChangeWindowMessageFilter)
			{
				ChangeWindowMessageFilter(WM_USER, MSGFLT_ALLOW);
			}
		}

		FreeLibrary(hUser32);
	}
Oh, and since VLC doesn't support ratings, I send 0 back to NowPlaying/CAD when receiving IPC_SET_RATING (line 464). You should of course handle this message appropriately (and not PostMessage()/SendMessage() anything back).

Feel free to contact for testing or more info :)
poiru
Developer
Posts: 2873
Joined: April 17th, 2009, 12:18 pm

foo_rainmeter.dll update (1.0.2)

Post by poiru »

foo_rainmeter.dll 1.0.2 for foobar2000 is available from here.

Change(s):
- Fixed that track information isn't updated when playing a (radio) stream
Skymil
Posts: 24
Joined: July 19th, 2011, 9:44 am
Location: France

Re: NowPlaying plugin - Multiple Media Player Support

Post by Skymil »

Hello poiru,

I'm using a skin which plays a webradio and displays informations such as the artist, the title and the cover of the song currently playing. I would like to improve it and displays the lyrics. Is there a mean to do this using your plugin? Something like that could really help me :

Code: Select all

[mPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=
PlayerType=NOPLAYER
PlayerPath=
SubstituteArtist=MeasureArtist
SubstituteTitle=MeasureTitle
DisableLeadingZero=0

[mLyrics]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=LYRICS
Substitute="":"N\A"

[Lyrics]
Meter=STRING
MeasureName=mLyrics
X=10
Y=150
W=390
H=400
SolidColor=000000EE
FontFace=Trebuchet MS
FontColor=FFFFFFFF
AntiAlias=1
ClipString=1
Text="%1"
Thanks in advance and sorry for my bad English. And if someone has any other simple way to do this, I'd be very glad to read it.
poiru
Developer
Posts: 2873
Joined: April 17th, 2009, 12:18 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by poiru »

Skymil wrote:I'm using a skin which plays a webradio and displays informations such as the artist, the title and the cover of the song currently playing. I would like to improve it and displays the lyrics. Is there a mean to do this using your plugin? Something like that could really help me :
...
Thanks in advance and sorry for my bad English. And if someone has any other simple way to do this, I'd be very glad to read it.
Unfortunately NowPlaying must be used with a supported player to display any data. What player do you use for the webradio?
Skymil
Posts: 24
Joined: July 19th, 2011, 9:44 am
Location: France

Re: NowPlaying plugin - Multiple Media Player Support

Post by Skymil »

Thanks for your quick answer!

It's VLC. But it's only a streaming mp3 without any information (http://listen.radionomy.com/tsumugi.m3u). I'm recovering these informations from a website (http://api.radionomy.com/currentsong.cfm?radiouid=4a0eb5be-db25-4430-b0bc-268cdc458621&type=xml&previous=yes&next=yes&cover=yes&callmeback=yes&defaultcover=yes&streamurl=yes&size=).

EDIT:
Actually VLC DOES have informations in "Now Playing" (in Interface>Media Information). But I can't recover them. I tried ARTIST (nothing), TITLE (Tsumugi, Radio rock et geek), ALBUM (nothing) and FILE (http://listen.radionomy.com/tsumugi).
poiru
Developer
Posts: 2873
Joined: April 17th, 2009, 12:18 pm

Re: NowPlaying plugin - Multiple Media Player Support

Post by poiru »

Skymil wrote:It's VLC. But it's only a streaming mp3 without any information (http://listen.radionomy.com/tsumugi.m3u). I'm recovering these informations from a website (http://api.radionomy.com/currentsong.cfm?radiouid=4a0eb5be-db25-4430-b0bc-268cdc458621&type=xml&previous=yes&next=yes&cover=yes&callmeback=yes&defaultcover=yes&streamurl=yes&size=).

EDIT:
Actually VLC DOES have informations in "Now Playing" (in Interface>Media Information). But I can't recover them. I tried ARTIST (nothing), TITLE (Tsumugi, Radio rock et geek), ALBUM (nothing) and FILE (http://listen.radionomy.com/tsumugi).
NowPlaying fully supports VLC when used in combination with the libcad plugin for VLC :) More info here.
Skymil
Posts: 24
Joined: July 19th, 2011, 9:44 am
Location: France

Re: NowPlaying plugin - Multiple Media Player Support

Post by Skymil »

Yeah and it's great! I said that I have used it. It works but doesn't recover the information needed for the lyrics (which is in "Now Playing"). It only recovers these informations:
TITLE -> Tsumugi, Radio rock et geek
FILE -> http://listen.radionomy.com/tsumugi
The artist and the title are in the section "Now Playing", separated by a dash (like that : R.E.M. - Losing My Religion).