It is currently March 28th, 2024, 10:50 pm

!PauseMeasure / !UnpauseMeasure / !TogglePauseMeasure

Changes made during the Rainmeter 3.0 beta cycle.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

!PauseMeasure / !UnpauseMeasure / !TogglePauseMeasure

Post by jsmorley »

We have added new bangs to Rainmeter, allowing you to "pause" or "unpause" a measure.

http://docs.rainmeter.net/manual-beta/bangs#PauseMeasure
http://docs.rainmeter.net/manual-beta/bangs#PauseMeasureGroup

This is similar in concept to the existing !DisableMeasure / !EnableMeasure bangs, in that when a measure is paused, it will no longer update or change value.

The difference is that when a measure is disabled, any numeric value of the measure is set to zero. When a measure is paused, the most recent numeric value will be retained.

One use of this is to control "stopping and starting" some animated effect, particularly those controlled by a measure like a Calc measure with a counter.

The best way to demonstrate how that would work is with an example skin:
PauseAnim_1.0.rmskin
PauseAnim.jpg

Code: Select all

[Rainmeter]
Update=500
DynamicWindowSize=1

[Metadata]
Name=PauseAnim
Author=JSMorley
Information=Demonstrates new !PauseMeasure bangs
Version=Jul 11, 2013
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[MeasureAnimation]
Measure=Calc
Formula=(MeasureAnimation + 1 ) % 7

[MeterAnimation]
Meter=Bitmap
MeasureName=MeasureAnimation
BitmapImage=#@#Images\Anim.png
BitmapFrames=7
BitmapExtend=1

[MeterFrameNumber]
Meter=String
MeasureName=MeasureAnimation
Y=3R
FontSize=12
FontColor=242,217,177,255
AntiAlias=1
Text=Frame: %1

[MeterPause]
Meter=Image
X=([MeterAnimation:W]-50)
Y=0r
W=20
H=20
SolidColor=98,149,217,255
DynamicVariables=1
LeftMouseUpAction=[!PauseMeasure MeasureAnimation]

[MeterUnpause]
Meter=Image
X=([MeterAnimation:W]-25)
Y=0r
W=20
H=20
SolidColor=119,219,103,255
DynamicVariables=1
LeftMouseUpAction=[!UnpauseMeasure MeasureAnimation][!Update]
What this does is display a Bitmap meter using an image with 7 frames. The animation of the bitmap is controlled by a Calc measure [MeasureAnimation]. When you click on the blue Image meter, [MeasureAnimation] is "paused", and the animation stops at the current frame of the image. When you click on the green Image meter, [MeasureAnimation] is "unpaused", and the animation picks up where it left off.

Nothing says this must be used with a Bitmap meter, as the same thing would work with any output you control with some measure, that you want to stop and start while not losing the current value of the measure.
You do not have the required permissions to view the files attached to this post.