It is currently March 28th, 2024, 11:03 am

Spotify Plugin Released! Now with less bugs!

Plugins and Addons popular with the Community
mjr
Posts: 1
Joined: May 19th, 2018, 11:49 pm

Re: Spotify Plugin Released! Now with less bugs!

Post by mjr »

I tried fixing a very basic skin and got the strings working alright but I cannot use the controls anymore. Here is the error message whenever I try to use the controls

Code: Select all

!CommandMeasure: Not supported (Soita\Soita_fix2.ini - [mPlayer])
Here's the skin itself. Can someone point me where the problem is

Code: Select all

[Rainmeter]
Author=mjr
Update=1000
DynamicWindowSize=1

[mPlayer]
Measure=Plugin
Plugin=SpotifyPlugin
Type=Playing

[mTrack]
Measure=Plugin
Plugin=SpotifyPlugin
Type=TrackName

[mArtist]
Measure=Plugin
Plugin=SpotifyPlugin
Type=ArtistName

[Track]
Meter=String
MeasureName=mTrack
x=10
Y=10
FontFace=Courier New
FontWeight=700
FontColor=FFFFFFFF
SolidColor=255,0,0,255
AntiAlias=1
ClipString=2
Text="%1"
LeftMouseUpAction=[!CommandMeasure "mPlayer" "next"]
RightMouseUpAction=[!CommandMeasure "mPlayer" "previous"]

[Artist]
Meter=String
MeasureName=mArtist
x=10
Y=5R
FontFace=Courier New
FontWeight=700
FontColor=FFFFFFFF
SolidColor=255,0,0,255
AntiAlias=1
ClipString=2
Text="%1"
LeftMouseUpAction=[!CommandMeasure "mPlayer" "playpause"]
^LeveLUP^
Posts: 1
Joined: May 25th, 2018, 11:17 pm

Re: Spotify Plugin Released! Now with less bugs!

Post by ^LeveLUP^ »

Not sure if this has been suggested before but I've noticed in (at least) Windows 10 using keyboard volume keys gets the album artwork and information displayed (see screenshot) https://prnt.sc/jmpqyg

Is it possible for the .dll to hook into this process and use this to grab all the necessary information? As it seems that this is consistent (although it lacks compatibility with older versions of windows potentially and other Operating systems)
User avatar
tjhrulz
Developer
Posts: 267
Joined: October 13th, 2016, 1:28 am
Location: Earth
Contact:

Re: Spotify Plugin Released! Now with less bugs!

Post by tjhrulz »

^LeveLUP^ wrote:Not sure if this has been suggested before but I've noticed in (at least) Windows 10 using keyboard volume keys gets the album artwork and information displayed (see screenshot) https://prnt.sc/jmpqyg

Is it possible for the .dll to hook into this process and use this to grab all the necessary information? As it seems that this is consistent (although it lacks compatibility with older versions of windows potentially and other Operating systems)
I have looked into it before, there is no easy way to do it as that data is supposed to be only accessible to the program that put it there. Which one is "displayed" on the volume OSD is up to windows.

The hacky way I had engineered was to internally grab the volume OSD every time it is displayed and OCR the image to get the info but that is a terrible idea.

The hacky workaround we came up with recently was either to iterate through every internal window, get their ID, get their info using an undocumented function. Then deciding on our own which is the best one to display. This would then need to be done at least twice a second (I would probably do it 10 times) so the data could be up to date. This would probably end up being too expensive to be useful but I may look into it, especially since I need to fix NowPlaying's Spotify support anyways.
vitaly
Posts: 1
Joined: May 27th, 2018, 6:10 am

Re: Spotify Plugin Released! Now with less bugs!

Post by vitaly »

A solution to monstercat's. Open the folder Documents> Rainmeter> Skins> monstercat's-visualizer> @Resources> include. Open the <MeasureSpotify.inc> file in Notepad. Under [MeasureState] Playername = Spotify, change to Playername = NowPlaying, close, and save. Refresh the cover. Returns the functionality of the control buttons.
TRMTZD
Posts: 5
Joined: May 27th, 2018, 2:05 pm

Re: Spotify Plugin Released! Now with less bugs!

Post by TRMTZD »

