Hi!
I am making a Spotify player and I wanted to make the rotate when Spotify is playing and when it's not, the rotation would stop but when I try to code that there are too many errors, can you help me out?
It is currently April 17th, 2024, 9:43 pm
Album cover animations: Help
-
- Posts: 28
- Joined: April 6th, 2017, 2:43 pm
-
- Posts: 826
- Joined: November 20th, 2012, 11:58 pm
Re: Album cover animations: Help
Post your code please
-
- Posts: 28
- Joined: April 6th, 2017, 2:43 pm
Re: Album cover animations: Help
I deleted my try to rotate. If you want it, send me a private message -> https://forum.rainmeter.net/ucp.php?i=pm&mode=compose&u=40211FreeRaider wrote:Post your code please
Code: Select all
[Rainmeter]
Update=1
DynamicWindowSize=1
[Metadata]
Name= Rainify
Author= @bernardovs23
Information= Spotify player with the spotify style
Version= 1.0
[Variables]
@Include=#@#Variables.ini
[Measure.AlbumArt]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=AlbumArt
DefaultPath=#@#Default.png
CoverPath=#@#Cover.png
[Measure.Progress]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=Progress
[Measure.TrackName]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=TrackName
[Measure.ArtistName]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=ArtistName
[Measure.AlbumName]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=AlbumName
[Meter.AlbumArt]
Meter=Image
ImageName=[Measure.AlbumArt]
W=(#Size#*2.5)
DynamicVariables=1
[Meter.Progress]
Meter=Bar
MeasureName=Measure.Progress
Y=R
W=(#Size#*2.5)
H=(#Size#*0.05)
BarColor=29,185,84
SolidColor=40,40,40
BarOrientation=Horizontal
DynamicVariables=1
[Meter.TrackName]
Meter=String
MeasureName=Measure.TrackName
Y=R
X=125
W=(#Size#*2.5)
SolidColor=23,23,23
FontFace=#Font#
FontSize=15
FontColor=255,255,255
StringStyle=Bold
StringAlign=Center
AntiAlias=1
DynamicVariables=1
[Meter.ArtistName]
Meter=String
MeasureName=Measure.ArtistName
Y=R
X=r
W=(#Size#*2.5)
SolidColor=23,23,23
FontFace=#Font#
FontSize=15
FontColor=255,255,255
StringAlign=Center
AntiAlias=1
DynamicVariables=1
[Meter.AlbumName]
Meter=String
MeasureName=Measure.AlbumName
Y=R
X=r
W=(#Size#*2.5)
SolidColor=23,23,23
FontFace=#Font#
FontSize=10
FontColor=255,255,255
StringAlign=Center
AntiAlias=1
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 5391
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Album cover animations: Help
I do not use Spotify, but can provide a simple example that might help.
I added the missing #Size# variable, and added variables for the cover width and height (set these values to your cover image size).
Added a loop measure [MeasureLoop360] to control rotation.
Modified [Measure.AlbumArt] to substitute images if none are found.
And changed your [Meter.AlbumArt] to Meter=Rotator
Here is the code I added and changed:You will need to create a measure to determine Spotify's current state (Play/Pause/Stop) and use that to toggle the rotation; I used a mouse action to simulate.
Hope this helps get you closer...
I added the missing #Size# variable, and added variables for the cover width and height (set these values to your cover image size).
Added a loop measure [MeasureLoop360] to control rotation.
Modified [Measure.AlbumArt] to substitute images if none are found.
And changed your [Meter.AlbumArt] to Meter=Rotator
Here is the code I added and changed:
Code: Select all
[Variables]
@Include=#@#Variables.ini
Size=1
CoverWidth=134
CoverHeight=134
[MeasureLoop360]
Measure=Loop
StartValue=0
EndValue=359
Increment=1
LoopCount=0
[Measure.AlbumArt]
Measure=Plugin
Plugin=SpotifyPlugin.dll
Type=AlbumArt
Substitute="":"#@#default.png","0":"#@#default.png"
[Meter.AlbumArt]
Meter=Rotator
MeasureName=MeasureLoop360
ImageName=[Measure.AlbumArt]
W=#CoverWidth#
H=#CoverHeight#
OffsetX=(#CoverWidth#/2)
OffsetY=(#CoverHeight#/2)
; Next line used to simulate Spotify play/pause
; You will need to create a measure for that
LeftMouseUpAction=[!ToggleMeasure MeasureLoop360]
;....
Hope this helps get you closer...
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 5391
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Album cover animations: Help
Aside: If your cover image is not square, then you may want to use a slightly different formula for the meter width and height, to avoid clipping the image during rotation:
Code: Select all
[Meter.AlbumArt]
Meter=Rotator
MeasureName=MeasureLoop360
ImageName=[Measure.AlbumArt]
W=(Sqrt(#CoverWidth#**2+#CoverHeight#**2))
H=(Sqrt(#CoverWidth#**2+#CoverHeight#**2))
OffsetX=(#CoverWidth#/2)
OffsetY=(#CoverHeight#/2)
; Next line used to simulate Spotify not play/pause
; You will need to create a measure for that
LeftMouseUpAction=[!ToggleMeasure MeasureLoop360]
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 28
- Joined: April 6th, 2017, 2:43 pm
Re: Album cover animations: Help
Ummm... So this happenedeclectic-tech wrote:I do not use Spotify, but can provide a simple example that might help.
I added the missing #Size# variable, and added vari...
https://i.imgur.com/dvxlzvG.png
I tried to fix it but nope, just didn't made sense
-
- Rainmeter Sage
- Posts: 16143
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Album cover animations: Help
I didn't understand from the posted image what's happened, but if you still have errors using the rotator meter(s), you could try to switch to a simple image meter and rotate it with a TransformationMatrix (well, I have to admit that since the moment I understood how this option works, I became a huge "fan" of it).bernardovs23 wrote:Ummm... So this happened
If you're interested, please post the last code you have. Additionally I just mention that I don't use Spotify, but just post your code, as it is right now.
-
- Moderator
- Posts: 1387
- Joined: April 11th, 2013, 8:08 pm
- Location: Italy
Re: Album cover animations: Help
No, balala, nooo!
...not TransformationMatrix!!!
I think I could hear his head exploding from here.
...not TransformationMatrix!!!
I think I could hear his head exploding from here.
-
- Rainmeter Sage
- Posts: 16143
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Album cover animations: Help
Why? I think TransformationMatrix is a very cool tool.fonpaolo wrote:No, balala, nooo!
...not TransformationMatrix!!!
I think I could hear his head exploding from here.
-
- Moderator
- Posts: 1387
- Joined: April 11th, 2013, 8:08 pm
- Location: Italy
Re: Album cover animations: Help
Obviously it was only a joke.
...however, even if I'm sure that TrasformationMatrix is very useful, it's not the easiest option to use.
...however, even if I'm sure that TrasformationMatrix is very useful, it's not the easiest option to use.