It is currently April 27th, 2024, 8:23 pm

OnChangeAction with ColorExtract Plugin.

Get help with creating, editing & fixing problems with skins
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: OnChangeAction with ColorExtract Plugin.

Post by Aryx »

@Balala Most extraordinary! The gif shows what I want to achieve, but, sadly, it does not work for me for some reason.
My update rate varies but I have settled to 25. But I don't know if that's an issue here, as it doesn't update anyhow.

@Eclectic-Tech You get what I said! I think, writing the name to some variable then referencing it to the current one for comparison would enable the use of !Refresh. This is just am assumption.
The [!Log "Updating Colors"][!Refresh] is not triggered. However, I can clearly see the MeasureTitle change. Why?

If this plugin is not upto the task, is there anything else I can do to achieve a similar effect? If yes, then how?
User avatar
balala
Rainmeter Sage
Posts: 16180
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: OnChangeAction with ColorExtract Plugin.

Post by balala »

eclectic-tech wrote: December 20th, 2023, 7:52 pm In my tests, the temp filename of the cover image DOES NOT CHANGE when using AIMP or Winamp as the player, so the skin never sees a "changing" value for the cover measure.
Yincognito wrote: December 20th, 2023, 8:10 pm For some reason, WMP works for balala in that regard
Yep, I tested only with WMP. Forgot to tell this (probably) important, but the skin perfectly works for me with this player.
Yincognito wrote: December 20th, 2023, 8:10 pm (or, he just tried with the first played track and did not change between tracks).
No, I didn't forget, as can see in the attached screenshot. The color changes when the cover changes.
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: OnChangeAction with ColorExtract Plugin.

Post by Aryx »

@Yincognito Sorry, I was in middle of typing my previous response to posts that came before yours. It was after posting it I saw your message. Yes - realizing one's mistakes can lead to fulfillment of tasks - no harm in that. I can't understand what do you mean by "stopping playing before changing tracks".
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: OnChangeAction with ColorExtract Plugin.

Post by eclectic-tech »

Aryx wrote: December 20th, 2023, 8:16 pm {snip}
@Eclectic-Tech You get what I said! I think, writing the name to some variable then referencing it to the current one for comparison would enable the use of !Refresh. This is just am assumption.
The [!Log "Updating Colors"][!Refresh] is not triggered. However, I can clearly see the MeasureTitle change. Why?

If this plugin is not upto the task, is there anything else I can do to achieve a similar effect? If yes, then how?
It works for me on every track title change... I did change the values for FontColor setting in each meter to use the SectionVariables format: [&CoverColor1], etc.

The Chameleon plugin can also be used to extract the cover colors.

Here is an example:

Code: Select all

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

---Measures---

[MeasureTitle]
Measure=Plugin
Plugin=NowPlaying
PlayerName=AIMP
PlayerType=TITLE
OnChangeAction=[!Log "Updating Colors"][!Refresh]

[MeasureCover]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[MeasureTitle]
PlayerType=COVER

[CoverColor]
Measure=Plugin
Plugin=Chameleon
Type=File
Path=[MeasureCover]

[CoverColor1]
Measure=Plugin
Plugin=Chameleon
Parent=CoverColor
Color=Light1
Format=Dec

[CoverColor2]
Measure=Plugin
Plugin=Chameleon
Parent=CoverColor
Color=Light2
Format=Dec

[CoverColor3]
Measure=Plugin
Plugin=Chameleon
Parent=CoverColor
Color=Light3
Format=Dec

[CoverColorBG]
Measure=Plugin
Plugin=Chameleon
Parent=CoverColor
Color=Light4
Format=Dec

---Meters---

[MeterBackground]
Meter=Shape
Shape=Rectangle 2,2,110,110,4 | Fill Color 0,0,0,0
DynamicVariables=1

[MeterCover]
Meter=Image
MeasureName=MeasureCover
X=[MeterBackground:X]
Y=[MeterBackground:Y]
W=[MeterBackground:W]
H=[MeterBackground:H]
DynamicVariables=1

[MeterTest]
Meter=String
X=([MeterCover:X]+[MeterCover:W])
FontSize=15
FontColor=[&CoverColor1]
Text=Test0
DynamicVariables=1
AntiAlias=1

[MeterTest1]
Meter=String
X=([MeterTest:X])
Y=([MeterTest:Y]+30)
FontSize=15
FontColor=[&CoverColor2]
Text=Test1
DynamicVariables=1
AntiAlias=1

[MeterTest2]
Meter=String
X=([MeterTest:X])
Y=([MeterTest1:Y]+30)
FontSize=15
FontColor=[&CoverColor3]
Text=Test2
DynamicVariables=1
AntiAlias=1

[MeterTest3]
Meter=String
X=([MeterTest:X])
Y=([MeterTest2:Y]+30)
FontSize=15
FontColor=[&CoverColorBG]
Text=Test3
DynamicVariables=1
AntiAlias=1
Edit: The !Refresh bang IS needed on the title measure.
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: OnChangeAction with ColorExtract Plugin.

Post by Yincognito »

