It is currently October 15th, 2019, 7:49 pm

Help with pausing a Gif Image Loader

Help with creating, editing & fixing problems with skins
User avatar
Lukaka
Posts: 21
Joined: August 9th, 2016, 5:03 pm

Help with pausing a Gif Image Loader

Lukaka » September 19th, 2016, 9:22 pm

Hey guys, im trying to get this skin to download a radar map gif, extract it into frames, and play it (that worked fine) But then I want it to pause when i midle click it, and play again when i left click it.Cant get it to work The Rskn file is included, as well as the code here:

Code: Select all

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

[MeasureAnimLoop]
Measure=Calc
Formula=(MeasureAnimLoop % 9) + 1
Disabled=1

[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=http://sirocco.accuweather.com/nx_mosaic_400x300_public/sir/inmasirCT_.gif
Download=1
DownloadFile=current.gif
ForceReload=1
FinishAction=[!CommandMeasure MeasureExtract "Run"]
disabled=0

[meterBackgroundFrame]
meter=Image
x=3
y=3
H=95
W=64
ImageTint=#Color1#
ImageName="hi.png"
DynamicVariables=1
LeftMouseDownAction=[!WriteKeyValue MeasureImage disabled "0"][!Refresh "RadarMap\Radar"]

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!SetOption MeterAnimLoop ImageName current0000[*MeasureAnimLoop*].png][!EnableMeasure MeasureAnimLoop]

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
DynamicVariables=1
MiddleMouseUpAction=[!WriteKeyValue MeasureImage disabled "1"][!Refresh "RadarMap\Radar"]
LeftMouseDownAction=[!WriteKeyValue MeasureImage disabled "0"][!Refresh "RadarMap\Radar"]
You do not have the required permissions to view the files attached to this post.
I'm a minecraft fan and I make custom rainmeter skins that show when a minecraft user is on! (the users have to be on a official server, for instance Mineplex will not work, but wildcraftmc will)
:welcome:
User avatar
balala
Rainmeter Sage
Posts: 8823
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with pausing a Gif Image Loader

balala » September 20th, 2016, 5:31 am

I can't check this solution right now, so I'm not sure it is 100% ok, but I'd be tempted to replace the MiddleMouseUpAction and LeftMouseDownAction options of the [MeterAnimLoop] measure with something like:

Code: Select all

[MeterAnimLoop]
...
MiddleMouseUpAction=[!PauseMeasure "MeasureAnimLoop"]
LeftMouseDownAction=[!UnpauseMeasure "MeasureAnimLoop"]
A refresh of the skin is not a good solution, because after it, the animation will be restarted, from the first frame.
User avatar
Lukaka
Posts: 21
Joined: August 9th, 2016, 5:03 pm

Re: Help with pausing a Gif Image Loader

Lukaka » September 20th, 2016, 11:26 am

That did not seem to work, it is still just a gray box.
I'm a minecraft fan and I make custom rainmeter skins that show when a minecraft user is on! (the users have to be on a official server, for instance Mineplex will not work, but wildcraftmc will)
:welcome:
User avatar
balala
Rainmeter Sage
Posts: 8823
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with pausing a Gif Image Loader

balala » September 20th, 2016, 12:05 pm

Lukaka wrote:That did not seem to work, it is still just a gray box.
Now I tried it and have to say, it's working well. The animation appears after the gif is downloaded and replacing the MiddleMouseUpAction and LeftMouseDownAction options of the [MeterAnimLoop] meter with the !PauseMeasure / !UnpauseMeasure bangs, did the pausing / unpausing job.
But in your initial post, you've said
Lukaka wrote:im trying to get this skin to download a radar map gif, extract it into frames, and play it (that worked fine)
so, I understood that the skin is working, the animation is played, just you can't pause / unpause it. I misunderstood something?
If you can't make to work and the animation appear, maybe it would deserve a restart of Rainmeter. The skin uses the WebParser plugin and sometimes to can make it to work well, it requests a such restart.
User avatar
Lukaka
Posts: 21
Joined: August 9th, 2016, 5:03 pm

Re: Help with pausing a Gif Image Loader

Lukaka » September 20th, 2016, 6:57 pm

Ok somehow the extract program was deleted, I fixed it and it works now!

Code: Select all

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

[MeasureAnimLoop]
Measure=Calc
Formula=(MeasureAnimLoop % 9) + 1
Disabled=1

