Resource icon

Advanced Scene Switcher 1.25.5

AaronD

Active Member
The important part is the state of the "wait for transition to complete" checkbox.
The first "scene" condition will check the scene being transitioned to and the second one the one that is being transitioned from.

Maybe those could be separate conditions, instead of the same condition with a modifier?
 

Warmuptill

Active Member
I'm still not entirely sure how the logic above works tbh with you; even reading you explanation like 10 times hehe. But if it works it works!
Glad to hear you got it to work.

Maybe those could be separate conditions, instead of the same condition with a modifier?
Might be an option - not sure what I would call this condition, however.

What do you think about instead of calling this option instead of "wait for transition to complete" something like "while transitioning check scene being transitioned to".

Another idea might be to maybe remove the checkbox entirely from the current scene check and expand the transition condition and offer specifying the transition target scene or source scene.

Also, I'm not sure this is the updates fault; but I've never had a crash like this before. It happened while switching back and forth testing Adv-ss;
Hm, I don't really see any useful information in the crash report unfortunately.
It seems to crash deep within the QT libraries and I don't see any activity of the advanced scene switcher.
Do you still remember what exactly you were doing?
 
Last edited:

AaronD

Active Member
Another idea might be to maybe expand the transition condition and offer specifying the transition target scene or source scene.

I like that version. It gets a little bit iffy when the UI is different from what's actually happening under the hood, but if it accurately describes what a user sees, then that's still the way to go.

(Just be careful about building more functionality on top of that mismatch, because it *will* catch up with you at some point! A little bit is probably okay.)
 

lindenkron

Member
I have implemented your request for the run action as a fallback option in the mean time.
So if the currently entered settings are a valid way to start a process the old method will be used.
If not (and no arguments were provided) the "Stream Deck open" way will be used.
A build should be available here in a few minutes:
1637526711223.png

This doesn't do anything on build
1637526775085.png

for me.

-Lind
 

CodeYan

Member
Thank you very very much for the detailed reproduction steps!
This made it much easier to track down the problem.
I really appreciate it!

>Some tests I did make me think that the bug is happening when you change the Macro action type.
That was indeed the case.
Whenever the condition or action type was changed the index was incorrectly set to "0".

I was no longer able to reproduce the problems after correctly setting the indices on action / condition type change.

A build with a fix will be available here in a few minutes:
You will have to be logged into GitHub to be able to download it. Let me know if that is an issue for you and I can share it via other means if necessary.

I will probably release an update for the plugin next weekend to make sure this gets fixed.
Thanks again for pointing this out!
Hey, I was able to access the build as I did have the github account, but sorry for not being able to test it b4 you published a release as I didn't have time to test. Thanks for fixing it! If I notice anything else, I'll mention it.

Now that I have used the plugin even more, I noticed that the plugin executes macros one at a time. Can we have them work concurrently (or at least an option)? I have a macro set to be looped (by checking if a source is active, which is always active), which shows a text source, waits for 15 seconds, hides it, shows a different one, waits for 15 seconds, then hides it. Then I have another macro set up with a hotkey for a "Screenshot" Effect, where it transitions to a scene with the screenshot, waits, then goes back to previous scene. The problem is that when I try to use the hotkey for the screenshot macro, it waits for the other macro to finish. I am using 1.16.4.

Also, can you please add macro actions for screenshots? Currently I have my screenshot hotkey set to the same one i'm using for the macro, but it would be nice if you could set it in the macro directly.

Thanks for your awesome work!
 

Warmuptill

Active Member
View attachment 77263
This doesn't do anything on build View attachment 77264
for me.

-Lind
Found the issue - thanks for pointing it out!
Spaces need to be escaped when using the fallback method.
New build will be available here in a few:

Hey, I was able to access the build as I did have the github account, but sorry for not being able to test it b4 you published a release as I didn't have time to test. Thanks for fixing it! If I notice anything else, I'll mention it.

Now that I have used the plugin even more, I noticed that the plugin executes macros one at a time. Can we have them work concurrently (or at least an option)? I have a macro set to be looped (by checking if a source is active, which is always active), which shows a text source, waits for 15 seconds, hides it, shows a different one, waits for 15 seconds, then hides it. Then I have another macro set up with a hotkey for a "Screenshot" Effect, where it transitions to a scene with the screenshot, waits, then goes back to previous scene. The problem is that when I try to use the hotkey for the screenshot macro, it waits for the other macro to finish. I am using 1.16.4.

Also, can you please add macro actions for screenshots? Currently I have my screenshot hotkey set to the same one i'm using for the macro, but it would be nice if you could set it in the macro directly.

Thanks for your awesome work!
No worries - I am very happy that you reported the issue in the first place! :)

Adding an option to run macros concurrently should be doable and is something I wanted to look into anyway.
The screenshot action should be very easy to add.
Thanks for the suggestions!

I will look into these two points once I find the time to. (Might not be before the weekend unfortunately)
 

Warmuptill