Aryx wrote: December 20th, 2023, 8:25 pm @Yincognito Sorry, I was in middle of typing my previous response to posts that came before yours. It was after posting it I saw your message. Yes - realizing one's mistakes can lead to fulfillment of tasks - no harm in that. I can't understand what do you mean by "stopping playing before changing tracks".
Sure thing. I meant that you have to follow these steps:
1. stop playing the track from the stop button in the player itself
2. jump to another track via the previous or next buttons also in the player
3. play the new track via the play button in the player
For me, they worked in changing the measures and meters in the skin.

Eclectic-Tech's method worked for my Winamp though. Alternatively, you can use the PlayerType=File option to be more precise:

Code: Select all

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

---Measures---

[MeasureCover]
Measure=PLUGIN
Plugin=NOWPLAYING
PlayerName=Winamp
PlayerType=COVER

; [MeasureTitle]
; Measure=Plugin
; Plugin=NowPlaying
; PlayerName=[MeasureCover]
; PlayerType=TITLE
; OnChangeAction=[!Log "Updating Colors"][!Refresh]

[MeasureFile]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[MeasureCover]
PlayerType=File
OnChangeAction=[!Log "Updating Colors"][!Refresh]

[CoverColor]
Measure=Plugin
Plugin=ColorExtract
ImagePath=[MeasureCover]
RegExpSubstitute=1
Substitute=",(255)$":"","":"255,0,0"
DynamicVariables=1

[CoverColor1]
Measure=Plugin
Plugin=ColorExtract
ImagePath=[MeasureCover]
ColorType=Accent1
RegExpSubstitute=1
Substitute=",(255)$":"","":"0,255,0"
DynamicVariables=1

[CoverColor2]
Measure=Plugin
Plugin=ColorExtract
ImagePath=[MeasureCover]
ColorType=Accent2
RegExpSubstitute=1
Substitute=",(255)$":"","":"0,0,255"
DynamicVariables=1

[CoverColorBG]
Measure=Plugin
Plugin=ColorExtract
ImagePath=[MeasureCover]
ColorType=Background
RegExpSubstitute=1
Substitute=",(255)$":"","":"125,125,125"
DynamicVariables=1


---Meters---

[MeterBackground]
Meter=Shape
Shape=Rectangle 2,2,110,110,4 | Fill Color 0,0,0,200
DynamicVariables=1

[MeterCover]
Meter=Image
MeasureName=MeasureCover
X=[MeterBackground:X]
Y=[MeterBackground:Y]
W=[MeterBackground:W]
H=[MeterBackground:H]
DynamicVariables=1

[MeterTest]
Meter=String
X=([MeterCover:X]+[MeterCover:W])
FontSize=15
FontColor=[CoverColor]
Text=Test0
DynamicVariables=1
AntiAlias=1

[MeterTest1]
Meter=String
X=([MeterTest:X])
Y=([MeterTest:Y]+30)
FontSize=15
FontColor=[CoverColor1]
Text=Test1
DynamicVariables=1
AntiAlias=1

[MeterTest2]
Meter=String
X=([MeterTest:X])
Y=([MeterTest1:Y]+30)
FontSize=15
FontColor=[CoverColor2]
Text=Test2
DynamicVariables=1
AntiAlias=1

[MeterTest3]
Meter=String
X=([MeterTest:X])
Y=([MeterTest2:Y]+30)
FontSize=15
FontColor=[CoverColorBG]
Text=Test3
DynamicVariables=1
AntiAlias=1

[MyMeter]
Meter=STRING
MeasureName=CoverColor
X=10
Y=10
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=10
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
DynamicVariables=1
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: OnChangeAction with ColorExtract Plugin.

Post by Aryx »

This is a job well done sirs! :great: Where what I asked was achieved by @Yincognito, @Eclectic-Tech showed me a plugin that could do the same and is much better in comparison! Also, @Balala was helpful in his way (his method worked for him - not for me... still, it worked for someone atleast.)

As of today, I'll be working with chameleon plugin; Is there a way to change luminescence automatically as per the background (not wallpaper just whatever is behind the skin)? Will I have to create another thread for the same? Edit: Never mind.. I found a thread: https://forum.rainmeter.net/viewtopic.php?t=38350
User avatar
balala
Rainmeter Sage
Posts: 16180
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: OnChangeAction with ColorExtract Plugin.

Post by balala »

Aryx wrote: December 21st, 2023, 8:28 am @Balala was helpful in his way (his method worked for him - not for me... still, it worked for someone atleast.)
My guess is that this has gone on because we've used different players: me personally worked with WMP. According to the posts of other users, it seems than when using AIMP or other players, the issue is present, with WMP it isn't.
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: OnChangeAction with ColorExtract Plugin.

Post by Yincognito »

Aryx wrote: December 21st, 2023, 8:28 am This is a job well done sirs! :great: Where what I asked was achieved by @Yincognito, @Eclectic-Tech showed me a plugin that could do the same and is much better in comparison! Also, @Balala was helpful in his way (his method worked for him - not for me... still, it worked for someone atleast.)

As of today, I'll be working with chameleon plugin; Is there a way to change luminescence automatically as per the background (not wallpaper just whatever is behind the skin)? Will I have to create another thread for the same? Edit: Never mind.. I found a thread: https://forum.rainmeter.net/viewtopic.php?t=38350
Glad you found a solution that works in every case - I would have made the same choice as you did if I was in your place, I don't like half working things either. Having multiple ways of doing the same thing helps a lot in problematic scenarios. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth