It is currently May 2nd, 2024, 1:57 am

Spotify Plugin Released! Now with less bugs!

Plugins and Addons popular with the Community
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Re: Spotify Plugin Released! Now with less bugs!

Post by ms310 »

mr.derek wrote:Glad it's working now man! =D

I'm attaching my latest copy of the colour EQ skin with 173 bars. Unfortunately it won't work very well with the default La Compagnie des Ombres skin, because this one uses recursion to create the EQ bars - which is why you can have as few or as many as your CPU can handle =)

I've also added a few colour playlists in there LewaBolt. The colours are selected through the variable:

ColorPlaylist=DerekColorPlaylist

And the corresponding playlist:

Code: Select all

[DerekColorPlaylist]
Measure=String

Shuffle=0

1=39,174,96|46,204,113
2=41,12,185|52,152,219
3=142,68,173|155,89,182
4=243,156,18|241,196,15
5=211,84,0|230,126,34
6=192,57,43|231,76,60
These are RGB values of the colours:



In 1=39,174,96|46,204,113 for example, 39,174,96 is dark green, the next set is light green and so on. The sets on the left are the bar colours at normal volume, the right number are colours at loud volumes.

Shuffle is set to 0 so it cycles through the colours sequentially - set to 1 to make random.

I added another playlist which is just 3 colours to further illustrate; just use:

ColorPlaylist=BluePurplePinkPlaylist
This is just awesome - thank you so much!

I was wondering if you would consider consolodating the Play/Pause button into a single button that change to PAUSE while PLAYING and PLAY while PAUSED? I just don't have the skill to do that. I have added the progress, track time and percent from the Soita code but I cannot get the images to work the way I want.

I also have a question - does the Spotify API allow us to hook the Thumbs UP/DOWN? I often listen to the radio function and would like to be able to interact with this skin instead of the main app to influence the radio.

Thank you everyone for making my desktop much cooler !!!!
mr.derek
Posts: 22
Joined: March 26th, 2015, 10:13 am

Re: Spotify Plugin Released! Now with less bugs!

Post by mr.derek »

Hey thanks man! I'm new to Rainmeter myself just a few days, but love what it can do and the community is very helpful! =)

I'm attaching an updated version which includes a consolidated play/pause button and I added a background image (which you can change/replace/delete) and fixed the EQ position (bit of a hack - added transparent pixel right before the first EQ bar position as they're all set to relative positioning)

Here's the bit to change the buttons:

Code: Select all

[MeasureTrackState]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=Playing
Substitute="0":"#@#\Images\play.png","1":"#@#\Images\Pause.png","2":"#@#\Images\play.png"

[Play]
Meter=BUTTON
ButtonImage=[MeasureTrackState]
DynamicVariables=1
X=110
Y=105
Padding=5,0,0,0
BackgroundMode=2
SolidColor=0, 0, 0, 1
AntiAlias=1
Group=Player
LeftMouseDownAction=[!CommandMeasure "MeasurePlayer" "Play"][!Update]
Hope this helps! =)

EDIT - I converted the buttons from images to buttons now (PNG with 3 states) - the zip file and code have been updated
You do not have the required permissions to view the files attached to this post.
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Re: Spotify Plugin Released! Now with less bugs!

Post by ms310 »

mr.derek wrote:Hey thanks man! I'm new to Rainmeter myself just a few days, but love what it can do and the community is very helpful! =)

I'm attaching an updated version which includes a consolidated play/pause button and I added a background image (which you can change/replace/delete) and fixed the EQ position (bit of a hack - added transparent pixel right before the first EQ bar position as they're all set to relative positioning)

Here's the bit to change the buttons:

Code: Select all

[MeasureTrackState]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=Playing
Substitute="0":"#@#\Images\play.png","1":"#@#\Images\Pause.png","2":"#@#\Images\play.png"

[Play]
Meter=BUTTON
ButtonImage=[MeasureTrackState]
DynamicVariables=1
X=110
Y=105
Padding=5,0,0,0
BackgroundMode=2
SolidColor=0, 0, 0, 1
AntiAlias=1
Group=Player
LeftMouseDownAction=[!CommandMeasure "MeasurePlayer" "Play"][!Update]
Hope this helps! =)

EDIT - I converted the buttons from images to buttons now (PNG with 3 states) - the zip file and code have been updated
Thanks very much! Very cool!

What is the "math" behind the number of bars? I would like them to be about 5 pixels thick - so less of them. What formula would I use to make sure they fit in the same boundaries as you currently have?
mr.derek
Posts: 22
Joined: March 26th, 2015, 10:13 am

Re: Spotify Plugin Released! Now with less bugs!

Post by mr.derek »

I'm actually really bad at maths, lol, someone else here might be better at giving you the formula. I think it would have something to do with ratios...

So in the code above the width of the progress bar is 343 pixels, which determines the max size of the EQ. I thought if the width was 5 pixels you would just divide the current 173 by 5 - but when I tried that it was too few bars. So I just eyeballed it and it turned out to be 58 bars to fit correctly.

Make sure you change the following in the Variables.inc:

Code: Select all

BarWidth=5
Bands=58
BandsOut=58
Hope it works for you! =)
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Re: Spotify Plugin Released! Now with less bugs!

Post by ms310 »

mr.derek wrote:I'm actually really bad at maths, lol, someone else here might be better at giving you the formula. I think it would have something to do with ratios...

So in the code above the width of the progress bar is 343 pixels, which determines the max size of the EQ. I thought if the width was 5 pixels you would just divide the current 173 by 5 - but when I tried that it was too few bars. So I just eyeballed it and it turned out to be 58 bars to fit correctly.

Make sure you change the following in the Variables.inc:

Code: Select all

BarWidth=5
Bands=58
BandsOut=58
Hope it works for you! =)
Cheers. This makes sense now that I think about it. Bar Width=5 + 1 for the gap. So 343 / 6 = 57.1167 - close enough to 58!

Another question (sorry!) when I change the BAR HEIGHT the alignment is WAY out of whack - the visualizer moves DOWN. I cannot figure out how to change the height of the visualizer and have it stay aligned.


Thanks again!
mr.derek
Posts: 22
Joined: March 26th, 2015, 10:13 am

Re: Spotify Plugin Released! Now with less bugs!

Post by mr.derek »

Ah! Thanks for that! Yes that makes much more sense now about the bar width!

Unfortunately the height stuff was hardcoded in from the previous skin but it's a pretty quick fix - as it was set to have bar height at 50 - just subtract 50 from the Y values for the displayed items and then add (#BarHeight#+1) instead of the previous 51, for example.

Here are the ones I changed like that, and it should be working now for any height:

Code: Select all

