Showing/hiding things on a single scene is generally not the recommended way to do things. Have a dedicated scene for each thing instead, so you have lots of simple scenes instead of a few complex ones. If you're layering things so that all are visible at the same time, then of course you need all of that to be in the same scene, but beyond that, use a different scene.Thanks Warmuptill for this ever evolving plug-in....
TLDR; How can I make a macro wait for an image slide show to finish playing (not looped) and then move on to the next action?
Looking for advice on how to achieve something or maybe it requires an enhancement you could build into the plug-in in future? I'll try and explain as best I can:
I have setup through a macro a sequence of showing + hiding sources in a scene, so it's essentially cycling through showind and hiding some sources in the scene, pseudocode of the macro a bit like this:
Show source 1 (Image)
Wait 10 seconds
Hide Source 1
Show Source 2 (Image Slide Show)
Wait 30 seconds
Hide Source 2
Show Source 3 (Media File)
Wait 10 seconds
One of the sources (Let's say Source 2 in the above example) is an image slide show and the playlist of the slide show is a folder. The folder currently has 3 files in it and the slide show is set to display each image for 10 seconds, so 10 seconds per image - 30 seconds in total which is why I've set the source to be visible for 30 seconds BUT (and this is where I'm stuck) if the image file count for the slideshow changes, if I want each image to be shown for 10 seconds then I will have to manually change how long the source 2 is shown for (i.e. 4 images = waiting 40 seconds before hiding it).
What I would like to be able to do is have the amount of time the image slide show is shown for automated based on the image count in the folder / slide show playlist OR have it so the macro waits for the image slide show to finish once it starts playing and only then move on (hiding source 2 + showing source 3).
So far I've tried to approach it in different ways but not been successful:
- Thought about using variables some how but I would some how need to get a variable set to the count of files in the image slide show folder, then multiply this number by 10 and have that variable set for the 'Wait X seconds' in the macro after showing the image slide show source
- Tried making a macro which watches the state of the image slide show to be ended(playlist) and would then use this to advance to the next source (hiding source 2 + showing source 3) rather than waiting 30 seconds but this ended up always showing source 3 continously
- Thought about running a program / script which outputs the file count but not sure how to get this into advanced scene switcher as a variable or value to be used in the macro
Open to any ways you think I can do this? I think with one of the following features I'd be able to do it:
- Ability in the 'Wait' action to wait for a source property to be met (value equals or not equal to), also with a optional timeout value to stop it waiting indefinitely as a fall back). Also with this, the conditions to be able to 'Wait' before moving on to the next condition
- Ability to run a program and get it's output
- Ability to set a variables value from a (text) file
Thanks!
Also, the Wait action commits you to the entire sequence unless you can stop the macro. *Maybe* that's what you want, as a form of "tamper resistance", but most of the time, I think you want it to be easily escapable. To do that, you'll have a bunch of macros:
- Macro A
- Conditions
- If Scene A for 10 seconds
- Actions
- Switch to Scene B
- Conditions
- Macro B
- Conditions
- If Scene B for 10 seconds
- Actions
- Switch to Scene C
- Conditions
- Macro C
- Conditions
- If Scene C for 10 seconds
- Actions
- Switch to Scene D
- Conditions
- Etc.
The pattern should be obvious, so now the question becomes, "How to collapse it all into one macro that follows that pattern?" I'm thinking about a naming convention for the scenes, that defines the available ones to switch to, and a sequence number. So then the one macro might be:
- Sequence Macro
- Conditions
- If Scene <prefix><number> for 10 seconds
- Actions
- number = number + 1
- Switch to Scene <prefix><number>
- Conditions
Now the sequence can be any length, simply by the number of scenes that follow that naming convention. The macro stays the same regardless. It does rely on well-behaved error handling, when the scene past the end doesn't exist, so you might want to test that before you use it in production.
And maybe you have a second, "starting" macro that sets the variable and switches to the scene that it corresponds to. Maybe something like this:
- Starting Macro
- Conditions
- <something>
- Actions
- number = 0
- Run actions of Sequence Macro
- Conditions
@Warmuptill Is that use of variables possible?