Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1494

Help: Rainmeter Skins • Re: Help with leading zeroes and counting files in a folder

$
0
0
I don't like loose ends, so here's an alternative that completely eliminates loading some particular image on refresh...

Code:

[Variables]Path=#ROOTCONFIGPATH#ImagesInterval=3600[Rainmeter]Update=1000AccurateText=1DynamicWindowSize=1[Metadata]Name=PolaroidAuthor=Mifdy---Measures---[Folder]Measure=PluginPlugin=FileViewRecursive=2Path=#Path#Extensions=jpg;png;bmpFinishAction=[!UpdateMeasureGroup Folder][!UpdateMeasureGroup Random][!SetOption Image MeasureName "Name"][!UpdateMeter Image][!Redraw][Count]Group=FolderMeasure=PluginPlugin=FileViewPath=[Folder]Type=FileCountUpdateDivider=-1[Index]Group=RandomMeasure=ScriptScriptFile=Random.luaUpdateDivider=#Interval#; [Index]; Group=Random; Measure=Calc; Formula=Random; LowBound=1; HighBound=([Count]=0?1:[Count]); UpdateRandom=1; UniqueRandom=1; UpdateDivider=#Interval#; DynamicVariables=1[Name]Group=Folder|RandomMeasure=PluginPlugin=FileViewPath=[Folder]Type=FilePathIgnoreCount=1Index=[Index]UpdateDivider=#Interval#DynamicVariables=1[Caption]Measure=PluginPlugin=QuotePluginPathName=#ROOTCONFIGPATH#Caption.txtUpdateDivider=-1---Meters---[Frame]Meter=ImageX=0Y=50W=444H=530ImageName=#ROOTCONFIGPATH#@Resources\frame.png[Tape]Meter=ImageX=215Y=5W=244H=144ImageName=#ROOTCONFIGPATH#@Resources\tape.png[Scene]Meter=ImageX=28Y=85W=356H=351SolidColor=60,60,60,170[Image]Meter=ImageX=28Y=85W=356H=351PreserveAspectRatio=1UpdateDivider=#Interval#LeftMouseUpAction=[!UpdateMeasureGroup Random][!UpdateMeter Image][!Redraw]DynamicVariables=1[Notes]Meter=StringMeasureName=CaptionFontSize=30SolidColor=0,0,0,1StringAlign=leftFontColor=0,0,0,250FontFace=GINETTEClipString=1Antialias=1Angle=(Rad(-3))X=80Y=490W=310H=65LeftMouseUpAction=[#CURRENTPATH#Caption.txt]MiddleMouseUpAction=[!UpdateMeasure Caption][!UpdateMeter Notes][!Redraw]
The key above is to start with no MeasureName in [Image] on refresh, and set it afterwards via !SetOption, as soon as the folder is read. You can test what happens in 'slow motion' by temporarily removing the [!Redraw] from the FinishAction in [Folder] - it won't display a particular image until the folder is read (using no [!Redraw] was yet another method to make the previous issue occur consistently, by the way). As a bonus, I left a commented out [Index] measure that gets the random without Lua by exhausting all values before reusing them again, feel free to see if it's the Lua script equivalent or what you may need for a potential scriptless version.
Amazing, thank you. I've implemented your index code and tested it with over 1500 images. I can't see any downside compared to using the Lua script, so it looks like an all-round improvement to me.

Perhaps you could help me with this: I attempted to add a log output that simply shows the number of the currently displayed picture. I've gotten it to work when the skin is clicked by appending [!Log "Current Image: [Index]"] to the LeftMouseUpAction= line, but can't get anything to show when the picture changes automatically due to the Interval timer. I tried adding it to the end of the FinishAction= line in the Folder measure and it appears once on skin refresh, but no more after that. Any ideas?

Statistics: Posted by Mifdy — 32 minutes ago



Viewing all articles
Browse latest Browse all 1494

Trending Articles