Active Member
Unfortunately I still can't get it to run/open the file

What am I doing wrong?
View attachment 77285
Unfortunately I still can't get it to run/open the file

What am I doing wrong?
View attachment 77285
You are probably not doing anything wrong - I am most likely just missing something obvious. :)
Just to be sure:
Does opening the file when using a "simpler" path work? (C:/test.xspf for example)
Is a default application to open .xspf files set up? (So if you double click the file VLC or whatever media player is opening up without windows asking you what program you want to use)
 

lindenkron

Member
You are probably not doing anything wrong - I am most likely just missing something obvious. :)
Just to be sure:
Does opening the file when using a "simpler" path work? (C:/test.xspf for example)
Is a default application to open .xspf files set up? (So if you double click the file VLC or whatever media player is opening up without windows asking you what program you want to use)

Simpler path does nothing different.
Default application to open is VLC:
1637615368584.png
 

lindenkron

Member
Update:
I seem to have found out what's causing it. I had one scene where it worked on (didn't check that one, just used the Intro one for testing).

In that scene; there was a delay between my 'close.bat' (that kills VLC), and my VLC opening.

I guess it compulates things so fast that it manages to execute the run (even if further down the list, and behind two audio volume changes) so fast that the .bat (which is at the beginning of the macro) closes the executed playlist.

I added a 1 sec wait inbetween, and now it seems to work.

Sorry about that!
Thanks for working on it :)

Edit:
As I say that I still have issues making some things work. I'm trying to work it out; but I think it's on my end. Seeing multiple .bat files firing and so on. I'll let you know if I get it all to work!
 
Last edited:

lindenkron

Member
Okay. So I'm very confused in all of this. Some of them were working; some of them weren't. Now, all of them seem to be working. I think the only thing I did was remove the runs, and adding them again. Same paths and all.

They seem to be functioning now. *fingers crossed*
 

CodeYan

Member
Found the issue - thanks for pointing it out!
Spaces need to be escaped when using the fallback method.
New build will be available here in a few:


No worries - I am very happy that you reported the issue in the first place! :)

Adding an option to run macros concurrently should be doable and is something I wanted to look into anyway.
The screenshot action should be very easy to add.
Thanks for the suggestions!

I will look into these two points once I find the time to. (Might not be before the weekend unfortunately)
Thanks!
 

AaronD

Active Member
Update:
I seem to have found out what's causing it. I had one scene where it worked on (didn't check that one, just used the Intro one for testing).

In that scene; there was a delay between my 'close.bat' (that kills VLC), and my VLC opening.

I guess it compulates things so fast that it manages to execute the run (even if further down the list, and behind two audio volume changes) so fast that the .bat (which is at the beginning of the macro) closes the executed playlist.

I added a 1 sec wait inbetween, and now it seems to work.

Sorry about that!
Thanks for working on it :)

Edit:
As I say that I still have issues making some things work. I'm trying to work it out; but I think it's on my end. Seeing multiple .bat files firing and so on. I'll let you know if I get it all to work!
Okay. So I'm very confused in all of this. Some of them were working; some of them weren't. Now, all of them seem to be working. I think the only thing I did was remove the runs, and adding them again. Same paths and all.

They seem to be functioning now. *fingers crossed*

Race conditions can be some of the more difficult bugs to track down and definitively solve. They happen when you have multiple things happening at the same time (not just appearing so because the system burns through them so quickly, but actually simultaneous), and the ultimate outcome depends on which one finishes first. (in your example, one kills VLC and another starts it) A seemingly unrelated thing can change when they start or how long they take, and so the result seems to change at random.

Generally, the way to solve that is either to serialize the process, only starting one thing after another has finished, or to use something like a "mutex" (MUTual EXclusive) to award control to the first thing that grabs a token and make everything else wait that wants it until the first one releases it. (not error-ed out, just waiting to continue) Between grabbing and releasing, you do everything that is required to keep the outcome consistent. The classic Computer Science example is "bank_account <- bank_account + $5", where you have to read the value, modify it, and then write it back in 3 separate steps while something else also wants to do the same thing, but the concept applies to anything.

The behavior that you describe sounds like all of the actions are started at the same time and operate simultaneously. (or practically so, on a multitasking operating system) So it's entirely possible to have a race condition between them. When you also consider that a standard time slice might be a large number of instructions and that the OS might not necessarily schedule things in the same order every time......

It might be easy to add a "serialize" checkbox to the Macro's UI, but it might not actually do much either. If it hands off control to the OS, which doesn't report back that it's done, then the race condition can still exist even if the controlling code is entirely serialized. Likewise for the mutex: you have to know when to release it and not be too early. So, what about adding a user-adjustable delay for each action? That's not a guaranteed solution, but if 1 second is generally acceptable to the user and the race is usually over within 500ms, then that can work...most of the time. Now watch the race drag on for 1.2 seconds because the hard drive is being stupid at the moment...
 

CodeYan

