;first check if .ini file is present and then get configuration IntControl (12, 5, 0, 0, 0) i=1 ;check file size change than 500 kb ;add a one time setup configuration routine if fileexist("picframe.ini")==1 pics=IniReadPvt("Main", "PictureDirectory", "c:\", "c:\picframe.ini") exe=IniReadPvt("Main", "ViewerEXE", "c:\", "c:\picframe.ini") autodownloadrexe=IniReadPvt("Main", "AutoDownLoadrEXE", "c:\program files\Flickr AutoDownloadr\Flickr Autodownloadr.exe", "c:\picframe.ini") msgboxdelay=IniReadPvt("Main", "MsgBoxDelay", "5", "c:\picframe.ini") ssonstartup=IniReadPvt("Main", "SlideShowModeOnStartUp", "NO", "c:\picframe.ini") ssonstartupinterval=IniReadPvt("Main", "SlideShowModeOnStartUpInterval", "5", "c:\picframe.ini") buttonclicksound=IniReadPvt("Main", "ButtonClickSound", "game.wav", "c:\picframe.ini") flickrdownloads=IniReadPvt("Main", "FlickrDownloads", "YES", "c:\picframe.ini") flickrurl=IniReadPvt("Main", "FlickrURL", "http://www.flickr.com/photos/alinke/sets/72057594100099663/", "c:\picframe.ini") flickrresolution=IniReadPvt("Main", "FlickrResolution", "6", "c:\picframe.ini") singlepicpath=IniReadPvt("Main", "SinglePicPath", "c:\pics\leila.jpg", "c:\picframe.ini") flickrdownloaddelay=IniReadPvt("Main", "FlickRDownloadDelay", "30", "c:\picframe.ini") flickrrechecktime=IniReadPvt("Main", "FlickRRecheckTime", "200", "c:\picframe.ini") checkfornewpicturesfrequency=IniReadPvt("Main", "CheckForNewPicturesFrequency", "300", "c:\picframe.ini") else ; if picframe.ini is not present, then just use defaults pics="c:\pics" exe="c:\vallen\jpegger\jpegger.exe" flickrdownloads="YES" flickrurl ="http://www.flickr.com/photos/alinke/sets/72057594100099663/" msgboxdelay=3 flickrresolution=6 autodownloadrexe="c:\program files\Flickr AutoDownloadr\Flickr Autodownloadr.exe" ssonstartup="YES" endif ;check the initial file size a=Dirsize(pics,1) ;Display(3, "size", a) if ssonstartup == "NO" ;load a single .jpg only startupcommandline="-fs -mw -dm:4 -setlng:ENU -notab" RunHideWait(exe,"%startupcommandline% %singlepicpath%") else ;do slideshow startupcommandline="-ss:%ssonstartupinterval% -fs -mw -dm:4 -setlng:ENU -notab -r " Run(exe,"%startupcommandline% %pics%") endif if flickrdownloads == "YES" ;now run autodownloadr TimeDelay(flickrdownloaddelay) ; this delay is to give the wireless connection time to connect as flickr can't start before the wireless is active Display(msgboxdelay, "FlickR", "Downloading Pictures from FlickR URL: %flickrurl%") autoloadrcommandline="flickrss:%flickrurl% /downloadonly /res=%flickrresolution% " TimeDelay(.5) Run(autodownloadrexe,autoloadrcommandline) endif ;get the initial file size ;check directory size again and is it different TimeDelay(flickrrechecktime) b=Dirsize(pics,1) ;Display(3, "size", b) ;check directory size if b > (a+500000) ;was 500kb added in file size to the directory display(5,"New Pictures Added","New Pictures Added, Slide Show Will Be Re-Started....") TimeDelay(1) ;something was added so wait for it to be added ;SendKeysTo("~Vallen", "{ESC}") ;SendKey("{ESC}") WinClose("~Vallen") if ssonstartup == "NO" ;load a single .jpg only startupcommandline="-fs -mw -dm:4 -setlng:ENU -notab" RunHideWait(exe,"%startupcommandline% %singlepicpath%") else ;do slideshow startupcommandline="-ss:%ssonstartupinterval% -fs -mw -dm:4 -setlng:ENU -notab -r " Run(exe,"%startupcommandline% %pics%") endif else ;display(5,"no change","no change") ; do nothing TimeDelay(1) endif while i == i ;infinite loop ;now get the initial file size again a=Dirsize(pics,1) ;Display(3, "size", a) ;now wait some time and then check again TimeDelay(checkfornewpicturesfrequency) b=Dirsize(pics,1) ;Display(3, "size", b) if b > (a+500000) ;was 500kb added in file size to the directory display(5,"New Pictures Added","New Pictures Added, Slide Show Will Be Re-Started....") TimeDelay(1) ;something was added so wait for it to be added ;SendKey("{ESC}") WinClose("~Vallen") if ssonstartup == "NO" ;load a single .jpg only startupcommandline="-fs -mw -dm:4 -setlng:ENU -notab" RunHideWait(exe,"%startupcommandline% %singlepicpath%") else ;do slideshow startupcommandline="-ss:%ssonstartupinterval% -fs -mw -dm:4 -setlng:ENU -notab -r " Run(exe,"%startupcommandline% %pics%") endif else ;display(5,"no change","no change") ; do nothing TimeDelay(1) endif endwhile ; end while loop