From 06d70ba343045e7ff3c3c2b56a3ca23f6cc8b5af Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Tue, 15 Apr 2025 20:59:59 +0200 Subject: [PATCH] Created Looping a set of media sources (markdown) --- Looping-a-set-of-media-sources.md | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Looping-a-set-of-media-sources.md diff --git a/Looping-a-set-of-media-sources.md b/Looping-a-set-of-media-sources.md new file mode 100644 index 0000000..55b594b --- /dev/null +++ b/Looping-a-set-of-media-sources.md @@ -0,0 +1,54 @@ +# Single macro setup + +If you want to keep the complete setup in a single macro you could use a macro like this: + +![1744741762296](https://github.com/user-attachments/assets/252c7edd-a61f-4ad4-97de-d5850e9ddd2e) + +The "Plugin is running" condition will always be true when the plugin is active. +This will ensure that the actions will be performed in a loop. + +The first action will (re)start the playback of the first media source. +The next two actions - "Wait" and "Wait for playback to stop ..." - will ensure that the subsequent "Restart" action for the next media source will only be performed once the playback of the first media source has stopped. +(The "Wait 1 second" step might not strictly be necessary, but I would recommend to keep as it might take a short moment for OBS to execute the "Restart") +Afterwards the same series of actions is performed for the next media source. + +The "Run macro in parallel to other macros" option is checked to ensure other macros are not blocked while this macro is waiting. +The "Perform actions only on condition" change option is not checked as we want this macro to always be executed. + +You can [import](https://github.com/WarmUpTill/SceneSwitcher/wiki/Exporting-and-importing-individual-macros) this example macro using this code: +``` +AAAOHHic7Vffb9owEP5XkJ9JRUKhhbeWMQ1p3dhge5mqyiRHsHDsyD8YFeJ/39kJSWi7burD2lVFQpi77+4+f3eOnB3JaKykJsMfOyJoBmRIxlua5RxIm6RK2pwMl5RraJOcWg0zuoFLWNENk4oMO6W1gVGUc+BkaJTF/1KMVlSkNUCvWT7eQvxZzAxVprYbmV/EhkmhJ8tP0ryTog5ydVdSmRFTsWVmvKHcUodtIkYWc2QjKRLmXKMVxOuJMKAQXeHiR0E74jJDY9E5iQZ3Pm1ibnPn2mNZwYxXYQNKez4hWhMZr2dgDBOpdrkUpExjjYrFiuqvVlxaY1xIoRTapk7Ke1bUyVj9kS6g3saKpSuOXzNZVnvRc2VrydQh/xy2SJFgPVI268juaxK3k/u+b4UNvfFRkYJRCarrt6iClqN9chTx3hF6LMQzdjFOt0mCAJpstA78ZAbOGJzG/QGltB/06Fk3OA273WDR7/WCwaJ3nvSjMOn0Hc2jLvjwYqSqgrOcM4OdmErNivnBsc/d+Ie98327XJ91O/vrMsEYuRVJfh/bH9SxPvLQ8A/SrOFWH5+gwojR15XqTZORacphetdc6+nrakgzEKY5ZbHknOYakvuH4nh44qaNXN22uF+2CQi64C6+mL0jNZnrS85tysSNxmY6ublMWezHP7HKn8crmbAlc5O+I4ZlcIO0tVGUieKYaHD70A+ftM6fTta+IQMZRkc+lIjGz61PBgmj5MCEDLtuxxz8v3mxtVqrJ4rgUsJ6CirG/dG0Gd27E+7pzKRFqG/IgUH5nL9y7lbhb4XEZcacMDswfiimQk0MZA8jWbKdN9bFL6J9tDsnz9ObnxS1fFz98G/UPySIntw/x6RSqOl5KWN7/ja2L2Zs/+NHSvTae/P2SHmNj5R/NbZ4Y4HqcqmLWx4TuTXfqWJOXm9zsE3DUL2lYTcOQNRZ42vZRcnAKQtLajlm8mpgtep69MWChbJapSUJ8TXnpBuEUZBGndNBFPVQhV/BlcOC +``` + +(You will have to readjust the media source selections after importing the example macro) + +# Multi macro setup + +Alternatively you could use multiple macros like this to achieve a similar effect: + +![1744742515604](https://github.com/user-attachments/assets/71932cad-df5e-4e64-8b93-2e70b00fff34) + +![1744742535572](https://github.com/user-attachments/assets/24cf38b6-eede-4cc4-a78a-af72fa787f4b) + +The first macro ensures to restart "Media Source 2" if the playback of "Media Source 1" ended. +And the second macro ensures that "Media Source 1" is restarted if the playback of "Media Source 2" ended. +This closes the loop and the actions will be performed continuously. + +This time it is important to check "Perform actions only on condition change" so the media sources are not continuously immediately restarted over and over. + +You can [import](https://github.com/WarmUpTill/SceneSwitcher/wiki/Exporting-and-importing-individual-macros) these example macros using this code: + +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ks67nB14adMJ+EETY8z8B+1xDaw== +``` + +# Conclusion + +Which way is the "correct" one depends on your exact requirements, but to mention a few key differences: + +* This first setup (single macro) is easier to maintain. +If an additional media source needs to be added into the chain you can simply insert more actions to the list. +* The second setup (multiple macros) allows more fine grained control when the (re)start of the other media source happens exactly. +For example pausing / stopping one media source will not automatically result in the next media source being restarted in the second setup while in the first one it does. + +There probably are even more ways to set this up, but I hope this will get you on the right track. \ No newline at end of file