vitaly wrote:A solution to monstercat's. Open the folder Documents> Rainmeter> Skins> monstercat's-visualizer> @Resources> include. Open the <MeasureSpotify.inc> file in Notepad. Under [MeasureState] Playername = Spotify, change to Playername = NowPlaying, close, and save. Refresh the cover. Returns the functionality of the control buttons.
Oh that actually worked thanks!
User avatar
tjhrulz
Developer
Posts: 267
Joined: October 13th, 2016, 1:28 am
Location: Earth
Contact:

Re: Spotify Plugin Released! Now with less bugs!

Post by tjhrulz »

TRMTZD wrote:Oh that actually worked thanks!
Yeah if you are curious why it works to copy paste my explanation from elsewhere:

You can put any gibberish you want there :p as you actually stumbled upon an oddity in Rainmeter, see Rainmeter's NowPlaying plugin has a mode for an old program called Windows Live Messenger (Saying that makes me feel old) back in the day music players would forward their media status to that. So thus as a general catch all Rainmeter added support for that protocol and then sent the player commands (Which are just keyboard commands) globally (which works a lot of the time since you normally only have one media player open at a time)

See here is the thing, WLM is what Rainmeter reverts to when the player type is not recognized. Even though Spotify does not send info to WLM most people use the SpotifyPlugin for all the track info. All that most people use NowPlaying for is for the media controls. So you have only Spotify open it works fine.
TRMTZD
Posts: 5
Joined: May 27th, 2018, 2:05 pm

Re: Spotify Plugin Released! Now with less bugs!

Post by TRMTZD »

tjhrulz wrote:Yeah if you are curious why it works to copy paste my explanation from elsewhere:

You can put any gibberish you want there :p as you actually stumbled upon an oddity in Rainmeter, see Rainmeter's NowPlaying plugin has a mode for an old program called Windows Live Messenger (Saying that makes me feel old) back in the day music players would forward their media status to that. So thus as a general catch all Rainmeter added support for that protocol and then sent the player commands (Which are just keyboard commands) globally (which works a lot of the time since you normally only have one media player open at a time)

See here is the thing, WLM is what Rainmeter reverts to when the player type is not recognized. Even though Spotify does not send info to WLM most people use the SpotifyPlugin for all the track info. All that most people use NowPlaying for is for the media controls. So you have only Spotify open it works fine.
Ahh that makes sense. So I've essentially told the plugin to use my pc's global music controls courtesy of WLM instead of Spotify's internal music controls which currently doesn't work inside of the plugin. Right?
User avatar
tjhrulz
Developer
Posts: 267
Joined: October 13th, 2016, 1:28 am
Location: Earth
Contact:

Re: Spotify Plugin Released! Now with less bugs!

Post by tjhrulz »

TRMTZD wrote:Ahh that makes sense. So I've essentially told the plugin to use my pc's global music controls courtesy of WLM instead of Spotify's internal music controls which currently doesn't work inside of the plugin. Right?
Dead on.
I also have a hotfix on my desk that I will be testing in the morning that should hopefully bring Spotify back to full working order and should be be included in the next Rainmeter beta.
User avatar
dudebaker
Posts: 55
Joined: July 17th, 2016, 4:42 pm
Location: Austria

Re: Spotify Plugin Released! Now with less bugs!

Post by dudebaker »

The update 2.1.5 seems to fix the previous, next and pause bangs.
The setposition bang does not work, at least with free users cause I have no premium (Log: Error 403: Not available for the current user).
The playpause bang pauses but instead of starting the track again it jumps to the next track.
The same goes with the play bang.

So my fix for this in the meantime - use the MediaKey measure for the commands and this plugin for the metadata, in this case there have not two MetaData-Plugins to be loaded, maybe uses a little less ressource. :)
User avatar
.raptor
Posts: 220
Joined: April 3rd, 2013, 11:03 pm
Location: Norway

Re: Spotify Plugin Released! Now with less bugs!

Post by .raptor »

dudebaker wrote:The update 2.1.5 seems to fix the previous, next and pause bangs.
The setposition bang does not work, at least with free users cause I have no premium (Log: Error 403: Not available for the current user).
The playpause bang pauses but instead of starting the track again it jumps to the next track.
The same goes with the play bang.

So my fix for this in the meantime - use the MediaKey measure for the commands and this plugin for the metadata, in this case there have not two MetaData-Plugins to be loaded, maybe uses a little less ressource. :)
Previous, next, play, pause and playpause all work just fine on my end. Tested on both free and premium accounts. It will throw a 403 error first, but it should fall back to using local keypress commands instead. Seeking is not available to free accounts. This is a limitation from Spotify's API.
Post Reply