It is currently April 28th, 2024, 4:21 pm

Now playing string : Song Title that changes color?

Get help with creating, editing & fixing problems with skins
dollarsan
Posts: 3
Joined: July 5th, 2012, 11:18 am

Now playing string : Song Title that changes color?

Post by dollarsan »

I have a now playing meter that I've modified from the ElementaryRMX skin. I want to make the fontcolor of the song title change when a new song begins. Is there any code that will do this?

Code: Select all

[Rainmeter]
Author=JackDMF | jackdmf.deviantart.com based on Flying Hyrax's Elementary Weather Skin (flyinghyrax.deviantart.com)
Update=1000
AppVersion=2000000
DynamicWindowSize=1

[Metadata]
Name=ElementaryRMX Now Playing
Config=ElementaryRMX | Now Playing
Description=Displays current song and details
Instructions=Change your player in Variables.inc
Version=1.5.1
Tags=music | basic | elementary | clean | Century Gothic | Futurist Fixed-Width
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=1
Preview="#SKINSPATH#\Elementary\elementaryrmx_prev.jpg"

[Variables]
@include=#ROOTCONFIGPATH#Variables.inc
@include2=#ROOTCONFIGPATH#Languages\#language#.txt

; # # # # # Begin Measures # # # # #
 [msrPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=WMP
PlayerType=TITLE
PlayerPath=
DisableLeadingZero=0
Substitute="":"."
; Return value is 1 on error
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter ErrorMessage][!RainmeterRedraw]

[msrArtist]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=ARTIST
Substitute="":"."

[msrAlbum]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=ALBUM
Substitute="":"."

[msrCover]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=COVER
Substitute="":"Default.png"

[msrPosition]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=POSITION

[msrDuration]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=DURATION

[msrProgress]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=PROGRESS

[msrRating]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=RATING

[msrStateText]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=STATE
Substitute="0":"#stopped#","1":"#playing#","2":"#paused#"
 
; # # # # # Begin Meters # # # # #

[mtrString]
Meter=STRING
MeasureName=msrPlayer
MeasureName2=msrArtist 
MeasureName3=msrAlbum

X=920
Y=0

