It is currently April 25th, 2024, 3:18 pm

Spotify Plugin Released! Now with less bugs!

Plugins and Addons popular with the Community
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 »

JoshuaVL1988 wrote:Hello .raptor. I need help with a skin. I'm trying to get this skin to work with the Spotify Plugin but it keeps crashing rainmeter when I do (sadly I know little to nothing about scripting). I've been trying for quite a while now and can't seem to figure it out. Even the creator of the skin was unable to figure it out (he had been away from creating rmskins for quite a while before attempting). I will attach a .zip file with the rmskin in it. Can you please edit the SpotfyPlugin into it?

[removed .rmskin]

To be prefectly honest i have no idea how rmskin works, but if i didnt misunderstand anything this should work. Keep in mind i haven't tested it.
Last edited by jsmorley on July 28th, 2015, 4:28 pm, edited 2 times in total.
Reason: Removed broken .rmskin
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Spotify Plugin Released! Now with less bugs!

Post by jsmorley »

No, that won't work. You can't just "edit" the .rmksin, but must create it from scratch with the Skin Packager, from the skins in the Rainmeter\Skins folder, and 32bit / 64bit versions of the plugin that you include.
Sober_1.0.rmskin
While in a sense a .rmskin is a "renamed .zip file", it isn't just that. There are protections built into the process to prevent someone from just renaming and unzipping a .rmskin, modifying it with god-knows-what, zipping it back up and renaming it back to .rmskin. That will be rejected by Rainmeter when you try to install it.
You do not have the required permissions to view the files attached to this post.
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 »

jsmorley wrote:While in a sense a .rmskin is a "renamed .zip file", it isn't just that.
Well there we go, guess i should stick to writing plugins. Thanks a lot jsmorley :thumbup:
JoshuaVL1988
Posts: 37
Joined: April 25th, 2015, 10:41 am

Re: Spotify Plugin Released! Now with less bugs!

Post by JoshuaVL1988 »

jsmorley wrote:No, that won't work. You can't just "edit" the .rmksin, but must create it from scratch with the Skin Packager, from the skins in the Rainmeter\Skins folder, and 32bit / 64bit versions of the plugin that you include.
Sober_1.0.rmskin
While in a sense a .rmskin is a "renamed .zip file", it isn't just that. There are protections built into the process to prevent someone from just renaming and unzipping a .rmskin, modifying it with god-knows-what, zipping it back up and renaming it back to .rmskin. That will be rejected by Rainmeter when you try to install it.

Isn't it possible to just edit the .ini within it to allow the Spotify Plugin to work? All I've managed to get done is to get the timer to show up and the album, but with a few slight errors. The album/track name shows up as N/A and the timer shows as 00:00 when not playing and simply the length of the song when a song is playing. Heres the .ini for the green skin in it, the only difference between skins is the color.
[Rainmeter]
Author=SierraDesign
Update=250

[Metadata]
Name=Sober Green
Description=Simple sunken music player.
Version=1.0

[variables]
;CHANGE YOUR PLAYER HERE!
player=Spotify

[Back]
Meter=IMAGE
ImageName=#@#Green\Background.png
X=0
Y=0

[mPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#player#
PlayerType=TITLE
PlayerPath=
DisableLeadingZero=0
Substitute="":"N\A"

[mArtist]
Measure=Plugin
Plugin=SpotifyPlugin.dll
PlayerName=[mPlayer]
PlayerType=ARTIST
Substitute="":""

[mAlbum]
Measure=Plugin
Plugin=SpotifyPlugin.dll
PlayerName=[mPlayer]
PlayerType=ALBUM
Substitute="":"N\A"

[mPosition]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=POSITION

[mDuration]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=DURATION

[mProgress]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=PROGRESS

[mRating]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=RATING

[mStateButton]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=STATE
Substitute="0":"Play.png","1":"Pause.png","2":"Play.png"

[mStateButton1]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=STATE

[mVolume]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=VOLUME


[Track]
Meter=STRING
MeasureName=mPlayer
FontFace=Calibri
FontColor=180,180,180
X=40
Y=7
W=215
H=18
AntiAlias=1
FontSize=11
ClipString=1
StringEffect=Shadow
FontEffectColor=0,0,0,200


[Artist]
Meter=STRING
MeasureName=mArtist
FontFace=Calibri
FontColor=150,150,150
FontSize=8
X=40
Y=23
W=185
H=16
AntiAlias=1
ClipString=1
StringCase=Upper
StringEffect=Shadow
FontEffectColor=0,0,0,200



[Play]
Meter=BUTTON
ButtonImage=[mStateButton]
X=280
Y=15
LeftMouseUpAction=!Execute [!RainmeterPluginBang "mPlayer PlayPause"][!RainmeterRefresh]
DynamicVariables=1

[ProgressBar]
Meter=BAR
MeasureName=mProgress
BarImage=#@#Green\Progress.png
X=0
Y=18
BarOrientation=HORIZONTAL
---EDIT---

I tried the version you posted, it didn't have the Spotify Plugin edited into the .ini, so i did that editing. Same result as before. Album/Track title still shows up as N/A and timer is also no different. The rest of the features of the skin still didn't show up either. Also, I have 64 bit rainmeter and no rainmeter folder in the Program Files x86 folder to put the 32 bit plugin into for the packager to use when trying to create it from scratch like you mentioned. Hopefully this gets figured ou soon because this skin would be a great spotify player if it could be made to work with the Spotify Plugin.
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 »

Editing skins
I will not edit any more skins, since the documentation to do so can be found here, here and here. For any new questions regarding this, i will only redirect to this post, incomplete as it might be.

Since the easiest way to learn this is by editing an already existing skin, I assume we already have a skin for the NowPlaying plugin. Example snippet below.

Code: Select all

[mPosition]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=Spotify
PlayerType=POSITION
We can see that the measure is the Plugin type, info here. The documentation says "Plugins have their own specific options that must be placed in the measure section. For more information, refer to the Plugins entry for each.". For the NowPlaying plugin, that would be here. We can see that both PlayerName and PlayerType is options connected to NowPlaying, so we can remove those. We are also switching to SpotifyPlugin, so we edit the "Plugin=" as well.

Code: Select all

[mPosition]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Unfortunately it wont just work like this. We have to look up the documentation for the plugin, that can be found on the first page of this thread. Seeing it now, i realize it might not be the best documentation around, so an update is probably coming. Either way, we can figure out from the two samples there that "Type" seems to be the correct option. In this case we wanted the position to show, and luckily for us "Position" is an option.

Code: Select all

[mPosition]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=Position
Repeat this process for all the measures you want changed.

Hope this clears things up. :)
Last edited by .raptor on August 14th, 2015, 7:06 pm, edited 2 times in total.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Spotify Plugin Released! Now with less bugs!

Post by jsmorley »

Actually, 3rd-party plugins should not go in Program Files/Rainmeter/Plugins. That is where the plugins that ship with Rainmeter are, and if you uninstall and re-install Rainmeter, you will lose any 3rd-party plugins that you put there.

Unless you are running Rainmeter in portable mode, plugins should be put in:

C:\Users\YourName\AppData\Roaming\Rainmeter\Plugins
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 »

jsmorley wrote:Actually, 3rd-party plugins should not go in Program Files/Rainmeter/Plugins. That is where the plugins that ship with Rainmeter are, and if you uninstall and re-install Rainmeter, you will lose any 3rd-party plugins that you put there.

Unless you are running Rainmeter in portable mode, plugins should be put in:

C:\Users\YourName\AppData\Roaming\Rainmeter\Plugins
To be perfectly honest I learned this quite a while ago, but since i originally asked people to put it in program files I had some issues when trying to switch. Can't really remember what the issue was at the time, but since you are here, I would love to get some things clarified.

Does any of the locations get preferred if there is a copy of the same plugin in both? And if so, is that regardless of plugin version?

Guess this is kind of the same question, but if i uploaded a .rmskin with the plugin, would the new install get priority over the old one as long as I increment the version number? (For users that installed in program files, as well as in appdata)
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Spotify Plugin Released! Now with less bugs!

Post by jsmorley »

If a 3rd-party plugin is in both places, then the one in APPDATA will get preference.

