It is currently February 4th, 2023, 3:38 am

Spotify and WindowMessage

Get help with creating, editing & fixing problems with skins
Ventrix
Posts: 4
Joined: April 2nd, 2010, 6:42 am

Spotify and WindowMessage

Post by Ventrix »

Hiya,

Basically I've got a config that displays the artist/track currently playing in spotify. I'm using substitute to give "Not playing anything" when spotify is open and not playing anything, and "Not open" when spotify isn't open.

The problem is that when spotify is closed, "Not playing anything" or "Not open" dosen't appear. It just hangs on whatever artist/track info happened too be there before spotify was closed, or "Not playing anything" if nothing was playing when spotify was closed.

A solution for the problem that works is using the following

Code: Select all

IfEqualValue="Not playing anything"
IfEqualAction=!RainmeterRefresh
  But I'm wondering if there is another way too fix this as it's not really appropriate and a bit heavy..  
Here's my config;

Code: Select all

[Rainmeter]
Author=Ventrixium
Update=1000

[Variables]
FontColor=255,255,255
FontFace=Georgia
FontSize=8
StringAlign=Left
StringStyle=Normal
AntiAlias=1

; MEASURES

[Track]
Measure=Plugin
Plugin=WindowMessagePlugin.dll
WindowClass=SpotifyMainWindow
Substitute="0":"Not open","–":"•","Spotify -":"","Spotify":"Not playing anything"
;IfEqualValue="Not playing anything"
;IfEqualAction=!RainmeterRefresh

; METERS

[~Track]
Meter=String
MeasureName=Track
X=[Center]
Y=10
W=#SCREENAREAWIDTH#
H=35
DynamicVariables=1
FontColor=#FontColor#
FontFace=#FontFace#
FontSize=15
StringAlign=Center
StringStyle=#StringStyle#
AntiAlias=1

[Center]
Measure=Calc
Formula=#SCREENAREAWIDTH#/2
Last edited by Ventrix on April 25th, 2010, 2:50 pm, edited 1 time in total.
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Spotify and WindowMessage

Post by dragonmage »

Use the About dialog to see if any value is returned when Spotify is not opened, If there is one substitute it with "value":""
Ventrix
Posts: 4
Joined: April 2nd, 2010, 6:42 am

Re: Spotify and WindowMessage

Post by Ventrix »

dragonmage wrote:Use the About dialog to see if any value is returned when Spotify is not opened, If there is one substitute it with "value":""
Of course, "0" should be the returned value when spotify is not open. However the value is not "0", but "Spotify" or "Spotify - Artist - Track".

And I do already substitute "0" with "Not open".

Maybe it's just the way spotify closes..
Ventrix
Posts: 4
Joined: April 2nd, 2010, 6:42 am

Re: Spotify and WindowMessage

Post by Ventrix »

Bump, didn't want too make a new thread.

I've got a 'solution' too the problem now. But it's not perfect.

I would like too know though if there is any way to refresh a measure using IfEqualAction=!RainmeterRefresh say.. every 10 seconds or so.

I've got

Code: Select all

IfEqualValue="0"
IfEqualAction=!RainmeterRefresh
But that makes the measure refresh waaaay more than once per 10 secs. Any ideas?
User avatar
jsmorley
Developer
Posts: 22558
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Spotify and WindowMessage

Post by jsmorley »

Ventrix wrote:Bump, didn't want too make a new thread.

I've got a 'solution' too the problem now. But it's not perfect.

I would like too know though if there is any way to refresh a measure using IfEqualAction=!RainmeterRefresh say.. every 10 seconds or so.

I've got

Code: Select all

IfEqualValue="0"
IfEqualAction=!RainmeterRefresh
But that makes the measure refresh waaaay more than once per 10 secs. Any ideas?
http://rainmeter.net/cms/Tips-CountersGuide

Use this calc statement with Counter idea with the !RainmeterRefresh.