It is currently December 15th, 2019, 11:46 am

Skin that changes depending on track name?

Help with creating, editing & fixing problems with skins
User avatar
VL4DST3R
Posts: 12
Joined: November 17th, 2018, 12:20 am
Location: Romania

Skin that changes depending on track name?

VL4DST3R » August 15th, 2019, 2:58 pm

Is it possible to identify different tracks currently being played and react accordingly to it? For example if we have track "a.mp3", have an image "1.png" show up, which then disappears if said track stops. If track "b.mp3" plays instead, show "2.png" and so on.
User avatar
balala
Rainmeter Sage
Posts: 9269
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin that changes depending on track name?

balala » August 15th, 2019, 3:33 pm

VL4DST3R wrote:
August 15th, 2019, 2:58 pm
Is it possible to identify different tracks currently being played and react accordingly to it? For example if we have track "a.mp3", have an image "1.png" show up, which then disappears if said track stops. If track "b.mp3" plays instead, show "2.png" and so on.
Yes, it definitely is. But is very complicated because the title can be anything and probably there isn't possible to have one image for all possible titles.
However here is a workaround:

Code: Select all

[MeasurePlayer]
Measure=NowPlaying
PlayerName=#PlayerName#
PlayerType=TITLE
IfMatch=FIRST-TITLE
IfMatchAction=[!SetOption MeterImage ImageName "THE-IMAGE-FOR-THIS-TITLE"][!UpdateMeter "MeterImage"][!Redraw]
IfMatch2=SECOND-TITLE
IfMatchAction2=[!SetOption MeterImage ImageName "THE-IMAGE-FOR-THIS-TITLE"][!UpdateMeter "MeterImage"][!Redraw]
...

[MeterImage]
Meter=Image
X=0
Y=0
You have to add the PlayerName variable to the [Variables] section, accordingly to this and the appropriate image names into the above !SetOption bangs, replacing the THE-IMAGE-FOR-THIS-TITLE with the proper names.
Although the number of IfMatch / IfMatchAction options isn't limited, what I see here a major problem is that you can't add an infinite number of such options.
User avatar
VL4DST3R
Posts: 12
Joined: November 17th, 2018, 12:20 am
Location: Romania

Re: Skin that changes depending on track name?

VL4DST3R » August 15th, 2019, 10:58 pm

balala wrote:
August 15th, 2019, 3:33 pm
Yes, it definitely is. But is very complicated because the title can be anything and probably there isn't possible to have one image for all possible titles.
Yes, I only want this to show up for a few select tracks, with a known name, not everything in my library!
balala wrote:
August 15th, 2019, 3:33 pm
You have to add the PlayerName variable to the [Variables] section, accordingly to this and the appropriate image names into the above !SetOption bangs, replacing the THE-IMAGE-FOR-THIS-TITLE with the proper names.
Although the number of IfMatch / IfMatchAction options isn't limited, what I see here a major problem is that you can't add an infinite number of such options.
Oh god, the PlayerName var... i completely forgot rainmeter works only with some media players, and that list doesn't include the w10 default player which i generally use... rats.

Regardless, thank you for the info, very helpful as always balala! ;)
User avatar
balala
Rainmeter Sage
Posts: 9269
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin that changes depending on track name?

balala » August 16th, 2019, 4:43 am

VL4DST3R wrote:
August 15th, 2019, 10:58 pm
Oh god, the PlayerName var... i completely forgot rainmeter works only with some media players, and that list doesn't include the w10 default player which i generally use... rats.
No, unfortunately it doesn't. Would be good, but at least for now, it doesn't.