Member
Can you add a Macro action to "Run" a macro? I only see pause/unpause. It will be useful for better macro organization, and looping macros. Someone on discord used a nice workaround though, by using the "random" action and specifying only one macro. Specifying hotkeys is also another way, but it is not a convenient workaround. It should bypass the specified condition.

On the note of looping macros, there does not seem to be a way to start the macro when the advanced scene switcher is run/running? I did work around it by using checking if a source if visible (which always will).

Also, a "Start" button for macros will be useful for testing macros.

Also, please add a condition for the timer to have a random time duration (min and max).
 

lindenkron

Member
So, it seemed to have been possibly a combination of /f (force close) and 1 second being barely enough time to close it. Removing force close, allowing VLC to close naturally - and giving it more time to do so - seems to have cured most of the quirks with running different audio playlists.

Regarding 'parameters' if one decides to use 'Run' for something, is there a list available with what is possible with it? Out of curiosity.

Thanks!
-lind
 

CodeYan

Member
for the media macro condition, can you please add a "milliseconds" unit? the media tab currently only supports "milliseconds" (though it would also be useful to add other units there), so migrating to the macros will be kinda different as you need seconds. Don't worry, i can do the math myself quickly, but it's a UX thing.
 

Warmuptill

Active Member
Can you add a Macro action to "Run" a macro? I only see pause/unpause. It will be useful for better macro organization, and looping macros. Someone on discord used a nice workaround though, by using the "random" action and specifying only one macro. Specifying hotkeys is also another way, but it is not a convenient workaround. It should bypass the specified condition.

On the note of looping macros, there does not seem to be a way to start the macro when the advanced scene switcher is run/running? I did work around it by using checking if a source if visible (which always will).

Also, a "Start" button for macros will be useful for testing macros.

Also, please add a condition for the timer to have a random time duration (min and max).
Great suggestions!
I will add them all to todo list :)

for the media macro condition, can you please add a "milliseconds" unit? the media tab currently only supports "milliseconds" (though it would also be useful to add other units there), so migrating to the macros will be kinda different as you need seconds. Don't worry, i can do the math myself quickly, but it's a UX thing.
Honestly I prefer the way it is done on the macro tab and don't really see the need to add milliseconds as the plugin itself will only perform checks at most every 50ms and the current way already provides enough accuracy to cover that range.

But I do get your point about the UI not being the same.

Please let me know if I am wrong and there are actually use cases where the increased precision is needed! :)

So, it seemed to have been possibly a combination of /f (force close) and 1 second being barely enough time to close it. Removing force close, allowing VLC to close naturally - and giving it more time to do so - seems to have cured most of the quirks with running different audio playlists.

Regarding 'parameters' if one decides to use 'Run' for something, is there a list available with what is possible with it? Out of curiosity.

Thanks!
-lind
Ah great!
I was worried I messed something up - thank you very much for the tests!

The parameters entirely depend on the application you are trying to launch so I cannot really give you an answer.
The follow the example of above VLC provides the following possible arguments:
 

grimofdoom

New Member
I have 3 things I want to ask about. First off, I made a set of macros which do two things. The core of it, Random Idle Selector hides all media sources in scene (manually add to list) from the macro Reset Idle, followed by randomly selecting a Macro - that individually show one of the Idle animations that were hidden prior. Then, there is separate functionality which on hot key, will do similar but play a single looped animation (Anim macros) and then reset back to the random idle animations.

Macros.png


First: Is it possible to make the timer on the If Timer, be random between X and Y seconds?

Second: Is there a way to more simply call 1 Macro, without having to have a Random list filled with 1 Macro (would really help clean up the screen)

Third: Is there a way to simple detect whether [any] media source has ended - instead of making multiple checking macros or a single macro with a dozen if checks to simply things?
 

Warmuptill

Active Member
I have 3 things I want to ask about. First off, I made a set of macros which do two things. The core of it, Random Idle Selector hides all media sources in scene (manually add to list) from the macro Reset Idle, followed by randomly selecting a Macro - that individually show one of the Idle animations that were hidden prior. Then, there is separate functionality which on hot key, will do similar but play a single looped animation (Anim macros) and then reset back to the random idle animations.

View attachment 77320

First: Is it possible to make the timer on the If Timer, be random between X and Y seconds?

Second: Is there a way to more simply call 1 Macro, without having to have a Random list filled with 1 Macro (would really help clean up the screen)

Third: Is there a way to simple detect whether [any] media source has ended - instead of making multiple checking macros or a single macro with a dozen if checks to simply things?

1.) Unfortunately not yet - I have added it to the todo list and will probably look into it on the weekend.
You could maybe use the "wait" action as that supports waiting for random amounts of time, but this might of course get rather messy.
2.) Not yet - will also look into it on the weekend.
(Both of these points were suggested a few comments earlier so I will raise the priority of those tasks)

3. ) Unfortunately no - this might be a bit more complex, but I will make sure to look into it as it was requested multiple times now already.

I apologize, that basically all answers were "no, not yet".
 
Top