It is currently March 28th, 2024, 12:47 pm

NowPlaying plugin odd behaviour

Get help with creating, editing & fixing problems with skins
Post Reply
apu889
Posts: 13
Joined: May 1st, 2017, 11:58 am

NowPlaying plugin odd behaviour

Post by apu889 »

Hi, so i made my first skin which obtaining lyrics from musixmatch.com, and so far while im developing the skin i'm always enabled another skin like Visualizer & Track display.

BUT, when it just my skin enabled on rainmeter, it takes a delay to detect the track information. as a result, the skin will always do an infinite refresh loop because it takes too long to detect the track title, so it will always displaying "Not Playing" than displaying the lyrics. BUT, if i'm also enabling another skin that uses same NowPlaying plugin too (ex: trackname display/visualizer like above mentioned), my skin can detect the track title instantaneously without long delay and works normally.

Does this mean NowPlaying plugin works that way ('rely-ing' another skin that uses same plugin)? or there's problem on my side?
here's my code, which the [MeasureTit] always return with "Not Playing" because the delay. i guess:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Variables]

;Music player name (Spotify, WMP, or others)
PlayerName=WMP

; NowPlaying      for WMP, and the others
; SpotifyPlugin   for Spotify
Plugin=NowPlaying

;Max skin width, so the text automatically wrap if exceeded this value
MaxWidth=300

;Skin fixed height.
SkinHeight=385

;Text Options
Font=Calibri
FontSize=10

;Valid values are Normal, Bold, Italic, and BoldItalic.
TextStyle=Normal

;In RGBA
TextColor=255,255,255,255

;Valid values are None, Shadow, and Border.
TextEffect=None

;Set mouse scrolling speed
ScrollSpeed=25

;Text states display
ConnectionError=Connection problem
LyricNotFound=Lyrics not found :(
NotPlaying=Not Playing

Offset=2500
Y=0

[MeasureArtis]
Measure=Plugin
Plugin=#Plugin#
PlayerName=#PlayerName#
PlayerType=ARTIST
Type=ArtistName
RegExpSubstitute=1
Substitute="\(([^)]+)\)":"", "\[([^)]+)\]":"", "\040":"%20", "-\z":"", "'":"%20", "\+\z":"", " & ":"", " x ":"", " vs ":"", " VS ":"", "\,":"", "Feat.*":"", "feat.*":"", "ft\..*": "", "Ft\..*":""

[MeasureTit]
Measure=Plugin
Plugin=#Plugin#
PlayerName=#PlayerName#
PlayerType=TITLE
Type=TrackName
RegExpSubstitute=1
Substitute="\(([^)]+)\)":"", "\[([^)]+)\]":"", "\040":"%20", "-\z":"", "'":"%20", "\+\z":"", " & ":"", " x ":"", " vs ":"", " VS ":"", "\,":"", "Feat.*":"", "feat.*":"", "ft\..*": "", "Ft\..*":"", "":"Not Playing"
IfMatch=Not Playing
IfMatchAction=[!ShowMeter "MeterNotPlaying"], [!DisableMeasure "MeasureCari"]
OnChangeAction=[!Refresh]
EDIT: also is it possible to refreshing a skin whenever Track changes to another? TrackChangeAction=!Refresh also does infinite refresh loop for me

hope you understand my broken english xD
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: NowPlaying plugin odd behaviour

Post by fonpaolo »

For what you've posted, the problem relies in the code.

Usually, only one measure uses data from the player, all the others will obtain the data from the first.

Code: Select all

[MeasureTrack]
Measure=Plugin
Plugin=#Plugin#
PlayerName=#Player#
PlayerType=TITLE
DisableLeadingZero=1
TrackChangeAction=[!UpdateMeasureGroup TrackInfos][!UpdateMeter MeterTrack][!UpdateMeter MeterCover][!UpdateMeter MeterInfoTrack][!Redraw]

[MeasureArtist]
Measure=Plugin
Plugin=#Plugin#
PlayerName=[MeasureTrack]
PlayerType=ARTIST
Group=TrackInfos
The second problem, never, never use !Refresh if there's no real reasons to use it.
As you experienced you can easily be hooked in an infinite loop.
As you can see in the above code, use !Update and !Redraw. ;-)
apu889
Posts: 13
Joined: May 1st, 2017, 11:58 am

Re: NowPlaying plugin odd behaviour

Post by apu889 »

fonpaolo wrote:For what you've posted, the problem relies in the code.
Usually, only one measure uses data from the player, all the others will obtain the data from the first.
ah i see that, thank you for the explanation :D
fonpaolo wrote: The second problem, never, never use !Refresh if there's no real reasons to use it.
As you experienced you can easily be hooked in an infinite loop.
As you can see in the above code, use !Update and !Redraw. ;-)
I'm using !Refresh because the skin needs to re-read variables that written using !WriteKeyValues. Is there any other method without !Refresh to re-read the vars?
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: NowPlaying plugin odd behaviour

Post by fonpaolo »

apu889 wrote:I'm using !Refresh because the skin needs to re-read variables that written using !WriteKeyValues. Is there any other method without !Refresh to re-read the vars?
Yes, SetVariable ;-)
Post Reply