It is currently June 23rd, 2024, 11:16 am

Help with pausing/stopping a GIF

Get help with creating, editing & fixing problems with skins
Meridian
Posts: 2
Joined: October 19th, 2014, 3:22 pm

Help with pausing/stopping a GIF

Post by Meridian »

Hi,

Can someone please help me with pausing/stopping a gif animation. Basically I want a GIF to play while music/sound is playing and when the music or sound stops the animation must pause/stop. I have no clue how to code or how to use LUA scripting, I did try researching on google and played around with the script but can't seem to get anything right.

I'm using Muziko skin and I looked to see how the seek bar was used because it moves while music is playing and stops when the music stops, but I don't understand how to use or adapt it for the gif animation.

Any help would be greatly appreciated
User avatar
balala
Rainmeter Sage
Posts: 16323
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with pausing/stopping a GIF

Post by balala »

A very simple solution I found is using the new AudioLevel AudioLevel plugin:

Code: Select all

[Rainmeter]
Update=100
DynamicWindowSize=1

[MeasureRMSRaw]
; This measure returns the level of the main audio output.
Measure=Plugin
Plugin=AudioLevel
Port=Output
Type=RMS

[measureRMS]
Measure=Calc
Formula=( 100 * MeasureRMSRaw )
IfCondition=(measureRMS>=1)
IfTrueAction=!UnpauseMeasure MeasureAnimation
IfFalseAction=!PauseMeasure MeasureAnimation

[MeasureAnimation]
Measure=CALC
Formula=(( MeasureAnimation + 1 ) % 13 )

[MeterAnimation]
Meter=BITMAP
MeasureName=MeasureAnimation
BitmapImage=Girl.png
BitmapFrames=13
BitmapExtend=1
and also find the Girl.png in the attachment. Obviously, if you are using another bitmap, you'll have to modify a bit the MeterAnimation section, to work well.
You do not have the required permissions to view the files attached to this post.
Last edited by balala on October 25th, 2014, 7:43 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22640
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with pausing/stopping a GIF

Post by jsmorley »