[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=http://sirocco.accuweather.com/nx_mosaic_400x300_public/sir/inmasirCT_.gif
Download=1
DownloadFile=current.gif
ForceReload=1
FinishAction=[!CommandMeasure MeasureExtract "Run"]
disabled=0

[meterBackgroundFrame]
meter=Image
x=3
y=3
H=95
W=64
ImageTint=#Color1#
ImageName="hi.png"
DynamicVariables=1
LeftMouseDownAction=[!UnpauseMeasure "MeasureAnimLoop"]

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!SetOption MeterAnimLoop ImageName current0000[*MeasureAnimLoop*].png][!EnableMeasure MeasureAnimLoop]

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
DynamicVariables=1
MiddleMouseUpAction=[!PauseMeasure "MeasureAnimLoop"]
LeftMouseDownAction=[!UnpauseMeasure "MeasureAnimLoop"]

I think the background code is unnecessary now, but it helps me know when the script is not working vs. when its downloading the image. Thanks again!
Last edited by Lukaka on September 21st, 2016, 2:51 pm, edited 3 times in total.
I'm a minecraft fan and I make custom rainmeter skins that show when a minecraft user is on! (the users have to be on a official server, for instance Mineplex will not work, but wildcraftmc will)
:welcome:
User avatar
balala
Rainmeter Sage
Posts: 8823
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with pausing a Gif Image Loader

balala » September 20th, 2016, 7:09 pm

You're welcome. I'm glad if it's working well now.
User avatar
Lukaka
Posts: 21
Joined: August 9th, 2016, 5:03 pm

Re: Help with pausing a Gif Image Loader

Lukaka » September 20th, 2016, 11:18 pm

Ok now it is no longer re-downloading the image every once and a while. Sorry im so inexperienced, first skin :)

Edit: After playing around i noticed that it IS re-downloading the image, but it is not extracting it. Turns out this was because i had deleted the extracting program. :?

Code: Select all

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

[MeasureAnimLoop]
Measure=Calc
Formula=(MeasureAnimLoop % 9) + 1
Disabled=1

[MeasureImage]
Measure=Plugin
Plugin=WebParser
UpdateRate=60
URL=http://sirocco.accuweather.com/nx_mosaic_400x300_public/sir/inmasirCT_.gif
Download=1
DownloadFile=current.gif
ForceReload=1
FinishAction=[!CommandMeasure MeasureExtract "Run"]
disabled=0

[meterBackgroundFrame]
meter=Image
x=3
y=3
H=95
W=64
ImageTint=#Color1#
ImageName="hi.png"
DynamicVariables=1
LeftMouseDownAction=[!UnpauseMeasure "MeasureAnimLoop"]

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
UpdateRate=60
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!SetOption MeterAnimLoop ImageName current0000[*MeasureAnimLoop*].png][!EnableMeasure MeasureAnimLoop]

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
DynamicVariables=1
RightMouseUpAction=[!UnpauseMeasure "MeasureImage"]
MiddleMouseUpAction=[!PauseMeasure "MeasureAnimLoop"]
LeftMouseDownAction=[!UnpauseMeasure "MeasureAnimLoop"]

I'm a minecraft fan and I make custom rainmeter skins that show when a minecraft user is on! (the users have to be on a official server, for instance Mineplex will not work, but wildcraftmc will)
:welcome:
User avatar
balala
Rainmeter Sage
Posts: 8823
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with pausing a Gif Image Loader

balala » September 21st, 2016, 3:22 pm

Lukaka wrote:Ok now it is no longer re-downloading the image every once and a while. Sorry im so inexperienced, first skin :)

Edit: After playing around i noticed that it IS re-downloading the image, but it is not extracting it. Turns out this was because i had deleted the extracting program. :?
So, now if you put back the extracting program, it's working well, or not?
User avatar
Lukaka
Posts: 21
Joined: August 9th, 2016, 5:03 pm

Re: Help with pausing a Gif Image Loader

Lukaka » September 21st, 2016, 3:27 pm

Its working 100% fine. Sorry to be confusing!
I'm a minecraft fan and I make custom rainmeter skins that show when a minecraft user is on! (the users have to be on a official server, for instance Mineplex will not work, but wildcraftmc will)
:welcome:
User avatar
balala
Rainmeter Sage
Posts: 8823
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with pausing a Gif Image Loader

balala » September 21st, 2016, 4:16 pm

Lukaka wrote:Its working 100% fine. Sorry to be confusing!
Ok, I'm glad.
I have just one more observation about the code: instead of using the MiddleMouseUpAction and LeftMouseDownAction, on the [MeterAnimLoop] meter, for pausing / unpausing the [MeasureAnimLoop] measure, I'd remove the MiddleMouseUpAction and would replace the LeftMouseDownAction, with the following LeftMouseUpAction (just mention that the LeftMouseDownAction is a usually undesired option): LeftMouseUpAction=[!TogglePauseMeasure "MeasureAnimLoop"]. This bang would pause the unpaused measure and would unpaused the paused one (with the same action - left click). Which solution do you prefere, is your choice - but at least I would use, for sure, that with the !TogglePauseMeasure bang.