FontColor=#color#
FontSize=((30*#phi#)*#phi#)
FontFace=#font2#
StringAlign=Center
StringStyle=#style#
StringCase=UPPER
AntiAlias=1
Text="Currently playing %1  #from# %3  #by# %2"
SolidColor=0,0,0,0


; # # # # # finish # # # # #
Thank you!
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Now playing string : Song Title that changes color?

Post by Mordasius »

You could use [msrPosition] to instigate the change in font color every time a new track starts:

Code: Select all

[msrPosition]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=POSITION
IfEqualValue=0
IfEqualAction=!SetOption mtrString FontColor [MeasureTrackFontColors]
DynamicVariables=1
All you need to do is decided what range of font colors you want to use and how these will be set by the measure [MeasureTrackFontColors]
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Now playing string : Song Title that changes color?

Post by poiru »

Mordasius wrote:You could use [msrPosition] to instigate the change in font color every time a new track starts:
...
Or you could simply use TrackChangeAction ;)
dollarsan
Posts: 3
Joined: July 5th, 2012, 11:18 am

Re: Now playing string : Song Title that changes color?

Post by dollarsan »

I tried using TrackChangeAction but it doesn't seem to be working. Or am I using the wrong command? I'm sorry but I'm quite clueless about how to use this command. :confused:

Code: Select all

[mtrString]
Meter=STRING
MeasureName=msrPlayer
MeasureName2=msrArtist 
MeasureName3=msrAlbum

X=920
Y=0

TrackChangeAction=[!SetOption msrPlayer FontColor 0,255,0,255]
FontColor=#color#
FontSize=((30*#phi#)*#phi#)
FontFace=#font2#
StringAlign=Center
StringStyle=#style#
StringCase=UPPER
AntiAlias=1
Text="Currently playing %1  #from# %3  #by# %2"
SolidColor=0,0,0,0
LeftMouseUpAction = !Execute ["http://www.youtube.com/results?search_query=[msrPlayer]"]
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: Now playing string : Song Title that changes color?

Post by KreAch3R »

In the !SetOption bang you have to specify the meter in which the option resides, not the measure that provides the data. Like this: TrackChangeAction=[!SetOption mtrString FontColor 0,255,0,255]
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Now playing string : Song Title that changes color?

Post by poiru »

KreAch3R wrote:In the !SetOption bang you have to specify the meter in which the option resides, not the measure that provides the data. Like this: TrackChangeAction=[!SetOption mtrString FontColor 0,255,0,255]
And TrackChangeAction needs to be under [msrPlayer].
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: Now playing string : Song Title that changes color?

Post by KreAch3R »

poiru wrote: And TrackChangeAction needs to be under [msrPlayer].
Affirmative, sir, I missed that. :)
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
dollarsan
Posts: 3
Joined: July 5th, 2012, 11:18 am

Re: Now playing string : Song Title that changes color?

Post by dollarsan »

I put the code in but the color doesn't change. Is it because of the variables file? I guess I could just make it a separate skin. How do I tell the script to pick a random font color or choose from a specific list of hex codes?

Thanks in advance for all your help!

Code: Select all

[Rainmeter]
Author=JackDMF | jackdmf.deviantart.com based on Flying Hyrax's Elementary Weather Skin (flyinghyrax.deviantart.com)
Update=1000
AppVersion=2000000
DynamicWindowSize=1

[Metadata]
Name=ElementaryRMX Now Playing
Config=ElementaryRMX | Now Playing
Description=Displays current song and details
Instructions=Change your player in Variables.inc
Version=1.5.1
Tags=music | basic | elementary | clean | Century Gothic | Futurist Fixed-Width
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=1
Preview="#SKINSPATH#\Elementary\elementaryrmx_prev.jpg"

[Variables]
@include=#ROOTCONFIGPATH#Variables.inc
@include2=#ROOTCONFIGPATH#Languages\#language#.txt


; # # # # # Begin Measures # # # # #

[msrPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=WMP
PlayerType=TITLE
PlayerPath=
DisableLeadingZero=0
Substitute="":"."
TrackChangeAction=[!SetOption mtrString FontColor=86,223,248,180]
; Return value is 1 on error
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter ErrorMessage][!RainmeterRedraw]



[msrArtist]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=ARTIST
Substitute="":"."

[msrAlbum]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=ALBUM
Substitute="":"."

[msrStateText]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[msrPlayer]
PlayerType=STATE
Substitute="0":"not playing anything","1":"#playing#","2":"#paused#"

 
; # # # # # Begin Meters # # # # #

[mtrString]
Meter=STRING
MeasureName=msrPlayer
MeasureName2=msrArtist 
MeasureName3=msrAlbum
MeasureName4=msrStateText

X=920
Y=0


FontColor=255,255,255,255
FontSize=((30*#phi#)*#phi#)
FontFace=#font2#
StringAlign=Center
StringStyle=normal
StringCase=UPPER
AntiAlias=1
DynamicVariables=1
Text="Currently %4 %1  #from# %3  #by# %2"
SolidColor=0,0,0,0
LeftMouseUpAction = !Execute ["http://www.youtube.com/results?search_query=[msrPlayer]"]



; # # # # # finish # # # # #
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: Now playing string : Song Title that changes color?

Post by KreAch3R »

Remove the "=" sign. Check the syntax here: !SetOption [Meter/Measure] [Option] [Value] (Config)

Regarding your other question, my top of the shelf guess is the Quote Plugin and an external file with the colors.
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Now playing string : Song Title that changes color?

Post by MerlinTheRed »

Or a Lua script that generates random colours or chooses a random entry of an array of colours you specify in the script. You could run the script as a TrackChangeAction too with almost no modifications to your existing code needed.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!