It is currently April 27th, 2024, 5:21 pm

!UpdateMeter vs !Update

General topics related to Rainmeter.
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

!UpdateMeter vs !Update

Post by AlC »

Hey Guys

I wanted my skins a little more CPU friendly, by replacing !Update with !UpdateMeter.

this code worked fine, but it updates to whole skin

Code: Select all

[Backward]
Meter=STRING
MeterStyle=Style
FontColor=#ColorBack#
X=10R
Y=r
Text="Backward"
MouseOverAction=!Execute [!RainmeterSetVariable ColorBack #ColorMusicActive#][!Update]
MouseLeaveAction=!Execute [!RainmeterSetVariable ColorBack #ColorMusicNormal#][!Update]
LeftMouseDownAction=!execute [!RainmeterPluginBang "mPlayer SetPosition -5"][!RainmeterUpdate]
DynamicVariables=1
change to

Code: Select all

[Backward]
Meter=STRING
MeterStyle=Style
FontColor=#ColorBack#
X=10R
Y=r
Text="Backward"
MouseOverAction=!Execute [!RainmeterSetVariable ColorBack #ColorMusicActive#][!UpdateMeter]
MouseLeaveAction=!Execute [!RainmeterSetVariable ColorBack #ColorMusicNormal#][!UpdateMeter]
LeftMouseDownAction=!execute [!RainmeterPluginBang "mPlayer SetPosition -5"][!RainmeterUpdate]
DynamicVariables=1
!UpdateMeter and !UpdateMeter Backward don't work.

So is the code false or is Updatemeter the false Bang for this ? 2.1 895

Edit: What is false: :)
I go on the meter it takes 1 second then is #ColorMusicActive#,
I left the meter it takes 1 second then is #ColorMusicNormal#
Rainmeter - You are only limited by your imagination and creativity.
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: !UpdateMeter vs !Update

Post by AlC »

Okey Update:

The above code couldn't work, because it updates the meter but not the Variables (I think) ;-)

Then I updated the code with !SetOption to this :

Code: Select all

[Backward]
Meter=STRING
MeterStyle=Style
;FontColor=#ColorBack#
X=10R
Y=r
Text="Backward"
MouseOverAction=!Execute [!SetOption Backward FontColor #ColorMusicActive#][!UpdateMeter Backward #CURRENTCONFIG#]
MouseLeaveAction=!Execute [!SetOption Backward FontColor #ColorMusicNormal#][!UpdateMeter Backward #CURRENTCONFIG#]
LeftMouseDownAction=!execute [!RainmeterPluginBang "mPlayer SetPosition -5"][!RainmeterUpdate]
DynamicVariables=1
But it didn't work again, it don't update the meter.
So Why ?? Can anyone help ??
Rainmeter - You are only limited by your imagination and creativity.
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: !UpdateMeter vs !Update

Post by Seahorse »

I am using this to highlight text, works fine, font is #Colour1# initially:

Code: Select all

MouseOverAction=!Execute [!SetOption "#CURRENTSECTION#" FontColor #Colour2#][[!Update]
MouseLeaveAction=!Execute [!SetOption "#CURRENTSECTION#" FontColor #Colour1#][!Update]
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: !UpdateMeter vs !Update

Post by AlC »

the code "works" of course, but my problem is the update

[!Update]
Updates the whole skin with all meters, measure, calcs ... isn't it??

and !UpdateMeter should update only the meter, which would be in this case enough. From the manual:
!UpdateMeter [Meter] (Config)
Immediately updates the given meter regardless of UpdateDivider.
and I have not only backward but also pause, play, next ... and all the launchers, too.

Because in the "highlight" case it would be enough to only update the meter and not the complete skin/config.

That's my "problem" and I can't bring it to work.
Rainmeter - You are only limited by your imagination and creativity.
User avatar
spx
Developer
Posts: 686
Joined: August 15th, 2009, 2:41 pm
Location: Osaka, JPN

Re: !UpdateMeter vs !Update

Post by spx »

Add !Redraw after !UpdateMeter.
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: !UpdateMeter vs !Update

Post by AlC »

Ahhww Redraw ...

So when I use !Update, it updates all (meters,variables) and I don't need !Redraw
And with !UpdateMeter, it updates the meter and I need !Redraw
mmh... why I don't need !Redraw at !Update

or is a kind of !Redraw in !Update :???:
If this is the case then should be a kind of !RedrawMeter in !UpdateMeter !

Anyway...

Thank you spx

After testing it a while, I found it's a little bit more CPU friendly than !Update and it's good for my mind :)
Rainmeter - You are only limited by your imagination and creativity.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: !UpdateMeter vs !Update

Post by poiru »

AlC wrote:mmh... why I don't need !Redraw at !Update
!Update is virtually identical to what occurs every Update= cycle (which includes redrawing the skin).
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: !UpdateMeter vs !Update

Post by AlC »

poiru wrote:!Update is virtually identical to what occurs every Update= cycle (which includes redrawing the skin).
Okey understand.


Sorry, but I must ask this :
Would it be then better, if !UpdateMeter update the meter ( including redrawing the meter) ?

Also can you say !UpdateMeter update the meter like a "Update= cycle", because when this is true, it should redraw the meter ?
Rainmeter - You are only limited by your imagination and creativity.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: !UpdateMeter vs !Update

Post by poiru »

AlC wrote:Sorry, but I must ask this :
Would it be then better, if !UpdateMeter update the meter ( including redrawing the meter) ?

Also can you say !UpdateMeter update the meter like a "Update= cycle", because when this is true, it should redraw the meter ?
I haven't wandered into the draw-handling code, but I believe that this isn't possible (in general). Draws accumulate, which basically means that the previous shape of the meter would remain (until the next full update and a full redraw) if only one component is (re)drawn.
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: !UpdateMeter vs !Update

Post by AlC »

Okay, thank you very much for explaining it.
Rainmeter - You are only limited by your imagination and creativity.