[Background]
Meter=IMAGE
SolidColor=23,38,55,200
X=0
Y=0
W=352
H=(#BarHeight#+92)



[MeterProgressBar]
Meter=Bar
MeasureName=MeasureProgress
X=5
Y=(#BarHeight#+1)
W=343
H=2
;Padding=5,0,0,0
BarColor=#BarColor#
SolidColor=0,0,0,75
BarOrientation=HORIZONTAL
Group=Player

[MeterCover]
Meter=Image
MeasureName=MeasureCover
X=6
Y=(#BarHeight#+9)
W=78
H=78
;Padding=5,0,0,0
ImageName="%1"
SolidColor=0,0,0,75
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "OpenPlayer"]
DynamicWindowSize=1
Group=Player

[MeterTitle]
Meter=STRING
MeasureName=MeasureTitle
X=80
Y=(#BarHeight#+9)
W=300
H=20
Padding=5,0,0,0
FontColor=255,255,255
FontSize=18
StringAlign=Left
StringCase=Upper
FontFace=Gravity
ClipString=1
Text=%1
AntiALias=1
DynamicWindowSize=1 

[MeterArtist]
Meter=STRING
MeasureName=MeasureArtist
X=81
Y=(#BarHeight#+33)
W=300
H=20
Padding=5,0,0,0
FontColor=255,255,255,99
FontSize=14
StringAlign=Left
StringCase=Upper
FontFace=Gravity
ClipString=1
Text=%1
AntiALias=1

[Background cover]
Meter=Image
ImageName=#@#\Images\bg.png
X=5
Y=(#BarHeight#+8)
;Padding=5,0,0,0
Group=Player

[Prev]
Meter=BUTTON
ButtonImage=#@#\Images\prev.png
X=85
Y=(#BarHeight#+55)
Padding=5,0,0,0
BackgroundMode=2
SolidColor=0, 0, 0, 1
Group=Player
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Previous"]

[Play]
Meter=BUTTON
ButtonImage=[MeasureTrackState]
DynamicVariables=1
X=110
Y=(#BarHeight#+55)
Padding=5,0,0,0
BackgroundMode=2
SolidColor=0, 0, 0, 1
AntiAlias=1
Group=Player
LeftMouseDownAction=[!CommandMeasure "MeasurePlayer" "Play"][!Update]

[Next]
Meter=BUTTON
ButtonImage=#@#\Images\next.png
X=135
Y=(#BarHeight#+55)
Padding=5,0,0,0
BackgroundMode=2
SolidColor=0, 0, 0, 1
Group=Player
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Next"]

You could probably do it with the padding setting too, but I noticed some strange behaviour with the shadows of elements when using the padding variable. Safest in this case to use Y as the quickest fix. Hope it helps!
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Re: Spotify Plugin Released! Now with less bugs!

Post by ms310 »

mr.derek wrote:Ah! Thanks for that! Yes that makes much more sense now about the bar width!

Unfortunately the height stuff was hardcoded in from the previous skin but it's a pretty quick fix - as it was set to have bar height at 50 - just subtract 50 from the Y values for the displayed items and then add (#BarHeight#+1) instead of the previous 51, for example.

Here are the ones I changed like that, and it should be working now for any height:

Code: Select all

[Background]
Meter=IMAGE
SolidColor=23,38,55,200
X=0
Y=0
W=352
H=(#BarHeight#+92)



[MeterProgressBar]
Meter=Bar
MeasureName=MeasureProgress
X=5
Y=(#BarHeight#+1)
W=343
H=2
;Padding=5,0,0,0
BarColor=#BarColor#
SolidColor=0,0,0,75
BarOrientation=HORIZONTAL
Group=Player

[MeterCover]
Meter=Image
MeasureName=MeasureCover
X=6
Y=(#BarHeight#+9)
W=78
H=78
;Padding=5,0,0,0
ImageName="%1"
SolidColor=0,0,0,75
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "OpenPlayer"]
DynamicWindowSize=1
Group=Player

[MeterTitle]
Meter=STRING
MeasureName=MeasureTitle
X=80
Y=(#BarHeight#+9)
W=300
H=20
Padding=5,0,0,0
FontColor=255,255,255
FontSize=18
StringAlign=Left
StringCase=Upper
FontFace=Gravity
ClipString=1
Text=%1
AntiALias=1
DynamicWindowSize=1 

[MeterArtist]
Meter=STRING
MeasureName=MeasureArtist
X=81
Y=(#BarHeight#+33)
W=300
H=20
Padding=5,0,0,0
FontColor=255,255,255,99
FontSize=14
StringAlign=Left
StringCase=Upper
FontFace=Gravity
ClipString=1
Text=%1
AntiALias=1

[Background cover]
Meter=Image
ImageName=#@#\Images\bg.png
X=5
Y=(#BarHeight#+8)
;Padding=5,0,0,0
Group=Player

[Prev]
Meter=BUTTON
ButtonImage=#@#\Images\prev.png
X=85
Y=(#BarHeight#+55)
Padding=5,0,0,0
BackgroundMode=2
SolidColor=0, 0, 0, 1
Group=Player
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Previous"]

[Play]
Meter=BUTTON
ButtonImage=[MeasureTrackState]
DynamicVariables=1
X=110
Y=(#BarHeight#+55)
Padding=5,0,0,0
BackgroundMode=2
SolidColor=0, 0, 0, 1
AntiAlias=1
Group=Player
LeftMouseDownAction=[!CommandMeasure "MeasurePlayer" "Play"][!Update]

[Next]
Meter=BUTTON
ButtonImage=#@#\Images\next.png
X=135
Y=(#BarHeight#+55)
Padding=5,0,0,0
BackgroundMode=2
SolidColor=0, 0, 0, 1
Group=Player
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Next"]

You could probably do it with the padding setting too, but I noticed some strange behaviour with the shadows of elements when using the padding variable. Safest in this case to use Y as the quickest fix. Hope it helps!
Thanks a bunch - that worked perfectly.

I've been experimenting the LUA marque plugin someone made for the song name. I can get it to work but you need to set the update to something besides 0 or the text just FLIES by which defeats the purpose. Not sure yet what I want to do for long strings. Maybe I'll just make the text smaller.

Anyway - cheers - I have learned a bunch!
RiliafCZ
Posts: 1
Joined: April 4th, 2015, 10:38 am

Re: Spotify Plugin Released! Now with less bugs!

Post by RiliafCZ »

Hi .raptor,
I just wanted to report few issues I've been dealing with but seems to be above my skills of coding (If it is solved just redirect me to proper threat - I've been searching for solution, but unlucky to find any):

First: It seems that after I restart Spotify and start song again the progress and position measures aren't updating for a while (10 to 30 seconds). Anything I can do with my skin (include Refresh and Update) doesn't solve it. I've been looking into others skins and it seems they have the same problem.

Second: I've been using the command: DisableLeadingZero=1 but it isn't working for Spotify so I'm just checking if it is implemented in your plugin.

I've included my skin, which I'm talking about below if you needed.
You do not have the required permissions to view the files attached to this post.
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Re: Spotify Plugin Released! Now with less bugs!

Post by ms310 »

mr.derek wrote:You could probably do it with the padding setting too, but I noticed some strange behaviour with the shadows of elements when using the padding variable. Safest in this case to use Y as the quickest fix. Hope it helps!
Hi Mr. Derek - thanks so much for all of your help.

I have a new challenge... I would like to merge the following two skins:

http://rabra.deviantart.com/ and http://madhoe.deviantart.com/art/VisBubble-for-Rainmeter-488601501

I laid them on top of each other but you cannot get to the settings of the player when the circular visualizer is on top of it.

I was able to get the player to work with Spotify thanks to all of your help. The only ONE thing that didn't work - the player does not fade away when Spotify is closed. To be honest I think it would be SLICK if the player just fades into the clockface.

Anyway - if you are up for it I figured I would ask. I will have a hand at hacking it together. They really work well togther visually - the player has round album art and the visuallizer is also round. I found if you set the radius of the visualizer to 80 it fits nicely.
User avatar
SquaredCircle
Posts: 24
Joined: April 23rd, 2015, 11:36 pm

Re: Spotify Plugin Released!

Post by SquaredCircle »

Hi .raptor. I registered just to thank you for developing a great plugin.

EDIT: I also had a question about a bug I was experiencing, but I found a fix for it. So thanks again for this plugin. It's great!
Last edited by SquaredCircle on April 25th, 2015, 11:39 am, edited 1 time in total.