As to versions, that is a bit of a problem today. The skin installer doesn't even try to reconcile versions, and will just happily replace whatever is in APPDATA with whatever is in the .rmskin. That can lead to an "old" version replacing a "new" one.

We are looking at improving that, but in the meantime, the best bet I think is to create a simple "example skin" that uses your plugin, and turn that into a .rmskin. That .rmskin should be kept up to date with any changes / versions you make to the plugin, and kept prominently with your documentation. Folks should be reminded to check the version number of the plugin in About / Plugins in Rainmeter any time they install a skin that uses your plugin, and get that .rmskin and install it if there is a mismatch. That will ensure they have the latest version from you.
JoshuaVL1988
Posts: 37
Joined: April 25th, 2015, 10:41 am

Re: Spotify Plugin Released! Now with less bugs!

Post by JoshuaVL1988 »

.raptor wrote:Editing skins
I will not edit any more skins, since the documentation to do so can be found here, here and here. For any new questions regarding this, i will only redirect to this post, incomplete as it might be.

Since the easiest way to learn this is by editing an already existing skin, I assume we already have a skin for the NowPlaying plugin. Example snippet below.

Code: Select all

[mPosition]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=Spotify
PlayerType=POSITION
We can see that the measure is the Plugin type, info here. The documentation says "Plugins have their own specific options that must be placed in the measure section. For more information, refer to the Plugins entry for each.". For the NowPlaying plugin, that would be here. We can see that both PlayerName and PlayerType is options connected to NowPlaying, so we can remove those. We are also switching to SpotifyPlugin, so we edit the "Plugin=" as well.

Code: Select all

[mPosition]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Unfortunately it wont just work like this. We have to look up the documentation for the plugin, that can be found on the first page of this thread. Seeing it now, i realize it might not be the best documentation around, so an update is probably coming. Either way, we can figure out from the two samples there that "Type" seems to be the correct option. In this case we wanted the position to show, and luckily for us "Position" is an option.

Code: Select all

[mPosition]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=Position
Repeat this process for all the measures you want changed.

Installing SpotifyPlugin
This is all about finding the location of your plugins folder. If you have a 32-bit version of windows, you want to download the 32-bit zip, and extract it to "Program Files/Rainmeter/Plugins".

If you on the other hand have a 64-bit system, there are two possible options. To figure out where the folder is, we need to find what Rainmeter version we are using.
  1. Start Rainmeter.
  2. Right-click the Rainmeter icon in the system tray.
  3. Click "About".
  4. Go to "Version".
  5. The first line now says either 32 or 64 bit.
For 64 bit versions, the plugin folder is at "Program Files/Rainmeter/Plugins".
For 32 bit versions, the plugin folder is at "Program Files(x86)/Rainmeter/Plugins".
Download the zip corresponding with your Rainmeter version, and put it in the plugins folder.

Hope this clears things up. :)
Thank you soooo much =D. Gpt most of the skin working perfectly with the Spotify plugin now. Just can't figure out what to edit to make the Album/Track name to show up. That part still shows up as N/A. Here's the newly edited .ini file. any help on what I'm missing would be much appreciated.
[Rainmeter]
Author=SierraDesign
Update=250

[Metadata]
Name=Sober Blue
Description=Simple sunken music player.
Version=1.0

[variables]
;CHANGE YOUR PLAYER HERE!
player=Spotify

[Back]
Meter=IMAGE
ImageName=#@#Blue\Background.png
X=0
Y=2

[mPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#player#
PlayerType=TITLE
PlayerPath=
DisableLeadingZero=0
Substitute="":"N\A"

[mArtist]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Substitute="":""

[mAlbum]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Substitute="":"N\A"

[mPosition]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=Position

[mDuration]
Measure=Plugin
Plugin=SpotifyPlugin.dll

[mProgress]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=Progress
Decimals=2

[mRating]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=RATING

[mStateButton]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=STATE
Substitute="0":"Play.png","1":"Pause.png","2":"Play.png"

[mStateButton1]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=STATE

[mVolume]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=VOLUME


[Track]
Meter=STRING
MeasureName=mPlayer
FontFace=Calibri
FontColor=180,180,180
X=40
Y=7
W=215
H=18
AntiAlias=1
FontSize=11
ClipString=1
StringEffect=Shadow
FontEffectColor=0,0,0,200


[Artist]
Meter=STRING
MeasureName=mArtist
FontFace=Calibri
FontColor=150,150,150
FontSize=8
X=40
Y=23
W=185
H=16
AntiAlias=1
ClipString=1
StringCase=Upper
StringEffect=Shadow
FontEffectColor=0,0,0,200

[Play]
Meter=BUTTON
ButtonImage=[mStateButton]
X=280
Y=15
LeftMouseUpAction=!Execute [!RainmeterPluginBang "mPlayer PlayPause"][!RainmeterRefresh]
DynamicVariables=1

[ProgressBar]
Meter=BAR
MeasureName=mProgress
BarImage=#@#Blue\Progress.png
X=0
Y=18
BarOrientation=HORIZONTAL
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 »

JoshuaVL1988 wrote: Thank you soooo much =D. Gpt most of the skin working perfectly with the Spotify plugin now. Just can't figure out what to edit to make the Album/Track name to show up. That part still shows up as N/A. Here's the newly edited .ini file. any help on what I'm missing would be much appreciated.
[Rainmeter]
Author=SierraDesign
Update=250

[Metadata]
Name=Sober Blue
Description=Simple sunken music player.
Version=1.0

[variables]
;CHANGE YOUR PLAYER HERE!
player=Spotify

[Back]
Meter=IMAGE
ImageName=#@#Blue\Background.png
X=0
Y=2

[mPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#player#
PlayerType=TITLE
PlayerPath=
DisableLeadingZero=0
Substitute="":"N\A"

[mArtist]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Substitute="":""

[mAlbum]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Substitute="":"N\A"

[mPosition]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=Position

[mDuration]
Measure=Plugin
Plugin=SpotifyPlugin.dll

[mProgress]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=Progress
Decimals=2

[mRating]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=RATING

[mStateButton]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=STATE
Substitute="0":"Play.png","1":"Pause.png","2":"Play.png"

[mStateButton1]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=STATE

[mVolume]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[mPlayer]
PlayerType=VOLUME


[Track]
Meter=STRING
MeasureName=mPlayer
FontFace=Calibri
FontColor=180,180,180
X=40
Y=7
W=215
H=18
AntiAlias=1
FontSize=11
ClipString=1
StringEffect=Shadow
FontEffectColor=0,0,0,200


[Artist]
Meter=STRING
MeasureName=mArtist
FontFace=Calibri
FontColor=150,150,150
FontSize=8
X=40
Y=23
W=185
H=16
AntiAlias=1
ClipString=1
StringCase=Upper
StringEffect=Shadow
FontEffectColor=0,0,0,200

[Play]
Meter=BUTTON
ButtonImage=[mStateButton]
X=280
Y=15
LeftMouseUpAction=!Execute [!RainmeterPluginBang "mPlayer PlayPause"][!RainmeterRefresh]
DynamicVariables=1

[ProgressBar]
Meter=BAR
MeasureName=mProgress
BarImage=#@#Blue\Progress.png
X=0
Y=18
BarOrientation=HORIZONTAL

You forgot to specify "Type=" in both mDuration, mAlbum and mArtist. For the track name, that would be a little different as we need mPlayer to stay the way it is. If we change mPlayer the pause and play buttons will stop working. My suggestion is to add:

Code: Select all

[mTrack]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=TrackName
Put it just between mArtist and mPlayer to keep things organized. Then we need to change the actual meter as well:

Code: Select all

[Track]
Meter=STRING
MeasureName=mPlayer
FontFace=Calibri
FontColor=180,180,180
X=40
Y=7
W=215
H=18
AntiAlias=1
FontSize=11
ClipString=1
StringEffect=Shadow
FontEffectColor=0,0,0,200
to

Code: Select all

[Track]
Meter=STRING
MeasureName=mTrack
FontFace=Calibri
FontColor=180,180,180
X=40
Y=7
W=215
H=18
AntiAlias=1
FontSize=11
ClipString=1
StringEffect=Shadow
FontEffectColor=0,0,0,200