SlideShow [v1.7]

Discuss and share scripts and script files...
FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

SlideShow [v1.7]

Post by FluxTorpedoe »

##################
###   Slideshow v1.7   ###
##################


• DOWNLOAD:
   — Latest version: Slideshow v1.7 — Updated 2020-05-21


———————————————————————————


DESCRIPTION:

Runs a slide show of your images. (doh!)

FEATURES:

:arrow: Various settings available:
     - define duration between slides
     - enable loop
     - slide through all pictures in folder including all subfolders!
     - choose to run slide show in floating window instead of fullscreen
     - slide show images in random order
:arrow: Available in three flavors:
  • a simple "no questions asked" Default SlideShow
  • a Custom SlideShow, with an input where you can change settings (Note: This is also were you can save settings for the default slideshow)
  • an extra "Alternate SlideShow" to be run from external source (Script, CKS, Menu, Catalog, etc.)
:arrow: Can be run from:
  • the filelist (via a button or Custom Keyboard Shortcut [CKS]) — automatically opens fullscreen preview, and closes it on slide show end
  • directly from the floating or fullscreen preview (via a CKS).
:arrow: Control:
  • Navigate with arrow/page keys
  • Zoom/Unzoom with +/- (Tip: don't forget to "lock zoom")
  • Pause by pressing "ALT" (Note: this disables all other KS)
  • or Pause with a CKS (Recommended: all other KS will work as usual) (see (#) below in Installation)


NOTES:

• Slide show can be interrupted by pressing ESC, or closing the preview window.
  • Before running the slide show, the script opens a new tab listing image files only. Tab will be closed automatically on slide show end.
  • By default, it will only show standard images (jpg, gif, png...).
     - If you have image codecs (FastPictureViewer CodecPack, SageThumbs...), it can make a slide show of all images.
     - Or if you use the PowerLauncher script, it can use your image "definitions" from PL's definition file.
:arrow: For that, just add/remove the corresponding comment ("//" sign) in the header of the script.



TIP:

You can use other file-related Keyboard Shortcuts during the slide show (*).
:arrow: e.g. Tag or Label your pics on the fly - and more! [pre]
(with CKS assigned to "Edit Tags by List..." or to Labeling, etc.)
[/pre]


(*) Requires XY>=v12.40.0213 with FPEnableCKS activated.


USAGE:

• Install the SlideShow script (procedure below)
• Go to a folder that contains images, then
  - Left Click on the SlideShow button, or press your CKS (e.g. Shift+Enter), or
  - Right Click on the SlideShow button and choose "Custom SlideShow", or press your CKS (e.g. Alt+Shift+Enter),
      In the window, enter e.g. 1SLW (i.e. Duration: 1sec, include Subfolders, Loop, play in floating Window),


and...

• Enjoy the show!
& don't hesitate to post your questions, suggestions, comments... 8)
Flux


———————————————————————————
###################
###    Installation   ###
###################


Download the script (link above) and copy it into XYplorer scripts folder: <xyscripts> , then:

• Recommended (but optional): Assign Custom Keyboard Shortcuts (CKS) via "User | Manage Command... | Load Script File"
      Script File: SlideShow.xys         Label: SlideShow              "Assign Keyboard Shortcut..."   e.g.   "Shift+Enter"
      Script File: SlideShow.xys         Label: CustomSlideShow  "Assign Keyboard Shortcut..."   e.g.   "Alt+Shift+Enter"


(#) Optional, to correctly pause SlideShow with CKS (instead of "ALT"): Assign a CKS to command "Iconize" (#358)
Menu: "Tools" | "Customize Keyboard Shortcuts..." > Button: "Jump..." > "358"
"Press New Shortcut:" e.g. "SHIFT+P"


---------------------------------------------------------------------------------

And/Or (optional if CKS defined), either:
Add load "SlideShow.xys"; to the "on click" and load "SlideShow.xys", "CustomSlideShow"; to the "on right-click" of your custom button, or

Use the following snippet (with Don's litteral instructions):
-a) Paste ::snippet; into the address bar and press ENTER. A text box will open to enter snippet.
-b) And here comes the copy+paste ready snippet. It will create a new button at the right end of your toolbar.

Code: Select all

Snip: CTB 1
  XYplorer 12.40.0000, 13-06-09 19:22:29
Action
  NewUserButton
Name
  SlideShow
Icon
  %winsysdir%\shell32.dll /141
ScriptL
  load "SlideShow.xys", "SlideShow";
ScriptR
  load "SlideShow.xys", "CustomSlideShow";
FireClick
  0
Or to integrate with another button, add the following lines to your CTB:

Code: Select all

"SlideShow|%winsysdir%\shell32.dll /141"
  load "SlideShow.xys", "SlideShow";
"Custom SlideShow"
  load "SlideShow.xys", "CustomSlideShow";
———————————————————————————
################
### Changelog ###
################


v1.7
* Recursing never done when no subfolder exists (prevents thumbnail regeneration)
v1.6
* Strict code compliance

v1.5
+++ Added random slideshow ability
+ Define Default Slideshow settings via Custom Slideshow interface (no need to edit script)
* Relocated settings from script header to "INI" section at bottom
* Optimization: Changed order when branch view and filtering take place —depending on XY version (</> 15.00.0504)
v1.0 beta 1
++ Ability to Pause slide show (info in header of script)
++ Run in Window or FullScreen (separate setting for standard, custom, and alternate slide show)
+ All options are now also available for standard slideshow and located in header of script
* Rewrote management of timer for better handling of slide show interruption
v0.9
+++ ESC cancels slideshow without interrupting script
=> no annoying message, no need to ESCape again to leave preview, no remaining tab
+++ SlideShow accepts all default Floating/Fullscreen Preview Keyboard Shortcuts
(Note: still works well with your own shortcuts via FPEnableCKS)
v0.6.1
! Fixed Default SlideShow not ending (bug introduced with last version)
v0.6
* Optimized visual experience in Recurse Subfolders mode
+ Script remembers last setting used in Custom SlideShow
+ Added an "Alternate SlideShow" for CKS use, i.e. a predefined inputless Custom SlideShow (check bottom of script) (opt.)
* Default slide duration of default SlideShow is now accessible in script header
! Fixed bug where Looped SlideShow would stop when started from last pic

v0.5b4
+ Use Left and Right arrows to navigate between files during slide show (opt.)
+ Resume interrupted slide show (smartly reusing SlideShow tab)
v0.5b3
! Fixed tab misbehavior (with settings OpenNewTabsNextToCurrent & CycleTabsInRecentlyUsedOrder OFF)
—————————

version 1.5:
Slideshow.xys
(7.61 KiB) Downloaded 1943 times
Last edited by FluxTorpedoe on 21 May 2020 20:18, edited 28 times in total.

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: SlideShow [v0.5b1]

Post by FluxTorpedoe »

Yikes,
Just after posting this, I had the idea to search the forum and I saw that serendipity had already wrote one slide show script!
At first glance it seems we don't use the same approach, so each might have its use.

One thing for sure is that if you have a too old version of XY and my script doesn't work, then serendipity's XYSlideshow might be the solution.
I'll update my post with the XY version warning.

---------

For the curious out there, basically I'm using:

Code: Select all

while (get("FocusedPos") <  get("CountItems")) {
  sel "+1";
}

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: SlideShow [v0.5b1]

Post by klownboy »

Hey Flux,
Nice script. Thanks for sharing. I noticed that after the last slide and getting the last picture message the script will leave me in a different folder from where I started and it's not the parent (in both versions - regular and custom). I started in: "G:\Pictures\Emory" and ended up in "G:\TV - Misc\". I haven't looked at the code details yet, but it seemed a bit strange and I figured I'd pass it on. I'd suggest not having the message popping up at the start and end and maybe simply have a status bar message (i.e., something we wouldn't have to click through) or an option for no messages. It can get a bit annoying when you have a small number of pictures especially since you typically get a sound along with the message.
Thanks again,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: SlideShow [v0.5b2]

Post by FluxTorpedoe »

Hi'
Thanks for the feedback!
The messages were annoying indeed... ;)
So I just removed them (they can still be activated in the script header). You can download the updated beta 2 (with this only change).

Regarding the mix-up of folders, I can't repro here (neither on my XY, nor on a clean one). :shock:
What's you XYplorer version?
Could you tell me if when ending up in this different folder, it's in in a new tab, or an old tab that already had this location, or an old tab overwritten with this new location?
Maybe it's related to the automatic closing of the "slideshow" tab (created to list images only), and a setting related to tab cycling... I'll check up on this as soon as I can.

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: SlideShow [v0.5b2]

Post by klownboy »

Hi Flux,
Beta 2 - much better without the messages. :) I still end up in a different folder than where I started though - same as I mentioned before - I know you didn't change anything concerning that. I'll take a look at the code later and step through it to see what's happening.

I'm using the very latest beta 10.40.0304, Windows 7 x64. Yes, it did make the slideshow tab and when it ended it closed the tab and I end up in my locked "TV - Misc" folder. The folder I was slide-showing the pictures was a sub-folder of a locked folder "Pictures".

As a side note, when I used the sub-folder allowance (e.g., 2S) and escaped out of the slideshow after seeing quite a few pictures, the script closed a locked tab "Pictures" (in G:\Pictures" - it has a ton of sub-folders containing pictures under it) when it finished. Previously I was using it from a sub folder under pictures, which is not locked, so it goes to my "C:\" root drive since it's set as a default for all folders I view which are not locked. More later.

Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: SlideShow [v0.5b3]

Post by FluxTorpedoe »

Thanks for the clarification, I've figured it out.
It was caused by your tab settings (OpenNewTabsNextToCurrent: OFF AND CycleTabsInRecentlyUsedOrder: OFF), i.e. new tabs are opened at the end, but when closed they don't switch to the previous active one but to the last one.
No it should work whatever the configuration.
8)

+ @all
I've added a cool TIP in the first post... :wink:

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: SlideShow [v0.5b4]

Post by klownboy »

Thanks Flux,

Beta 0.5b4 works like a charm...no jumping to another folder at the end of the slideshow.

You are right about the tab settings. I like to work with fixed (locked) tabs and have my "C:\" act as the default for opening other folder locations.

Just curious though, is the script generating new thumbnails as opposed to using existing one for the folder(s)? Because of the filtering there may not be anyway to avoid that situation I suppose. After a bit more testing, I noticed the generation seems to happen when I use the "s" to include sub-folders. It generated new thumbs when I used the "s" switch even when there were no sub-folders (obviously, I shouldn't have used the "s" when I knew there were no subs). It doesn't appear to generate "new" thumbs (when they previously existed) if you are slide showing only the current folder with no subs.

I did notice though on escaping the newly generated slideshow tab with the picture filters is still present. I'm not sure if it would be easy to clean up the remnant tab when escaping, maybe using "_Terminate" label.

Thanks again,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: SlideShow [v0.5b4]

Post by FluxTorpedoe »

klownboy wrote:is the script generating new thumbnails as opposed to using existing one for the folder(s)? Because of the filtering there may not be anyway to avoid that situation I suppose. After a bit more testing, I noticed the generation seems to happen when I use the "s" to include sub-folders.
Per se, the script isn't using any thumbnail or thumbnail view at all, it just opens the preview and select images one by one.
So I guess the effect you're talking about is only when you start the slide show in one of the Thumbnails Views.
And after investigation, the fact that you notice it only in "Subfolder" mode comes from the thumbnails cache settings: for the script to list all images in folder including its subfolders, the branch mode (aka flatfiles) is activated, which is a form of search.
:arrow: So the solution would be to activate the setting "Cache thumbnails of search results, too".

:!: Anyway, that raised my interest, so I completely reordered the way the "Subfolder" mode is parsed, so it will be much faster and responsive even without this setting!
klownboy wrote:I did notice though on escaping the newly generated slideshow tab with the picture filters is still present. I'm not sure if it would be easy to clean up the remnant tab when escaping, maybe using "_Terminate" label.
Unfortunately, ESC really interrupts the whole script and all its dependencies AFAIK... So I fear there's no way to auto-close the tab after an interruption.
That's why in v0.5b4 I'd decided to take advantage of it and optimized the code to be able to resume a slideshow from the current slideshow tab.
So e.g. even this sequence works: Regular SlideShow (Opens a new filtered tab) > Interruption > CustomSlideShow with Subfolders (keep filtered tab but recurse it).

I'll give all this a day to try and see if there are other things to fix or enhance before posting the update.
Thanks for your remarks & don't hesitate if you have any other comment or suggestion! 8)
Flux

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: SlideShow [v0.5b4]

Post by klownboy »

Hey Flux,
Thanks for the explanations. I was indeed in the thumbnail view when I started the slideshow. Typically, I would be since I have my picture and wallpaper folders set to view as thumbnails in Folder View Settings. It did look like it was redrawing the thumbnails before starting the slideshow when I used the "S" switch whether I had a sub-directory or not.

I was under the impression that if "_Terminate" was present in the script resource file, it would be run at the conclusion of the script whether it was escaped or not, but I guess that's not the case. Some previous posts with Don that raised the need for "_Initiate" and "_Terminate" led me to believe that though.
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: SlideShow [v0.5b4]

Post by aurumdigitus »

Would this be possible - when using Custom Slideshow could there be a MRU drop-down list? If that is too complex or impossible maybe at least have the dialog box remember the last value input. :!:

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: SlideShow [v0.6]

Post by FluxTorpedoe »

@Ken
Things should be better now with thumbnails in Subfolders mode - though as I said, it's a search so they have to be rebuilt anyway (AFAIK).

@aurumdigitus
I like that idea...
Done! :)

Have a nice day, 8)
Flux

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: SlideShow [v0.6]

Post by klownboy »

Hi Flux, You refer to v0.6 in the updated first post, but what I downloaded on June 13 is "0.5b5 - 2013-06-12" according to the file contents. I take it that 0.5b5 is really 0.6?
Thanks for the updates,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: SlideShow [v0.6]

Post by FluxTorpedoe »

Ooops. :oops:
Right file but wrong header indeed... (Fixed)
I had a late thought that it was worthy of going out of beta. ;)

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: SlideShow [v0.6.1]

Post by FluxTorpedoe »

Hi'
One of the last fixes introduced a bug, with the Default SlideShow remaining stuck on the last image... :bug:

Sorry for that. It's now fixed.

Have a nice day, 8)
Flux

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: SlideShow [v0.6.1]

Post by klownboy »

Hey Flux, I had tried version 0.6.0 and it got me in some kind of fix that I couldn't get out of without exiting XY and restarting it. Those darn bugs...no harm done. Never got a chance to report back. SlideShow [v0.6.1] seems to be working fine.
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Post Reply