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

General Discussion • Re: Looking for a multi-source picture frame

$
0
0
I got a problem with this bugger. Despite having a folder with hundreds of pictures to choose from, it regularly and repeatedly picks the the same photos over and over. I see the same pictures over and over while others are never or rarely show. There's nothing in the code to explain such favoritism, so what else could it be?
I do have a FolderInfo/ FileView / Random Calc version written and functioning, but didn't post it yet since sometimes it returns no image (i.e. a black output), which might indicate some slight timing issue between reading from drive and showing the result. Once that is solved, I'll share it here, maybe it helps. In the meantime, the Lua variants can of course be tested, though personally I don't see Lua an absolute necessity in this case.
So, first, here's an improved version of the earlier code, it has scaling and some tooltip details on hover, but will exhibit the same random issue:

Code:

[Variables]Width=160Height=90Border=2Scale=1Step=0.1InfoTime=300ViewTime=1ImageCount=3ImagePath1=f:\Images\Cars\Wallpapers\Unprocessed\000000001SubFolders1=0FileFilter1=*.jpg;*.jpeg;*.png;*.bmp;*.gifImagePath2=f:\Images\Cars\Wallpapers\Unprocessed\000000002SubFolders2=0FileFilter2=*.jpg;*.jpeg;*.png;*.bmp;*.gifImagePath3=f:\Images\Cars\Wallpapers\Unprocessed\000000003SubFolders3=0FileFilter3=*.jpg;*.jpeg;*.png;*.bmp;*.gif[Rainmeter]Update=1000AccurateText=1DynamicWindowSize=1---Measures---[Path1Image]Measure=PluginPlugin=QuotePluginPathName=#ImagePath1#FileFilter=#FileFilter1#Subfolders=#SubFolders1#UpdateDivider=#ViewTime#[Path2Image]Measure=PluginPlugin=QuotePluginPathName=#ImagePath2#FileFilter=#FileFilter2#Subfolders=#SubFolders2#UpdateDivider=#ViewTime#[Path3Image]Measure=PluginPlugin=QuotePluginPathName=#ImagePath3#FileFilter=#FileFilter3#Subfolders=#SubFolders3#UpdateDivider=#ViewTime#[FinalImage]Measure=CalcFormula=RandomLowBound=1HighBound=#ImageCount#UpdateRandom=1UpdateDivider=#ViewTime#RegExpSubstitute=1Substitute="^(\d+)$":"Path\1Image"DynamicVariables=1---Meters---[Background]Meter=ShapeShape=Rectangle (#Border#/2*#Scale#),(#Border#/2*#Scale#),((#Width#+#Border#)*#Scale#),((#Height#+#Border#)*#Scale#) | Fill Color 0,0,0,255 | StrokeWidth (#Border#*#Scale#) | StrokeColor 255,255,255,75UpdateDivider=-1DynamicVariables=1[Slideshow]Meter=ImageX=(#Border#*#Scale#)Y=(#Border#*#Scale#)W=(#Width#*#Scale#)H=(#Height#*#Scale#)PreserveAspectRatio=1MeasureName=[FinalImage]UpdateDivider=#ViewTime#MouseScrollUpAction=[!SetVariable Scale (Clamp(#Scale#+#Step#,0.5,10))][!UpdateMeter *][!Redraw]MouseScrollDownAction=[!SetVariable Scale (Clamp(#Scale#-#Step#,0.5,10))][!UpdateMeter *][!Redraw]LeftMouseUpAction=["[#ImagePath[&FinalImage:]]"]TooltipTitle=[FinalImage:]) [&[&FinalImage]]TooltipText=1) [Path1Image]#CRLF#2) [Path2Image]#CRLF#3) [Path3Image]DynamicVariables=1
Secondly, as promised, here's the FolderInfo / FileView alternative, featuring the same things as the first, but without the random issue:

Code:

[Variables]Width=160Height=90Border=2Scale=1Step=0.1InfoTime=300ViewTime=1ImageCount=3PathIndex=1FileIndex=1ImagePath1=f:\Images\Cars\Wallpapers\Unprocessed\000000001SubFolders1=0FileFilter1=(?i)^.*[.](?:jpg|jpeg|png|bmp|gif)$ImagePath2=f:\Images\Cars\Wallpapers\Unprocessed\000000002SubFolders2=0FileFilter2=(?i)^.*[.](?:jpg|jpeg|png|bmp|gif)$ImagePath3=f:\Images\Cars\Wallpapers\Unprocessed\000000003SubFolders3=0FileFilter3=(?i)^.*[.](?:jpg|jpeg|png|bmp|gif)$FileFilterAll=jpg;jpeg;png;bmp;gif[Rainmeter]Update=1000AccurateText=1DynamicWindowSize=1---Measures---[Path1Count]Measure=PluginPlugin=FolderInfoFolder=#ImagePath1#InfoType=FileCountIncludeSubFolders=#SubFolders1#RegExpFilter=#FileFilter1#UpdateDivider=#InfoTime#[Path2Count]Measure=PluginPlugin=FolderInfoFolder=#ImagePath2#InfoType=FileCountIncludeSubFolders=#SubFolders2#RegExpFilter=#FileFilter2#UpdateDivider=#InfoTime#[Path3Count]Measure=PluginPlugin=FolderInfoFolder=#ImagePath3#InfoType=FileCountIncludeSubFolders=#SubFolders3#RegExpFilter=#FileFilter3#UpdateDivider=#InfoTime#[FinalNumber]Measure=CalcFormula=RandomLowBound=1HighBound=([Path1Count]+[Path2Count]+[Path3Count])UpdateRandom=1UpdateDivider=#ViewTime#OnUpdateAction=[!SetVariable PathIndex ([FinalNumber]-0>[Path1Count]?([FinalNumber]-[Path1Count]>[Path2Count]?3:2):1)][!SetVariable FileIndex ([FinalNumber]-0>[Path1Count]?([FinalNumber]-[Path1Count]>[Path2Count]?[FinalNumber]-[Path1Count]-[Path2Count]:[FinalNumber]-[Path1Count]):[FinalNumber])][!SetOption FinalFolder Path "[#ImagePath[#PathIndex]]"][!SetOption FinalImage Index [#FileIndex]][!UpdateMeasureGroup Final][!CommandMeasure FinalFolder "Update"]DynamicVariables=1[FinalFolder]Group=FinalMeasure=PluginPlugin=FileViewPath=ShowDotDot=0ShowFolder=0ShowHidden=0ShowSystem=0HideExtensions=0Recursive=2Extensions=#FileFilterAll#FinishAction=[!UpdateMeter *][!Redraw]UpdateDivider=-1DynamicVariables=1[FinalImage]Group=FinalMeasure=PluginPlugin=FileViewPath=[FinalFolder]Type=FilePathIndex=IgnoreCount=1UpdateDivider=-1DynamicVariables=1---Meters---[Background]Meter=ShapeShape=Rectangle (#Border#/2*#Scale#),(#Border#/2*#Scale#),((#Width#+#Border#)*#Scale#),((#Height#+#Border#)*#Scale#) | Fill Color 0,0,0,255 | StrokeWidth (#Border#*#Scale#) | StrokeColor 255,255,255,75UpdateDivider=-1DynamicVariables=1[Slideshow]Meter=ImageX=(#Border#*#Scale#)Y=(#Border#*#Scale#)W=(#Width#*#Scale#)H=(#Height#*#Scale#)PreserveAspectRatio=1MeasureName=FinalImageUpdateDivider=-1MouseScrollUpAction=[!SetVariable Scale (Clamp(#Scale#+#Step#,0.5,10))][!UpdateMeter *][!Redraw]MouseScrollDownAction=[!SetVariable Scale (Clamp(#Scale#-#Step#,0.5,10))][!UpdateMeter *][!Redraw]LeftMouseUpAction=["[#ImagePath[#PathIndex]]"]TooltipTitle=#PathIndex#) #FileIndex#) [FinalImage] <[FinalNumber]>TooltipText=1) #ImagePath1# <[Path1Count]>#CRLF#2) #ImagePath2# <[Path2Count]>#CRLF#3) #ImagePath3# <[Path3Count]>DynamicVariables=1
Feel free to adjust the paths and ViewTime / InfoTime to your own, make sure FileFilterAll is equivalent to the previous 3 FileFilters if you change them, or ask for an explanation if you didn't understand how it works and want to find out. If you wonder, the things in the OnUpdateAction take advantage of numeric conditionals (also known as the ternary operator in other languages) to convert the multi-folder random [FinalNumber] into the corresponding single-folder equivalents used to choose the displayed image.

P.S. In the end, the blank result I was getting earlier was simply because I forgot to use the nested syntax for the FileIndex variable in the OnUpdateAction.

Statistics: Posted by Yincognito — Yesterday, 9:20 pm



Viewing all articles
Browse latest Browse all 781

Trending Articles