Compare commits

...

1986 Commits

Author SHA1 Message Date
WarmUpTill
9301ead060 Add chat settings toggles
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2026-03-21 22:52:27 +01:00
WarmUpTill
bc29ece526 Cleanup and layout adjustments 2026-03-21 22:52:27 +01:00
WarmUpTill
4158c7a363 Add Twitch actions
* Send shoutout
* Cancel raid
* Enable/disable shield mode
* Enable/disable branded content
* Snooze next ad
2026-03-21 22:52:27 +01:00
WarmUpTill
944d1059da Add user moderation actions 2026-03-21 22:52:27 +01:00
WarmUpTill
bf18d8e106 Validate that user id matches token 2026-03-21 22:52:27 +01:00
WarmUpTill
bf216e0917 Fix subscription handling and improve logging
* Revocations were not handled properly
* Active subscriptions were not cleared on reconnect
* Migration client handling could cause crash
* Add error logging
2026-03-21 22:52:27 +01:00
WarmUpTill
2405b6dbbf Add "Next Macro" temp var to Sequence actions when setting index
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2026-03-21 00:05:58 +01:00
WarmUpTill
e64f2d195e Add temp vars to "Sequence" and "Random" action for executed macro 2026-03-21 00:05:58 +01:00
WarmUpTill
f66bec8caf Add option to expose current settings of source as temp var 2026-03-20 23:40:05 +01:00
WarmUpTill
3eb79e3adb Scroll to new macro segments
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2026-03-19 20:21:08 +01:00
WarmUpTill
07e2ac3ca0 Fix macro list / macro edit area splitter resizing
When horizontally large widgets (e.g. the Window condition) were part of
the currently selected macro moving the splitter would result in it
either fully hiding the macro list or the macro edit area.

Now the list and edit area can be resized smoothly.
2026-03-19 20:21:08 +01:00
WarmUpTill
8e2c466c2d Rework libproc2 API version check
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
The previous version was not behaving as expected for flatpak builds
2026-03-15 16:27:01 +01:00
WarmUpTill
cc68e2366c Fix file selection displaying resolved variable values
Some checks are pending
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2026-03-15 13:17:06 +01:00
WarmUpTill
7a0e08b0d8 Adapt to enable testing and add more tests
Some checks are pending
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2026-03-14 13:34:50 +01:00
WarmUpTill
be8744f0d0 Add action trigger modes
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
* always -> same as old behavior, if "on change" was disabled
* results changes -> same as old behavior, if "on change" was enabled
* any condition changes
* any condition changes and evaluates to true
2026-03-12 20:45:57 +01:00
WarmUpTill
d4425df694 Add FirstRunWizard 2026-03-12 20:45:57 +01:00
WarmUpTill
70e5f6002d Cleanup 2026-03-12 20:45:57 +01:00
WarmUpTill
ff98ec36d6 Show dialogs after OBS_FRONTEND_EVENT_FINISHED_LOADING is fired
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2026-02-28 13:09:27 +01:00
WarmUpTill
4966802f14 Fix first action of paused macros being executed
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2026-02-26 21:20:37 +01:00
kak hil imup
b23a90557f Fixed get_filename_component command call
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2026-02-22 20:51:48 +01:00
WarmUpTill
d6ea815b85 Expose "Similarity Rating" as temp var when pattern matching 2026-02-22 13:27:20 +01:00
WarmUpTill
f35ef558ee Fix crash when restoring scene item transition in parallel
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2026-02-19 20:28:10 +01:00
WarmUpTill
d7ff9088f8 Enable selecting multiple days in simple view of date condition 2026-02-19 20:11:12 +01:00
WarmUpTill
7048925d6e Add DayOfWeekSelector 2026-02-19 20:11:12 +01:00
WarmUpTill
fcb3ea50d3 Add QTimer::singleShot() wrappers to display startup dialogs on macOS 2026-02-19 20:11:12 +01:00
WarmUpTill
87c45e2b32 Focus name edit for new items 2026-02-19 20:11:12 +01:00
WarmUpTill
eb5046a9d6 Add websocket callbacks to run macros and set variables
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2026-02-17 22:07:54 +01:00
WarmUpTill
58c05f3f6e Fix race condition in plugin post load steps 2026-02-17 22:07:54 +01:00
WarmUpTill
0b284da3de Fix stream deck condition not matching key "down" state properly 2026-02-17 22:07:54 +01:00
WarmUpTill
03fe7016e4 Fix crash in game capture condition when receiving null data
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2026-02-07 22:38:26 +01:00
WarmUpTill
2ea89912a3 Fix transition duration selection not being editable
Some checks failed
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Check locale / ubuntu64 (push) Has been cancelled
2026-02-07 21:32:58 +01:00
WarmUpTill
78d2efa083 Skip invalid json object settings value 2026-02-07 21:32:58 +01:00
WarmUpTill
149fce1c2b Show tooltip updates while the tooltip is visible 2026-02-07 21:32:58 +01:00
WarmUpTill
2dd9120265 Add tooltip for last execution time of macro in macro list 2026-02-07 21:32:58 +01:00
WarmUpTill
3a9f315b67 Highlight macros blocked by the "on change" setting in the macro list 2026-02-07 21:32:58 +01:00
WarmUpTill
6ba01dca39 Fix Twitch event sub reconnect handling
If the connection was aborted by the local machine, the active
subsciptions were not cleared causing the new connection not attempt to
register any new subsciptions.

An event sub connection without any active subsciptions will be dropped
by Twitch after a certain amount of time.

Additionally the reconnection logic was triggering to frequently causing
unecessary load.
2026-02-07 21:32:58 +01:00
WarmUpTill
ad1f1effeb Add option to pick random value 2026-02-07 21:32:58 +01:00
WarmUpTill
0a53a8649f Add initializer_list support and set default add dialog window title 2026-02-07 21:32:57 +01:00
WarmUpTill
7ea721f9f1 Add option to set transition when changing scene item visibility 2026-01-27 19:28:45 +01:00
WarmUpTill
718a899a98 Move functions 2026-01-27 19:28:45 +01:00
WarmUpTill
4c493451f4 Keep URL parameters if parameters input is not used 2026-01-18 19:44:19 +01:00
WarmUpTill
a8d483f5a7 Enable un-/pausing all macros in a group 2026-01-13 21:45:04 +01:00
WarmUpTill
dc786a5313 Cleanup 'find and replace' layout in variable action 2026-01-13 21:44:17 +01:00
WarmUpTill
628a4d896c Add option to stop plugin in case unclean shutdown is detected 2026-01-05 10:58:55 +01:00
WarmUpTill
74a9681c8e Fix deadlock when opening settings window 2026-01-05 10:58:55 +01:00
WarmUpTill
faf52c38bb Add temp var for window text 2026-01-05 10:58:55 +01:00
WarmUpTill
bad1a548fb Fix resource table shortcuts conflicting with OBS shortcuts
This could happen when adding the variable tab as a dock.
The problem is visible in the OBS log:
QAction::event: Ambiguous shortcut overload: Del
2025-12-27 20:38:53 +01:00
WarmUpTill
f706416df5 Fix warnings
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-12-21 14:33:08 +01:00
WarmUpTill
c344c88acd Add support for scenes of secondary canvases in source selection 2025-12-21 14:33:08 +01:00
WarmUpTill
2cd9e61717 Adapt paths to new OBS directory structure 2025-12-21 14:33:08 +01:00
WarmUpTill
6314de8f37 Add option to always show feature tabs
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-12-14 12:54:17 +01:00
WarmUpTill
6bfcabc4af Add option to get channel info 2025-12-14 12:54:17 +01:00
WarmUpTill
69711d973a Fix memory leak 2025-12-14 12:54:17 +01:00
WarmUpTill
225913b44d Fix warnings 2025-12-14 10:42:51 +01:00
WarmUpTill
7c6d657fdd Add temp var for last recording save path 2025-12-14 10:42:51 +01:00
WarmUpTill
12e38274f5 Fix freeze on shutdown / scene collection change 2025-12-14 10:31:45 +01:00
WarmUpTill
5d49e8825b Add group support to MacroSelection 2025-12-14 10:30:58 +01:00
WarmUpTill
21c34356ed Add macro group helper functions 2025-12-14 10:30:58 +01:00
WarmUpTill
266e470509 Remove unused function 2025-12-14 10:30:58 +01:00
WarmUpTill
de20c93b14 Rearrange layout of "General" tab
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-12-06 19:27:54 +01:00
WarmUpTill
b0d877db8c Cleanup unnecessary nested layouts 2025-12-06 19:27:54 +01:00
WarmUpTill
caf9e59475 Remove option to disable widget caching
Option was only introduced in case instabilities arise.
However, there weren't any reports of issues for a long time.
2025-12-06 19:27:54 +01:00
WarmUpTill
5f6982b5bb Add macro search functionality
Allows search by ...
* Macro name
* Segment type
* Segment label
2025-12-06 19:27:54 +01:00
WarmUpTill
ce399cc647 Move functions 2025-12-06 19:27:54 +01:00
WarmUpTill
03f67534c7 Default to main canvas in scene selection
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
New scene selections would have no canvas selected at all.
This would cause issues in places which do not support an empty canvas
selection.

For example, the "scene changed" check of the scene condition would not
work as without any canvas it is not clear which scene to check for.
2025-12-05 17:30:16 +01:00
WarmUpTill
246667e65e Fix scene list scene switches not working
* Assume default canvas to be main canvas
* Add proper handling for the preview scene for next / previous
* Only display canvas warning if a canvas was selected
* Fix canvas selection not showing backend value
2025-12-05 17:30:16 +01:00
WarmUpTill
68fe7716e7 Add special handling for main canvas 2025-12-05 17:30:16 +01:00
WarmUpTill
98cc710b4a Add tooltip to "verify timestamps" option 2025-12-05 17:30:16 +01:00
WarmUpTill
c602c30c54 Display warning if Twitch token expired or is invalid 2025-12-05 17:30:16 +01:00
WarmUpTill
cc1b89fe1d Fix crash on macro tab setup 2025-12-05 17:30:16 +01:00
WarmUpTill
1de4ef7ec2 Add retry mechanism for downloading dependencies 2025-12-05 17:30:16 +01:00
WarmUpTill
e29060fdea Throttle Twitch API access for at least 1 second
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-12-03 18:30:17 +01:00
WarmUpTill
a0e6e6f528 Add options to close source dialogs
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-11-14 13:56:03 +01:00
WarmUpTill
e30d5845fa Run macro via dock button in parallel and ignore pause 2025-11-14 13:56:03 +01:00
WarmUpTill
d12911cd02 Fix typo 2025-11-14 13:56:03 +01:00
WarmUpTill
b8ecc40e8c Add search clear button to the variable tab 2025-11-14 12:38:24 +01:00
WarmUpTill
8ec4849b1d Add option copy value of another variable 2025-11-14 12:38:24 +01:00
WarmUpTill
e6e9f3a831 Add temp var for last replay buffer save path
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2025-11-13 21:06:29 +01:00
WarmUpTill
555f7c1381 Add option to enable dock containing variable tab
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-11-10 18:45:06 +01:00
WarmUpTill
f0f8b0fd92 Add option to search in variable tab 2025-11-10 18:45:06 +01:00
WarmUpTill
661e83162f Cleanup 2025-11-10 18:45:06 +01:00
WarmUpTill
4606f80a9d Enable filtering in "Hotkey" action 2025-11-10 18:45:06 +01:00
WarmUpTill
9c109742fb Add option to change action state based on label and action type
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-11-05 20:49:24 +01:00
WarmUpTill
b8b0682aaf Add support for else actions to MacroSegmentSelection 2025-11-05 20:49:24 +01:00
WarmUpTill
f93175db77 Sort scenes alphabetically
Prior to implementing canvas suppor they were in the order they are in
the scenes dock.
After switching from obs_frontend_get_scene_names() to
obs_canvas_enum_scenes() this seems to not always be the case.
2025-11-05 20:49:24 +01:00
WarmUpTill
8f92ba3ffa Increase slide index selection maximum to 9999 2025-11-05 20:49:24 +01:00
WarmUpTill
0d56de11d1 Refactor to support loading macro properties on import 2025-11-05 20:49:24 +01:00
WarmUpTill
e1020a1909 Fix poad load steps being executed too frequently
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-10-30 20:48:33 +01:00
WarmUpTill
8b0bd4193b Fix temp var save / loading not working 2025-10-30 20:48:33 +01:00
WarmUpTill
d55bb6bc86 Fall back to obs_frontend_get_current_scene()
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
If there wasn't any scene change yet GetCurrentScene() would always
return nullptr and break various scene checks.
For example, this could happen when startup up a fresh OBS install for
the first time.
2025-10-29 12:26:44 +01:00
WarmUpTill
0583331bfd Fix scene selection not working without secondary canvases 2025-10-29 12:26:44 +01:00
WarmUpTill
6932de866d Refactor Twitch event server migration and reconnect handling
Some checks failed
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Check locale / ubuntu64 (push) Has been cancelled
This should avoid any events being lost due to server migration.
2025-10-28 19:20:52 +01:00
WarmUpTill
00db0cf7c4 CI: Refactor OpenSSL handling on MacOS to support MQTT SSL 2025-10-28 19:20:52 +01:00
WarmUpTill
e9baf27ca2 Add helper to find recent versions of OpenSSL on Windows 2025-10-28 19:20:52 +01:00
WarmUpTill
b1a5db0c9c Fix crash when switching macros after deleting one containing temp refs 2025-10-28 19:20:52 +01:00
WarmUpTill
8f3b868fd9 Limit projector action to main canvas and improve layout 2025-10-28 19:20:52 +01:00
WarmUpTill
b3bf89840b Add GetPath() 2025-10-28 19:20:52 +01:00
WarmUpTill
84f7d0d214 Add SSL support to MQTT connections
Also fixes crash on startup if SSL was used while there was no support
for encrypted connections yet
2025-10-28 19:20:52 +01:00
WarmUpTill
e1164c4fa3 Refactor help icon usage 2025-10-28 19:20:52 +01:00
WarmUpTill
4534b23bad Enable Windows and MacOS build with OBS versions older than 31.1.1 2025-10-28 19:20:52 +01:00
WarmUpTill
5d6a693f36 Refactor macro signal handling
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
Also drop support for scene group signals in macro, which hopefully
aren't used much anymore
2025-10-19 18:05:16 +02:00
WarmUpTill
a82662c8f4 Refactor "no match scene" handling 2025-10-19 18:05:16 +02:00
WarmUpTill
602675b3b3 Add option to automatically start the plugin on a given scene
This functionality was lost with the removal of the "Scene trigger" tab.
2025-10-19 18:05:16 +02:00
WarmUpTill
9551519cb9 Cleanup 2025-10-19 18:05:16 +02:00
WarmUpTill
badce063eb Retain settings of currently unknown macro segments 2025-10-19 18:05:16 +02:00
WarmUpTill
10d45c67d6 Workaround for FilterComboBox cutting off entries 2025-10-19 18:05:16 +02:00
WarmUpTill
0b77ef5081 Adapt to support canvas API 2025-10-19 18:05:16 +02:00
WarmUpTill
8f54e71e61 Add canvas and position variable support to scene condition 2025-10-19 18:05:16 +02:00
WarmUpTill
16136b8741 Rework scene switch action
* Support "next scene" and "previous scene"
* Support "scene at index"
* Add canvas support
* Rework layout
2025-10-19 18:05:16 +02:00
WarmUpTill
02d5051974 Rework scene switch helpers to support vertical canvas 2025-10-19 18:05:16 +02:00
WarmUpTill
078d62fa18 Add canvas support to scene selection 2025-10-19 18:05:16 +02:00
WarmUpTill
8aa6a7df2c CI: Bump dependency cache version 2025-10-19 18:05:16 +02:00
WarmUpTill
1494b1db6c Update based on obs-plugintemplate to enable switch to OBS 31.1.1 2025-10-19 18:05:16 +02:00
WarmUpTill
b4b3dc5a2b Update json to v3.12.0
Enable compatability with cmake versions > 3.5.
This is required for OBS 31.1.1.
2025-10-19 18:05:16 +02:00
WarmUpTill
ee41a8d58b CI: Switch to MacOS 15 to enable OBS 31.1.1 support 2025-10-19 18:05:16 +02:00
WarmUpTill
5f2237ac2a buildspec: Update OBS Studio dependency to 31.1.1
This enabled obs_canvas API support
2025-10-19 18:05:16 +02:00
WarmUpTill
6fb76e7e07 Refactor macro dock handling
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
* Move dock related settings into its own class
* Add support for grouping macro docks into a single dock window
2025-10-16 18:03:06 +02:00
WarmUpTill
ba094372a9 Add macro dock windows
They can be used to consolidate multiple macro docks into a single dock
window
2025-10-16 18:03:06 +02:00
WarmUpTill
0c886c8679 Refactor save / load handling 2025-10-16 18:03:06 +02:00
WarmUpTill
d9f05d3f7b Enable user to select install directory in Windows installer 2025-10-16 18:03:06 +02:00
WarmUpTill
c99b5f1feb Cleanup 2025-10-16 18:03:06 +02:00
WarmUpTill
a3b3cf9818 Improve disconnect reason logging
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-10-14 23:28:11 +02:00
WarmUpTill
ca3bbf5660 Fix Twitch event sub connection breaking after reconnect message
This will have to be revisited to avoid events being lost during the
reconnect
2025-10-14 23:28:11 +02:00
WarmUpTill
18524761a6 Add option to check if a macro's actions were performed
Some checks failed
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Check locale / ubuntu64 (push) Has been cancelled
2025-10-14 19:21:29 +02:00
WarmUpTill
85222aed33 Enable left click to open links 2025-10-03 20:44:50 +02:00
WarmUpTill
84132f7c37 Ignore autoselect deprecations for now 2025-10-03 20:44:50 +02:00
WarmUpTill
ead664763f CI: Fix OBS 32 build 2025-10-03 20:44:50 +02:00
WarmUpTill
a2fa16f2d7 Fix typo 2025-10-03 20:44:50 +02:00
Tiefsee5037008
75edcffac9 l10n(zh-CN): correct reversed duration condition strings 2025-10-03 13:17:10 +02:00
WarmUpTill
dd5bcf425a Fix freeze on shutdown
Recording / streaming start event might be stuck in event queue if
advanced scene switcher or OBS takes a while to shut down.
This could result in the plugin starting back up while OBS is attempting
to shut down resulting in a potential deadlock during shutdown.
2025-10-03 11:56:40 +02:00
WarmUpTill
de32e1b18e Allow macro property selection from parent macro 2025-10-03 11:56:40 +02:00
WarmUpTill
1d412a818d Fix constness 2025-10-03 11:56:40 +02:00
WarmUpTill
c8e5b561ef Fix MacOS build 2025-10-03 11:56:40 +02:00
WarmUpTill
a1702dc798 Fix nested macro property selections not being saved 2025-10-03 11:56:40 +02:00
WarmUpTill
ae571583fc Fix queued nested macros duplicating segments 2025-10-03 11:56:40 +02:00
WarmUpTill
c4f70657d9 Fix nested macro PostLoad being called too early
Would lead to macro dependent settings potentially being lost
2025-10-03 11:56:40 +02:00
WarmUpTill
7901a988af Add option to enable or disable OBS preview 2025-10-03 11:56:40 +02:00
WarmUpTill
d2b70bbc6b Add option to change stream language 2025-10-03 11:56:40 +02:00
WarmUpTill
4d22a539f0 Add option to set content classification of Twitch stream 2025-10-03 11:56:40 +02:00
WarmUpTill
4e561320f7 Add option to disable shutdown confirmation dialog 2025-10-03 11:56:40 +02:00
WarmUpTill
0dfa4fe2c0 Add support for temp var selection highlighting in light theme 2025-10-03 11:56:40 +02:00
WarmUpTill
4cac4584f3 Fix invalid channel selections leading to event sub disconnect
Repeated invalid POSTs to /helix/eventsub/subscriptions will lead to a
disconnect of the event sub websocket connection.
Thus one single invalid channel selection could tear down any existing
subscriptions with it.
2025-10-03 11:56:40 +02:00
WarmUpTill
d20a975c4f Add option to enable / disable / toggle macro highlighting 2025-10-03 11:56:40 +02:00
WarmUpTill
756d7bbd3c Add support for multi-action stream deck buttons
It has to be noted however:

* multi-action buttons don't have any coordinates
* multi-action buttons send the "up" and "down" event at the same time.
  (When the multi-action button is released)
  Thus they might arrive in the wrong order due to network latency.
2025-10-03 11:56:40 +02:00
WarmUpTill
395a18fa4c Fix typo 2025-10-03 11:56:40 +02:00
WarmUpTill
2ea00d94c5 Add support for commercial start event 2025-10-03 11:56:40 +02:00
WarmUpTill
058e941a46 Add option to set Twitch stream tags 2025-10-03 11:56:40 +02:00
WarmUpTill
ea4a951554 Add warning if inline script file is invalid
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-09-23 22:59:42 +02:00
WarmUpTill
3c355ac6fe Improve file condition
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
* Add support for existence check
* Add support for "is file" check
* Add support for "is folder" check
* Add more temp vars
2025-09-13 08:41:40 +02:00
WarmUpTill
37606e274c CI: demote optional dependencies in deb package
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-09-07 19:11:22 +02:00
WarmUpTill
3e8d6e103a Add temp var to Media condition indicating which source matched
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-08-11 18:02:45 +02:00
WarmUpTill
4cae420ade Add support for "any" selection in secene item selection 2025-08-11 18:02:45 +02:00
WarmUpTill
b27a11931a Restore current selection when re-populating 2025-08-11 18:02:45 +02:00
WarmUpTill
92616bed6b Ignore warning C5287 for libusb build 2025-08-11 18:02:45 +02:00
WarmUpTill
b3f38851b6 Update libusb to v1.0.29
Resolves few warnings which were treated as errors with the recent MSVC
udpate
2025-08-11 18:02:45 +02:00
WarmUpTill
bf7fe71ae3 Fix system tray warning not being translated
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-07-17 17:49:44 +02:00
炭酸コーラ
12a6b26d9a Updated Japanese translation to the latest version 2025-07-17 17:45:44 +02:00
WarmUpTill
373e74c080 Switch to different port for aquiring Twitch tokens
Some checks are pending
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2025-07-16 21:15:36 +02:00
WarmUpTill
f3e7eaf212 Rework to support frequently resizing widgets
Some checks failed
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Check locale / ubuntu64 (push) Has been cancelled
2025-07-13 18:17:46 +02:00
WarmUpTill
b036736547 Refactor MacroSegmentList rework to support nested macros 2025-07-13 18:17:46 +02:00
WarmUpTill
817de13e9d Add nested macro support 2025-07-13 18:17:46 +02:00
WarmUpTill
0b774c171d Cleanup
* Use GetSettingsWindow() instead of window() to avoid connecting to the
  wrong widget
* Fix typos
2025-07-13 18:17:46 +02:00
WarmUpTill
be8f7bd70f Add ResizableWidget
When manual resizing is enabled, the vertical widget size can be changed
by dragging the widget in the lower right corner.
2025-07-13 18:17:46 +02:00
WarmUpTill
5f963b5b7d Refactor macro edit area into separate class
This will enable support for nested macros
2025-07-13 18:17:46 +02:00
WarmUpTill
c6155c9fea Add default settings support 2025-07-13 18:17:46 +02:00
WarmUpTill
be809dbfab Fix macro dock being being destroyed when opening macro settings
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-07-09 15:22:04 +02:00
WarmUpTill
7478c149b3 Add option to toggle mute state of audio source
Some checks failed
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Check locale / ubuntu64 (push) Has been cancelled
2025-07-08 17:51:21 +02:00
WarmUpTill
f4eaa9785d Fix crash on macro load 2025-07-08 17:49:33 +02:00
WarmUpTill
49c0de3f1b Add context menu option to expand / collapse all macro groups 2025-07-08 17:49:33 +02:00
WarmUpTill
101ef4e973 Fix crash when adding new macro to group 2025-07-08 17:49:33 +02:00
WarmUpTill
82568b23e8 Fix crash when initially setting up tab ordering
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
The tabOrder vector was initialized with the size of tabNames.
Then new tabs were registered with AddSetupTabCallback() causing
tabNames to grow but tabOrder to remain the same.

Usually this is not a problem as LoadTabOrder() will be called which
ensures that their sizes are in sync.

However, when using a fresh OBS install or one with a corrupted scene
configuration file, the on_save() callbacks are called before any
loading callbacks.
With the sizes of tabNames and tabOrder not being in sync this would
lead to a crash.

Fixed by adding a tabWidgetOrderValid() check within SaveTabOrder()
before iterating over both vectors.
The tabWidgetOrderValid() was expanded to check the sizes of both
vectors.
Additionally the tabOrder initialization was moved from global static
initialization to function local static initialization to ensure that
potential preceeding calls to AddSetupTabCallback() will be taken into
account when setting up the tabOrder vector.
2025-07-06 10:19:20 +02:00
WarmUpTill
0cd7004f6a Setup MIDI device observers in parallel to avoid blocking OBS startup
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-06-25 13:56:40 +02:00
WarmUpTill
40c62ba700 CI: Add libremidi dependencies 2025-06-25 13:56:40 +02:00
Arimil
f2c7b532d9
Add support for kwin (wayland) (#1393)
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-06-21 19:51:25 +02:00
WarmUpTill
456a9c04c7 Add icon for windows installer
Some checks failed
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Check locale / ubuntu64 (push) Has been cancelled
2025-06-20 22:29:35 +02:00
WarmUpTill
3e1fdbde45 Add option to set and check list source settings by name
This makes it easier to select the intended settings value as the
underlying value often has no direct connection to the user facing name.

It also makes it possible to select list entries whos underlying value
changes frequently, but the user facing value does not.
(E.g. device IDs based on the input port compared to the device name)
2025-06-20 22:29:35 +02:00
WarmUpTill
874b9b86e2 Refactor locking of macro segments
This should avoid crashes when actions or conditions are performed in
parallel to the main macro loop and will improve the UI responsiveness
in some scenarios
2025-06-20 22:29:35 +02:00
WarmUpTill
98d1f83acc Cleanup 2025-06-20 22:29:35 +02:00
WarmUpTill
7e91f81957 Ease development with dirty dependency directory 2025-06-20 22:29:35 +02:00
WarmUpTill
20488afdd1 Fix tempvars being reset across macros for cached widgets
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-06-12 21:29:07 +02:00
WarmUpTill
d9d387ad47 Fix crash when deleting cached macro widgets 2025-06-12 21:29:07 +02:00
WarmUpTill
0736d673e1 Add option to check if chat was cleared / message was removed 2025-06-12 21:29:07 +02:00
WarmUpTill
34151e4bc6 Fix "Get user info" only allowing small values for user ids 2025-06-12 21:29:07 +02:00
WarmUpTill
1346c19bec Fix crash when invalid token is used to connect to Twitch chat 2025-06-12 21:29:07 +02:00
WarmUpTill
be6bc48231 Fix macro selection resetting when any macro was removed 2025-06-12 18:33:24 +02:00
WarmUpTill
79a8ad57af Rework HTTP action URL input
The URL to be accessed can now be passed as a single URL instead of it
being split into a host and path component
2025-06-12 18:33:24 +02:00
WarmUpTill
daeb9275a3 Add support for inline scripts
* Script can be defined in the macro segment or loaded from a file
* Supports both LUA and Python
* Can be used for actions and conditions
* obs_script_create and obs_script_destroy are resolved at runtime
  (Let's hope the API remains stable)
2025-06-09 14:20:44 +02:00
WarmUpTill
73b542a4db Move scripting support to seperate project 2025-06-09 14:20:44 +02:00
WarmUpTill
e3471066e9 Export symbols 2025-06-09 14:20:44 +02:00
WarmUpTill
ec41c06b4d Update feature request description 2025-06-09 14:20:44 +02:00
WarmUpTill
201e45d058 Fix macro tree not resizing properly with OBS 31.1.0 2025-06-07 18:56:42 +02:00
WarmUpTill
b17aa30432 Fix attempting to cache widgets of about to be deleted macros 2025-06-06 19:14:46 +02:00
WarmUpTill
93703c80bc Hide option to verify timestamps when functionality is disabled 2025-06-01 11:57:26 +02:00
WarmUpTill
d7951a7179 Cleanup constness 2025-06-01 11:57:26 +02:00
WarmUpTill
d42a3b584a Rework resource tab hotkey handling
Added hotkey to add new entry
2025-06-01 11:57:26 +02:00
WarmUpTill
becd1bd02a Set default hotkey for new macro to CTRL + N 2025-06-01 11:57:26 +02:00
WarmUpTill
30422aecf3 Fix crash when deleting macro 2025-06-01 11:57:26 +02:00
WarmUpTill
c567e6ef7f Allow import of json files
Automatic backups are stored as json files
2025-06-01 11:57:26 +02:00
WarmUpTill
1ca61f3ed4 Add option to not link date-tz even if the source code exists 2025-05-28 22:11:07 +02:00
WarmUpTill
1affe9dce3 Fix macro segment list entries not resizing properly 2025-05-27 22:37:46 +02:00
WarmUpTill
406e3c1855 Cleanup
* Add variable support to process condition
* Display unresolved variable value in Window action
* Add tooltips to indicate that variables are supported
2025-05-27 22:37:46 +02:00
WarmUpTill
c05dd40c4c Add option to change various OBS video settings 2025-05-27 22:37:46 +02:00
WarmUpTill
9a86ecac42 Add option to disable widget caching 2025-05-27 22:37:46 +02:00
WarmUpTill
721a786e79 Rework preview dialog to improve performance
Object detection and OCR models were constantly being re-initialized
each frame due to copy in the signal / slot handling
2025-05-27 22:37:46 +02:00
WarmUpTill
32d29875ed Move responsibility of cascade init to ObjDetectParameters 2025-05-27 22:37:46 +02:00
warmuptill
0e5f56b562 Add tesseract config file support 2025-05-27 22:37:46 +02:00
WarmUpTill
5490fabf92 Add hotkey to create new macro 2025-05-27 22:37:46 +02:00
WarmUpTill
5e3ab19940 Add ProfileSelectionWidget
Refreshes list of profiles when widget becomes visible to support widget
caching.
2025-05-27 22:37:46 +02:00
WarmUpTill
1c94a1ab44 Add X and Y position tempvars to cursor condition 2025-05-27 22:37:46 +02:00
WarmUpTill
34baa56134 Update process list on visibility change
This is done to support widget caching
2025-05-27 22:37:46 +02:00
WarmUpTill
5ce4171773 Add MonitorSelectionWidget
Refreshes list of monitors when widget becomes visible to support widget
caching
2025-05-27 22:37:46 +02:00
WarmUpTill
c281c6db83 Add WindowSelectionWidget
Refreshes list of windows when widget becomes visible to support widget
caching
2025-05-27 22:37:46 +02:00
WarmUpTill
c43439ee64 Add option to keep selection when FilterComboBox entry doesn't exist 2025-05-27 22:37:46 +02:00
WarmUpTill
a84731b8fe Rework TransitionSelectionWidget to support widget caching 2025-05-27 22:37:46 +02:00
WarmUpTill
61fbff5821 Fix SetSourceSetting() not changing settings if the default value is set
This won't help in scenarios in which even a default value does not
exist, e.g. "text" for the text sources, as here it is unclear which
value type to use
2025-05-27 22:37:46 +02:00
WarmUpTill
1381654fed Add Add support for widget caching to FilterSelectionWidget 2025-05-27 22:37:46 +02:00
WarmUpTill
9805601c07 Add support for widget caching to SceneItemSelectionWidget 2025-05-27 22:37:46 +02:00
WarmUpTill
fcf57ee031 Add support for widget caching to SceneSelectionWidget 2025-05-27 22:37:46 +02:00
WarmUpTill
ba3e87a761 Rework SourceSelectionWidget to support widget caching 2025-05-27 22:37:46 +02:00
WarmUpTill
3dd3f576c3 Add hint that parallel condition check feature is experimental 2025-05-27 22:37:46 +02:00
WarmUpTill
7403a18e96 Cleanup 2025-05-27 22:37:46 +02:00
warmuptill
56494480ba Cache macro segment widgets for each macro 2025-05-27 22:37:46 +02:00
warmuptill
cdc5d16e95 Allow changing Tesseract model directory
This will prevent custom models being deleted when installing a new
version of the plugin, as the plugin's data directory might get wiped on
some operating systems.
2025-05-27 22:37:46 +02:00
warmuptill
27aed79305 Enable building with OCR support in Ubuntu environment 2025-05-27 22:37:46 +02:00
WarmUpTill
7ec95e33eb Hide outdated video condition options
The "throttle" and "reduce matching latency" optiohns were introduced
before "short circuit evaluation" was available and are now outdated.

Both don't behave as expected with this option enabled.
The throttling effect can be better achieved with an additional "Timer"
condition.
2025-05-27 22:37:46 +02:00
WarmUpTill
98260b25a1 Add option to toggle the pause state of a macro 2025-05-27 22:37:46 +02:00
WarmUpTill
45b37de9f7 Add MQTT connection tab 2025-05-27 20:23:07 +02:00
WarmUpTill
027a3e9074 Add MQTT condition and action 2025-05-27 20:23:07 +02:00
WarmUpTill
cab50e0922 Add MQTT helpers 2025-05-27 20:23:07 +02:00
WarmUpTill
88514e209d CI: build paho.mqtt.cpp libs 2025-05-27 20:23:07 +02:00
WarmUpTill
4ed7f13b72 Add paho.mqtt.cpp dependency 2025-05-27 20:23:07 +02:00
WarmUpTill
0fb11ac274 Add copy / move to MessageDispatcher 2025-05-27 20:23:07 +02:00
WarmUpTill
942933290a Remove unnecessary include 2025-05-27 20:23:07 +02:00
WarmUpTill
f13beaead2 Reduce log spam in case of invalid token
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
The caching mechanism for the token validity checks did not have the
desired effect, and the Twitch channel to user id mapping function was
attempting to resolve names even with an invalid token.
2025-05-08 21:10:13 +02:00
WarmUpTill
13dba6527d Exclude jsoncons files from release folder 2025-05-08 21:10:13 +02:00
WarmUpTill
b78a6510a9 Start the plugin on first boot 2025-05-08 21:10:13 +02:00
WarmUpTill
6c22f438b6 Disable macro add button highlight when importing macros 2025-05-08 21:10:13 +02:00
WarmUpTill
347abe6c84 Enable macro highlighting by default 2025-05-08 21:10:13 +02:00
WarmUpTill
230863adda Lazy initialize macro segment widgets
This should make it less time consuming to accidentally switch between
macros with a large amount of macro segments
2025-05-08 21:10:13 +02:00
WarmUpTill
f59478fac7 Cleanup 2025-05-08 21:10:13 +02:00
WarmUpTill
8adac79cd8 Rework option to run macro actions in parallel to other macros 2025-05-08 20:44:56 +02:00
WarmUpTill
ea93c44db7 Add option to check macro conditions in parallel to other macros 2025-05-08 20:44:56 +02:00
WarmUpTill
9e20b341d8 Rework Macro constructors to support passing GlobalMacroSettings 2025-05-08 20:44:56 +02:00
WarmUpTill
232cbb06f6 Disable Twitch event timestamp verification by default
Some checks are pending
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
It brakes too often to be worth it as an option to be enabled by
default.
2025-05-07 18:33:04 +02:00
WarmUpTill
e9d57a0f4a Refactor log helpers and add option to disable logging
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-05-01 19:55:28 +02:00
WarmUpTill
9633a61a65 Add option to disable Twitch event timestamp verification
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2025-05-01 12:46:20 +02:00
WarmUpTill
0643b250e1 Fix typos 2025-05-01 12:46:20 +02:00
WarmUpTill
b52738881f Fix "HTTP" action failing to send data on MacOS
Some checks are pending
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2025-04-30 21:25:44 +02:00
WarmUpTill
470d5ba3d7 Log HTTP errors when verbose logging is enabled 2025-04-30 21:25:44 +02:00
WarmUpTill
8326e72047
Add link to installation wiki page
Some checks failed
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-04-23 11:48:17 +02:00
WarmUpTill
12ab4d8cf9 Add option to query JSON strings and access JSON array elements
Some checks failed
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
2025-04-22 15:35:45 +02:00
WarmUpTill
295ec9eb81 Add more JSON tests 2025-04-22 15:35:45 +02:00
WarmUpTill
4c5dbd4b7c Add more JSON helpers 2025-04-22 15:35:45 +02:00
WarmUpTill
5568f92ad0 Move JSON helpers to lib 2025-04-22 15:35:45 +02:00
WarmUpTill
7c4c0056ce Remove libremidi patch 2025-04-22 15:35:45 +02:00
WarmUpTill
d2b4b1cc07 Add jsoncons 2025-04-22 15:35:45 +02:00
WarmUpTill
a3ca22d238 Cleanup CMakeLists.txt 2025-04-22 15:35:45 +02:00
WarmUpTill
c73542a3cc Fix variables not being re-resolved on Load()
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-04-17 19:22:52 +02:00
WarmUpTill
70bbc7cdac Implement proper timestamp validation for Twitch messages
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-04-11 19:02:37 +02:00
WarmUpTill
d892298995 Add missing "[adv-ss]" log tag 2025-04-11 19:02:37 +02:00
WarmUpTill
0fe31432be Add "previous scene" to the "scene has (not) changed" checks 2025-04-11 18:57:58 +02:00
WarmUpTill
aaa0113ccb Ignore Xerrors 2025-04-11 18:57:25 +02:00
WarmUpTill
b908954b46 CI: Add cmake setup step to Linux build
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-04-02 13:48:23 +02:00
WarmUpTill
b0eede8a85 Add "disable" effect to macro conditions using "ignore" logic selection 2025-04-02 13:48:23 +02:00
WarmUpTill
aa87911b71 Use cpp-httplib based HTTP action type
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
The goal is to remove the older, more limited version of the HTTP action
at some point in the future.
2025-03-30 14:06:19 +02:00
WarmUpTill
1b05019acc Add option to hide entries from action selection
Intended to be used to hide legacy version of actions types (e.g. HTTP)
2025-03-30 14:01:41 +02:00
WarmUpTill
78a5a2629d Hide the "remote" file check option
This option will be removed at some point in the future.
The http action should be used instead.
2025-03-30 14:01:41 +02:00
WarmUpTill
634270a978 Cleanup includes 2025-03-30 14:01:41 +02:00
WarmUpTill
78ba22e1e4 Hide "get settings" button when setting macro property value 2025-03-30 14:01:41 +02:00
WarmUpTill
aba5737a60 Update and clean up locale (qwe1154323937) 2025-03-30 14:01:41 +02:00
WarmUpTill
4315f7f621 Exclude unwanted files from sources archive 2025-03-30 14:01:41 +02:00
WarmUpTill
53c535962f Use tab key to switch to dialog controls and set default focus to input 2025-03-30 14:01:41 +02:00
WarmUpTill
1e718b78c7 Fall back to project version if git tag cannot be queried 2025-03-30 14:01:41 +02:00
WarmUpTill
b1d2156228 Update libremidi to v4.3.0 2025-03-30 14:01:41 +02:00
WarmUpTill
9c3c953c6b Ignore deprecation warnings for Qt 6.7 and above
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-03-22 18:09:51 +01:00
WarmUpTill
ae74f68db7 Add option to close projector windows 2025-03-22 18:09:51 +01:00
WarmUpTill
213f1bba36 Add "Any" entry of the reward selection only for Twitch condition 2025-03-22 18:09:51 +01:00
WarmUpTill
5a2cb0bd68 Add more scripting signals / procedures 2025-03-22 18:09:51 +01:00
WarmUpTill
23b461828b Add start start / stop callbacks 2025-03-22 18:09:51 +01:00
WarmUpTill
9944a1b03b Move interval reset handling 2025-03-22 18:09:51 +01:00
WarmUpTill
eaad4d1bbd Fix Twitch helper caches misbehaving
API calls with different sets of arguments could map to the same key
value pair, which resulted in unexpected behavior for functions using
those caches
2025-03-22 18:09:51 +01:00
WarmUpTill
17d9b73b9a Fix thread flood when Twitch event sub connection is lost
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-03-15 12:31:13 +01:00
WarmUpTill
d6185a6099 Add handling for Twitch API throttling 2025-03-15 12:31:13 +01:00
WarmUpTill
41c06b9edb Refactor Twitch condition event handling 2025-03-15 12:31:13 +01:00
WarmUpTill
d8807077da Add option to query reward information 2025-03-15 12:31:13 +01:00
WarmUpTill
34e125f82d Rework chache handling
* No longer provide multiple HTTP helper functions with the same name
* Default to cache not being used
* Explicitly use the cache for certain Twitch actions and conditions
* Clear caches on shutdown to avoid leaks being reported
2025-03-15 12:31:13 +01:00
WarmUpTill
d670b6d07e Move JSON temp var heper functions 2025-03-15 12:31:13 +01:00
WarmUpTill
7b0f985f18 Add macro properties for 'reward' object in redemption events 2025-03-15 12:31:13 +01:00
WarmUpTill
212be923f6 Add option to query user information 2025-03-15 12:31:13 +01:00
WarmUpTill
88fcb57e9f Cleanup 2025-03-15 12:31:13 +01:00
WarmUpTill
9b609c118f Fix disabling chat emote only mode attempting to send chat messages 2025-03-15 12:31:13 +01:00
WarmUpTill
37c398d37a Indicate that "Set to condition/action value" should be avoided 2025-03-15 12:31:13 +01:00
WarmUpTill
a51b7f6b13 Fix UI theming issues
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-03-11 22:12:05 +01:00
WarmUpTill
808fd84b83 Remove Qt5 support 2025-03-11 22:12:05 +01:00
WarmUpTill
57bcea15f5 cmake: Replace find_qt with find_package 2025-03-10 19:48:01 +01:00
WarmUpTill
4e51b56b9b Add game capture condition 2025-03-10 18:49:07 +01:00
WarmUpTill
ef5cf41d34 Add OBS 31 support 2025-03-10 18:49:07 +01:00
WarmUpTill
911e79ea6a Fix OCR controls showing in place of color controls
This happened when OCR support was disabled at build time
2025-03-10 18:33:13 +01:00
WarmUpTill
d586177de0 Add screenshot condition
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2025-03-09 20:57:51 +01:00
WarmUpTill
202c36646c Fix UI issues when opening ItemSettingsDialogs
Some widgets were displayed incorrectly if the parent of the dialog
window is not the main settings window
2025-03-09 20:05:07 +01:00
WarmUpTill
ab5102f5ca Fix typo 2025-03-09 20:05:07 +01:00
WarmUpTill
e612fb99f6 Cleanup
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
* Reorder action type selection
* Refactor
2025-03-06 21:30:03 +01:00
WarmUpTill
691e77a69a Add option to generate random number 2025-03-06 21:30:03 +01:00
Kaito Udagawa
930118c61f Call Setup() after Load()
Some checks are pending
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Tesseract API depends on the languageCode and this must be reinitialized after Load
2025-03-06 08:43:54 +01:00
Kaito Udagawa
1e05f2f2ce Fix languageCode
LanguageCode is not respected by OCRParameters and settings properly.
2025-03-06 08:43:54 +01:00
WarmUpTill
ae25b4d023 Improve setting selection handling
Some checks are pending
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Will now try to keep the current selection if possible.
This can be useful when switching between source of the same time.
2025-03-05 14:16:04 +01:00
WarmUpTill
af055a12a1 Cleanup 2025-03-05 14:16:04 +01:00
WarmUpTill
7de28eedd3 Improve settings button selection handling
Will now try to keep the current button selection if possible.
This can be useful when switching between source of the same time.
2025-03-05 14:16:04 +01:00
WarmUpTill
8dfe81f522 Display failure if Twitch token account name cannot be fetched
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-02-27 19:52:41 +01:00
WarmUpTill
a1d8ae291d Add option to hide empty name warning in ItemSettingsDialog 2025-02-27 19:52:41 +01:00
WarmUpTill
eb6989527d Add support for libproc2 version 4.0.5
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-02-10 18:12:08 +01:00
WarmUpTill
2986a5dd96 Fix crash when actions were copied into a action queue
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
The steps added via AddPostLoadStep() from the copy were never executed.
Thus they might be invalid when RunPostLoadSteps() is next called.

This could result in a crash when a new action or condition is added
after e.g. a "Filter" action's TempVariableRef was copied, which adds a
PostLoadStep to resolve the macro segment reference.
2025-02-04 08:26:04 +01:00
WarmUpTill
816ee9b244 Fix crash when changing Twitch condition type 2025-02-04 08:26:04 +01:00
WarmUpTill
51b53bf948 Fix script actions / conditions not working after stopping macro
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-01-30 09:39:50 +01:00
WarmUpTill
2c5121ee94 Prevent crash when macro contains invalid action or condition 2025-01-30 09:39:50 +01:00
WarmUpTill
6a58684854 Fix import of incomplete settings not resetting duration to zero
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-01-23 19:00:51 +01:00
WarmUpTill
0b622fdbed Fix crash when importing settings 2025-01-23 19:00:51 +01:00
WarmUpTill
3bce8e075f CI: Switch to and adapt to Ubuntu 24 runner
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-01-15 21:36:54 +01:00
WarmUpTill
f598d84ea1 Fix freeze due to ResizingPlainTextEdit constantly resizing incorrectly 2025-01-15 21:36:35 +01:00
WarmUpTill
d7a244e80e Fix transition condition not considering transition overrides
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2024-12-31 12:47:20 +01:00
WarmUpTill
408002e96a Add support for OBS 31 in-tree builds
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2024-12-12 21:41:21 +01:00
WarmUpTill
50da3d3210 Fix "Media" condition showing the incorrect macro property selection
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2024-11-30 12:11:14 +01:00
WarmUpTill
9e13067769 Fix typo
Some checks failed
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2024-11-23 17:11:05 +01:00
WarmUpTill
821e768e76 Reduce screenshot selection area to area to be checked
Some checks failed
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
debian-build / build (push) Has been cancelled
2024-11-22 20:52:15 +01:00
WarmUpTill
4d2179448b Rename files 2024-11-22 20:52:15 +01:00
WarmUpTill
40d9002470 Update scripting examples
* Add more comments
* Add example showcasing how to register and set temp vars
2024-11-22 20:36:36 +01:00
WarmUpTill
7f1e310ca6 Add support to register, deregister, and set temp vars from scripts 2024-11-22 20:36:36 +01:00
WarmUpTill
66d02f4683 Fix typos 2024-11-22 20:36:36 +01:00
Arash Partow
0aae1b9978 Update ExprTk to 0.0.3
Some checks are pending
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2024-11-22 19:56:02 +01:00
WarmUpTill
db50822b05 Prepare to fix deprecation warning when using OBS 31
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
The following log message will be present in OBS 31 when
CheckIfTrayIsDisabled() is called:

DEPRECATION: obs_frontend_get_global_config is deprecated. Read from
global or user configuration explicitly instead.

It will be resolved when the minimum OBS version is bumped to OBS 31.
2024-11-02 08:28:52 +01:00
WarmUpTill
63a545b293 Fix "Date" condition returning true unexpectedly
This could happen if the plugin was stopped on the General tab and
restarted or the first time the plugin was started.
2024-11-02 08:28:52 +01:00
WarmUpTill
bc0497d2c9 Add MacroWasCheckedSinceLastStart() 2024-11-02 08:28:52 +01:00
WarmUpTill
37226a3a4c Fix macro group icon not being displayed correctly in OBS 31
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2024-10-31 19:39:38 +01:00
WarmUpTill
9f15fbe47c Recursively search for source button in property groups
Some checks are pending
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2024-10-30 18:29:23 +01:00
WarmUpTill
0ee6feb529 Add option to check the current stream key
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2024-10-26 23:42:59 +02:00
WarmUpTill
3b82b55090 Fix Queue condition not displaying the correct size selection 2024-10-26 23:42:59 +02:00
WarmUpTill
071c3309c2 Add option to check current streaming service
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
2024-10-26 11:09:06 +02:00
WarmUpTill
ee7ee7a846 Move AutoUpdateTooltipLabel definition 2024-10-26 11:09:06 +02:00
WarmUpTill
d10300bd4b Fix typo 2024-10-26 11:09:06 +02:00
WarmUpTill
e262672876 Add "Last empty" row to Queue tab 2024-10-26 11:08:51 +02:00
WarmUpTill
392e775c7b Add temp var support for size and running state 2024-10-26 11:08:51 +02:00
WarmUpTill
f641c20564 Add SetTempVarValue() overload to support boolean values 2024-10-26 11:08:51 +02:00
WarmUpTill
39327be88e Add option to move scene item above / below specified scene item
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2024-10-21 20:46:27 +02:00
WarmUpTill
ed0963799c Fix "Screenshot" action variable selection not being loaded
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2024-10-18 18:30:49 +02:00
WarmUpTill
f9e73a2b8f Fix crash when clearing Twitch chat buffer 2024-10-18 18:29:46 +02:00
Przemek Pawlas
dfaa704b71 Remove some unused includes 2024-10-12 17:09:33 +02:00
Przemek Pawlas
d54edddde4 Enable use of variables as input for "Variable" action 2024-10-12 17:09:33 +02:00
Przemek Pawlas
37cc289204 Rename function 2024-10-12 17:09:33 +02:00
WarmUpTill
8d9519c849 Adapt to OBS switch from "themeID" to "class" properties
OBS commit: cb026964b00c366943a3c16dfb1511eafc24c035
2024-10-10 20:02:35 +02:00
WarmUpTill
0fd5f47982 Add option to check if users leave or join Twitch chat 2024-10-08 19:57:50 +02:00
Przemek Pawlas
62ce83a7f6 Add one more Twitch chat tag temp var 2024-10-05 23:19:53 +02:00
Przemek Pawlas
8ecee0070d Add more Twitch chat tag temp vars and properties 2024-10-05 16:01:32 +02:00
WarmUpTill
a4970b1b07 Match any Twitch chat message by default 2024-10-05 14:30:30 +02:00
WarmUpTill
140dc9c6f4 Add option to set enabled state for partial match regex config 2024-10-05 14:30:30 +02:00
Przemek Pawlas
9a4d2935f8 Disable custom macro interval by default 2024-10-04 18:56:57 +02:00
WarmUpTill
335c964419 Fix connecting Twitch account leading to OBS freeze
In rare cases the close() call for the Twitch chat connection might fail
due to a race condition I have not fully figured out yet.
As a workaround the connection to the chat server will be force closed
for now.
2024-10-04 12:33:17 +02:00
WarmUpTill
72b2a7a07a Add option to assign screenshot to variable 2024-10-03 19:10:14 +02:00
WarmUpTill
f863909f34 Fix incorrect websocket request callback being called 2024-10-02 19:52:07 +02:00
WarmUpTill
621ca201ef Cleanup 2024-10-02 19:52:07 +02:00
WarmUpTill
563ea1a5e7 Add workaround for obs_source_set_sync_offset()
Calling obs_source_set_sync_offset() once with the desired value has no
effect.
The function needs to be called multiple times with different values in
hopes of the sync offset being changed successfully.

See https://github.com/obsproject/obs-studio/issues/7912
2024-10-01 22:19:27 +02:00
WarmUpTill
2af6ee883b Fix process condition not respecting regex options 2024-10-01 22:18:29 +02:00
Przemek Pawlas
0e9875e6b5 Allow using regex capture groups in replacement 2024-10-01 21:11:16 +02:00
WarmUpTill
c2d2e883c6 Add option to configure macro pause state on startup 2024-09-29 12:54:35 +02:00
WarmUpTill
a196e56078 Fix macro action paste happening in the wrong section
Instead of checking the cursor position at the time of the paste, it
needed to be checked at the time of the context menu creation to ensure
the segment gets pasted into the correct section
2024-09-24 23:00:47 +02:00
WarmUpTill
0536e4a60b Add option to trim screenshot created in Video condition 2024-09-24 23:00:47 +02:00
WarmUpTill
55ab096e49 Cleanup screenshot helper 2024-09-24 23:00:47 +02:00
WarmUpTill
c39ea0854a Fix crash when changing position of scene item transform 2024-09-24 23:00:47 +02:00
WarmUpTill
aef080984e Add new macros after current selection 2024-09-24 23:00:47 +02:00
WarmUpTill
1aa2425e81 Cleanup locale 2024-09-24 23:00:47 +02:00
WarmUpTill
f5eadfa39c Add option to disable saving when switching macros 2024-09-24 23:00:47 +02:00
WarmUpTill
faa65facfe Add Stream Deck condition type
The Stream Deck plugin to enable communication with the Advanced Scene
Switcher can be found here:
https://github.com/WarmUpTill/advanced-scene-switcher-streamdeck-plugin
2024-09-24 23:00:47 +02:00
WarmUpTill
b60235d964 Export VariableSpinbox symbols 2024-09-24 23:00:47 +02:00
WarmUpTill
718b18248e Add context menu entry to remove selected macro segment 2024-09-24 23:00:47 +02:00
WarmUpTill
4316e53039 Cleanup constness of MacroSegmentList 2024-09-24 23:00:47 +02:00
WarmUpTill
790ac50385 Add warning if temp vars are not available for "Run" action 2024-09-24 23:00:47 +02:00
WarmUpTill
3a87a8d155 Hide priority settings when legacy tabs are hidden 2024-09-24 23:00:47 +02:00
WarmUpTill
91912f2aa5 Add/Move helpers to register OBS websocket vendor requests
Adds websocket vendor requests to start and stop the plugin.
Adds vendor events to indicate when the plugin is started or stopped.

These are ntended to be used for the StreamDeck plugin support.
2024-09-24 23:00:47 +02:00
WarmUpTill
624b841ca1 Add option for custom macro condition check interval 2024-09-24 23:00:47 +02:00
WarmUpTill
9eb4e90291 Rename and refactor macro class functions
LastConditionCheckTime() will be required to support custom condition
check intervals per macro
2024-09-24 23:00:47 +02:00
WarmUpTill
94263cc7a0 Work around crash in std::filesystem due to unexpected char encoding 2024-09-24 23:00:47 +02:00
WarmUpTill
2d035758f4 Fix build issues with macos-14 runner
Default runner switched from X86_64 based to arm64 based starting with
the macos-14 runner images
2024-09-24 23:00:47 +02:00
WarmUpTill
86697002f7 Add option to wait for media playback to end 2024-09-24 23:00:47 +02:00
WarmUpTill
2247152aa8 Remove legacy tab "Scene Triggers" 2024-09-24 23:00:47 +02:00
WarmUpTill
2528449c84 Cleanup 2024-09-24 23:00:47 +02:00
WarmUpTill
f2df3d18be Rename locale key to better reflect its purpose 2024-09-24 23:00:47 +02:00
WarmUpTill
c7c48d03e9 Add option for short circuit evaluation of conditions 2024-09-24 23:00:47 +02:00
WarmUpTill
0906c6bb3f Add regex settings option to scene name pattern check 2024-09-24 23:00:47 +02:00
WarmUpTill
9f2daf1a15 Add option to select all items in a source group 2024-09-24 23:00:47 +02:00
WarmUpTill
6fb8619671 Clear outdated highlight triggers when enabling macro segment highlights 2024-09-24 23:00:47 +02:00
WarmUpTill
36fb83246b Add log level to log executed macros 2024-09-24 23:00:47 +02:00
WarmUpTill
e729d15e97 Remove legacy tab "Network" 2024-09-24 23:00:47 +02:00
WarmUpTill
7836298076 buildspec: Update OBS Studio dependency to 30.1.2
This is necessary to support OBS 31, which removes a bunch of deprecates
functions
2024-09-24 23:00:47 +02:00
WarmUpTill
354880ad52 Prepare for deprecations in OBS 31
See https://github.com/obsproject/obs-studio/pull/11164
2024-09-24 23:00:47 +02:00
WarmUpTill
c1ac9bb890 Resolve QCssParser::parseColorValue warning 2024-09-24 23:00:47 +02:00
WarmUpTill
49bf1ad379 Fix transition condition timing issues
The condition type was able to miss transition starts of very fast
conditions (e.g. Cut) when the selection "Any transition" was made.

In that case no signal handler was installed (as the condition type
might change) and only the transition scenes were compared at the time
of the condition check.
If that moment where the transition scenes differ was missed no
transition start was recognized.

Additionally, the "Transitioning to" and "Transitioning from" checks
faced a similar issue, if the scene transition was happening so fast,
that the condition check was not performed during the time of the
transition.
2024-09-24 23:00:47 +02:00
WarmUpTill
a6e30a1e20 Add temp var support to media condition 2024-09-24 20:27:11 +02:00
WarmUpTill
2f54c2ee62 Increase volume meter scale from -100 to 0 dB
This was done to enable users to to use higher precision values in the
"Audio" condition type.
Previously, the UI would reset the selected values to the minimum value
possible to display in the volume meter widget, which was -60 dB.
2024-09-20 23:05:45 +02:00
Przemek Pawlas
6ccbaad41c Add enhanced relative time to variable tab cells 2024-09-18 17:38:53 +02:00
Przemek Pawlas
57d78a996a Add variable trim and case change actions 2024-09-16 19:42:41 +02:00
炭酸コーラ
2d3dada30e Updated Japanese translation to the latest version 2024-09-11 17:59:20 +02:00
WarmUpTill
5bf20d155f Ignore comments 2024-09-11 17:59:20 +02:00
WarmUpTill
2b95598958 CI: Replace deprecated actions/upload-artifact action 2024-09-11 17:59:20 +02:00
WarmUpTill
b561a20dde Rename issue template file 2024-08-24 00:28:23 +02:00
WarmUpTill
835722af34 Update issue templates and links 2024-08-24 00:24:09 +02:00
WarmUpTill
93efc7cab3 Add option to check for addition chat message properties 2024-08-24 00:23:54 +02:00
WarmUpTill
d69364ec19 Fix crash on IRC disconnect due to maintenance
Reworked the (dis)connect handling
2024-08-24 00:23:54 +02:00
WarmUpTill
d75066df5f Fix crash when adding new entries to the legacy tabs 2024-08-24 00:23:54 +02:00
WarmUpTill
863c84026e Move GetSettingsWindow() to ui-helpers 2024-08-24 00:23:54 +02:00
WarmUpTill
a523081d77 Move GetIndexOfSignal() to ListEditor 2024-08-24 00:23:54 +02:00
WarmUpTill
66534519d6 Export complete RegexConfigWidget class 2024-08-24 00:23:54 +02:00
WarmUpTill
b3b2114c45 Fix SetHeightToContentHeight() not respecting diffrently sized rows 2024-08-24 00:23:54 +02:00
WarmUpTill
510f83246e Only emit signals when value changed
* Fixes crash when deleting macro in case macro selection is in focus
* Prevent unnecessary create operation when switching macro segment type
2024-08-16 06:49:27 +02:00
WarmUpTill
c969b21f93 Fix MacroSelection not properly unhiding first macro in selection 2024-08-16 06:49:27 +02:00
WarmUpTill
6ec40ef8e9 Cleanup 2024-08-16 06:49:27 +02:00
WarmUpTill
27859e83b3 Fix crash when creating macro which uses macro segment factories 2024-08-16 06:49:27 +02:00
WarmUpTill
263565700a Fix crashes related to widget highlighting 2024-08-16 06:49:27 +02:00
WarmUpTill
5bb10a4aef Resolve unused parameter warnings 2024-08-15 01:02:03 +02:00
WarmUpTill
ee72bb192c Improve corrupted installation detection 2024-08-15 01:02:03 +02:00
WarmUpTill
1a1028cbaa Paste copied macro action depending on cursor position
If cursor is above else action section paste it there.
If cursor is above regular action section paste it there.

In case of neither paste in original position.
2024-08-14 22:02:55 +02:00
WarmUpTill
2f4f8bcc74 Add IsCursorInWidgetArea() 2024-08-14 22:02:55 +02:00
WarmUpTill
4113615cd6 Add context menu to change custom label for macro segments 2024-08-14 22:02:55 +02:00
WarmUpTill
9522d7c0b4 Adapt to new OBS dock API
* The plugin will no longer attempt to restore dock positions on scene
  collection change.
* When a macro is being renamed the dock widget with the current name
  will be removed.
  A new dock with the new name will have to be opened manually.
* The status dock position will be when updating to a version containing
  this changei from an older version.
2024-08-14 21:51:42 +02:00
WarmUpTill
cc3ea79836 buildspec: Update OBS Studio dependency to 30.0.2 2024-08-14 21:51:42 +02:00
WarmUpTill
f72e802d00 Add API link 2024-08-14 21:51:42 +02:00
WarmUpTill
36201cbfb4 Add API to register new macro condition and action types 2024-08-14 21:51:42 +02:00
WarmUpTill
685e28d161 Make read and write functions of variables thread-safe 2024-08-14 21:51:42 +02:00
WarmUpTill
82d23dcf0e Exclude python cache directories 2024-08-14 21:51:42 +02:00
WarmUpTill
ad322d54f0 Fix crash in case of high frequency resize events
I am not sure if this could really happen in normal use.
Was discovered after implementing the script properties UI widgets.
2024-08-14 21:51:42 +02:00
WarmUpTill
8bac6fe829 Set Run condition default timeout to one second
The action is often used in combination with python scripts which
usually take longer to initialize than 100ms
2024-08-14 21:51:42 +02:00
WarmUpTill
ac7531decb Fix crash in MIDI initialization 2024-08-14 21:51:42 +02:00
Junior Anzolin
7af4969ec6
Add portuguese brazil translation (#1168)
* Add portuguese brazil translation
2024-08-13 19:36:27 +02:00
WarmUpTill
a088325968 Refresh pattern data when pattern file changes 2024-08-11 16:03:08 +02:00
WarmUpTill
57bc58be8e Add duration modifier tests 2024-08-11 16:03:08 +02:00
WarmUpTill
f9730b1bc2 Refactor DurationModifier to enable testing 2024-08-11 16:03:08 +02:00
WarmUpTill
d4025214e5 Cleanup duplicate "[advss]" log prefix 2024-08-11 16:03:08 +02:00
WarmUpTill
c431e6c31d Show warning if default action or condition cannot be created 2024-08-11 16:03:08 +02:00
WarmUpTill
9941cfe9b5 Install libproc2-dev in Linux build environment
This ensures that the plugin will attempt to load either libprocps-dev
or libproc2-dev libraries at runtime, instead of just the libprocps-dev
library

Dep packages taken from:
 * https://packages.debian.org/bookworm/libproc2-0
 * https://packages.debian.org/bookworm/libproc2-dev
2024-08-11 16:03:08 +02:00
WarmUpTill
15998012e5 Change default verbosity of busy loop detection log
This is mostly relevant when analysing issues, so it does not make sense
to potentially spam the OBS log with this message
2024-08-11 16:03:08 +02:00
WarmUpTill
bcb043f997 Add condition logic tests 2024-08-11 16:03:08 +02:00
WarmUpTill
74116382b1 Enable include during unit testing 2024-08-11 16:03:08 +02:00
WarmUpTill
24f33fb0d2 Refactor condition logic to enable testing 2024-08-11 16:03:08 +02:00
WarmUpTill
d80df57ef8 Increase default threshold value for image pattern matching
The previous default value could cause a lot of false positive
detections and thus cause confusion if the image detection is working
correctly or not.
2024-08-11 16:03:08 +02:00
WarmUpTill
240c47975c Rework Media condition
* Split state and time check
* Improve signal handling
* Prevent exponential memory groth when using the "any" / "all" check
* Improve layout
2024-08-07 21:22:45 +02:00
WarmUpTill
bedb3b8dc6 Change plugin folder name
Requested by lindenkron to ease development of a plugin manager
2024-07-09 21:21:10 +02:00
WarmUpTill
8032dde045 Prevent users from accidentally enabling action cooldowns 2024-07-09 21:21:10 +02:00
WarmUpTill
bfc51b2df5 Add option to set individual transform settings 2024-07-09 21:00:25 +02:00
WarmUpTill
2160da59f3 Add support to check values of individual transform settings 2024-07-09 21:00:25 +02:00
WarmUpTill
d3164e3ed6 Add TransformSettingSelection 2024-07-09 21:00:25 +02:00
WarmUpTill
17c72b772d Display plugin load failure warning only once 2024-07-09 19:10:51 +02:00
WarmUpTill
3ff9a1f270 Add USB condition type
It allows users to check if a given USB device is currently connected
2024-07-08 20:54:26 +02:00
WarmUpTill
7d120d8b6a Fix MacOS version of install_advss_plugin_dependency_file 2024-07-08 20:54:26 +02:00
WarmUpTill
53cfe4b030 Add libusb dependency 2024-07-08 20:54:26 +02:00
WarmUpTill
4dcd748a1f Switch to github repo of openssl 2024-07-08 20:54:26 +02:00
WarmUpTill
223ce0d0a0 Fix potential crash in StatusControl 2024-07-03 13:02:34 +02:00
WarmUpTill
5bd3341681 Add option to clear message buffer on match 2024-07-03 13:02:34 +02:00
WarmUpTill
bb527d6910 Improve error logging of commercial start via Twitch action 2024-07-03 12:55:49 +02:00
WarmUpTill
dfedbcf31a Add option to set maximum replay buffer time 2024-06-26 19:19:41 +02:00
WarmUpTill
1bbfd16b3f Add option to check disk space available
Based on the OBS stats dock implementation, which queries the drive to
which outputs would write to
2024-06-22 15:40:47 +02:00
WarmUpTill
7f5737d03f Use default cursor icon on macro segment control hover
Previously the cursor icon would be set to Qt::SplitVCursor as those
widgets were moved into the splitter handle layout
2024-06-20 21:41:28 +02:00
WarmUpTill
7702541d81 Cleanup
* Increase update frequency of AutoUpdateTooltipLabel
* Prevent crash in TempVariableRef::PostLoad()
* Ensure that correct widget is passed for MacroSelection connections
2024-06-20 21:41:28 +02:00
WarmUpTill
3bc15e585c Switch QPushButton to QToolButton
This will be more consistent with the widget styles used throughout OBS
and solves a few layout issues
2024-06-20 21:41:28 +02:00
WarmUpTill
d77101b6aa Restore fullscreen projector display selection
Instead of discarding the monitor selection now only no longer perform
the action while the monitor setup is changed.
2024-06-18 21:24:28 +02:00
WarmUpTill
c1e23f9c7a Improve slide show condition
* Add temp var support
* Add regex support for path check
* Improve layout stretch handling
2024-06-16 18:42:06 +02:00
WarmUpTill
70415cd8f4 Add support for "slideshow_v2" 2024-06-16 18:42:06 +02:00
WarmUpTill
f50cd76493 Fix i386 build issue 2024-06-16 11:04:05 +02:00
炭酸コーラ
e4af698881 Add Japanese translation 2024-06-15 10:11:45 +02:00
WarmUpTill
33120a359c Fix Twitch "goal type" temp var tooltips being cut off early 2024-06-15 10:11:45 +02:00
WarmUpTill
091a364097 Print line numbers in check-locale.py in case of error 2024-06-15 10:11:45 +02:00
WarmUpTill
e3ff6f34fc Update OpenCV to 4.10.0
This adds support for the MSVC toolset 19.40.x
2024-06-11 19:01:01 +02:00
WarmUpTill
ed75a221fe Fix crashes in combination with older MSVC redistributable versions
Since the switch of Windows 2022 GitHub actions runner image to version
20240603.1.1 the Visual Studio version was bumped to 17.10.34928.147.
This results in MSVC version 19.40.33811.0 being used at build time.
Combining this with e.g. the MSVC redistributable version 14.34.31938.0
results in segfaults when calling std::mutex::lock.

See also:
https://developercommunity.visualstudio.com/t/Invalid-code-generation-in-release-1940/10678572
2024-06-09 00:39:54 +02:00
WarmUpTill
7b48cb2b8d Fix locale error 2024-06-09 00:39:51 +02:00
WarmUpTill
9d4c8ab475 Fix stylesheet of StatusControl not being set to stopped state 2024-06-07 23:05:08 +02:00
WarmUpTill
3d61ea7d25 Add option to reevaluate condition state in "Macro" action 2024-06-07 21:44:21 +02:00
WarmUpTill
99c8a46296 Add option to ignore pause during condition check 2024-06-07 21:44:21 +02:00
WarmUpTill
7e1d20031c Add HelpIcon
A QLabel consisting of a question mark icon and tooltip
2024-06-07 21:44:21 +02:00
WarmUpTill
0e4b000fb1 Set default action of tpye "Macro" to "Run" 2024-06-07 21:44:21 +02:00
WarmUpTill
fc2451ae08 Rename MacroProperties to MacroSettings 2024-06-07 21:44:21 +02:00
WarmUpTill
be44577967 Add option to set input variable values to Macro action 2024-06-07 21:44:21 +02:00
WarmUpTill
3480ff238e Add macro input variable support 2024-06-07 21:44:21 +02:00
WarmUpTill
ee68427036 Add HighligthMacroSettingsButton() 2024-06-07 21:44:21 +02:00
WarmUpTill
37c32dd1ed Move StringList from base to lib 2024-06-07 21:44:21 +02:00
WarmUpTill
c05a92d417 Refactor widget highlighting 2024-06-07 21:44:21 +02:00
WarmUpTill
d72a0c0d38 Add VariableSelectionDialog 2024-06-07 21:44:21 +02:00
WarmUpTill
235b31fccc Add GUARD_LOADING_AND_LOCK
Helper macro to reduce repetition
2024-06-07 21:44:21 +02:00
WarmUpTill
286f781f4d Add ListEditor helper widget 2024-06-07 21:44:21 +02:00
WarmUpTill
b7516cac5b Fix crash when adding resources to resources tab
A crash could occur if the plugin window was closed and reopened and a
new resource was added to either the Variable, Action queue, Websocket,
or Twitch tab.

No context object was provided to the signal handlers.
The signal provider is intentionally not deleted when the UI is closed.
Because of this, the signal connections were never cleared when the
underlying tab widget was destroyed.
So, in the case of closing and reopening the settings window, the old
connection with the outdated widget pointers would be called again.
2024-06-05 01:05:31 +02:00
WarmUpTill
45967a090f Add tempvar support to filter condition 2024-06-05 01:05:31 +02:00
WarmUpTill
687fb4623e Add tempvar support to source condition 2024-06-05 01:05:31 +02:00
WarmUpTill
4157ae4ed2 Add option to check source height and width 2024-06-05 01:05:31 +02:00
WarmUpTill
5e1469b0d8 Don't restore last opened tab if that tab is no longer visible 2024-06-05 01:05:31 +02:00
WarmUpTill
b3bde6c59f Fix imported variables / actions not being added to respective tabs 2024-06-05 01:05:31 +02:00
WarmUpTill
032f5e2fe9 Improve visibility of plugin stop warning flash in status dock 2024-06-05 01:05:31 +02:00
WarmUpTill
91c053dfd8 Re-add tooltips for the "last used" cells on the variable tab 2024-06-05 01:05:31 +02:00
Przemek Pawlas
1f1ef4ca03 Add variable values swap action 2024-05-25 19:04:09 +02:00
WarmUpTill
7cc44b4470 Fix folder watch condition filter handling 2024-05-19 03:46:53 +02:00
WarmUpTill
54356d9410 Add tooltip to macro property selection in variable action 2024-05-19 01:44:10 +02:00
WarmUpTill
defbdf8b7a Add folder condition
It allows you to watch for chagnes in a given folder
2024-05-19 01:44:10 +02:00
WarmUpTill
a01af6cfc3 Adapt code to be compatible with older MSVC redistributable versions 2024-05-18 23:31:04 +02:00
WarmUpTill
4d9c7f1054 Fix typo 2024-05-18 23:31:04 +02:00
WarmUpTill
ced36e2b5b Add nodiscard to sync-helpers 2024-05-18 23:31:04 +02:00
WarmUpTill
d2749f29b0 Add note about limitations of the window focus action 2024-05-14 20:23:36 +02:00
WarmUpTill
b78c8bc1de Assume minimum volume when no volume update was received within 250ms
Without this timeout the peak volume update, which was received last,
would be used permanently until the next update arrives.
This might only take place when the source produces audio output again.
2024-05-14 19:12:49 +02:00
WarmUpTill
cc4a3560d8 Fix "Window" actions not being applied to OBS windows 2024-05-12 01:29:06 +02:00
WarmUpTill
3ab2ea9e66 Only update Twitch tab content when switching to it
This should reduce the potential lag introduced when querying the token
status using the Twitch API
2024-05-12 01:28:51 +02:00
WarmUpTill
69b82ee2a3 Fix audio condition incorrectly reporting very low volume levels
OBS might very rarely not update _peak quickly enough when very low
intervals are configured on the General tab.
In that case _peak might be set to negative infinity still, which will
result in unexpected behavior, so we use the previously valid peak value
instead.
2024-05-10 15:11:20 +02:00
WarmUpTill
f14e6bf252 Fix crash when access to midi devices is denied 2024-05-10 15:11:20 +02:00
WarmUpTill
e51ae79b4c Improve window action
* The focus action no longer restores maximized windows
* The focus, maximize, minimize, and close actions will be performed on
  all handles matching the given window title
2024-05-10 15:11:20 +02:00
WarmUpTill
8f55856fd5 Fix macro segment highlighting not being in sync
Each macro segment had its own internal timer to handle highlighting.
This handing was now moved centrally to the macro tab.
2024-05-10 15:11:20 +02:00
WarmUpTill
a360d53419 Enable right-click to select macro segments
This will be used to enable copy-paste via the context menu available
when right-clicking a macro segment
2024-05-10 15:11:20 +02:00
WarmUpTill
d28164d02f Fix initial replay buffer save not triggering condition 2024-05-10 15:11:20 +02:00
WarmUpTill
f723212394 Add copy-paste support for individual macro segments 2024-05-10 15:11:20 +02:00
WarmUpTill
a0cb08d18f Fix potential crash when creating actions 2024-05-10 15:11:20 +02:00
WarmUpTill
d18044b764 Add handling for fading of else-controls 2024-05-10 15:11:20 +02:00
WarmUpTill
406b5d61f5 Add option to conditionally run action of other macros 2024-05-10 15:11:20 +02:00
WarmUpTill
9a4eef4a83 Adjust busy loop sleep to 10ms
This is now in line with the new minimum interval value
2024-05-10 15:11:20 +02:00
WarmUpTill
efaf9a2ef3 Add option to check if hotkey is released
This was already possible previously by inverting the logic with a
"not", however, this should it make it more obvious that this type of
check is possible.
2024-05-09 23:19:08 +02:00
WarmUpTill
edb2952fd6 Add temp vars to file condition 2024-05-09 22:14:43 +02:00
Denilson Sá Maia
088828a351 Fixed typo 2024-05-03 20:04:22 +02:00
WarmUpTill
e359b7fa00 Add Twitch connection tab 2024-05-01 19:44:57 +02:00
WarmUpTill
44fc5177d6 Add action queue tab 2024-05-01 19:44:57 +02:00
WarmUpTill
604a27141f Move files 2024-05-01 19:44:57 +02:00
WarmUpTill
fd65a84d7d Improve buildnumber handling 2024-05-01 19:44:57 +02:00
WarmUpTill
966b389807 Rework variable tab to use tab helpers 2024-05-01 19:44:57 +02:00
WarmUpTill
a6bcce5a63 Add websocket connections tab 2024-05-01 19:44:57 +02:00
WarmUpTill
530fbdd282 Add ResourceTable class
Base class to be used to display items in a table
2024-05-01 19:44:57 +02:00
WarmUpTill
54f1051456 Ease detection of calling obs_module_text() too early 2024-05-01 19:44:57 +02:00
WarmUpTill
d136bf5561 Fix crash when on startup when registering new tab 2024-05-01 19:44:57 +02:00
WarmUpTill
5cba948e02 Decouple plugin init, load, cleanup handling from SwitcherData 2024-05-01 19:44:57 +02:00
WarmUpTill
ab922f6735 Rename and refactor websocket helpers 2024-05-01 19:44:57 +02:00
WarmUpTill
d71c87535f Add RemoveItemsByName()
Helper function to remove Items by name from std::queue of Item
2024-05-01 19:44:57 +02:00
WarmUpTill
ce501bd972 Move / add tabWidget related helper functions 2024-05-01 19:44:57 +02:00
WarmUpTill
ec5944f53c Fix Debian cmake configure issue
The "CI" environment variable was defined but "GITHUB_RUN_ID" was not
resulting in a broken if statement:

if(true AND)

https://github.com/WarmUpTill/SceneSwitcher/issues/1090
2024-04-25 19:31:18 +02:00
WarmUpTill
5e64e0bbaa Disable "psabi" warning for x86 Debian build
https://github.com/WarmUpTill/SceneSwitcher/issues/1091
2024-04-25 19:31:18 +02:00
WarmUpTill
e16f1d732d Fix layout of the "System tray notification" action 2024-04-25 19:30:43 +02:00
WarmUpTill
cdacfc946c Save macro segment settings in separate object
To avoid conflicts with other setting of the segment
2024-04-20 17:39:47 +02:00
WarmUpTill
26e854f0a3 Open macro selection dialog at plugin window location 2024-04-20 17:39:47 +02:00
WarmUpTill
2bc89364b2 Refactor NameDialog 2024-04-20 17:39:47 +02:00
WarmUpTill
e080d2de9b Add option to set custom labels on macro segments 2024-04-20 17:39:47 +02:00
WarmUpTill
ca1262aeb7 Resize temp var selection when repopulating list 2024-04-20 17:39:47 +02:00
WarmUpTill
cbc95e2095 Add option to export macro as plain json 2024-04-20 17:39:47 +02:00
WarmUpTill
9c5051cbf8 Increase scene item index selection maximum to 999 2024-04-20 17:39:47 +02:00
WarmUpTill
e6ca3390a2 Resize settings selection when repopulating list 2024-04-20 17:39:47 +02:00
Przemek Pawlas
e74b531905 Fix saving scene item index range 2024-04-15 19:17:28 +02:00
WarmUpTill
01437183ac Fix checkbox icon of groups in macro tree not being set on OBS 30.1.2
This change is necessary because of
https://github.com/obsproject/obs-studio/pull/9584
2024-04-07 20:23:54 +02:00
WarmUpTill
e5ab2ceca3 Fix build issue with GCC 13.2.0 and clang-17 2024-04-04 20:49:10 +02:00
WarmUpTill
e19f4ddf7c Fix variable deletion via variable tab not updating variable selections
The order of operations was incorrect.
First the signal that a variable was removed was propagated before the
variable was actually selected.
So e.g. scene item selections would receive the signal that a variable
was deleted but when repopulating the scene item selection the variable
still exists resulting in the list of available entries not to change.
2024-04-02 17:59:17 +02:00
WarmUpTill
4e3a062084 Only insert enabled actions to action queues 2024-04-02 17:59:17 +02:00
WarmUpTill
96db0ad507 Fix crash when stopping queue from within the queue 2024-04-02 17:59:17 +02:00
WarmUpTill
6b4bcc074a Add option to press buttons in the properties dialog of filters 2024-04-02 17:59:17 +02:00
WarmUpTill
14dd390680 Add option to truncate or pad variable value 2024-04-02 17:59:17 +02:00
WarmUpTill
3fe8ea8961 Fix timer condition not properly using random values 2024-04-02 17:59:17 +02:00
WarmUpTill
3ee913ea98 Add option to enable or disable sources on audio tracks 2024-04-02 17:59:17 +02:00
WarmUpTill
d18277653c Resolve settings groups in source selection 2024-04-02 17:59:17 +02:00
WarmUpTill
8c478cc330 Add control description to source selection 2024-04-02 17:59:17 +02:00
WarmUpTill
003ffc161b Show warning if system tray is disabled in OBS settings 2024-04-02 17:59:17 +02:00
Przemek Pawlas
74dc0c871b Add Run action/condition temp vars 2024-03-24 14:44:24 +01:00
WarmUpTill
c8545dea4d Fix crash when setting variable to invalid environment variable 2024-03-22 21:55:47 +01:00
WarmUpTill
e1b8edd444 Improve macro name conflict error messages 2024-03-22 21:55:47 +01:00
WarmUpTill
f3996855c3 Add example OBS websocket message 2024-03-22 21:55:47 +01:00
WarmUpTill
ea17e8ea08 Add tooltips 2024-03-17 12:50:12 +01:00
WarmUpTill
00fc313609 Add clipboard condition type 2024-03-15 22:00:57 +01:00
Przemek Pawlas
c72f9abc2b Add pre-commit hooks 2024-03-15 21:27:08 +01:00
Przemek Pawlas
6df818503e Add macro option to stop and rerun actions 2024-03-15 21:27:08 +01:00
WarmUpTill
b17a6cc109 Formatting changes 2024-03-12 21:56:25 +01:00
WarmUpTill
82d1aed472 CI: Fix clang format check using incorrect folder 2024-03-12 21:56:25 +01:00
WarmUpTill
eb6fc6c140 CI: Skip updating of git binaries
This seems to break the CI step "Install macOS build requirements" as
python is attempted to be installed as a dependency of git for which a
symlink cannot be created successfully.
2024-03-12 21:56:25 +01:00
Przemek Pawlas
2710406f5f Add QString arg checking to locale CI script 2024-03-10 13:48:57 +01:00
Przemek Pawlas
a634499423 Fix some locale inconsistencies 2024-03-10 13:48:57 +01:00
Przemek Pawlas
71b3fbaa19 Error CI if other languages have redundant extras 2024-03-10 13:48:57 +01:00
Przemek Pawlas
c656bb4571 Fix invalid JSON storage of source/filter double values 2024-03-10 13:48:57 +01:00
Przemek Pawlas
6c4e4b8cd8 Don't show 2 warning popups for groups with macros 2024-03-10 13:48:57 +01:00
Przemek Pawlas
7b1a256f8a Add Del/F2 keyboard shortcuts for macro and var removal/renames 2024-03-10 13:48:57 +01:00
Przemek Pawlas
66f9eaf8c2 Exclude *.orig files in .gitignore 2024-03-10 13:48:57 +01:00
Przemek Pawlas
7fa0ba3355 Add change count to var tab tooltip 2024-03-10 13:48:57 +01:00
Przemek Pawlas
eec9244e4c Variable related refactors 2024-03-10 13:48:57 +01:00
Przemek Pawlas
e265e4828e Add tooltip with full var value to variable tab 2024-03-10 13:48:57 +01:00
Przemek Pawlas
ad6e720912 Add last changed column to variable tab 2024-03-10 13:48:57 +01:00
WarmUpTill
70dad8ebb4 Handle MIDI device disconnect and reconnect 2024-03-09 12:00:52 +01:00
WarmUpTill
497b3b3e04 Clean up macro import and add action queues 2024-03-09 12:00:52 +01:00
WarmUpTill
891811aa47 Convert audio volume thresholds to new format 2024-03-09 09:18:29 +01:00
WarmUpTill
be9ddaa4c9 Increase precision of percent based volume threshold input 2024-03-09 09:18:29 +01:00
WarmUpTill
03494c2915 Adapt to volume widget slider changes 2024-03-09 09:18:29 +01:00
WarmUpTill
bcf7c247bf Increase precision of volume widget slider 2024-03-09 09:18:29 +01:00
WarmUpTill
132d89b350 Fix virtual camera action selection causing a crash
The Create() and Copy() functions were not correctly implemented and
returned a nullptr
2024-03-06 12:53:43 +01:00
WarmUpTill
daf16357c9 Fix output volume check of audio condition not working
Only the percent based selection was not working properly since the
calculation was off by a factor of 100.
2024-03-03 20:54:15 +01:00
WarmUpTill
8080abc93c Fix crash when opening setting window 2024-03-03 20:54:15 +01:00
WarmUpTill
902715bd3e Save settings when switching to new macro
This should ensure that settings are saved more frequently and less data
is lost in case the plugin crashes with the settings dialog opened.
2024-03-03 20:54:15 +01:00
WarmUpTill
8271a6e8db CI: Don't attempt to rename files if not required 2024-03-02 16:38:24 +01:00
WarmUpTill
6c121a093b Add "Log" action
This action will allow you to write custom messages to the OBS log
2024-03-02 15:27:02 +01:00
WarmUpTill
ab0cce9eaa Add log level which prints performed actions 2024-03-02 15:27:02 +01:00
WarmUpTill
9acbead87b Update BUILDING.md 2024-03-02 15:27:02 +01:00
WarmUpTill
03e71e9183 Add support to resolve variables on action queue add 2024-03-02 15:27:02 +01:00
WarmUpTill
f8dadd38b4 Add ResolveVariables()
Settings will be set to fixed values based on the values of the
variables used.
2024-03-02 15:27:02 +01:00
WarmUpTill
2928775f5b Add option to resolve variables on queue add 2024-03-02 15:27:02 +01:00
WarmUpTill
673ac8078b Update lastVariableChange when using settings dialog to change value 2024-03-02 15:27:02 +01:00
WarmUpTill
234ae27205 Fix crash when running RunPostLoadSteps()
RunPostLoadSteps() could be called with "stale" post load steps as
RunPostLoadSteps() was never called when a copy of an action or
condition was created
2024-03-02 15:27:02 +01:00
WarmUpTill
a740a29798 Cleanup includes 2024-03-02 15:27:02 +01:00
WarmUpTill
341a58b8e4 Add window action
It allows to set the focus window and close windows.
Only supported on Windows for now.
2024-03-02 14:03:00 +01:00
Michael Kirsch
ba9a16e718 Force LF for formatter script for WSL 2024-02-29 20:31:50 +01:00
WarmUpTill
2b2bab8fbc Backup setting on exit to plugin config dir
Only one version of the settings file will be kept per scene collection
and plugin version combination
2024-02-28 12:53:02 +01:00
WarmUpTill
f50f31ec4c Allow stop of current macro when using run button 2024-02-26 20:56:26 +01:00
WarmUpTill
3a1c353ea3 Use git tag as version identifier in package scripts 2024-02-24 22:51:24 +01:00
WarmUpTill
8bf9b2d009 Disable notarization for release builds and switch to RelWithDebInfo 2024-02-24 20:38:17 +01:00
WarmUpTill
1e43ffef51 Update test test binary path 2024-02-24 20:38:17 +01:00
WarmUpTill
534c783bd8 Fix initial Twitch chat message not being sent 2024-02-24 16:48:52 +01:00
WarmUpTill
14a12432e9 Cleanup 2024-02-24 16:48:52 +01:00
WarmUpTill
1be72218a9 Clear message buffers when macro was paused 2024-02-24 16:48:52 +01:00
WarmUpTill
cf97c1f60b Add Clear() to MessageBuffer 2024-02-24 16:48:52 +01:00
WarmUpTill
782791b013 Switch to message buffer / dispatcher for Twitch chat messages 2024-02-24 16:48:52 +01:00
WarmUpTill
04631964d3 Switch to message buffer / dispatcher for MIDI messages 2024-02-24 16:48:52 +01:00
WarmUpTill
97983d5ac5 Adapt to new libremidi version 2024-02-24 16:48:52 +01:00
WarmUpTill
b1ae83e075 Update libremidi to v4.2.4 2024-02-24 16:48:52 +01:00
WarmUpTill
ecfd177d78 Run tests in CI 2024-02-24 16:47:50 +01:00
WarmUpTill
fb7bcd57cd Add more tests 2024-02-24 16:47:50 +01:00
Przemek Pawlas
01cf000cbe Refactor
* Minor style changes
* Move function definitions
* Split utility.hpp
* Enable include of export-symbol-helper.hpp in tests
2024-02-24 16:47:50 +01:00
Przemek Pawlas
dcba7c535d Check for lower/upper GetDouble/GetInt limits 2024-02-24 16:47:50 +01:00
Przemek Pawlas
b2fc560701 Store truncated representation of doubles when used as variables 2024-02-24 16:47:50 +01:00
WarmUpTill
c3f207f93c Add decibel selection to audio condition 2024-02-21 18:48:54 +01:00
WarmUpTill
583b559c78 Adjust minimum volume dB from -60 to -100 2024-02-21 18:48:54 +01:00
WarmUpTill
bb1f19c0cb Use correct capitalization for "dB" 2024-02-21 18:48:54 +01:00
WarmUpTill
a62883153c Switch to message buffer / dispatcher for Twitch event sub messages 2024-02-21 18:02:22 +01:00
WarmUpTill
41033f2230 Switch to message buffer / dispatcher for websocket messages 2024-02-21 18:02:22 +01:00
WarmUpTill
394e2500e8 Add simple message buffer and dispatcher 2024-02-21 18:02:22 +01:00
WarmUpTill
06fef08f56 Add variable tab
This should make it significantly easier to get an overview of the
variables, which currently exist, modify their settings, or potentially
remove multiple variables.
2024-02-21 10:10:03 +01:00
WarmUpTill
a7da22b7e9 Keep track of last use of variable 2024-02-21 10:10:03 +01:00
WarmUpTill
cb58eb9f04 Add return value to ReplaceAll()
Returns true of the string was modified and false otherwise
2024-02-21 10:10:03 +01:00
WarmUpTill
b803c0ad75 Update header info of action queue macro segments 2024-02-20 21:48:09 +01:00
WarmUpTill
b5426b398a Fill rename dialog with current name 2024-02-20 21:48:09 +01:00
WarmUpTill
c94863b0cb Fix item selection not updating correctly
* Remove could lead to the "add" dialog being opened
* Rename could result in some entries not being renamed (due to
  FilterComboBox using a QComboBox with setEditable() set to true)
2024-02-20 21:48:09 +01:00
WarmUpTill
e13b9b0aa7 Add helpers which also update the lineEdit text of FilterComboBox 2024-02-20 21:48:09 +01:00
WarmUpTill
aa1b10425f Fix temp var references not being resolved on macro copy and import 2024-02-17 13:54:00 +01:00
WarmUpTill
6cbfc48736 Rename function 2024-02-17 13:54:00 +01:00
WarmUpTill
87c18143a2 Fix crash when switching settings in the OBS stats condition 2024-02-17 13:49:02 +01:00
Przemek Pawlas
58144bf9a8 More efficient QComboBox items initialization 2024-02-17 13:49:02 +01:00
Przemek Pawlas
438d9bf220 Use RAII wrappers 2024-02-17 13:49:02 +01:00
WarmUpTill
d8d73f0cd4 Show refresh button if source / filter selection is a variable 2024-02-17 10:03:04 +01:00
WarmUpTill
dc91ee0cf1 Add workaround for MacOS build issue 2024-02-17 10:03:04 +01:00
WarmUpTill
84e01c0c9c Fix warnings 2024-02-17 10:03:04 +01:00
WarmUpTill
ce262f0dad Use OBS 29.1.2 for now 2024-02-17 10:03:04 +01:00
WarmUpTill
9e2a6a7760 Update BUILDING.md 2024-02-17 10:03:04 +01:00
WarmUpTill
a4e26a7a51 Update github actions
Based on obs-plugintemplate@68e9fcd
2024-02-17 10:03:04 +01:00
WarmUpTill
8e7955984e Update cmake
Based on obs-plugintemplate@68e9fcd
2024-02-17 10:03:04 +01:00
WarmUpTill
77eb5ed286 Add build-aux
Based on obs-plugintemplate@68e9fcd
2024-02-17 10:03:04 +01:00
WarmUpTill
7a668d661b Update buildspec.json
Based on obs-plugintemplate@68e9fcd
2024-02-17 10:03:04 +01:00
WarmUpTill
44733a4c91 Update clang format 2024-02-17 10:03:04 +01:00
WarmUpTill
9a0ffa9379 Update .gitignore 2024-02-17 10:03:04 +01:00
WarmUpTill
5cc5a3d412 Display warning if token expired or no token is selected 2024-02-15 21:14:35 +01:00
WarmUpTill
9c4fdc9803 Update hotkey name when description is changed
This makes it easier to identify the hotkey in external tools
2024-02-15 21:12:01 +01:00
WarmUpTill
71a887db03 Disable audio fade controls if fading is not checked 2024-02-15 21:12:01 +01:00
WarmUpTill
7f5d7325ba Use RAII wrappers 2024-02-15 21:12:01 +01:00
WarmUpTill
5aadca41d4 Fix crash on shutdown 2024-02-15 21:12:01 +01:00
WarmUpTill
f5d072414f Fix skip of first execution of macros on startup not working 2024-02-15 21:12:01 +01:00
WarmUpTill
768356e11e Rename variable 2024-02-15 21:12:01 +01:00
WarmUpTill
8ba246a349 Add regex support for "find and replace" variable action 2024-02-10 23:13:04 +01:00
WarmUpTill
668bba16ea Add temp variable support to streaming condition 2024-02-10 01:46:53 +01:00
Przemek Pawlas
96809f76b9 Fix token permissions warning when it's invalid 2024-02-08 21:30:50 +01:00
WarmUpTill
62743afaa7 Fix setting value selection not being visible for on change check 2024-01-31 19:58:58 +01:00
WarmUpTill
8ca5e76afb Move variable files to to variables folder 2024-01-31 16:11:31 +01:00
WarmUpTill
b22913a22c Warn if settings might contains sensitive data 2024-01-31 16:11:31 +01:00
WarmUpTill
74a3bf0b12 Rename websocket connections settings entry 2024-01-31 16:11:31 +01:00
WarmUpTill
88ad694d8c Switch to RAII wrappers 2024-01-31 16:11:31 +01:00
WarmUpTill
e36e4f61da Clean up variable signal handling 2024-01-31 16:11:31 +01:00
WarmUpTill
8f77b6cbd7 Set sensible tab order 2024-01-30 19:50:58 +01:00
WarmUpTill
184cbb6dd9 Add tooltips to macro tab 2024-01-30 19:50:58 +01:00
WarmUpTill
9eda8be954 Improve Display condition
* Add temp variable support
* Add options to check display width and height
* Add option to select comparision operator for display count check
2024-01-30 19:50:21 +01:00
WarmUpTill
19bc270d5c Fix manually started macros not being stopped when stopping the plugin 2024-01-27 14:10:34 +01:00
WarmUpTill
462c3445e3 Add StopAllMacros() helper 2024-01-27 14:10:34 +01:00
WarmUpTill
d237e3fe4e Add temp variable support to websocket condition 2024-01-27 14:10:34 +01:00
WarmUpTill
458a1ec4c1 Update README.md and BUILDING.md 2024-01-27 14:10:34 +01:00
WarmUpTill
88bc87b367 Fix typo 2024-01-27 14:10:34 +01:00
WarmUpTill
aeb0e7f8ad Fix hotkey condition evaluating to true if macro was paused
The condition check now also takes the time during which the macro was
paused into consideration
2024-01-27 14:10:34 +01:00
WarmUpTill
0c97b3be4a Add MacroWasPausedSince()
It will allow you to query if the macro was paused since a given time
point.
It checks this by comparing the time point against the time point at
which the macro was last paused.
2024-01-27 14:10:34 +01:00
WarmUpTill
9855f0c64a Rename function 2024-01-27 14:10:34 +01:00
WarmUpTill
6d1c0dda91 Fix input dialogs causing crash on shutdown 2024-01-27 14:10:34 +01:00
WarmUpTill
8701ec807e Add more tests 2024-01-27 14:10:34 +01:00
WarmUpTill
9b34af98fd Buffer websocket messages until they were processed 2024-01-27 14:10:34 +01:00
WarmUpTill
cf5f338902 Split utility headers 2024-01-27 14:10:34 +01:00
WarmUpTill
8b9f3064ba Fix else-actions being executed for paused macros 2024-01-27 14:10:34 +01:00
WarmUpTill
b199b8bcff Fix warning 2024-01-27 14:10:34 +01:00
WarmUpTill
77528520d9 Change settings defaults
* Start plugin by default
* Highlight condittions, actions, and recently executed macros by
  default
* Open Macro tab instead of General tab when opening settings window
* No longer start legacy websocket server and client
2024-01-27 14:10:34 +01:00
WarmUpTill
7d0332dd0e Restructure library and plugins
The "core" macro conditions and actions have been extracted out to the
"base" plugin.

The library now mostly contains functionality which is required across
all plugins and (e.g. definitions for macro segments).

The goal is to reduce the complexity and cross-dependencies and group
the source files in a better way.

This should relsove the "library limit of 65535 objects exceeded" build
issue occuring in some Windows build environments.
2024-01-27 14:10:34 +01:00
WarmUpTill
498bf31295 Remove layout spacer if text input is required 2024-01-21 18:09:23 +01:00
WarmUpTill
50c54a8341 Add option to get window class of window 2024-01-21 18:09:23 +01:00
WarmUpTill
cde4e24cc4 Add action queues
This is intended to be used to execute long running actions which shall
not be run in parallel to one another.

Multiple different action queues can be created.

The "Queue" action and condition can be used to modify and check the
status and size of action queues.
2024-01-17 11:43:59 +01:00
Przemek Pawlas
e37e35e318 Fix Twitch chat connection in action when token/channel change 2024-01-17 11:42:40 +01:00
WarmUpTill
d7dc9976c9 Update segment header when variable selection changes 2024-01-17 10:55:23 +01:00
WarmUpTill
7690ae8684 Add option to perform media actions on scene items 2024-01-16 19:26:08 +01:00
WarmUpTill
b0e6279f53 Fix show-/hide-transitions being corrupt
Setting scene item show-/hide-transitions requires each source to have
their own private transition source which cannot be shared across scene
items.
Otherwise strange graphical artifacts will be introduced when showing /
hiding the scene items.

Also switched to RAII wrappers for transition action.
2024-01-15 19:46:00 +01:00
WarmUpTill
b826f10372 Fix dialogs being opened at OBS instead of plugin window location 2024-01-13 09:36:30 +01:00
WarmUpTill
a40f175af5 Fix else action delete button only working with active selection 2024-01-13 09:36:30 +01:00
WarmUpTill
5e2bd84478 Add option to set sequence index 2024-01-12 22:15:33 +01:00
WarmUpTill
0317d45ea8 Reduce dependencies to macro internals 2024-01-12 22:15:33 +01:00
WarmUpTill
43a3ae9726 Fix flickering of macro list controls on widget creation 2024-01-12 22:15:33 +01:00
WarmUpTill
6a900623b0 Move files 2024-01-12 22:15:33 +01:00
WarmUpTill
35e243f0eb Cleanup audio action constness 2024-01-06 17:49:58 +01:00
WarmUpTill
38423341c2 Add option to use db value as input for audio action 2024-01-06 17:49:58 +01:00
WarmUpTill
2da8a25ffd Cleanup wait action
* Add HeaderInfoChanged()
* Move enum definition
2024-01-06 02:02:46 +01:00
WarmUpTill
17c4eb4c72 Fix warning 2024-01-06 02:02:46 +01:00
WarmUpTill
321ec48510 Adjust widget order for "source type" scene item selection 2024-01-05 23:32:56 +01:00
WarmUpTill
777d52a167 Fix scene item name conflict selection not being visible
For example, this could happen when the widget was initially created and
SetSceneItem() was called, since currentSelection was still not set
2024-01-05 23:32:56 +01:00
WarmUpTill
6398f4a698 Adjust RegexConfigChanged signal definition 2024-01-05 23:32:56 +01:00
WarmUpTill
101ab26069 Add option to check single settings value in Filter condition 2024-01-05 23:32:56 +01:00
WarmUpTill
481da80d4c Add option to check single settings values in Source condition 2024-01-05 23:32:56 +01:00
WarmUpTill
2cc8a15118 Add Matches() helper function 2024-01-05 23:32:56 +01:00
WarmUpTill
2defa06ba4 Fix media condition "any" / "all" selection ignoring some source types 2024-01-05 21:40:19 +01:00
WarmUpTill
a113327476 Use RAII wrappers 2024-01-05 21:40:19 +01:00
Michael Kirsch
c341d6ebd8 Fix pattern matching by excluding non-finite results 2024-01-04 01:12:13 +01:00
Michael Kirsch
4e84866f17 Fix pattern marking loops 2024-01-04 01:12:13 +01:00
Michael Kirsch
a58950924c Add Current Pattern Matching Value to UI 2024-01-04 01:12:13 +01:00
WarmUpTill
98f3f51ba9 Don't enable drag of macro segment when interacting with scrollbars 2023-12-31 10:13:48 +01:00
WarmUpTill
f0df9ead3c Fix macro segment widgets being squashed below a sensible minimum size
Now a horizontal scroll bar will be displayed in the corresponding
MacroSegmentList widget instead.
2023-12-29 19:31:45 +01:00
WarmUpTill
7b1a57070d Clean up locale 2023-12-29 19:31:45 +01:00
WarmUpTill
a412f2fd5e Fix ResizingPlainTextEdit hiding text in some circumstances
In some scenarios - the exact reason is not known - the widget would
scroll to the very last row, which is always empty, and result in the
text cursor and the already entered text being moved above the displayed
edit area.

It could be fixed by manually scrolling back up (e.g. by attempting to
highlight text with the mouse), but the problem would reappear as soon
as new existing text was modified.

To work around this issue text wrapping was disabled and additional
height will be added for the horizontal scroll bar, if they are visible.

There are still some issues of the height randomly flickering in the
scenarios, which would previously result in the text no longer being
visible.
2023-12-29 19:31:45 +01:00
WarmUpTill
4f0c8c4ab5 Move audio fade helpers to audio action 2023-12-29 19:31:45 +01:00
WarmUpTill
946c90a749 Move tracking of cursor position changes to cursor condition 2023-12-29 19:31:45 +01:00
WarmUpTill
7ba4eaab9c Fix replay buffer save event only triggering in a single condition 2023-12-29 19:31:45 +01:00
WarmUpTill
74553a82fc Remove deprecated "on change" toggle of media condition 2023-12-29 19:31:45 +01:00
WarmUpTill
39fcb2d743 Fix typos 2023-12-29 19:31:45 +01:00
WarmUpTill
7041feaea3 Move handling of stream start / stop time to stream condition 2023-12-29 19:31:45 +01:00
WarmUpTill
9b1ffaeded Remove switcher-data dependency from transition-selection 2023-12-29 19:31:45 +01:00
WarmUpTill
07d397bdac Remove switcher-data dependency from scene-selection 2023-12-29 19:31:45 +01:00
WarmUpTill
a86ff4f1f0 Remove switcher-data dependency from status-control 2023-12-29 19:31:45 +01:00
WarmUpTill
953eca2732 Remove switcher-data dependency from variables 2023-12-29 19:31:45 +01:00
WarmUpTill
d6c5fb149a Fix warning 2023-12-29 19:31:45 +01:00
WarmUpTill
12982708cf Remove curl-helper dependency from switcher-data 2023-12-29 19:31:45 +01:00
WarmUpTill
0cf9e1dd81 Reduce dependencies of macros to switcher data 2023-12-29 19:31:45 +01:00
WarmUpTill
71e20c4983 Move loading / saving of global macro properties 2023-12-29 19:31:45 +01:00
WarmUpTill
2147f6d3bf Rename files 2023-12-29 19:31:45 +01:00
WarmUpTill
23df42d2d3 Add more plugin state helpers 2023-12-29 19:31:45 +01:00
WarmUpTill
bcf0a0b7fd Move functionality to scene-switch-helpers 2023-12-29 19:31:45 +01:00
WarmUpTill
dd78b03a28 Add additional sync-helpers to reduce dependencies to switcher-data 2023-12-29 19:31:45 +01:00
WarmUpTill
84dd5e6930 Add macro-helpers
Added to reduce dependencies to switcher-data
2023-12-29 19:31:45 +01:00
WarmUpTill
dcee98fea7 Move macro segment factory functinos to seperate files 2023-12-29 19:31:45 +01:00
WarmUpTill
9ffb982ae5 Reset date condition type only if necessary 2023-12-29 19:31:45 +01:00
WarmUpTill
428850306f Add option to wait for spawned process to exit 2023-12-25 21:24:48 +01:00
WarmUpTill
abfd6798e3 Adapt to new process start helpers 2023-12-25 21:24:48 +01:00
WarmUpTill
fffadd94de Add helpers to launch process with given config 2023-12-25 21:24:48 +01:00
WarmUpTill
d0919776f3 Add option to set variable to scene item name at given index 2023-12-19 22:59:32 +01:00
WarmUpTill
267855fded Cleanup
* Use OBSSourceAutoRelease
* Do not return true if source selection is invalid
2023-12-17 10:40:29 +01:00
WarmUpTill
4bdebb7feb Fix crash when asking for settings backup
This dialog cannot be modal since other plugins might attempt to display
content which might result in a deadlock.
2023-12-16 19:02:38 +01:00
Michael Kirsch
ab5f69d2ef Decrease the minimal interval time to 10ms 2023-12-13 19:29:14 +01:00
Michael Kirsch
63ee36ddfe Enable Area Selection in ScreenshotHelper class 2023-12-13 14:19:17 +01:00
WarmUpTill
43967f5ded Add temp variable support for video condition 2023-12-10 14:26:30 +01:00
WarmUpTill
c043053b2b Remove unused variable 2023-12-10 14:26:30 +01:00
WarmUpTill
220f27bd0a Move plugin dependencies to Aptfile 2023-12-10 13:42:39 +01:00
WarmUpTill
83914d5378 Linux: resolve procps symbols at runtime
This is done to be able to support both libprocps and libproc2.
Either of them or neither might be available on all platforms and this
should not prevent the plugin from being used at all.
2023-12-10 13:42:39 +01:00
WarmUpTill
57e4b1a3f1 Fix warning 2023-12-10 13:42:39 +01:00
WarmUpTill
c85e556924 Add support for "random()" expression
Generates a random number between [0,1)
2023-12-10 13:33:18 +01:00
WarmUpTill
8c0be8011d Enable use of obs-module-helper.hpp in tests 2023-12-10 13:33:18 +01:00
WarmUpTill
7914f75876 Fix macro references not being resolved when importing macros 2023-12-09 09:52:12 +01:00
WarmUpTill
7d1253e14e Use RAII wrappers for OBS data 2023-12-09 09:52:12 +01:00
WarmUpTill
d7c58b3eb3 Remove websocket dependency to switcher-data internals 2023-12-09 09:52:12 +01:00
WarmUpTill
fb664b6f08 Reduce dependencies to switcher-data.hpp implementation details
This is necessary for the switch to libremidi version 4 due to
incompatabilities  with websocketpp, but also might save some headaches
later on.
2023-12-09 09:52:12 +01:00
WarmUpTill
258a6d076e Fix "or not" logic type check being ignored 2023-12-09 09:52:12 +01:00
WarmUpTill
32ab060153 Ease configuration of token grabber port 2023-12-09 09:52:12 +01:00
WarmUpTill
91d3784f9b Don't wait for transition to complete if already on target scene 2023-12-09 09:52:12 +01:00
WarmUpTill
8a5aac3d31 Add option to check the recording duration 2023-12-09 09:52:12 +01:00
WarmUpTill
06c6effb7d Fix duration value not being updated correctly when changing units 2023-12-09 09:52:12 +01:00
WarmUpTill
f3789c05bd Move Duration and DurationSelection into separate files 2023-12-09 09:52:12 +01:00
WarmUpTill
c64e1f5e51 Rework Process condition
* Add option to en-/disable regex matching
* Add tempvar support for process name
2023-12-09 09:52:12 +01:00
WarmUpTill
5d8e24c19a Add temp variable support to Macro condition 2023-12-09 09:52:12 +01:00
WarmUpTill
f756de05c3 Add option to check if macro is paused 2023-12-09 09:52:12 +01:00
WarmUpTill
574fdb496f Add error logs for token grabber server 2023-12-09 09:52:12 +01:00
WarmUpTill
5580da69eb Fix window condition not clearing tempvars of previous condition type 2023-12-09 09:52:12 +01:00
WarmUpTill
35274863c9 Use available layout stretch space for settings input field 2023-12-09 09:52:12 +01:00
Przemek Pawlas
1f31b81f0d Add else actions toggle button 2023-12-09 09:42:10 +01:00
WarmUpTill
cde111ddeb Ignore settings which don't have a description or name
This fixes a crash when attempting to populate the setttings selection
of a Window Capture or Game Capture source
2023-12-07 07:04:50 +01:00
Przemek Pawlas
845c12c01c
Add tooltip for run button explaining else (#931)
* Add tooltip for run button explaining else
* Switch run button modifier to Shift
* Toggle button label only when hovering over it
2023-12-06 10:40:14 +01:00
Przemek Pawlas
99a0118d31 Add clipboard text/image copy actions 2023-11-27 21:07:38 +01:00
Przemek Pawlas
bb7ee17362 Prepare Twitch action for introduction of new action types 2023-11-26 17:48:45 +01:00
Przemek Pawlas
70854ef012 Reorder Twitch condition enum value definitions 2023-11-26 17:48:45 +01:00
Przemek Pawlas
053c14056d Add more token options and reorder existing ones 2023-11-26 17:48:45 +01:00
Przemek Pawlas
9397d50764 Refactor twitch-helpers
Added more http helpers, reordered parameters, and reduced code
duplication
2023-11-26 17:48:45 +01:00
Przemek Pawlas
473e24cc42 Use consistent function naming for setting widget visibility 2023-11-26 17:48:45 +01:00
WarmUpTill
d9394605f4 Set tempvar values for raid events 2023-11-26 15:29:54 +01:00
WarmUpTill
d2b9074852 Fix build for Twitch mock 2023-11-26 15:29:54 +01:00
WarmUpTill
b525eb7a0e Add temp variable support to MIDI condition 2023-11-26 13:05:44 +01:00
WarmUpTill
3805aaeeec Add Twitch chat support
* Enable sending chat messages via the Twitch action
* Enable checking for chat messages using the Twitch condition
2023-11-26 00:17:38 +01:00
WarmUpTill
50dc404689 Add temp variable support to date condition 2023-11-20 20:08:09 +01:00
WarmUpTill
975eacbc7e Add temp variable support to timer condition 2023-11-20 20:08:09 +01:00
WarmUpTill
7e56dc35b8 Enable use of variables in find and replace options of variable action 2023-11-20 20:08:09 +01:00
WarmUpTill
b3566d98bf Add condition to check temporary variable values / macro properties 2023-11-20 20:08:09 +01:00
WarmUpTill
15379a8e20 Clean up locale and variable condition 2023-11-20 20:08:09 +01:00
WarmUpTill
1e178f4223 Add temp variable support to scene condition 2023-11-20 20:08:09 +01:00
WarmUpTill
c16a7b93ea Add temp variable support to window condition 2023-11-20 20:08:09 +01:00
WarmUpTill
f89bb1a750 Add temp variable support for audio condition 2023-11-20 20:08:09 +01:00
WarmUpTill
79961aabe4 Use SourceSetting helpers to enable modification of single setting 2023-11-20 20:08:09 +01:00
WarmUpTill
4686fc2b01 Add SourceSetting helpers
They enable easy modification of single setting value of sources
compared to working with the raw json string
2023-11-20 20:08:09 +01:00
WarmUpTill
569b915c07 Set temporary variables in Twitch condition 2023-11-20 20:08:09 +01:00
WarmUpTill
324d3fe7a5 Fix content content_classification_labels not being set 2023-11-20 20:08:09 +01:00
WarmUpTill
ae8d0bf5cb Add support for setting variable to value of temporary variable 2023-11-20 20:08:09 +01:00
WarmUpTill
17efa82057 Add temporary variables
Enables easier use of values returned by macro segments.
For example, this enables the user to extract the user name of a new
Twitch follower and change a text sources settings accordingly
2023-11-20 20:08:09 +01:00
WarmUpTill
c17523a476 Enable extraction of array values from channel info 2023-11-20 20:08:09 +01:00
WarmUpTill
33635d6991 Add action to enable extraction of values from json string 2023-11-20 20:08:09 +01:00
WarmUpTill
d290dbe86b Add nlohmann json dependency 2023-11-20 20:08:09 +01:00
WarmUpTill
c1f5c49eda Run PostLoad() for "else actions" as well 2023-11-20 20:08:09 +01:00
WarmUpTill
c3f4caa6f3 Add AddPostLoadStep()
Enables registering additional functions, which are to be executed after
the loading steps are complete
2023-11-20 20:08:09 +01:00
WarmUpTill
d4c7b0e455 Fix crash while running macro actions
Users could invalidate the actions vector while the actions were
executed resulting in a crash.
2023-11-20 20:08:09 +01:00
WarmUpTill
b0cb52fe90 Fix warning 2023-11-20 20:08:09 +01:00
WarmUpTill
386f831cd4 Fix typos 2023-11-20 20:08:09 +01:00
Przemek Pawlas
449daa80cc Add media seek to percentage action + cleanup 2023-11-17 20:11:00 +01:00
Przemek Pawlas
3003547b83 Rework Twitch condition
* Fix channel changes in condition not resetting subscription ID
* Simplified Twitch condition logic to match the subscription ID rather
  than broadcaster ID and some other data - worked well for me, as I
  mentioned not sure why it wasn't done this way in the 1st place (but
  if there's a reason let me know)
* Further made ordering more consistent so that Twitch macros/conditions
  are easier to read (more or less samethematical order in hpp and cpp)
* Removed some unused code
* Added some param names to some header files to functions
2023-11-08 19:59:59 +01:00
Przemek Pawlas
1664eb672f Verify if channel given channel name is valid 2023-11-08 19:59:59 +01:00
Przemek Pawlas
0939dcacb6 Cleanup 2023-11-08 19:59:59 +01:00
Przemek Pawlas
54b81d1a42 Add AnyOptionIsEnabled() 2023-11-08 19:59:59 +01:00
Przemek Pawlas
626606100f Add helper classes to handle Twitch channel point rewards 2023-11-08 19:59:59 +01:00
Przemek Pawlas
53a0b76e8c Add empty() 2023-11-08 19:59:59 +01:00
WarmUpTill
e16ac9400a Add option to set variable value to length of string
* Also use SringVariable for _strValue input field to enable getting the
  length of variable values
2023-10-25 15:06:11 +02:00
WarmUpTill
94060c236b Add option to set ResizingPlainTextEdit parameters 2023-10-25 15:06:11 +02:00
Przemek Pawlas
890792c270 Add more Twitch condition types
Also simplifies some code and make it more consistent
2023-10-25 14:47:34 +02:00
WarmUpTill
7bc1fc3d0d Fix crash if previous condition / action was invalid 2023-10-25 14:47:34 +02:00
WarmUpTill
9ea90ed61b Add Twitch condition
It supports:
* Checking if a channel is live (polling)
* Checking if a channel went live and it's stream type (event)
* Checking if a channel weng offline (event)
* Checking the stream title of a channel (polling)
* Checking the stream category of a channel (polling)
* Checking if the channel information was changed (event)
* Checking for new followers (event)
* Checking for subsciptions (new / end / gift / resub message) (event)
* Checking for cheers (event)
2023-10-14 21:22:53 +02:00
WarmUpTill
ce40b80d90 Clean up token selection
* Adjust locale
* Hide token and name fields if no account is connected
* Enable all token options by default
* Validate token every hour as required by Twitch
* Retrigger event subscriptions on token change

token
2023-10-14 21:22:53 +02:00
WarmUpTill
53fcd94c5a Add Twitch EventSub helpers
EventSub subscriptions let your application listen for events that
happen on Twitch.
2023-10-14 21:22:53 +02:00
WarmUpTill
ecb6247959 Combine manual category search button and combobox into a single widget
To avoid code duplication for Twitch condition and action
2023-10-14 21:22:53 +02:00
WarmUpTill
3b4cb6934d Prevent crashes when downgrading to older version of Twitch action 2023-10-14 21:22:53 +02:00
WarmUpTill
babe93a6ce Clean up Twitch action
* Allow filtering in action selection by typing
* Add spacing between action type definitions to allow reordering in
  future
2023-10-14 21:22:53 +02:00
WarmUpTill
1e9173699c Add option to start a channel raid 2023-10-14 21:22:53 +02:00
WarmUpTill
37ba7aa2ca Only change text of segment value preview if value changed
This is done to prevent the selection being lost whenever the text filed
was updated.
2023-10-14 21:22:53 +02:00
WarmUpTill
a83d2d9910 Add channel selection 2023-10-14 21:22:53 +02:00
WarmUpTill
0449064f5d Enable empty name warning to be hidden
Used for the twitch token selection for which the whole name selection
will be hidden if no token is connected.
2023-10-14 21:22:53 +02:00
WarmUpTill
6cf1073a3c Add option to use cached results
The cache will remain valid for 10s before it is refreshed with a "real"
Get / Post / Patch call.
2023-10-14 21:22:53 +02:00
WarmUpTill
9ac9171206 Fix windows being created when constructing ProgressDialog 2023-10-14 21:22:53 +02:00
WarmUpTill
25ce8cd2e4 Also ex-/import variables when ex-/importing macros
Manually creating necessary variables and reconfiguring the macros to
use them can be unintuitive so instead just create the missing variables
included in the export.
2023-10-11 21:42:05 +02:00
WarmUpTill
e50522ab89 Compress export / import macro text 2023-10-11 21:42:05 +02:00
WarmUpTill
4801502f32 Add option to open properties and filter windows of sources 2023-10-05 18:54:22 +02:00
Przemek Pawlas
e13e4b5ddd Add max length validation support for TextEdit 2023-10-05 18:53:46 +02:00
Michael Kirsch
de8da553f1
Implement source item transform changed condition (#885) 2023-10-03 19:55:45 +02:00
Przemek Pawlas
6558792e73
Add Twitch send chat announcement and emote-only mode actions (#890) 2023-10-03 14:09:29 +02:00
WarmUpTill
ea5e92017e Add "all" option in filter selection 2023-10-03 12:34:11 +02:00
Przemek Pawlas
46199efb58
Add tooltips for variable text inputs (#888) 2023-10-03 11:42:41 +02:00
WarmUpTill
8a6eae6c97 CI: Fix Windows build script appending new lines to CMakeLists.txt 2023-10-03 00:09:29 +02:00
WarmUpTill
67eef8a004 CI: Fix MacOS builds
This is just a temporary fix.
The real solution would be to switch to the new OBS plugin template
version and no longer rely on the packages app
2023-10-03 00:09:29 +02:00
WarmUpTill
b5341e5cde Hide option to set master volume (deprecated) 2023-09-21 23:52:14 +02:00
WarmUpTill
ac6140b17a Fix warnings 2023-09-21 23:52:14 +02:00
WarmUpTill
b1489d98f0 Update websocketpp to 0.8.2 2023-09-17 19:59:30 +02:00
WarmUpTill
3b7119ec58 Update Asio to 1.28.0 2023-09-17 19:59:30 +02:00
WarmUpTill
efa34d080e CI: Use dependency build cache 2023-09-17 17:50:25 +02:00
WarmUpTill
19a6277841 Enable use of throttling for "has changed" checks. 2023-09-17 17:08:15 +02:00
Przemek Pawlas
107e1413ed Add Twitch clip and marker actions
* Refactor stream title variable name
* Limit commerical duration to 180s
* Set maximum stream title size to 140 chars
2023-09-16 22:23:34 +02:00
Przemek Pawlas
94416dd881 Add .vscode to .gitignore 2023-09-16 22:23:34 +02:00
WarmUpTill
8efc39958f Add action to assign scene item count to variable
To be able to iterate through the scene items of a scene
2023-09-16 19:49:54 +02:00
WarmUpTill
569f794e33 Move GetSceneItemCount() to utility 2023-09-16 19:49:54 +02:00
WarmUpTill
fc1460e592 Fix crash on shutdown related to macro docks
It could happen that the macro was already deleted while the macro dock
was still attempting to update its displayed information.
2023-09-13 19:49:55 +02:00
WarmUpTill
d6e4ee0203 Add option to run "else" actions using the "Run macros" button
If there are else actions to run holding control and clicking the "Run
macros" button will allow you to test them.
2023-09-13 19:49:55 +02:00
WarmUpTill
0c8135078d Rework PerformActions() to enable choosing which action type to run 2023-09-13 19:49:55 +02:00
WarmUpTill
24f4b864c4 Fix macro splitter position not saving when switching to empty selection 2023-09-13 19:49:55 +02:00
WarmUpTill
41e47f32b6 Display warning if selected token does not support selected action 2023-09-11 18:27:47 +02:00
WarmUpTill
a73ccb15a1 Enable MacOS support for Twitch action 2023-09-11 18:27:47 +02:00
WarmUpTill
36a78f49a5 Add openssl to MacOS build scripts to enable Twitch support 2023-09-11 18:27:47 +02:00
WarmUpTill
cbd459b0a5 Improve error logging 2023-09-11 18:27:47 +02:00
WarmUpTill
03bb1fd089 Stop token server if token was received / timeout was reached 2023-09-11 18:27:47 +02:00
WarmUpTill
4e2c254717 Set commercial duration suffix to "s" to inidicate unit is in seconds 2023-09-11 18:27:47 +02:00
WarmUpTill
fffb6c5f29 Adaptions for "else" support
* Fix "on change" option always being highlighted
* Fix "run macro" button performing actions based on condition state
* Fix "run" option of macro action performing action based on condition
  stated of selected macro
2023-09-11 18:25:46 +02:00
WarmUpTill
81f669e226 CI: Separate dependency build from plugin build
* Goal is to enable caching of dependency builds to speed up CI build
  times significantly
* Should ease transition to new plugin build template version
2023-09-10 12:26:41 +02:00
Denis KARUPOVIC
6484ae54c0
Create fr-FR.ini (#863)
* Create fr-FR.ini

add french language

* Update fr-FR.ini (fix white spaces)

* Update fr-FR.ini (remove some useless trads + fix others)

* Update fr-FR.ini (correct some trads)

* Update fr-FR.ini (fix some trads)

* Update fr-FR.ini (fix some trads)

* Update fr-FR.ini (fix errors)

---------

Co-authored-by: WarmUpTill <WarmUpTill@web.de>
2023-09-10 01:41:01 +02:00
WarmUpTill
1c52caf5e9 Move legacy tab entries to end of file 2023-09-09 11:17:29 +02:00
WarmUpTill
ce1d4cce57 Add support for "else" action block
* Changed the "on change" match behaviour
  Previously macros with true conditions but "on change" enabled would
  be considered to be evaluating to false.
  Now they are considered to be evaluating to true and the "on change"
  option only has an effect on if the actions are performed or not.

  This could have effects on user which use the "Macro" condition type
  to check what other macros' conditions evaluate to.

* The splitter position separating the conditions, actions, and
  else-actions are not saved and restored based on which macro is being
  selected.
2023-09-09 11:16:50 +02:00
WarmUpTill
8246197ae6 Add "else" action block 2023-09-09 11:16:50 +02:00
WarmUpTill
8f90bf8846 Move splitter save/load helpers to utility 2023-09-09 11:16:50 +02:00
WarmUpTill
b955e8a0ea Move action and condition macro segement list to Ui_AdvSceneSwitcher 2023-09-09 11:16:50 +02:00
WarmUpTill
81da32f7a2 Only show slide show condition type if OBS supports necessary features 2023-09-09 09:56:29 +02:00
WarmUpTill
5324fa9350 Reset monitor selection in projector action when monitor setup changed 2023-09-06 21:30:55 +02:00
WarmUpTill
c375daa258 Add option to start commercial 2023-09-03 14:29:14 +02:00
WarmUpTill
4f3bd699c8 Fix tooltip not being translated 2023-09-03 14:29:14 +02:00
WarmUpTill
f5024621c0 Add option to assign environment variable value to variable 2023-09-01 20:37:02 +02:00
WarmUpTill
8308506d71 Rely on Qt when using GetCurrentWindowTitle() and OBS is in focus 2023-09-01 19:22:02 +02:00
WarmUpTill
6605c19202 Add OBS windows to GetWindowList() 2023-09-01 19:22:02 +02:00
WarmUpTill
fdf1a94f97 Add option to set placeholder text when asking for input 2023-08-29 20:46:33 +02:00
WarmUpTill
6b6e37da92 Hide preview scene options from studio mode action and condition
The options will only be hidden if the it is not being used.
Thus the functionality of existing macros will not be affected.
2023-08-28 21:19:38 +02:00
WarmUpTill
0f0fc8ae4e Add option to switch preview scene to scene switch action
Same functionality of the "Studio mode" action will be hidden and
eventually be removed.
2023-08-28 21:19:38 +02:00
WarmUpTill
4d7e2992e5 Add preview scene support to scene condition
Existing functionality of the "Studio mode" condition will be hidden and
eventually be removed.
2023-08-28 21:19:38 +02:00
WarmUpTill
a5050d4810 Add Twitch action
Allows you to set the stream title and stream category
2023-08-26 17:32:36 +02:00
WarmUpTill
9df6963f08 Add cpp-httplib 2023-08-26 17:32:36 +02:00
WarmUpTill
b833dd4576 Export FilterComboBox widget symbols
To be used for Twitch action
2023-08-26 17:32:36 +02:00
WarmUpTill
39378ae20f Enusre that placeholder text is visible for FilterComboBox 2023-08-26 17:32:36 +02:00
WarmUpTill
5a2cb943f7 Add option to open interaction dialog of source 2023-08-25 18:19:23 +02:00
WarmUpTill
b88209f63d Add option to check for settings change to source and filter condition 2023-08-19 19:21:19 +02:00
WarmUpTill
9c848938f8 Add support for registering additional save and load steps
Also renamed the reset steps to make it more clear what their use is.
2023-08-15 18:24:03 +02:00
WarmUpTill
07b86dda41 Cleanup ItemSettingsDialog and ItemSelection
* Added option to configure name conflict locale
 * Fixed some locale options not being displayed properly due to missing
   obs_module_text() calls and name conflicts not being handled
   properly.
 * No longer force a fixed width
 * Added option to hide the rename context menu entry
 * Use locale for invalid connection and variable selection string
2023-08-15 18:24:03 +02:00
WarmUpTill
49e8bf7639 Export ItemSelection and ItemSettingsDialog widget symbols
This is done to be able to support use of these widgets in plugins.
2023-08-15 18:24:03 +02:00
WarmUpTill
a2d0a7f544 Fix OCR value not being assigned to variables with enabled regex 2023-08-15 18:24:03 +02:00
WarmUpTill
1a8c894ddf Cleanup
* Fix warnings
 * Remove unused includes
 * Fix build issue if libremidi CMakeLists.txt does not exist
2023-08-15 18:24:03 +02:00
WarmUpTill
3f51f63298 Cleanup locale
* Remove unnecessary widget spacing
* Remove unused values
2023-08-15 18:24:03 +02:00
WarmUpTill
a0b4df574b Add option to disable filtering by typing in FilterComboBox 2023-08-14 15:47:38 +02:00
WarmUpTill
68c6492c3f Revert "Add OCL support to improve performance"
This reverts commit 284c8020b2.
2023-08-09 17:04:00 +02:00
WarmUpTill
0ba7ba77d8 Fix potential crash related to OCR 2023-08-09 17:04:00 +02:00
WarmUpTill
04b2b3474d Fix crash in output change check with pattern matching enabled 2023-08-09 17:04:00 +02:00
WarmUpTill
ecbb5ebbd7 Update issue template 2023-08-09 17:04:00 +02:00
WarmUpTill
b62757b65d Rely on output flag to identify media sources
Using OBS_SOURCE_CONTROLLABLE_MEDIA instead of a hardcoded list of
source names is much more reliable and has the upside of also supporting
plugin sources
2023-08-09 14:01:19 +02:00
WarmUpTill
b1a3ab5493 Fix window condition ignoring title matching if regex is disabled
If the only enabled option was window title matching and regular
expressions were not used any window title would match regardless if it
existed or not
2023-08-09 13:50:32 +02:00
WarmUpTill
abc3357180 Make macro properties dialog resizable 2023-08-07 19:17:41 +02:00
WarmUpTill
29f9cba236 Add option to skip execution of given macro on OBS startup 2023-08-07 19:17:41 +02:00
WarmUpTill
9a62522140 Fix DisplayMessage() not being visible when OBS is always on top
The previous behaviour would cause the impression of OSB being frozen
due to dialogs windows being opened behind OBS while they take over the
input focus.
2023-08-07 18:03:12 +02:00
WarmUpTill
666c52556e Fix plugin state condition not functioning on OBS shutdown
Also added note indicating the limitations of running macros on OBS
shutdown
2023-08-05 15:43:44 +02:00
WarmUpTill
1c0734d1cb Add media_playlist_source_codeyan to supported media source types
Source at: https://github.com/CodeYan01/media-playlist-source/
2023-08-05 13:35:19 +02:00
WarmUpTill
1304ac7336 Add tooltip to regex configure widget 2023-08-03 21:44:17 +02:00
WarmUpTill
884fb1b637 Adjust to SceneItemSelection rework
And do minor cleanup
2023-08-03 21:44:17 +02:00
WarmUpTill
a82bce947f Rework scene item selection
Added support for:
* Index based scelection
* Type based selection
* Name pattern based selection
2023-08-03 21:44:17 +02:00
WarmUpTill
d5241f0700 Add tooltip for variable and connection selection 2023-08-03 21:44:17 +02:00
WarmUpTill
f24f258c9c Add option to hide enable button and set default enable value 2023-08-03 21:44:17 +02:00
WarmUpTill
eddd9fa8ab Add helper to check if value is a valid number 2023-08-03 21:44:17 +02:00
WarmUpTill
6cc224aeec Add helper to get int from variable 2023-08-03 21:44:17 +02:00
WarmUpTill
4b0a631987 Add export / import functionality to macro tab
This enables the easy sharing of single / multiple macros across scene
collections.
Previously either all settings had to be copied via the export / import
functionality of the General tab or none at all.
2023-08-02 20:55:59 +02:00
WarmUpTill
dcae0e8e8b Reset scene switcher state when new scene collection is created
This avoids copying all macros of the previous scene collection to the
newly created one.
2023-08-02 20:55:59 +02:00
WarmUpTill
29f810a2a0 Add buttons to move macro segments to top / bottom of segment list 2023-08-02 17:00:34 +02:00
WarmUpTill
719dfa7b72 Fix segment selection being lost when using up / down button 2023-08-02 17:00:34 +02:00
WarmUpTill
259aac8fcd Perform actions only on condition change by default 2023-08-02 17:00:34 +02:00
WarmUpTill
5be2cd278f Allow empty string as argument and increase max length of argument 2023-08-02 17:00:34 +02:00
WarmUpTill
211eac5313 Add slide show condition
It allows you to check ...
* if the slide changed
* the current slide index
* the current slide path

Important limitation:
Its internal state is only updated whenever the "slide_changed" signal
is sent by the particular source.
2023-08-01 23:52:44 +02:00
WarmUpTill
f92ed3139d Add more transform actions
* Reset
* Rotation
* Flip (horizontal / vertical)
* Fit to screen
* Stretch to screen
* Center (horizontal / vertical / to screen)
2023-07-28 18:51:30 +02:00
WarmUpTill
bdff84c605 Use MacroSegmentSelection for index selection in "Variable" action 2023-07-27 21:06:54 +02:00
WarmUpTill
08e430396a Add option to check action enable state to "Macro" condition 2023-07-27 21:06:54 +02:00
WarmUpTill
df7fc7ec01 Add option to enable / disable actions of macros via "Macro" action 2023-07-27 21:06:54 +02:00
WarmUpTill
9eef581161 Add MacroSegmentSelection
Utility class to enable selection of index of a macro segments.
Add description of selected segment.
Highlights segment if selected macro is current macro.
2023-07-27 21:06:54 +02:00
WarmUpTill
52811e44f4 Add option to disable variable selection 2023-07-27 21:06:54 +02:00
WarmUpTill
7b1c56877e Add GetMacroSegmentDescription() and IsValidMacroSegmentIndex() 2023-07-27 21:06:54 +02:00
WarmUpTill
78d73af589 Adjust to FilterComboBox 2023-07-27 21:06:54 +02:00
WarmUpTill
d9c1ef4c22 Only emit signals if valid entry was found 2023-07-27 21:06:54 +02:00
WarmUpTill
93f96ee660 Add support for custom URIs 2023-07-27 19:53:25 +02:00
WarmUpTill
d25a8d4efb Remove unnecessary include 2023-07-27 19:53:25 +02:00
WarmUpTill
1f22278496 Move SetGridLayoutRowVisible() to utility 2023-07-27 19:53:25 +02:00
WarmUpTill
70b705e0fd Add variable support to timer condition 2023-07-26 13:34:47 +02:00
WarmUpTill
9e1dfdc3f0 Enable use of duration modifiers for hotkey condition 2023-07-26 08:00:16 +02:00
WarmUpTill
47d6d4ac06 Handle potential horizontal scrollbar when resizing StringListEdit 2023-07-23 00:29:14 +02:00
WarmUpTill
fe3586b6f4 Set maximum header size to 4096 2023-07-23 00:29:14 +02:00
WarmUpTill
650881204f Adjust capitalization of HTTP action 2023-07-23 00:29:14 +02:00
WarmUpTill
8c0ba112e2 Add SetMaxStringSize()
A fixed size of 170 chars caused issues with the http action
2023-07-23 00:29:14 +02:00
WarmUpTill
a17d8f7e09 Add support for sending generic OBS websocket messages
This should allow to send OBS websocket vendor requests to other plugins
which offer an API via this method (e.g. vertical OBS)
2023-07-15 14:48:45 +02:00
WarmUpTill
371b4ae05d Add option to disable individual actions of macros 2023-07-15 11:05:19 +02:00
WarmUpTill
1d7ce510f7 Add SwitchButton
Simple switch toogle button widget based on
https://github.com/KDAB/kdabtv/blob/master/Styling-Qt-Widgets/toggleswitch.h
2023-07-15 11:05:19 +02:00
WarmUpTill
d759ded64d Use FilterComboBox instead of regular QComboBox
This required the following adjustments:

Instead of having a dedicated entry indicating the empty selection the
setPlaceholderText() mechanism is used.
Thus the locations where the 1st entry was assumed to be the empty
selection would have to be adjusted.

Additional checks for the empty string / index -1 have been added.

FindIdxInRagne() was adjusted to return -1 instead of 0 in case the
given string was not found.

Switched to index based singal instead of text based signal to be
notified about selection changes.
2023-07-15 11:05:19 +02:00
WarmUpTill
0b2e1b88cc Add FilterComboBox
This helper class is based on QComboBox, which has filtering of items
enabled by default.
It is intended to be used in places where QComboBoxes have a lot of
entries.
For example, the condition, action, or macro selection widgets.
2023-07-15 11:05:19 +02:00
WarmUpTill
72a11eedfc Make selection entry optional for transition list
Needed for FilterComboBox
2023-07-15 11:05:19 +02:00
WarmUpTill
1f02226620 Add option to set flags in FindIdxInRagne() 2023-07-15 11:05:19 +02:00
WarmUpTill
ad8c29997c Fix group creation starting at incorrect index 2023-07-15 04:22:08 +02:00
WarmUpTill
2c7c40c3f0 Fix reordering issues in macro tree 2023-07-15 04:22:08 +02:00
WarmUpTill
c9c0e4db2e Improve OCR option of video condition
* Improve preprocessing of image by separating text color from the rest
  of the image properly
* Add option to choose how similar the matched color can be to other
  colors for it to still be counted as a match
* Show the prepreprocessed image in the "show match" preview dialog
2023-07-09 17:58:38 +02:00
WarmUpTill
dd880b13c0 Cleanup invertPatternMatchResult() 2023-07-09 17:58:38 +02:00
WarmUpTill
76c759c8f4 Display different message if whole image matches pattern
The "pattern is highlighted in red" message does not make sense in this
case as there is no room to display the red border around the match.
2023-07-09 17:58:38 +02:00
WarmUpTill
284c8020b2 Add OCL support to improve performance 2023-07-09 17:58:38 +02:00
WarmUpTill
f506600b8c Enable use of other OCR language models 2023-07-09 17:58:38 +02:00
WarmUpTill
339418b5f3 Add color matching 2023-07-09 17:58:38 +02:00
WarmUpTill
2eca2cc2e9 Cleanup video condition
* Style changes
* Separate functionality into different widgets
* Fix typos
2023-07-09 17:58:38 +02:00
WarmUpTill
4315d309f2 Add option to show description as tooltip 2023-07-09 17:58:38 +02:00
WarmUpTill
8d18bb363a Add options to disable plugins 2023-07-07 21:35:51 +02:00
WarmUpTill
592f31f059 Use the correct build type for dependencies (Windows)
Always building with the Release configuration caused issues (e.g.
linking) when attempting to build non-release configurations when using
the CI build scripts.
This is not done for OpenCV as it does not support all build types.
2023-07-07 21:35:51 +02:00
WarmUpTill
300ad15ad0 Reduce size of audio action widget
Only show audio fade options when they are needed.
2023-07-07 21:35:51 +02:00
WarmUpTill
91f93169eb Add option to set deinterlace mode and deinterlace field order 2023-07-07 19:19:40 +02:00
WarmUpTill
5d95069291 Cleanup
* Move run count increment back to PerformActions()
 * Rename variable
2023-07-06 19:59:46 +02:00
WarmUpTill
e5bb9162ef Prevent flicker when creating MacroConditionMacroEdit
Seems to be caused by the fact that some widgets were not part of any
layout while setLayout() was already called
2023-07-06 19:59:46 +02:00
WarmUpTill
6869cc8a01 Add option to highlight macro dock if conditions of macro are true 2023-07-06 19:59:46 +02:00
WarmUpTill
55c7ac8a32 Rework WasExecutedRecenty()
Added ExecutedSince() instead as WasExecutedRecenty() did not support
checking if a macro was executed recently when using it multiple times
in quick succession.

This could be the case if the MacroTree and a MacroDock would both
attempt to use this function at the same time.
2023-07-06 19:59:46 +02:00
WarmUpTill
101a85b063 Enable use of variables in macro dock widgets 2023-07-06 19:59:46 +02:00
WarmUpTill
e7c6afbc6a Fix potential crash when resolving variables during shutdown 2023-07-06 19:59:46 +02:00
WarmUpTill
18e19fb6c8 Add support for adding status labels to macro docks 2023-07-06 19:59:46 +02:00
WarmUpTill
a7ccfc3282 Add action to toggle lock of scene items 2023-07-05 00:53:03 +02:00
Joao Eriberto Mota Filho
85eb2a4235 Fix spelling errors 2023-07-01 20:51:31 +02:00
WarmUpTill
3e3805b542 Ignore libremidi warnings 2023-06-17 13:57:35 +02:00
WarmUpTill
c59acd836a Reduce size of audio action widget
Only show audio fade options when they are needed.
2023-06-17 13:57:35 +02:00
WarmUpTill
1e81181312 Add option to toggle filter 2023-06-09 20:28:01 +02:00
WarmUpTill
8a796efdb3 Allow specifying custom prompts for variable input 2023-06-07 12:36:39 +02:00
WarmUpTill
1a07a93552 Add spacer if not modifying strValue and remove it otherwise 2023-06-07 12:36:39 +02:00
WarmUpTill
bd74629420 Add helpers to add and remove trailing spacer items in QBoxLayouts 2023-06-07 12:36:39 +02:00
WarmUpTill
dabb293cc0 Mark locale maps as const
There is no reason to have these not be const as new locale entries will
not be added at runtime.
2023-06-03 22:38:42 +02:00
WarmUpTill
b6031bd29a Fix typo in locale name 2023-06-03 22:38:42 +02:00
WarmUpTill
05fa3af2ac Fix crash while waiting for transition and no transition is selected 2023-05-31 13:39:47 +02:00
WarmUpTill
c52166bfec Add option to trigger OBS hotkeys directly
Main use case would be to interact with other plugins which offer
hotkeys.
The benefit of this method is that it does not require a key to be bound
to the particular hotkey to trigger the functionality.
2023-05-30 13:14:58 +02:00
WarmUpTill
6d3964fa5d Fix non-modal-dialog answer being ignored 2023-05-30 13:14:58 +02:00
WarmUpTill
65545d85ba Let OBS handle dock restoration on first startup and cleanup on shutdown
The "manual" attempt at restoring the docks should only be performed on
scene collection change as OBS will already take care of this on
starutp.

Do not delete the macro dock widgets on shutdown so OBS is able to save
their location and size properly.
2023-05-30 12:58:23 +02:00
WarmUpTill
dea4ff47cd Add option to prompt user for value to be assigned to variable 2023-05-28 19:59:12 +02:00
WarmUpTill
258a5f6ab7 Move NonModalMessageDialog to separate file 2023-05-28 19:59:12 +02:00
WarmUpTill
2048ca2816 Add scenes to possible selection of "Source" condition type
It might be useful to check if a given scene is visible outside of it
being the currently active scene, as scenes can also be used as sources
within other scenes.
2023-05-26 21:45:45 +02:00
WarmUpTill
eb9e2e8062 Const correctness 2023-05-26 21:45:45 +02:00
WarmUpTill
3229bf0150 Clean up source condition and action
* Add hints directing to the scene item visibility action / condition as
  they frequently get mixed up
* Clean up layout of the source condition (removed spaces in locale as
  this unnecessary spacing in the layout when the settings check was not
  selected
2023-05-26 21:45:45 +02:00
WarmUpTill
dfa12f9807 Add support for configuring additional streaming options
* Set server
* Set stream key
* Set username
* Set password
2023-05-26 20:42:16 +02:00
WarmUpTill
e0917a35fd Fix function priorities not being saved 2023-05-20 06:18:32 -07:00
WarmUpTill
686b00ffd1 Update zh-CN.ini locale (provided by qwe1154323937) 2023-05-20 01:59:32 -07:00
WarmUpTill
78402f6546 Fix plugin state and timer action not being translated 2023-05-17 13:47:45 -07:00
WarmUpTill
a1b5fbb1fe Add OSC action 2023-05-17 06:31:43 -07:00
WarmUpTill
b71f633fac Add support for websocket messages not following the OBS WS protocol 2023-05-17 04:39:04 -07:00
WarmUpTill
dbb674aa8e Add "Display" condition
Allows you to check for the amount and name of the connected displays
2023-05-17 04:38:44 -07:00
WarmUpTill
018daf7f09 Move GetMonitorNames() to utility 2023-05-17 04:38:44 -07:00
WarmUpTill
a07a84a8b1 Add option to rename buttons of macro dock 2023-05-17 02:20:35 -07:00
WarmUpTill
0f36f34a4f Cleanup
* Const correctness
* Group functionality
* Move Actions() and Conditions() implementation
2023-05-17 02:20:35 -07:00
WarmUpTill
cf2cebd0fc Ignore "StatusIndicator" window on MacOS
It interferes with the focus window checks
2023-05-14 04:44:49 -07:00
WarmUpTill
90dd59abe6 Rework window condition
Layout changes to make controlling the checkboxes less confusing.

Added variable support for the winddow title selection.

Previously window title matching was mandatory, which is now optional.
This would make it difficult to set up condition which are independent
of the window title. For example, a condition wich triggers on focus
window change.

Add support for configuring the regex options used for the window title
options.

Also adds the option to check the content displayed in a given window
using the Windows API as an alternative to the OCR of the video
condition.
2023-05-14 04:44:49 -07:00
WarmUpTill
5332ed6bef Regex config improvements
* Use icon instead of checkbox
* Enable use of custom save name
* Allow access to functions modifying the enable state
2023-05-14 04:44:49 -07:00
WarmUpTill
d45d4ded99 Insert duplicated macro after original macro 2023-05-12 16:26:43 -07:00
WarmUpTill
25b5590d2c Add option to automatically close OBS 2023-05-10 12:44:01 -07:00
WarmUpTill
d2b2ced5bf Add support for non modal dialogs for DisplayMessage() helper 2023-05-10 12:44:01 -07:00
Erik van der Veen
c551953283 Fix crash brightness
This will prevent a crash when the brightness is calculated and the source has no output (yet).
2023-05-08 11:52:56 -07:00
WarmUpTill
5ae1f38ea8 Enable using received MIDI messages in variables 2023-05-07 11:33:52 -07:00
WarmUpTill
372f12de95 Fix libremidi build files being picked up by the Windows installer 2023-05-07 11:33:52 -07:00
WarmUpTill
9cfa88dd8c Add support setting title and icon of system tray message 2023-05-06 11:53:45 -07:00
WarmUpTill
7b355ebc49 Add type alias for NumberVariable 2023-05-02 15:17:49 -07:00
WarmUpTill
43a56c8ec8 Resolve variables even when calling const functions
This is done to ensure that logs printed before actions are executed
contain the correct parameter values instead of potentially outdated
ones.
2023-05-02 15:17:49 -07:00
WarmUpTill
3da90bfa97 Display warning if libremidi directory cannot be found 2023-05-01 13:59:50 -07:00
WarmUpTill
dd572a7456 Fix NameUsed() of source and scene selection widgets
Would always return false as the variable would already be deleted
whenever NameUsed() was called
2023-05-01 04:18:24 -07:00
WarmUpTill
8cd818b80e Enable use of variables in filter selection 2023-05-01 04:18:24 -07:00
WarmUpTill
530bbc07c5 Add MIDI condition and action
This new action will allow you to send MIDI messages to the selected
device.
The condition type will allow you to perform actions based on the MIDI
messages received from the selected device.
2023-04-30 16:54:56 -07:00
WarmUpTill
a992f7a0e8 Enable regex checks to also use useTransitionTargetScene toggle 2023-04-30 16:53:13 -07:00
WarmUpTill
ca3718594d Display warning symbol for the General tab if plugin is stopped 2023-04-30 16:52:30 -07:00
WarmUpTill
17a66853d5 Clean up SetupGeneralTab() 2023-04-30 16:52:30 -07:00
WarmUpTill
8c317c1396 Add option to check for and set keyframe interval settings 2023-04-30 16:51:56 -07:00
WarmUpTill
20f888b991 Fix video condition parameters not saving due to namespace changes 2023-04-30 13:13:18 -07:00
WarmUpTill
cd0d3862c7 Style changes platform-funcs.hpp 2023-04-30 13:13:18 -07:00
WarmUpTill
443ffb7906 Mark free functions static where applicable 2023-04-30 13:13:18 -07:00
WarmUpTill
5967c83b03 Remove switch-priority.cpp 2023-04-30 13:13:18 -07:00
WarmUpTill
66498a03ce SwitcherData style changes 2023-04-30 13:13:18 -07:00
WarmUpTill
9ec772f723 Restructure includes
The intention of this change is to reduce the interdependency of the
various components to reduce compile time when applying changes.
2023-04-30 13:13:18 -07:00
WarmUpTill
20eb56db2d Add helpers for logging, translation, and synchronized data access 2023-04-30 13:13:18 -07:00
WarmUpTill
e4d064aaa3 Rename file 2023-04-30 13:13:18 -07:00
WarmUpTill
5602dfa09a Clean up SwitcherData
* Moved various functions, members, and definitions
 * Separated out priority related functionality
 * Visually grouped various function groups
2023-04-30 13:13:18 -07:00
WarmUpTill
0138b412b4 Style changes in utility.hpp 2023-04-30 13:13:18 -07:00
WarmUpTill
20a934c9ab Move platform-funcs.hpp include 2023-04-30 13:13:18 -07:00
WarmUpTill
09d2b397dc Move scene group files to legacy folder 2023-04-30 13:13:18 -07:00
WarmUpTill
482a99cf15 Clean up shutdown handling 2023-04-30 13:13:18 -07:00
WarmUpTill
81ac45a1d4 Move AskForBackup() definition 2023-04-30 13:13:18 -07:00
WarmUpTill
0b8078f3bf Move scene switch related functions to separate files 2023-04-30 13:13:18 -07:00
WarmUpTill
8b6ace902c Style changes in advanced-scene-switcher.hpp 2023-04-30 13:13:18 -07:00
WarmUpTill
1dead9fca5 Group function definitions of advanced-scene-switcher.hpp 2023-04-30 13:13:18 -07:00
WarmUpTill
524c4b71d7 Add option to set recording folder and file format string 2023-04-23 05:37:59 -07:00
WarmUpTill
e51318768d Fix websocket events not being processed
This could happen if a websocket event message arrived just after the
macro condition checks of the current interval completed and just before
the websocket event message buffers were cleared.
2023-04-17 11:33:24 -07:00
WarmUpTill
c821bb20d0 Add specialValueText() to variable spinbox 2023-04-17 11:33:24 -07:00
WarmUpTill
c6b693b4ac Reduze status label column to minimum size 2023-04-17 11:33:24 -07:00
WarmUpTill
2c5caabab0 Add advss namespace
Fixes name conflict with "Duration" class and typedef of the same name
on MacOS
2023-04-17 11:33:24 -07:00
WarmUpTill
b7479e8342 Enable plugin callbacks to be peformed after condition checks completed
Also run these callbacks before restarting the plugin.
This should ensure that no outdated signals received while the plugin
was stopped will trigger unexpected actions. (E.g. websocket messages
that were received while the plugin was stopped)
2023-04-17 11:33:24 -07:00
WarmUpTill
ffca124762 Enable use of vblog in plugins 2023-04-17 11:33:24 -07:00
WarmUpTill
9bedbf6fb8 Display warning if plugin could not be loaded 2023-04-11 03:55:30 -07:00
WarmUpTill
853150e458 Resize MacroPropertiesDialog to fit contents 2023-04-11 03:55:30 -07:00
WarmUpTill
1ddd48e008 Improve dock handling when changing scene collections
Note that the positions of the docks will still not be restored
perfectly when changing scene collections.
To my understanding this would somehow have to be handled by the
QMainWindow which is controlled by OBS.

This might have to be revisited at a later date.
2023-04-11 03:55:30 -07:00
WarmUpTill
17d24d642e Add more error handling for reordering macros 2023-04-11 03:55:30 -07:00
WarmUpTill
87a46684cd Remove "Studio mode" backwards compatabilty fallback
This should remove the frequent logs of complaining about a name
conflict between different action types.
2023-04-11 03:55:30 -07:00
WarmUpTill
e4c5193945 CI: Use git tag as version identifier in packaging step 2023-04-11 03:55:30 -07:00
WarmUpTill
2e969bf6dd Fix video condition's pattern match mode not loading correctly 2023-04-11 03:55:30 -07:00
WarmUpTill
6db26d9f7b Fix crash when using OCR check of video condition 2023-04-11 03:55:30 -07:00
WarmUpTill
4f02c9ec36 Ask for confirmation even if only a single macro is being deleted 2023-04-06 00:36:07 -07:00
WarmUpTill
2fdd39fba5 Use exprtk lib to evaluate mathematical expressions 2023-04-01 05:37:40 -07:00
WarmUpTill
fe1ddc3a94 Fix connection selection being lost after renaming connection 2023-04-01 05:37:40 -07:00
WarmUpTill
cff2d805db Fix variable selection being lost after renaming variable 2023-04-01 05:37:40 -07:00
WarmUpTill
34425d3e47 CI: minor improvements
* Print checksums in log
* Log if tests were skipped
* Switch to gh-release action version 1
2023-03-27 12:37:08 -07:00
WarmUpTill
4ac4f00620 Fix icons not loading on Linux and MacOS 2023-03-25 16:15:55 -07:00
WarmUpTill
e30a4623c5 Fix HideSelectedMacro() hiding the incorrect index 2023-03-25 15:17:19 -07:00
WarmUpTill
e2f4dcaaee Fix warnings 2023-03-25 15:17:19 -07:00
WarmUpTill
ebbf64ddae Add simple tests 2023-03-25 15:17:19 -07:00
WarmUpTill
8b105ad22b Add support for abs, sin, cos, tan, sqrt function in math expression 2023-03-25 15:17:19 -07:00
WarmUpTill
f3416c5b1d Add option to remove Run or Pause button from macro dock 2023-03-25 12:50:49 -07:00
WarmUpTill
e194fc5ee4 Fix crash when deleting multiple macros in combination with a group 2023-03-25 12:50:49 -07:00
WarmUpTill
e465c81bf1 Fix rename via contenxt menu not updating macro name line edit 2023-03-25 12:50:49 -07:00
WarmUpTill
9dce6a99fd Prevent crashes in case obs_module_text() is called during shutdown 2023-03-25 12:50:49 -07:00
WarmUpTill
6f2c53d14e Add option to create docks of macros
These docks allow to control the pause state and manual execution of the
macro actions
2023-03-25 12:50:49 -07:00
WarmUpTill
9044ae4ade Move OBSDock definition 2023-03-25 12:50:49 -07:00
WarmUpTill
0a422174bc Remove unnecessary cast 2023-03-25 12:50:49 -07:00
WarmUpTill
c2020fe77c Fix crash when selecting new audio source in audio condition 2023-03-24 14:39:41 -07:00
WarmUpTill
8beca6fcc7 Do not allow duplication of groups
Functionality has to be implemented first.
Otherwise visual issues might occur when expanding or collapsing the
new copy of the group entry.
2023-03-24 14:39:41 -07:00
WarmUpTill
18769df2ca Fix duplication of macro not copying references to macros or segments 2023-03-22 11:09:41 -07:00
WarmUpTill
2806fd6cdb Add support for variables in various path selections 2023-03-19 03:52:21 -07:00
WarmUpTill
b607940c8c Add variable support to OpenVR condition 2023-03-19 03:52:21 -07:00
WarmUpTill
dff599df4c Add variable support for scene item order condition
Also cleaned up condition type being defined globally
2023-03-19 03:52:21 -07:00
WarmUpTill
b3cd38e019 Add variable support for OBS stats condition
Also move definition of stat type and condition type into
MacroConditionStats
2023-03-19 03:52:21 -07:00
WarmUpTill
61975e1992 Fix macro list layout margins 2023-03-19 03:52:21 -07:00
WarmUpTill
1a8ad69f23 Add variable support for macro condition spinbox controls 2023-03-19 03:52:21 -07:00
WarmUpTill
f21e40151b Add variable support for cursor condition spinbox controls 2023-03-19 03:52:21 -07:00
WarmUpTill
4e58769648 Fix hotkey action not "holding" down keys for the specified duration 2023-03-19 03:52:21 -07:00
WarmUpTill
f9d6001025 Enable use of variables for hotkey action duration selection 2023-03-19 03:52:21 -07:00
WarmUpTill
ae5f5f90ff Add variable support for audio condition spinbox controls 2023-03-19 03:52:21 -07:00
WarmUpTill
89db21d734 Add variable support for video condition spinbox controls 2023-03-19 03:52:21 -07:00
WarmUpTill
0e4b072650 Add varaible support for audio action spinbox controls 2023-03-19 03:52:21 -07:00
WarmUpTill
13b0e00b27 Add variable support to SliderSpinbox 2023-03-19 03:52:21 -07:00
WarmUpTill
bf5d8ca19e Add option to assign value of math expressions to variable 2023-03-19 03:52:21 -07:00
WarmUpTill
4a3339c09c Add math helpers 2023-03-19 03:52:21 -07:00
WarmUpTill
b28c2b28b2 Adjust to Duration rework 2023-03-19 03:52:21 -07:00
WarmUpTill
fcb3e648d2 Enable use of variables in duration selections 2023-03-19 03:52:21 -07:00
WarmUpTill
5d6f08e38f Adjust to refactor of variable string 2023-03-19 03:52:21 -07:00
WarmUpTill
b932af1c97 Move string and number variables to separate files 2023-03-19 03:52:21 -07:00
WarmUpTill
8874eb2b1c Add widgets that allows using both fixed number values or variables 2023-03-19 03:52:21 -07:00
WarmUpTill
dcf9816a72 Add header support to http action 2023-03-19 03:52:21 -07:00
WarmUpTill
c8722c9f62 Add support for using variables in URL field of http action 2023-03-19 03:52:21 -07:00
WarmUpTill
a82a2ccffe Add option to find and replace strings in current value 2023-03-19 03:52:21 -07:00
WarmUpTill
0bf70e443e Move replaceAll() to utility 2023-03-19 03:52:21 -07:00
WarmUpTill
3d6d690583 Add variable support for custom screenshot path 2023-03-19 03:52:21 -07:00
WarmUpTill
783f76d55d Add support for variables in file FileSelection widget 2023-03-19 03:52:21 -07:00
WarmUpTill
1dd46fb777 Add VariableLineEdit helper 2023-03-19 03:52:21 -07:00
WarmUpTill
22bbd3a4ca Extract argument list to generic string list class and widget
* To be used for http header support
* Add variable support
2023-03-19 03:52:21 -07:00
WarmUpTill
3cd4b2251f CI: Remove zip file from windows installer 2023-03-19 03:51:28 -07:00
WarmUpTill
9e4b003608 Use theme based icons for status dock, group, and duration icon 2023-03-19 03:51:28 -07:00
WarmUpTill
e66d0bc6b8 Rework MacroRef
This should resolve issues of macro names / selections not properly
updating after renaming / grouping / un-grouping macros
2023-03-13 11:30:29 -07:00
WarmUpTill
9a4abd78ed Fix warnings 2023-03-13 11:30:29 -07:00
WarmUpTill
826bee8b1e Enable assigning value of scene item transform to variables 2023-03-11 06:06:18 -08:00
WarmUpTill
143020dc27 Prevent accidental duration changes while scrolling through settings
This was especially problematic with the "cooldown" option of the "Match
behavior" settings on the General tab as accidental changes here could
lead to macros not being executed unexpectedly, which is very hard to
diagnose without inspecting logs.
2023-03-10 13:52:32 -08:00
WarmUpTill
be23065988 Move MouseWheelWidgetAdjustmentGuard 2023-03-10 13:52:32 -08:00
WarmUpTill
2cb62eae96 Enable shrinking the status dock to smaller sizes 2023-03-10 13:52:32 -08:00
WarmUpTill
76c411d1e2 Extract argument list to generic string list class and widget
To be used for http header support.
2023-03-04 13:45:32 -08:00
WarmUpTill
16fa91c2a1 Add "Run" condition
Allows to use external programs as conditions
2023-03-04 13:45:32 -08:00
WarmUpTill
b77f8717fe Move process configuration to separate class and widget 2023-03-04 13:45:32 -08:00
WarmUpTill
59ecf43c5f Enable setting a minimum and initial duration 2023-03-04 13:45:32 -08:00
WarmUpTill
1fd8546354 Improve preview frame visibilty of cursor condition
* Add transparent diagonal stripes to frame
* Do not show frame if invalid selection was made
2023-03-04 13:40:14 -08:00
WarmUpTill
7cb95cb3f6 CI: Cache dependency builds for macOS and Windows 2023-02-19 09:48:03 -08:00
WarmUpTill
160d19d6c1 Clean up UI 2023-02-19 09:48:03 -08:00
WarmUpTill
a0550ca141 Add support for TM_SQDIFF_NORMED and TM_CCOEFF_NORMED for pattern match 2023-02-19 09:48:03 -08:00
WarmUpTill
ac68fc016d Adjust area selection layout
Prefix description instead of using tooltip and remove the "x"
2023-02-19 09:48:03 -08:00
WarmUpTill
5170307f72 Add leptonica and tesseract build 2023-02-19 09:48:03 -08:00
WarmUpTill
3af0e51bd2 Add submodules leptonica and tesseract (OCR) 2023-02-19 09:48:03 -08:00
WarmUpTill
f34d1fe081 Enable variable support 2023-02-19 09:48:03 -08:00
WarmUpTill
83c72ebba5 Add OCR support to video condition using tesseract 2023-02-19 09:48:03 -08:00
WarmUpTill
6ca8e6b3ea Fix preview not showing matches
This can happen if a new video condition was created and the condition
type was cahnged to one which supports displaying matches without
changing any parameters.
2023-02-19 09:48:03 -08:00
WarmUpTill
ba24fc2fab Use correct conversion method for object detection 2023-02-19 09:48:03 -08:00
WarmUpTill
7f28b22599 Add macro list context menu options for add, rename, remove 2023-02-19 09:47:46 -08:00
WarmUpTill
4345db0d2e Don't ask for confirmation when deleting empty groups 2023-02-19 09:47:46 -08:00
WarmUpTill
eddc10c3e2 Enable deleting multiple macros at once 2023-02-19 09:47:46 -08:00
WarmUpTill
46eaada0c4 Enable dragging macro segment by header 2023-02-19 09:47:46 -08:00
WarmUpTill
f8b2dea270 Clean up MacroSegmentList 2023-02-19 09:47:46 -08:00
WarmUpTill
90ebf0e0f8 Set default logic type of new non-root conditions to "or" 2023-02-19 09:47:46 -08:00
WarmUpTill
1a819c807e Create new groups at the top most selection index 2023-02-19 09:47:46 -08:00
WarmUpTill
3220809c04 Fix macro list displaying wrong contents after deleting group
This was only a visual issue - the correct macros were deleted in the
backend
2023-02-11 01:45:28 -08:00
WarmUpTill
72d5255c9e Fix typo 2023-02-11 01:45:28 -08:00
WarmUpTill
5995563a80 Add action to open projector 2023-02-04 08:34:20 -08:00
WarmUpTill
347743d93a Also trigger HighlightOnChange() if highlighting actions 2023-02-04 08:29:33 -08:00
WarmUpTill
3c067ce723 Rework preview dialog to use signals / slots to update image data
Previous implementation caused crashes on some setups
2023-02-03 13:36:51 -08:00
WarmUpTill
8dd2170dfa Update locale 2023-01-31 20:23:14 +01:00
WarmUpTill
5f3a3dd5cf Dynamically increase delay between screenshots up to one second
Otherwise users with a very low switcher interval might not be able to
use the preview dialog at all
2023-01-31 11:20:18 -08:00
WarmUpTill
8ad3563963 Always call obs_remove_tick_callback() in destructor
Seems like in some scenarios a screenshot thread would still be active
while the ScreenshotHelper object was deleted
2023-01-31 11:20:18 -08:00
WarmUpTill
492128ef86 Avoid deadlocks while opening settings window and calling frontend API 2023-01-31 11:20:18 -08:00
WarmUpTill
b4936274f2 Synchronize re-ordering and grouping of macros 2023-01-31 11:20:18 -08:00
WarmUpTill
64ccd5ba53 Detect invalid group setups and attempt to clean them up 2023-01-31 11:20:18 -08:00
WarmUpTill
7ae88f7560 Reset invalid transition behaviour settings 2023-01-28 12:42:32 -08:00
WarmUpTill
ae70af26d1 Add option to assign substring based on regex to variable 2023-01-28 12:42:32 -08:00
WarmUpTill
483bdc237c Add option to create partial matching RegexConf 2023-01-28 12:42:32 -08:00
WarmUpTill
2c564b47f4 Add option to assign substring of current value to a variable 2023-01-28 12:42:32 -08:00
WarmUpTill
fc80d0b5f3 Add option to round variable to nearest integer 2023-01-28 12:42:32 -08:00
WarmUpTill
d094c189d3 Handle invalid paths due to scene collection name in settings export 2023-01-28 12:42:32 -08:00
WarmUpTill
40d8819e77 Fix warnings 2023-01-28 12:42:32 -08:00
WarmUpTill
4a3d019f06 Remove workaround to avoid race conditions 2023-01-28 12:42:32 -08:00
WarmUpTill
5366a4a6ed Fix crash on exit if using scene condition
obs_source_get_name() returning nullptr was not handled
2023-01-28 12:42:32 -08:00
WarmUpTill
e8230d8e5b Fix themes displaying list item selections incorrectly
The issue was that the blue selection highlight was not visible and
instead, a grey box was painted around each item.
I am not sure what exactly was causing this.
2023-01-28 12:42:32 -08:00
WarmUpTill
ebdbb9011f Fix scene switch action aborting macro execution
abortMacroWait was not reset in waitForTransitionChangeFixedDuration()
leading to the scene switch action returning false
2023-01-28 12:42:32 -08:00
BlackScreen
e43793354e Update german translation to the latest version 2023-01-27 12:32:03 -08:00
WarmUpTill
438c54599e Reduce time it takes to close preview dialog 2023-01-20 12:30:47 -08:00
WarmUpTill
da42183177 Fix VariableResolvingString returning empty string if no variables exist 2023-01-20 12:30:47 -08:00
WarmUpTill
295fa3f122 Fix crash on import 2023-01-20 12:30:47 -08:00
WarmUpTill
cb87f1cc36 Fix file condition always returning false 2023-01-18 07:49:21 -08:00
WarmUpTill
19eb5074f2 Enable getting variable values from websocket condition 2023-01-17 12:12:44 -08:00
WarmUpTill
828a69bbf7 Save space by reducing size of "current value" text box 2023-01-17 12:12:44 -08:00
WarmUpTill
c01d471b5f Save space by moving settings button to the same layout as stop button 2023-01-15 09:33:46 -08:00
WarmUpTill
8751c0d296 Enable getting variable values from http action 2023-01-15 09:33:46 -08:00
WarmUpTill
334d173dc9 Add PostLoad()
Used to reslove values that only can be resolved after all macros /
macro segments have been set up initally.
2023-01-15 09:33:46 -08:00
WarmUpTill
1c3ff927a5 Enable getting variable values from window condition 2023-01-15 09:33:46 -08:00
WarmUpTill
b12c25fdf4 Enable getting variable values from studio mode condition 2023-01-15 09:33:46 -08:00
WarmUpTill
e9f4ac7ca7 Enable getting variable values from source condition 2023-01-15 09:33:46 -08:00
WarmUpTill
f1cdab80a9 Enable getting variable values from process condition 2023-01-15 09:33:46 -08:00
WarmUpTill
ae6f0bc470 Enable getting variable values from idle condition 2023-01-15 09:33:46 -08:00
WarmUpTill
3d4b69848c Enable getting variable values from filter condition 2023-01-15 09:33:46 -08:00
WarmUpTill
c4c4a27dcb Enable getting variable values from file condition 2023-01-15 09:33:46 -08:00
WarmUpTill
87ed11d3bf Enable getting variable values from date condition 2023-01-15 09:33:46 -08:00
WarmUpTill
23e2fb8d5a Enable getting variable values from cursor condition 2023-01-15 09:33:46 -08:00
WarmUpTill
af5950748d Switch to using RegexConfig for variable comparison check 2023-01-15 09:33:46 -08:00
WarmUpTill
df9dc1e002 Enable getting variable values from scene condition 2023-01-15 09:33:46 -08:00
WarmUpTill
5c7e0f292f Enable getting variable values from audio condition 2023-01-15 09:33:46 -08:00
WarmUpTill
a5f610b7b7 Add options to compare variable values 2023-01-15 09:33:46 -08:00
WarmUpTill
df8e84dd09 Add option to set variable value based on condition or action 2023-01-15 09:33:46 -08:00
WarmUpTill
ee5038106a Add MacroSegmentOrderChanged() signal 2023-01-15 09:33:46 -08:00
WarmUpTill
6617c08b89 Allow choosing highlight color 2023-01-15 09:33:46 -08:00
WarmUpTill
42773790e4 Enable getting varaible values from conditions and actions 2023-01-15 09:33:46 -08:00
WarmUpTill
1fd6f75ee1 Add variable support to video condition 2023-01-15 09:33:46 -08:00
WarmUpTill
8a2ccef8ec Only return source from variable if source is a scene 2023-01-15 09:33:46 -08:00
WarmUpTill
d30f389db7 Add variable support to source condition 2023-01-15 09:33:46 -08:00
WarmUpTill
a2906a534b Add variable support to media condition 2023-01-15 09:33:46 -08:00
WarmUpTill
30294842f2 Add variable support to filter condition 2023-01-15 09:33:46 -08:00
WarmUpTill
eb478d2948 Add variable support to audio condition 2023-01-15 09:33:46 -08:00
WarmUpTill
e4ee55cd3d Add variable support to source action 2023-01-15 09:33:46 -08:00
WarmUpTill
9c4fe38c97 Add variable support for screenshot action 2023-01-15 09:33:46 -08:00
WarmUpTill
81e64382c9 Add variable support to media action 2023-01-15 09:33:46 -08:00
WarmUpTill
b55db1a79a Add variable support to filter action 2023-01-15 09:33:46 -08:00
WarmUpTill
dcdcd23361 Add variable support to audio action 2023-01-15 09:33:46 -08:00
WarmUpTill
3ccc057547 Clean up utilty 2023-01-15 09:33:46 -08:00
WarmUpTill
d04884fe8b Resolve variables in log messages 2023-01-15 09:33:46 -08:00
WarmUpTill
7ae490ca25 Add option to resolve variable values in ToString() 2023-01-15 09:33:46 -08:00
WarmUpTill
cd74534e4c Add source selection helpers 2023-01-15 09:33:46 -08:00
WarmUpTill
e4f9ccec3f Add support for variables in text edit widgets of actions and conditions 2023-01-15 09:33:46 -08:00
WarmUpTill
f106329892 Enable use of multi-line values for variables 2023-01-15 09:33:46 -08:00
WarmUpTill
14f0194372 Add helper classes to support strings containing variables
* VariableResolvingString will accept strings potentially containing
   variables as inputs and will automatically resolve any variables when
   converting to std::string
 * VariableTextEdit is a simple wrapper around ResizingPlainTextEdit to
   enable working with VariableResolvingString
2023-01-15 09:33:46 -08:00
WarmUpTill
632ad5085f Remove duplicate "is" 2023-01-15 09:33:21 -08:00
WarmUpTill
fafaafd578 Fix crash when showing frame for cursor condition
Extreme values for setGeometry() could cause a crash.
Limit frame size to screen union to avoid these crashes.
2023-01-14 05:09:42 -08:00
WarmUpTill
e01f28f2bf Create archives for manual install on MacOS 2023-01-13 15:05:21 -08:00
WarmUpTill
fd4476c0b3 Fix warnings 2023-01-07 11:49:53 -08:00
WarmUpTill
c96c81cf1d Update macro properties dialog
* Visually group settings
 * Hide hotkey settings if no macro or a group is selected
2023-01-07 11:49:53 -08:00
WarmUpTill
3e4293f9b0 Set background of macro action / condition splitter transparent 2023-01-07 11:49:53 -08:00
WarmUpTill
a80af327d7 Enable grouping of macros
Based on OBS's source-tree model/view implementation
2023-01-07 11:49:53 -08:00
WarmUpTill
2116bd7a78 Adjust function signature for macro rename signal 2023-01-07 11:49:53 -08:00
WarmUpTill
11571751b9 Fix crash related to highlights
A crash could occur when macro segments would be deleted while
highlighting of a segment was triggered.
2023-01-07 11:49:53 -08:00
WarmUpTill
f9de63bc88 Rename "count" to "runCount" 2023-01-07 11:49:53 -08:00
WarmUpTill
378bf4dfd6 Add button to open settings window to dock
Also apply current OBS theme to status dock by using "OBSDock" wrapper
class
2023-01-07 11:49:53 -08:00
WarmUpTill
5444d6fd9e Adjust locale 2023-01-02 08:38:25 -08:00
WarmUpTill
15d7e2f972 Add option to check audio balance 2022-12-27 04:02:08 -08:00
WarmUpTill
357d9447f2 Add option to set audio balance 2022-12-27 04:02:08 -08:00
WarmUpTill
6c9d6095c9 Move slider spinbox to core lib 2022-12-27 04:02:08 -08:00
WarmUpTill
bba029e901 Only show audio monitoring options if monitoring is supported by OBS 2022-12-27 04:02:08 -08:00
WarmUpTill
4eafbb8f18 Improve plugin state action
Add options to check for ...
 * Initial plugin start
 * Plugin restart
 * Scene collection change
2022-12-27 03:55:40 -08:00
WarmUpTill
e147402250 Improve random action
* Allow duplicates to enable weighting macro occurance
 * Add option to allow consecutive execution of the same macro
2022-12-23 15:50:17 -08:00
WarmUpTill
e0602f8de2 Rename function and class 2022-12-23 14:10:37 -08:00
WarmUpTill
11f769cf09 Add option to check for change in visibilty 2022-12-23 14:10:37 -08:00
WarmUpTill
4ab88ea218 Add option to not reset seletion on any / all index type change 2022-12-23 14:10:37 -08:00
WarmUpTill
20cbe636df Update locale 2022-12-23 14:09:26 -08:00
WarmUpTill
601b035285 Fall back to OBS-only key press if global key press can't be simulated 2022-12-23 13:18:45 -08:00
WarmUpTill
0027ae9bb8 Reuse last import path 2022-12-23 13:17:58 -08:00
WarmUpTill
ffccc435ca Use unicode as chracter set for lib build 2022-12-23 13:17:58 -08:00
WarmUpTill
8d6b9e37d5 Prioritize manually specified variables 2022-12-23 13:17:58 -08:00
WarmUpTill
70c9a3bd83 Improve video condition and preview dialog
* Fix crashes in preview dialog
 * Pass copy of parameters instead of working directly with condition
   data
 * Set sensible default paths in file selection dialogs
 * Add maximize button to preview dialog
 * Derive preview dialog size from scene switcher settings window
 * Use parameter helper classes
2022-12-23 13:16:22 -08:00
WarmUpTill
b7c6deddde Add helper classes to more easily handle video condition parameters 2022-12-23 13:16:22 -08:00
WarmUpTill
feab4fe744 Add ValidPathOrDesktop() helper function 2022-12-23 13:16:22 -08:00
WarmUpTill
b5ec9e7586 Add const qualifier to various functions 2022-12-23 13:16:22 -08:00
WarmUpTill
a901f59f0f Add option to interact with source settings buttons 2022-12-21 11:52:48 -08:00
WarmUpTill
ea826f1be0 Add option to check for mouse button press
Implemented only for Windows for now.
2022-12-21 11:52:36 -08:00
WarmUpTill
f7afb9c446 Cleanup
* Add include
* Fix typo
2022-12-21 11:52:36 -08:00
WarmUpTill
42198a8773 Update locale 2022-12-18 11:02:09 -08:00
WarmUpTill
368034ad5a Combine hotkeys with the same description into a single hotkey 2022-12-15 11:46:38 -08:00
WarmUpTill
0d1a3e5646 Add missing virtual destructors 2022-12-15 11:46:38 -08:00
WarmUpTill
76be75474b Set default path for import to desktop folder 2022-12-15 11:46:38 -08:00
WarmUpTill
cca32e59c2 Do not allow running paused macros
The old behaviour was not consistent with the other action types.
(E.g. "Sequence" or "Random" ignore paused macros)
It would also only ever execute the first action of the given macro as
afterwards the plugin would realise the macro is paused and abort the
execution.
2022-12-10 13:06:55 -08:00
WarmUpTill
85bb0e62dc Clean up locale 2022-12-10 13:06:19 -08:00
WarmUpTill
0ce9c515af Add option to check / set audio monitoring of sources 2022-12-10 13:06:19 -08:00
WarmUpTill
03854376ef Remove outdated translations for cooldown option 2022-12-10 00:55:28 -08:00
WarmUpTill
88b7603ed1 CI: No longer manually install obs-frontend-api.h for debian build 2022-12-07 11:28:46 -08:00
WarmUpTill
c07ef3c699 Enable detection of user holding down hotkey
Previously only the key down event would trigger the condition
2022-12-05 07:23:13 -08:00
WarmUpTill
f3e5fb59f3 Reset duration modifier timers when stopping the plugin 2022-12-05 07:22:57 -08:00
WarmUpTill
ef0f6839e5 Remove unnecessary duration reset 2022-12-05 07:22:57 -08:00
WarmUpTill
6a488316d8 Update locale (provided by qwe1154323937) 2022-12-04 10:26:03 -08:00
WarmUpTill
8dc434f45e Add option to match scene name to pattern 2022-12-04 09:26:38 -08:00
WarmUpTill
7b65286181 Add error handling for non X11 windowing systems
This will only avoid crashes.
Functionality relying on X11 might not be available in such situations.
(E.g. window title, idle detection, key press simulation)
2022-12-02 20:14:13 -08:00
WarmUpTill
05fce566f4 Use existing Qt functionality to get cursor position
Might resolve issues with cursor position detection on non-X windows on
Linux
2022-12-02 20:14:13 -08:00
WarmUpTill
cc3ce3f0e0 Resolve libXss.so symbols at runtime
This enables running the advanced scene switcher in environments in
which this library is not available with only minimal loss of
functionality (idle detection)
2022-11-28 10:18:18 -08:00
WarmUpTill
20ba02be8d Fix MultiStateCondition not being saved 2022-11-26 08:46:31 -08:00
WarmUpTill
e3d9bf11a4 Fix windows build
The default cmake version used on the Windows runner was unable to
configure OpenCV
2022-11-26 08:46:31 -08:00
WarmUpTill
31511851c9 Add option to match date pattern 2022-11-26 08:46:31 -08:00
WarmUpTill
4f71c55034 Show simple date settings by default 2022-11-26 08:46:31 -08:00
WarmUpTill
46fb63e960 Add option to set working directory for new process 2022-11-26 05:47:24 -08:00
WarmUpTill
034a5255a5 Add option to select folder 2022-11-26 05:47:24 -08:00
WarmUpTill
1be2764d7b Allow setting / checking the audio sync offset of sources 2022-11-26 05:47:13 -08:00
WarmUpTill
34355379ca Clean up Linux platform code
* Fix foreground process check not working for large pids.
* Clean up memory leaks.
* Reduce code duplication.
* Style changes.
2022-11-21 11:15:07 -08:00
WarmUpTill
fd8e3c1e5c Add support for libproc2 (Linux)
Needed for Debian build. (#590)
Also cleaned up platform dependent sections of CMakeLists.txt.
2022-11-21 11:15:07 -08:00
WarmUpTill
7407bc7d82 Add option to toggle visibility 2022-11-20 10:09:56 -08:00
WarmUpTill
d636022576 Add support for additional source groups
Previous implementation missed source types like "scene" and "group"
2022-11-20 10:09:56 -08:00
WarmUpTill
ae9ef2bf3b Fix potential crash for sources of unkown type
This can happen if a source was created but the corresponding
functionality was later removed (e.g. when loading a scene collection
containing a browser source on an OBS build without browser source
support)
2022-11-20 10:09:56 -08:00
WarmUpTill
624ff9f5c6 Fix freeze when changing scene collection 2022-11-16 08:44:15 -08:00
WarmUpTill
9bcced524b Move transition behaviour related settings to General tab 2022-11-09 09:57:55 -08:00
WarmUpTill
3bb2ddfaac Update GitHub Actions for set-output deprecation
GitHub Actions has deprecated set-output. Replace usages of set-output
in stdout with the new syntax to save the output to the new environment
variable.

See:
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2022-11-06 09:53:25 -08:00
WarmUpTill
50e26aba72 Improve focus handling
* Display current focus window / process
 * Match against app name instead of window name on MacOS when using
   Process condition
 * Clean up
2022-11-06 09:53:25 -08:00
WarmUpTill
267ab6a7c1 Set Windows installer version to git tag 2022-11-05 12:24:50 -07:00
WarmUpTill
65ea7987c7 Add special handling for the "between" case when ignoring the date
In this case the left time value will be treated as the start of the
time range and the right one as the end.

This now enables specifying ranges that span over the 24h boundary.
E.g. 23:00:00 to 01:00:00.
This would have previously been treated as 01:00:00 to 23:00:00 instead.
2022-11-02 07:57:01 -07:00
WarmUpTill
a6839666ce Fix scene item selection not saving index 2022-11-02 07:56:37 -07:00
WarmUpTill
e5843de4fc Add option to check for average brightness 2022-10-21 13:15:11 -07:00
WarmUpTill
a330378c16 Improve option to check multiple media sources
* Added the option to select current, previous, variables, ...
 * Refresh the source list on scene change
 * General clean up of media condition
2022-10-21 13:15:00 -07:00
WarmUpTill
ddb7888e61 Enable word wrap for "on change" and "parallel" options on macro tab 2022-10-21 13:14:35 -07:00
WarmUpTill
73aef4f0b2 Workaround for macro drag / drop not working as expected
See:
 * QTBUG-106395
 * https://github.com/obsproject/obs-studio/issues/7321
2022-10-13 10:29:39 -07:00
WarmUpTill
67c3b73e10 Fix date condition showing incorrect date
This is only affecting the displayed value when reopening a macro.
The entered values were stored / used correctly.
2022-10-08 15:59:15 -07:00
WarmUpTill
9a3d381cf0 Improve macro examples 2022-10-08 15:59:07 -07:00
WarmUpTill
8b8829f7df Fix scene item selection not returning expected number of items 2022-10-04 23:35:58 -07:00
WarmUpTill
6fff3b54e6 Remove version number from dep package name 2022-10-04 12:01:47 -07:00
WarmUpTill
dd69ca1b35 Add libprocps-dev 2022-10-04 02:59:59 -07:00
WarmUpTill
66ddf3b4ef Rebase volume control widgets to new OBS version 2022-10-04 02:59:59 -07:00
WarmUpTill
c9b5bbfc14 Fix multi state count not being saved 2022-10-04 02:59:59 -07:00
WarmUpTill
3e1e8d01b6 Add option to check for value change 2022-10-04 02:59:59 -07:00
WarmUpTill
c22f40e333 Set SOVERSION to resolve Debian warning 2022-10-04 02:59:36 -07:00
WarmUpTill
b83acaca79 Set rpath for Debian package 2022-10-04 02:59:36 -07:00
Joao Eriberto Mota Filho
53bef18d15 Fix spelling and double word 2022-10-01 10:14:49 -07:00
WarmUpTill
ced1c7605a Add option to set default value on load 2022-10-01 08:24:11 -07:00
WarmUpTill
f78e91eec4 Add compatibility note 2022-10-01 08:24:11 -07:00
WarmUpTill
7fdff72a92 Only show duration selection if dynamic length transition is selected 2022-10-01 08:24:11 -07:00
WarmUpTill
d2d042bae3 Move transition type definition 2022-10-01 08:24:11 -07:00
WarmUpTill
f70ae803a3 Enable creating screenshots of scenes 2022-10-01 01:58:57 -07:00
WarmUpTill
cdefbf383c Add preview scene support 2022-10-01 01:58:57 -07:00
ubuntu
5f8641b18a Adjust cmake to support LIB_OUT_DIR and DATA_OUT_DIR for debian build 2022-10-01 01:52:22 -07:00
ubuntu
d107f653de Fix warnings 2022-10-01 01:52:22 -07:00
WarmUpTill
22f4c11ee3 Hide Scene Groups tab
The tabs functionality is often confused with the sequence tab.
With the introduction of variables / macros this tab is unlikely to find
much use so also hide when legacy-tabs are hidden.
2022-09-29 10:59:08 -07:00
WarmUpTill
7683957267 Add variable support for scene item selection 2022-09-28 02:21:05 -07:00
WarmUpTill
e0d4c7244d Add variable support for scene selection 2022-09-28 02:21:05 -07:00
WarmUpTill
b2ccd30f68 Clean up SceneSelection
* Adjust save and load functions to avoid conflicts with other values
 * Move enum definition
2022-09-28 02:21:05 -07:00
WarmUpTill
1dea2e5f5d Adjust to new Item, ItemSelection, and ItemSettingsDialog classes 2022-09-28 02:21:05 -07:00
WarmUpTill
c95fb6c2ea Add macro action "Variables" 2022-09-28 02:21:05 -07:00
WarmUpTill
d779ced27f Add macro condition "Variable" 2022-09-28 02:21:05 -07:00
WarmUpTill
c84c1638bf Add support for variables 2022-09-28 02:21:05 -07:00
WarmUpTill
3ac4e22600 Add generic item selection and settings configuration widgets
To be used for configuring variables and connections
2022-09-28 02:21:05 -07:00
WarmUpTill
a59d15a77a Add option to disable hotkey registration for new macros 2022-09-28 02:20:22 -07:00
Joao Eriberto Mota Filho
c2edc7c612 Fix spelling errors in final binary 2022-09-27 11:07:31 -07:00
WarmUpTill
77fe75f738 Fix websocket condition layout when enabling regular expressions 2022-09-24 00:45:58 -07:00
WarmUpTill
fdb70a32c6 Fix splitter position save data size growing on scene collection change 2022-09-24 00:45:58 -07:00
WarmUpTill
487db7302e Update OBS version 2022-09-21 10:04:09 -07:00
ubuntu
12a74caf62 Add obs-websocket-api.h to deps/
Using a submodule which is not available as a package on Debian makes it
difficult to package the plugin for Debian.

Instead add the obs-websocket header file directly to the repo.
2022-09-21 10:04:09 -07:00
ubuntu
742996fc83 Remove submodule deps/obs-websocket
Using a submodule which is not available as a package on Debian makes it
difficult to package the plugin for Debian.

Instead add the obs-websocket header file directly to the repo.
2022-09-21 10:04:09 -07:00
WarmUpTill
f5a0b2e91a Reintroduce debian build workflow 2022-09-20 14:01:22 -07:00
WarmUpTill
114ca7b545 Remove unused file 2022-09-20 14:01:22 -07:00
WarmUpTill
a8953f23f4 Add backwards compatability to at least OBS 26.1.2
Required for Debian Stable
2022-09-20 14:01:22 -07:00
WarmUpTill
106be642aa Set CPACK_DEBIAN_PACKAGE_DEPENDS to OBS 28 and correct Qt version 2022-09-19 11:36:28 -07:00
WarmUpTill
4c20ac605d Fix UI not showing correct logic type if removing root condition 2022-09-19 11:36:28 -07:00
WarmUpTill
75cdd3c80d Add option to reduce video matching latency 2022-09-19 11:36:28 -07:00
WarmUpTill
b2585ae176 Fix potential crash in video condition 2022-09-19 11:36:28 -07:00
WarmUpTill
d1e912cb24 Clean up video condition widget
* only show area selection widget if option is enabled
 * fix slight alignment issue
 * move "Show match" button to the bottom of the widget
2022-09-19 11:36:28 -07:00
WarmUpTill
bd5ecb3b3b Add "slideshow" to list of supported media sources 2022-09-17 00:40:10 -07:00
WarmUpTill
1a8a4584c1 Add support for websocket vendor events 2022-09-16 23:55:36 -07:00
WarmUpTill
6d755ad570 Add content / modification date changed as separate options
Previously this would require knowledge of regular expressions to match
any content.
2022-09-15 12:25:37 -07:00
WarmUpTill
99ceb6a42a Style changes
* Move FileType definition
* Change capitalization
2022-09-15 12:25:37 -07:00
WarmUpTill
7ddfdcf5be Switch to RegexConfig 2022-09-15 12:25:37 -07:00
WarmUpTill
a243e026c8 Add RegexConfig class and widget
This allow more control over regular expressions, when they are used
throughout the plugin, as it enables configuration of additional
QRegularExpression::PatternOptions.
2022-09-15 12:25:37 -07:00
WarmUpTill
f40f98c702 Move setButtonIcon to utility 2022-09-15 12:25:37 -07:00
WarmUpTill
d99618d2f6 Enable multiline regex pattern matching 2022-09-15 12:25:37 -07:00
WarmUpTill
a93305e16e Convert line endings to "\n" to allow easier matching 2022-09-15 12:25:37 -07:00
WarmUpTill
fa3ae607b5 Fix missing icon on macro up / down buttons 2022-09-07 12:08:01 -07:00
WarmUpTill
bddbcebece Slight layout adjustments to better support new OBS themes 2022-09-05 12:19:07 -07:00
WarmUpTill
aeaa13955c Hide password 2022-09-05 12:19:07 -07:00
WarmUpTill
f99eb6c3c8 Set sensible default paths when browsing using FileSelection
Previously FileSelection would default to the OBS run dir
2022-09-03 10:31:47 -07:00
WarmUpTill
c16b97e5cd Add option to save screenshot to custom path 2022-09-03 10:31:47 -07:00
WarmUpTill
0d29fb2ee1 Add support to save screenshots to file 2022-09-03 10:31:47 -07:00
WarmUpTill
0169f6c445 Drop 32 bit Windows build 2022-09-02 16:00:18 -07:00
WarmUpTill
886639fe24 Drop version number in name of generated build artifacts 2022-09-02 16:00:18 -07:00
WarmUpTill
7304fa349e Build both portable and non-portable artifacts for Linux 2022-09-02 16:00:18 -07:00
WarmUpTill
7b44c28767 Fix warnings 2022-09-01 13:20:35 -07:00
WarmUpTill
9bed6df2b5 Adjust macro list to new OBS layout changes 2022-09-01 13:20:35 -07:00
WarmUpTill
ad4c41c1dd Replace "\" with "/" 2022-09-01 13:20:35 -07:00
WarmUpTill
9e2ca1529c Save splitter positions on macro tab 2022-08-31 12:12:25 -07:00
WarmUpTill
e62504968c Move comment to correct line 2022-08-31 12:12:25 -07:00
WarmUpTill
97720a798c Waste less space in the UI
* Adjusted layout margins

   Nested layouts lead to lots of wasted space.
 * Removed unnecessary "Close" button

   Closing the settings dialog via "x" or the close button does not make
   a difference so it can savely be removed.
2022-08-31 12:12:25 -07:00
WarmUpTill
636630fdf3 Add splitter between macro list and macro edit area
This will make editing macros easier on smaller window sizes as the list
or edit area can be resized to the users needs
2022-08-31 12:12:25 -07:00
WarmUpTill
602622c841 Remove paths-ignore block
Didn't serve any purpose and is not allowed in combination with 'paths'
2022-08-31 07:58:24 -07:00
WarmUpTill
c3aa421bc5 Add option to split recording 2022-08-31 07:58:24 -07:00
WarmUpTill
c392004edf Remove duplicate line 2022-08-27 15:08:19 -07:00
WarmUpTill
9e4893abc3 Only run locale checks when locale was changed 2022-08-27 15:08:19 -07:00
WarmUpTill
54f940be0d Revert to old AppId for Windows installer and set new UUIDs for MacOS 2022-08-27 15:08:19 -07:00
WarmUpTill
046de4118f Rework curl helpers 2022-08-25 11:26:31 -07:00
WarmUpTill
c9177c4429 Add Http action 2022-08-25 11:26:31 -07:00
WarmUpTill
9704d5f1f4 Add AnimationFinished signal 2022-08-24 12:53:25 -07:00
WarmUpTill
5ce177bcd3 Add websocket files and dependencies 2022-08-24 12:53:25 -07:00
WarmUpTill
a7b6a4a67c Add websocket locale 2022-08-24 12:53:25 -07:00
WarmUpTill
1978b8f1a1 Save and load websocket connections 2022-08-24 12:53:25 -07:00
WarmUpTill
59cc37c90a Add websocket condition 2022-08-24 12:53:25 -07:00
WarmUpTill
866c49bffd Add websocket action 2022-08-24 12:53:25 -07:00
WarmUpTill
c9370c8929 Add websocket helper functions to receive and send messages 2022-08-24 12:53:25 -07:00
WarmUpTill
e97f41a356 Add connection-manager
Used to add, remove, and modify websocket connections
2022-08-24 12:53:25 -07:00
WarmUpTill
6c7ba4225b Add obs-websocket dependency 2022-08-24 12:53:25 -07:00
WarmUpTill
b694598d16 Disable the "Directory already exists" warning in Windows installer 2022-08-23 13:53:13 -07:00
WarmUpTill
954b634aa5 Update actions/cache from v2.1.7 to v3 2022-08-23 13:53:13 -07:00
WarmUpTill
c9820e77d8 Add option to check states of multiple macros at the same time 2022-08-23 11:31:48 -07:00
WarmUpTill
a268f98b73 Rework to use MacroList widget 2022-08-23 11:31:48 -07:00
WarmUpTill
700e75a2b5 Fix potential crashes when removing macros 2022-08-23 11:31:48 -07:00
WarmUpTill
19e79aff50 Add macro list widget 2022-08-23 11:31:48 -07:00
WarmUpTill
c8f684ce9f Add helper to get internal ref name 2022-08-23 11:31:48 -07:00
WarmUpTill
1027dda6f6 Enable inheriting from both MultiMacroRef* and MacroRef*
Initially to be used only for the "Macro" condition type
2022-08-23 11:31:48 -07:00
WarmUpTill
6f7bcc34af Add helper functions to save / load list of macro refs 2022-08-23 11:31:48 -07:00
WarmUpTill
face0f7f3c Add MultiMacroRefCondtition 2022-08-23 11:31:48 -07:00
WarmUpTill
7480e793b8 Adjust General tab layout for new Yami theme of OBS 28 2022-08-23 10:58:57 -07:00
WarmUpTill
bcdcaed136 Format example 2022-08-17 11:16:22 -07:00
WarmUpTill
85e715dc75 Update .gitignore 2022-08-17 11:08:53 -07:00
WarmUpTill
9e8e1a6e4d Set LINUX_PORTABLE to OFF to create valid .deb file 2022-08-17 11:08:53 -07:00
WarmUpTill
7fbfb7806b Add link to wiki and OBS forums 2022-08-17 11:08:53 -07:00
WarmUpTill
1556334c0e Update README.md and BUILDING.md
* Add "Contributing" section
 * Update build instructions
2022-08-17 11:08:53 -07:00
WarmUpTill
53a5fa6ff4 Restructure "src/" folder
Moving files from the "src/" folder into "src/legacy", "src/macro-core",
and "src/utils" was necessary as it was becoming a bit too cluttered.
2022-08-17 11:08:53 -07:00
WarmUpTill
5ae9e18044 Rework plugin to allow split into module and library part
This is mostly intended to allow easier bundling for MacOS but might
prove to be useful for other areas as well.
2022-08-17 11:08:53 -07:00
WarmUpTill
aef29d7d82 Update plugin build scripts
Based on OBS plugin template build scripts with some minor adjustments:

 * Adjust format check scripts to exclude ./deps folder
 * Adjust release scripts to only draft releases
 * Always build installers
 * Always upload build artefacts
 * Build opencv for Mac and Windows releases
2022-08-17 11:08:53 -07:00
WarmUpTill
f000758820 Add Qt version checks to support Qt5 2022-08-17 11:08:53 -07:00
WarmUpTill
786c9592a1 Fix depecrations and clean up backwards compatibility checks 2022-08-17 11:08:53 -07:00
WarmUpTill
5cb50821e0 Rewrite CMakeLists.txt to support new build system based on obs-plugintemplate 2022-08-17 11:08:53 -07:00
WarmUpTill
bcdfe79831 Add action to refresh sources 2022-08-03 11:35:06 -07:00
WarmUpTill
ec93babed6 Fix duration modifier of media conditions not saving 2022-08-03 11:34:25 -07:00
WarmUpTill
e075dcd4be Cleanup
Rename locale entry to match naming scheme
2022-06-28 11:25:50 -07:00
WarmUpTill
4113f94528 Add condition to check current profile 2022-06-28 11:25:50 -07:00
WarmUpTill
db3affc43d Set screenshot file extension to *.png
Files without any file extension are not properly loaded as an QImage and
thus pattern matching might not work
2022-06-28 11:25:38 -07:00
EliasDIPA
e11d882e87 Spanish translation of version 1.17.7 2022-06-28 11:24:57 -07:00
WarmUpTill
925729e6b8 Fix hotkeys not being registered for new macros 2022-06-22 14:13:34 -07:00
WarmUpTill
4d2c3e0f80 Copy settings of selected transition for show / hide transition 2022-06-13 11:40:12 -07:00
WarmUpTill
1665841589 Fix freeze on setting hide/show transition
A "private" copy of the transition source has to be used for show and
hide transitions as otherwise this can lead to an OBS freeze the next
time the show / hide transition is used
2022-06-13 11:40:12 -07:00
WarmUpTill
e89343b03e Fix crash when deleting last macro
A crash could occur if the last macro was deleted and the highlighting
of macro segments was enabled due to the macro segments already being
deleted while the widgets representing these segments were not
2022-06-12 06:45:11 -07:00
WarmUpTill
a9c79b02ff Fix UI elements shifting slightly
Content margins of scene item selection widget would cause Transition
action to shift slightly whenever the widget's visibility changed
2022-06-12 04:50:13 -07:00
WarmUpTill
c6541825f8 Add option to select before and after for time of simple date check 2022-06-12 03:46:18 -07:00
WarmUpTill
003a1aa696 Remove delay before saving replay buffer 2022-06-12 03:46:04 -07:00
WarmUpTill
20767630c0
Add option to set show, hide, and override transitions (#471) 2022-06-12 12:45:45 +02:00
WarmUpTill
70fb972f84 Add option to ignore time component in simple check 2022-05-18 04:55:55 -07:00
WarmUpTill
4d65956f25 Fix MacOS memory leak 2022-05-18 04:55:28 -07:00
WarmUpTill
a2e4580970 Fix media and audio condition unexpectedly returning true after unpause 2022-05-12 11:42:39 -07:00
WarmUpTill
8da1e3ad40 Rework time restriction to support "within" duration modifier
Also renamed duration constraint to duration modifier
2022-05-12 11:42:39 -07:00
WarmUpTill
92b6a057f6 Restructure files
- Move condition and action related parts into separate files
 - Move duration constraint to macro condition
 - Move duration constraint widget to macro condition edit
 - Adjust includes
2022-05-12 11:42:39 -07:00
WarmUpTill
70a3ae0245 Fix waiting for transition to complete with fixed duration transitions 2022-05-12 11:42:39 -07:00
WarmUpTill
8cc7b65436 Do not allow duplicates in condtion and action type selection 2022-05-12 11:42:39 -07:00
WarmUpTill
fd18e64e19 Add studio mode action (previously scene swap and preview scene action)
The option to enable and disable studio mode is new
2022-05-12 11:42:39 -07:00
WarmUpTill
e4526c4e81 Enable option to check previous scene during active transition 2022-05-07 16:55:36 -07:00
WarmUpTill
d6ef69a3d4 Add spinbox control to threshold slider 2022-05-06 11:37:43 -07:00
WarmUpTill
b5eb0b3f3e Add option to disable registering of pause control hotkeys 2022-05-06 11:37:28 -07:00
WarmUpTill
22a361f977 Fix scene group not being random 2022-05-04 06:20:10 -07:00
WarmUpTill
a0db023aae cleanup es-ES.ini 2022-05-04 02:28:10 -07:00
EliasDIPA
dc8a60a5e5 Traduccion al Español añadida 2022-05-04 02:18:32 -07:00
WarmUpTill
d47b878b56 Display next match time if repeat is selected 2022-04-24 09:45:22 -07:00
WarmUpTill
9105087036 Show update on repeat option only if repeat is selected 2022-04-24 09:45:22 -07:00
WarmUpTill
e26f41a1a8 Add option to preserve original date in combination with repeat option 2022-04-24 09:45:22 -07:00
WarmUpTill
ff513d8664 Fix cursor condition frame blocking mouse inputs 2022-04-24 06:28:28 -07:00
WarmUpTill
07f11c63f0 Don't allow manipulating area selection when highlighting match 2022-04-02 12:51:57 -07:00
WarmUpTill
6685a1ccaa Do not spam first time setup message 2022-04-02 09:14:26 -07:00
WarmUpTill
ecee919e0b Hide legacy tabs by default and adjust default tab order 2022-04-02 09:14:26 -07:00
WarmUpTill
e8c1b673c0 Allow accessing macro properties even without selecting any macro 2022-04-02 09:14:26 -07:00
WarmUpTill
1a8b185f7d Make date "At"-type check more robust
Previously the "At" check could skip the desired time window if e.g another
macro was performing a long wait wait action or condition was taking
a long time to check.
The date condition will now take into consideration when the last time
was the condition checked a date instead of simply applying a fixed
window of "switcher->interval".
2022-04-02 09:13:01 -07:00
WarmUpTill
eb8a9df627 Create cropped screenshot depending on selected area 2022-04-02 00:29:29 -07:00
WarmUpTill
123d308a0d Add option to select OSB' main video output 2022-03-29 10:02:44 -07:00
WarmUpTill
102b93d3b5 Fix deadlock when changing condition / action type
The video preview dialogs could not exit as the destructor was holding
the main mutex while joining the preview thread, which in turn was
waiting to get the access to the mutex to exit its main loop
2022-03-29 10:02:44 -07:00
WarmUpTill
eeceb7cbd9 Fix random action not being random 2022-03-27 11:45:50 -07:00
WarmUpTill
92add4f090 Update .gitignore 2022-03-26 15:55:48 -07:00
ubuntu
3ed7727c85 Fix warnings 2022-03-26 15:40:19 -07:00
ubuntu
a922d6a73d Add missing reordering of action widgets 2022-03-26 15:40:19 -07:00
WarmUpTill
9ba8a02a11 Add hotkey to move current macro segment selection up / down 2022-03-26 10:05:50 -07:00
WarmUpTill
e61539a878 Reuse macro segment widgets if possible 2022-03-26 10:05:50 -07:00
WarmUpTill
5a78c99703 Ignore delete hotkey if macro tab is not in focus 2022-03-26 10:05:50 -07:00
WarmUpTill
dbbcf04b8a Auto scroll during drag if touching top or bottom areas of list widget 2022-03-26 10:05:50 -07:00
WarmUpTill
6a8066795b Improve drag & drop behaviour of macro segments
- Depending on the drop position you can either drop before or after a
  widget
- Added a visual indicator where the macro segment will be dropped
2022-03-26 10:05:50 -07:00
WarmUpTill
e0763a4957 Improve performance for drag and drop
- Changing the style sheets for the selection frame dynamically considerably
  slowed down the handling of the mouse events.
  Instead two separate widgets with fixed style sheets are now used.
- Recreating the macro segments after dropping a widget took too much
  time leading to unresponsive drop operations
2022-03-26 10:05:50 -07:00
WarmUpTill
1ab9a38914 Selection idx handling was moved to macro segment list widget 2022-03-26 10:05:50 -07:00
WarmUpTill
a6ca266dab Fix potential crash / memory leak when clearing layouts 2022-03-26 10:05:50 -07:00
WarmUpTill
0a8f279e97 Rework macro segment list widget
- Allows drag and drop reorder
- Handles selection change
- Handles highlight
- Handles changing collapse change
- Handles add, insert, remove, and clear functionality
2022-03-26 10:05:50 -07:00
WarmUpTill
1b63978acb Add media seek action 2022-03-26 10:05:40 -07:00
WarmUpTill
8487ef4716 clean up locale 2022-03-26 10:05:40 -07:00
WarmUpTill
ddc2ee4fa5 Remove "Played to end" and replace it with "Playlist end" state
"Ended" can now be used to also detect the end of individual playlist
items.
2022-03-26 10:05:40 -07:00
WarmUpTill
11fede6cc3 Fix start streaming action only working every second attempt 2022-03-18 13:08:31 -07:00
WarmUpTill
1d45072c58 Recurse in setLayoutVisible() 2022-03-15 10:58:29 -07:00
WarmUpTill
d450210d39 Add option to visually select area to check 2022-03-15 10:58:29 -07:00
WarmUpTill
5462334693 Add option to perform video check only on parts of the video source
This will significantly reduce CPU usage if the video source larger than
the selected area and make it easier to only check parts of a video
source output image.
2022-03-15 10:58:29 -07:00
WarmUpTill
293d3dd16c Work around macro handle buttons not being redrawn
Not sure what exaclty causes this - investigating it further is not
worth the time at the moment
2022-03-12 06:35:59 -08:00
WarmUpTill
71b6ae4d78 Add additional settings dialog to macro tab
This settings dialog currently contains debug features to highlight
recently executed macros, actions and conditions.
2022-03-12 06:35:59 -08:00
WarmUpTill
69d6d63dfd Increase macroSplitter size by moving condition controls into handle 2022-03-12 06:35:59 -08:00
WarmUpTill
d693dbc844 Add highlighting of onChagne if actions were prevented recently 2022-03-12 06:35:59 -08:00
WarmUpTill
428e114a0a Highlight recently executed action and true conditions 2022-03-12 06:35:59 -08:00
WarmUpTill
001d8b4714 Move hightlight and update of paused state into MacroListEntryWidget 2022-03-12 06:35:59 -08:00
WarmUpTill
37734445e7 CI: Add automated check for invalid locale files
Also clean up issues found in the existing locale files
2022-03-05 17:09:58 -08:00
WarmUpTill
d1fe5beaeb Fix fade animation triggering unexpectedly for controls 2022-03-05 17:09:58 -08:00
WarmUpTill
036afb4a4f Add option to abort active fade when starting new fade 2022-03-05 15:38:46 -08:00
WarmUpTill
c87589d534 reduce duplicate code 2022-03-05 15:38:46 -08:00
WarmUpTill
1df513585d Add option to specifiy rate of change instead of duration for audio fade 2022-03-05 15:38:46 -08:00
WarmUpTill
e1bacd75b6 Move audio fade threads to generic _helperThreads of macro
This will allow waiting for and stopping audio fades when calling Stop()
for a particular macro
2022-03-05 15:38:46 -08:00
WarmUpTill
7095f4668c Rework wait action to support being interrupted by calling Stop() 2022-03-05 15:38:46 -08:00
WarmUpTill
8131ad3c24 Block when calling Stop() until macro is stopped 2022-03-05 15:38:46 -08:00
WarmUpTill
ac5b2c3f9e Rework handling of fade threads
Previous implementation did not allow ongoing fades to be stopped.
New implementations allows waiting for fade to complete.
2022-03-05 15:38:46 -08:00
WarmUpTill
a86f7d0fd4 Set background of openVR controls transparent 2022-03-05 07:40:14 -08:00
WarmUpTill
34736ffbda Update zh-CN locale (by qwe1154323937) 2022-03-05 01:19:48 -08:00
WarmUpTill
da28fea2e0 Fix potential freeze or crash with "Show match" dialog
This is a workaround to handle random segfaults triggered when using ...
QMetaObject::invokeMethod(this, "RedrawImage", -Qt::QueuedConnection,
		   Q_ARG(QImage, image));
... from within CheckForMatchLoop().
Even using BlockingQueuedConnection causes deadlocks.
2022-02-26 16:08:55 -08:00
WarmUpTill
b6b0531dbc Fix size ofi new collapsed segments containing ResizingPlainTextEdit 2022-02-26 16:08:55 -08:00
WarmUpTill
2de0a94756 Fix highlight animations never stopping 2022-02-26 16:08:55 -08:00
WarmUpTill
d018740442 Fix potential deadlock in ShowMatchDialog 2022-02-26 16:08:55 -08:00
WarmUpTill
d89f8a7972 Clear pixmap if screenshot creation failed 2022-02-26 16:08:55 -08:00
WarmUpTill
f7a2aa09cb Fix potential crash 2022-02-26 16:08:55 -08:00
WarmUpTill
04825e4b88 Fix warning 2022-02-26 08:23:10 -08:00
WarmUpTill
1cfd981245 Reduce text edit areas size of file, filter, source, transform segments 2022-02-26 08:23:10 -08:00
WarmUpTill
6fb8297275 Use QPropertyAnimation::DeleteWhenStopped PulseWidget() when once is set
Also fixes potential crash when waiting for single shot timer when
looping and widget and animations are deleted in the meantime
2022-02-26 08:23:10 -08:00
WarmUpTill
4253c99cf2 Fade out segment controls which will likely not be needed
This was done to give some hints which controls will likely need to be
used to avoid mistakenly clicking on the action controls when editing
conditions.
2022-02-26 08:23:10 -08:00
WarmUpTill
ae13a68cae Double click on list item in run and sequence action to edit 2022-02-26 08:23:10 -08:00
WarmUpTill
4e5aae7e5f
Add 'OBS stats' condition type (#414)
It supports various different types of stats:
* fps
* cpu
* ram
* frame time
* skipped frames
* missed frames
* dropped frames
* data size sent
* bitrate
2022-02-26 11:37:54 +01:00
WarmUpTill
88dff37776 Allow drag and drop reordering of macros 2022-02-24 14:15:23 -08:00
WarmUpTill
83df1ab658 Skip collapse animation if section is already in the desired state 2022-02-24 14:15:23 -08:00
WarmUpTill
5298b14803 Use name of macro to be copied in addNewMacro() dialog 2022-02-24 14:15:23 -08:00
WarmUpTill
eeedf11c6a Add hotkey to delete macro segments 2022-02-24 14:15:23 -08:00
WarmUpTill
89efb6d1c8 Allow selecting either an action or condition but not both 2022-02-24 14:15:23 -08:00
WarmUpTill
1054bce4a7 Remove slight movement of macro segment when (de-)selecting them 2022-02-24 14:15:23 -08:00
WarmUpTill
d3cbddf0a4 Allow selecting scene groups in preview scene change action 2022-02-24 14:15:05 -08:00
WarmUpTill
a91fed1583 Simplify waitForTransitionChange()
Will now also work if the target scene is the already currently active
scene.
2022-02-24 14:15:05 -08:00
WarmUpTill
c94a791d19 Allow switching to already active scene if in studio mode
Preview and program scene can differ in regards to the active scene
items.
Thus it can make sense to switch to the already active scene.
2022-02-24 14:15:05 -08:00
WarmUpTill
02e380a9f2 Allow selecting current and previous scene in preview scene action 2022-02-24 14:15:05 -08:00
WarmUpTill
4349a98614 CI: Switch to Visual Studio 17 2022 2022-02-22 11:40:33 -08:00
WarmUpTill
f294283306 CI: Bump OBS version 2022-02-21 12:09:23 -08:00
WarmUpTill
cc9d5897da Add deprecation warning for legacy tabs 2022-02-20 04:50:12 -08:00
WarmUpTill
8e3eb8519b Fix potential crashes when adding or removing macro segments
I wrongly assumed that std::deque would guarantee that pointers to
elements in deque would not be invalidated by insert() or erase() but
this is not the case it seems.

""
An erase in the middle of the deque invalidates all the iterators and
references to elements of the deque. An erase at either end of the deque
invalidates only the iterators and the references to the erased
elements.
""

I guess I got lucky noone ran into these sorts of crashes for now?
2022-02-20 04:50:12 -08:00
WarmUpTill
354ef56070 Do not select any item if pressing add without any active selection 2022-02-20 04:50:12 -08:00
WarmUpTill
352dac5e32 Add MacroSegmentList to allow deselecting items
Previously once a macro segement was selected you could only deselect it
by clicking on different macro segment, thus never allowing the user to
deselect all macro segments
2022-02-20 04:50:12 -08:00
WarmUpTill
584fe4b3b6 Copy logic type when adding conditions 2022-02-20 04:50:12 -08:00
WarmUpTill
bdd489aea5 Fix crashes related to PulseWidget()
* Fix crash if widget was deleted during animation
* Fix crash if multiple animations were started at the same time
2022-02-20 04:50:12 -08:00
WarmUpTill
0b2e725471 Do not run collapse animation when calling SetContent() 2022-02-20 04:50:12 -08:00
WarmUpTill
45e8378021 Remove old macro segment controls 2022-02-20 04:50:12 -08:00
WarmUpTill
955f308c59 Add list-like controls to macro actions and conditions 2022-02-20 04:50:12 -08:00
WarmUpTill
2c25bb4dd4 Make slider background transparent
Sliders, e.g. in the video condition, would otherwise block parts of the
highlight frame around macro segments.
2022-02-18 13:40:33 -08:00
WarmUpTill
d8dcd91ed9 Split video condition into multiple files 2022-02-18 13:40:33 -08:00
WarmUpTill
03900e936b Rename class AdvSSScreenshotObj to ScreenshotHelper 2022-02-18 13:40:33 -08:00
WarmUpTill
6d2360eb87 Clean up AdvSSScreenshotObj usage in video condition 2022-02-18 13:40:33 -08:00
WarmUpTill
ab4a70a758 Refresh contents of "Show match" dialog every second 2022-02-18 13:40:33 -08:00
WarmUpTill
b48276bd5c Add option to check for OBS shutdown to MacroConditionPluginState 2022-02-18 13:35:15 -08:00
WarmUpTill
34167366db Add day of week based check to date condition 2022-02-12 17:57:35 -08:00
WarmUpTill
bfa8f4d9d5 Visually clean up date condition
- add "and" separator if "between" check is chosen
- split dateTimeEdit into a dateEdit and a timeEdit to make editing
  easier
- move ignore* checkboxes in front of respective edit widgets to make
  their intention more clear and add tooltips to further clarify their
  use
2022-02-12 17:57:35 -08:00
WarmUpTill
f8e3a3e275 CI: Fix MacOS build
Packages version bump
2022-02-10 12:19:56 -08:00
WarmUpTill
1328896801 Reopen last opened tab in current session
Will reset to General tab on startup / scene collection change
2022-02-10 11:29:44 -08:00
WarmUpTill
0effbd8ace Add context menu entry for expanding and collapsing edit areas 2022-02-04 11:38:42 -08:00
WarmUpTill
08a8157f3a Reduce spacing between macro segments 2022-02-04 11:38:42 -08:00
WarmUpTill
262bb3f1ee Keep size of individual macro sgements consistent
Previously the segments would expand if there was still room in the
condition and action area.
2022-02-04 11:38:42 -08:00
WarmUpTill
415f63c46c Fix warnings generated about missing icons 2022-02-04 11:38:42 -08:00
WarmUpTill
0771f939a6 Restore original color after PulseWidget() completes 2022-02-04 11:38:42 -08:00
WarmUpTill
a81ee605d6 Rename function 2022-02-04 11:38:42 -08:00
WarmUpTill
1e7726bcfc Add option to highlight recently executed macros on the Macro tab 2022-02-04 11:38:42 -08:00
WarmUpTill
dc698e426d Add MacroListEntryWidget
To be used for macro tab's macro list as regular QListWidgetItem are too
limited
2022-02-04 11:38:42 -08:00
WarmUpTill
a4f66dbbcd Fix warnings 2022-02-04 11:38:42 -08:00
WarmUpTill
1516b9a939 Add option to hide legacy tabs 2022-02-04 11:38:42 -08:00
WarmUpTill
e13f20c860 Adding frame highlighting individual macro segments 2022-02-04 11:38:42 -08:00
WarmUpTill
727992f1d0 Clean up stylesheet usage 2022-02-04 11:38:42 -08:00
WarmUpTill
4e75a15118 Clean up unnecessary variable 2022-02-04 11:38:42 -08:00
WarmUpTill
48368f4bd6 Move vertical / horizontal control handling to macro segment 2022-02-04 11:38:42 -08:00
WarmUpTill
61d9031933 Add option to toggle between vertical and horizontal macro controls 2022-02-04 11:38:42 -08:00
WarmUpTill
487c735e13 Delay show and hide of macro controls 2022-02-04 11:38:42 -08:00
WarmUpTill
7a34c334bd Highlight macro segments new position when moving it up or down 2022-02-04 11:38:42 -08:00
WarmUpTill
4988683e22 Resize conditions and actions areas on expand / collapse all 2022-02-04 11:38:42 -08:00
WarmUpTill
cb681643c8 Fix scene switch action blocking unexpectedly
If "wait for transition" was checked and no valid scene was selected the
waitForTransitionChange() function will wait for its maximum allowed
duration as switcher->currentScene will never be null.
2022-02-02 09:55:35 -08:00
WarmUpTill
d79e10ec97 Add tr-TR.ini locale (Provided by dargat) 2022-01-30 19:15:49 +01:00
WarmUpTill
af188b55df
Move plugins to separate folder (#400) 2022-01-29 15:47:16 +01:00
WarmUpTill
f287a1041d Add option to also check for configured volume level 2022-01-25 12:46:16 -08:00
WarmUpTill
fda9b1c3ea Fix dock location and size not saving correctly
OBS will handle the docking position / window size and position as long
as an object name is set
2022-01-25 10:33:41 -08:00
WarmUpTill
9eb7f58525 CI: Save debian build result 2022-01-25 10:33:02 -08:00
WarmUpTill
abd6fd6b7e
Add sequence action (#395) 2022-01-22 18:07:26 +01:00
WarmUpTill
2909b1300e Fix empty statusControl of general tab blocking mouse input 2022-01-22 06:14:03 -08:00
WarmUpTill
d1331a60b9 Fix crash on exit caused by status dock 2022-01-22 06:14:03 -08:00
WarmUpTill
d5fc3befb8 Remove QtConcurrent dependency 2022-01-22 06:14:03 -08:00
WarmUpTill
80f9c79907 CI: Bump windows QT version to 5.15.2 2022-01-22 06:14:03 -08:00
WarmUpTill
e4bd1fc180 Reduce amount of signals emitted on repopulate 2022-01-22 06:14:03 -08:00
WarmUpTill
59c87ca027 Emphasize that a duration of 0s means using default duration 2022-01-21 09:51:00 -08:00
WarmUpTill
eda161de39 Sort condition and action selection alphabetically 2022-01-21 09:51:00 -08:00
WarmUpTill
6033426a6e Enable word wrap for macro priority warning 2022-01-21 09:51:00 -08:00
WarmUpTill
caea16c6ad Hide selected macro for run or stop action
Running a macro from within itself is not supported and stopping it from
withint itself does not seem useful either.
2022-01-21 09:51:00 -08:00
WarmUpTill
e3a39a5df7 Add label clarifying the condition's intent 2022-01-21 09:51:00 -08:00
WarmUpTill
38b7e08711 Add macro action to stop other macros 2022-01-21 09:51:00 -08:00
WarmUpTill
7349841758 Fix unexpectedly returning true for hotkey condition
The condition would return true after unpause, if a configured hotkey was pressed
during the time the macro was paused.
2022-01-21 09:50:19 -08:00
WarmUpTill
5d58269b02 Add function to access parent macro from condition or action 2022-01-21 09:50:19 -08:00
WarmUpTill
8a4aef0f50
Update bug_report.md 2022-01-19 20:22:26 +01:00
WarmUpTill
4b877d865c
Add issue templates 2022-01-16 19:43:51 +01:00
WarmUpTill
82503286ea Use the same widget for main settings window and status dock 2022-01-14 09:11:36 -08:00
WarmUpTill
16ee789c82 Add option to perform macro actions only on condition change 2022-01-06 08:41:18 -08:00
WarmUpTill
d040a01016 Reintroduce checkbox to change current scene check transition behaviour 2022-01-06 08:41:18 -08:00
WarmUpTill
eb952afe58 Enable time constraints for transition condition 2022-01-06 08:41:18 -08:00
WarmUpTill
34cff925fc
CI: No longer query for 32 bit OBS install path 2022-01-05 20:21:03 +01:00
WarmUpTill
016d963598 Fix volume not changing when selecting fade with a duration of 0s 2022-01-04 19:32:53 -08:00
WarmUpTill
d31ae77176 Run macros even if they are paused when pressing "Run Macro" 2022-01-04 19:32:53 -08:00
WarmUpTill
2c1b97e5cd Abort macro early if it was paused 2022-01-05 03:39:37 +01:00
WarmUpTill
c498d1509a Adjust locale 2022-01-05 02:54:39 +01:00
WarmUpTill
2d61189655 Display message on first boot 2022-01-04 17:16:38 -08:00
WarmUpTill
82c20b871b Don't ask to backup settings if there is nothing to backup 2022-01-04 17:16:38 -08:00
WarmUpTill
bd52ef8e84 Don't abort build if OpenVR cannot be found 2022-01-04 15:50:26 -08:00
WarmUpTill
59e1ddd31e Add openvr condition 2022-01-04 15:50:26 -08:00
WarmUpTill
a320d78a08 Separate OpenCV dependency into its own lib
This should avoid issues of the whole plugin not loading if OpenCV is
not available.
This approach should also work for possible future external
dependencies.
2022-01-03 18:22:02 -08:00
WarmUpTill
ce5730428c Remove unnecessary uses of UNUSED_PARAMETER macro 2022-01-03 13:48:21 -08:00
WarmUpTill
f7b9795014 Add option to check if source is muted 2022-01-03 13:48:21 -08:00
WarmUpTill
3417fc5407 Add status dock 2022-01-03 11:32:22 -08:00
WarmUpTill
2649efe8b3 Adjust to SceneItemSelection and SceneItemSelectionWidget 2022-01-03 08:52:32 -08:00
WarmUpTill
3af5897427 Rename function 2022-01-03 08:52:32 -08:00
WarmUpTill
92877a6b30 Add SceneItemSelection and SceneItemSelectionWidget
Allows selecting individual scene items if there are duplicate entries
for the same source.
2022-01-03 08:52:32 -08:00
WarmUpTill
fbdaffcbf6 Clean up formatJsonString() 2022-01-03 08:52:32 -08:00
WarmUpTill
ba111c6caa Add action to import settings from file 2022-01-01 18:26:40 -08:00
WarmUpTill
5c8760ac0a Add action to switch scene collection 2022-01-01 18:26:40 -08:00
WarmUpTill
e0cca2a0d4 Add action to switch profile 2022-01-01 18:26:40 -08:00
WarmUpTill
d69aba8ab7 Remove dependency to SceneSwitcherEntry and SwitchWidget 2021-12-28 05:07:37 -08:00
WarmUpTill
a2ba7adc56 Add option to wait for transition to complete 2021-12-28 05:07:37 -08:00
WarmUpTill
0881146a25 Fix startup behavior not loading correctly 2021-12-22 13:12:41 -08:00
WarmUpTill
5224d6589e Reduce log output when running macro in background 2021-12-22 13:12:27 -08:00
WarmUpTill
15eeec8ebf Add condition "Studio Mode"
Can be used to check whether or not studio mode is active or to check
the current preview scene
2021-12-22 13:12:27 -08:00
WarmUpTill
ed7f375d64 Fix crash when reordering macros 2021-12-22 13:12:27 -08:00
WarmUpTill
82da6b3217 Update locale of "cooldown" and "no match" behaviour 2021-12-06 11:44:52 -08:00
WarmUpTill
8d83df9034 Add warning if macro functionality is not running with highest priority 2021-12-06 10:27:20 -08:00
WarmUpTill
0029977ae1 Adjust and move default priorities
New users will be confused if their macros are not executed,
if they are "blocked" by other scene switching methods.
2021-12-06 10:27:20 -08:00
WarmUpTill
0a481b3e31 Add example to data folder instructions for Linux 2021-12-04 08:32:52 -08:00
WarmUpTill
70b3c2e240 Workaround OpenCV MacOS build issue 2021-12-04 08:32:52 -08:00
WarmUpTill
1785035b96 Fix warnings 2021-12-04 08:32:52 -08:00
WarmUpTill
69ab101ba3 Fix header info for media and transition condition 2021-12-04 08:32:52 -08:00
WarmUpTill
d1e752cda1 Remove Linux workaround 2021-12-04 08:32:37 -08:00
WarmUpTill
e9d366f2b9 Update readme to include flatpak 2021-12-04 04:32:29 -08:00
WarmUpTill
b168518c60 Update zh-CN locale (provided by qwe1154323937) 2021-12-04 04:32:29 -08:00
WarmUpTill
845506f7e4 Allow running macros in parallel to other macros 2021-12-04 04:09:30 -08:00
WarmUpTill
9dd47b811b Add button to manually run macro actions 2021-12-04 04:09:30 -08:00
WarmUpTill
eafad7fe7f Add option to match any or all media sources of a specific scene 2021-12-04 04:04:55 -08:00
WarmUpTill
f36062859d Allow setting random duration in specified range 2021-12-04 03:37:46 -08:00
WarmUpTill
949e26781a Enable screenshots of scenes 2021-12-04 03:37:08 -08:00
WarmUpTill
2d70fbac36 Add compatability check for screenshot functionality 2021-12-04 03:37:08 -08:00
WarmUpTill
bb954a2e9a Add macro action for triggering screenshots 2021-12-04 03:37:08 -08:00
WarmUpTill
631423a251 Add condition to check if the plugin is running
This will only ever return true as the plugin cannot perform checks if
it is not running.
This is intended to be used in cases where it can be useful to trigger
actions once the plugin was stopped and restarted or if one wants to
perform actions after a certain amount of plugin "uptime".
2021-12-01 11:38:38 -08:00
WarmUpTill
c527f15744 Add hotkey to toggle pause state of macros 2021-12-01 09:23:04 -08:00
WarmUpTill
8fdacc3ef7 Suggest file name when saving settings 2021-11-28 09:57:30 -08:00
WarmUpTill
02918785ba Hide waitForTransition option if waiting for transition
The additions to the transition condition to check for target and source
scene of a ongoing transition fullfill the same role and this option
does not really fit the current scene check anyways.
2021-11-28 09:56:50 -08:00
WarmUpTill
2d9e6bcaa2 Add transition option to check for transition source and target scene 2021-11-28 09:56:50 -08:00
WarmUpTill
f2570e1deb Add the option to execute another macro's actions 2021-11-28 09:56:37 -08:00
WarmUpTill
f9afbcbc59 Add macro action to display system tray notifications 2021-11-28 09:56:17 -08:00
WarmUpTill
51b4ef326d Add fallback using QDesktopServices::openUrl() for "run" action
Users not familiar with launching processes with arguments might expect
the run action to behave like clicking on icons on the desktop and be
frustrated if the "file is not being opened".
Thus introducing this fallback might help some users out.
2021-11-23 11:11:41 -08:00
WarmUpTill
ad08df3d2f Clean up adding new macros to Random action 2021-11-23 11:11:41 -08:00
WarmUpTill
4d32e921f9 Resize list to minimum necessary height 2021-11-23 11:11:41 -08:00
WarmUpTill
5dfed8ac2a CI: Switch to OBS 27.1.3 2021-11-20 05:37:57 -08:00
WarmUpTill
d7102d395e Ensure contents of comboboxes are readable when changing scene/filter 2021-11-20 03:52:54 -08:00
WarmUpTill
82a41694a1 Allow interacting with OBS main window while plugin settings are opened 2021-11-20 03:52:54 -08:00
WarmUpTill
a1cae263c1
Add macro action "random" (#353)
This should be expanded upon by adding the ability to add weights to each macro.
2021-11-20 12:52:12 +01:00
WarmUpTill
cce6e240c2 Add option to fade in/out volume change 2021-11-17 12:30:10 -08:00
WarmUpTill
9d04b4d1a0 Move setLayoutVisible() to utility 2021-11-17 12:30:10 -08:00
WarmUpTill
fd7e48eff9 Add scene-visibility macro condition 2021-11-17 12:29:57 -08:00
WarmUpTill
0350a46004 Allow use of "previous scene" 2021-11-17 12:29:57 -08:00
WarmUpTill
00fec4b573 Fix macro hotkeys not working 2021-11-17 12:29:41 -08:00
WarmUpTill
c40a3af8ca Fix add, delete, reorder not working when changing macro segment type 2021-11-17 12:06:53 -08:00
WarmUpTill
e452d8cc8c Allow selecting source type for scene visibility action
This should allow to simplify some setups which required showing /
hiding all sources of a particular type.
2021-11-12 10:05:54 -08:00
WarmUpTill
fbc9818764 Fix macro count not updating correctly
The underlying issue are the potential deadlocks when triggering
frontent function calls while saving / loading is triggered in parallel
like it can happen when switching scene collections.

Hopefully the new frontend events allow for a cleaner solution.
2021-11-12 10:05:11 -08:00
WarmUpTill
5ef09f661f Show warning if macro is paused
And clean up timer handling for this condition type
2021-11-12 10:05:11 -08:00
WarmUpTill
2155a942f3 Do not check conditions of paused macros 2021-11-12 10:05:11 -08:00
WarmUpTill
5af206da60 Fix typo 2021-11-09 10:24:14 -08:00
WarmUpTill
924f68df64 Fix typo 2021-11-07 11:14:25 +01:00
WarmUpTill
2f3c4a6dae Cleanup 2021-11-06 22:30:26 +01:00
WarmUpTill
f955c07bda Fix warnings 2021-11-01 11:23:43 -07:00
WarmUpTill
6f1cd3cbcc Enable building without opencv 2021-11-01 11:23:43 -07:00
WarmUpTill
95537f39e4
Switch to using process names for process condition and executable tab (#337)
Previously the process condition and executable tab were just reusing
the window title functionality.
2021-10-31 14:05:54 +01:00
WarmUpTill
0490c97ad9 Add option to use pattern matching for "output changed" condition
This will allow you to ignore minor changes in the video output, for
example in noisy video streams.
2021-10-31 06:05:16 -07:00
WarmUpTill
4b17314c66 Add conditions "stream starting" and "stream stopping" 2021-10-31 05:40:28 -07:00
WarmUpTill
7459793fe3 Improve missing data dir error 2021-10-30 11:40:34 -07:00
WarmUpTill
8a39a859be Remove whitespace 2021-10-30 11:40:26 -07:00
WarmUpTill
f8a592f17a CI: Update readme 2021-10-30 11:40:26 -07:00
WarmUpTill
f824ac8f4e Add option to display plugin running state in system tray 2021-10-30 11:40:10 -07:00
WarmUpTill
8e9323173a CI: Run builds on tag creation also 2021-10-28 14:38:25 -07:00
WarmUpTill
9bc59c1082 Add option to not save remaining time 2021-10-25 11:19:53 -07:00
WarmUpTill
8b9f03a349 Add timer action
This action can be used to control the state of the timers on macro
conditions
2021-10-23 13:54:26 -07:00
WarmUpTill
093b0f9ec0 Add pause / continue and save / load remaining time for time condition 2021-10-23 13:54:26 -07:00
WarmUpTill
254eabfa8d Fix exact image match not wokring when using images with alpha channel
The screenshots taken from video sources were using the image format
Format_RGBX8888 instead of Format_RGBA8888.
The alpha channel of screenshots taken from OBS would be blended with a
black background while this step would be not performed for files loaded
to macht match the video sources.
2021-10-23 13:54:15 -07:00
WarmUpTill
b2da8faf37 Improve performance by not creating pattern data each interval 2021-10-23 13:54:15 -07:00
WarmUpTill
3eba20e2d8 Add option to use alpha channel as mask for pattern match 2021-10-23 13:54:15 -07:00
WarmUpTill
08841aa88e Use duration control class / widget for scene triggers 2021-10-23 13:53:56 -07:00
WarmUpTill
2e96c226b5 Improve performance of expand / collapse all 2021-10-23 13:53:56 -07:00
WarmUpTill
c34308f743 Fix scroll position being lost when adding or removing macro segments 2021-10-23 13:53:56 -07:00
WarmUpTill
4af07d9d55 Fix incorrectly set start scene type when extending scquence with groups
This would result in extended sequences being aborted early whenever one
would try to extend after a scene group entry
2021-10-23 13:53:56 -07:00
WarmUpTill
d743260ca8 Add wait for transition to complete option for currrent scene check
Previous behaviour was to always wait for the transition to complete, as
switcher->currentScene is only updated on
OBS_FRONTEND_EVENT_SCENE_CHANGED.
2021-10-23 13:53:56 -07:00
WarmUpTill
8ff50056f0 Fix crash when switching scene collection during macro wait
Also update comment stating why the main mutex needs to be unlocked
during the "action" phase of running macros
2021-10-23 13:53:56 -07:00
WarmUpTill
b786831f3b Remove unnecessary return value check 2021-10-23 13:53:56 -07:00
WarmUpTill
32e2a5f44c Add git tag to version info 2021-10-19 13:02:15 -07:00
WarmUpTill
e3f277c32a Reword date repeat option 2021-10-19 13:01:24 -07:00
WarmUpTill
5a7d76061c Clean up general tab
- Remove unnecessary spacer next to priority list
- Remove horizontal line in General behviour section
2021-10-19 13:01:01 -07:00
WarmUpTill
39a8c34fa6 Add description for the "min neighbors" parameter 2021-10-09 08:08:15 -07:00
WarmUpTill
ead51e2f13 Fix minNeighbors parameter not loading correctly 2021-10-09 08:08:15 -07:00
WarmUpTill
3b465e1fdc Fix crash while loading haar cascade 2021-10-03 12:30:45 -07:00
WarmUpTill
26fd26051b CI: Run on ubuntu-latest 2021-10-03 11:11:53 -07:00
WarmUpTill
08933a3683 Add transition condition 2021-10-03 07:51:09 -07:00
WarmUpTill
9be00ba3ca Rework to use transition selection widget 2021-10-03 07:51:09 -07:00
WarmUpTill
cce15529fe Adjust return type 2021-10-03 07:51:09 -07:00
WarmUpTill
588f90f0b1 Add transition selection widget 2021-10-03 07:51:09 -07:00
WarmUpTill
d3220c40dc Add any transition selection in populate function 2021-10-03 07:51:09 -07:00
WarmUpTill
79c659b4fa Reduce logging 2021-10-03 01:38:08 -07:00
WarmUpTill
292adb990d Add option to throttle object and pattern recognition 2021-10-03 01:38:08 -07:00
WarmUpTill
b7a0f6c5d0 Add object detection option 2021-10-03 01:38:08 -07:00
WarmUpTill
b3f1aff03c Add file selection widget
Rework the following macro conditions and actions to use this widget:
 - file action
 - run action
 - file condition
2021-10-03 01:38:08 -07:00
WarmUpTill
aea9d1b319 Update build instructions 2021-10-03 01:38:08 -07:00
WarmUpTill
1fd724e4f4 Include OpenCV in build 2021-10-03 01:38:08 -07:00
WarmUpTill
3d1c613f1c Add pattern match using openCV 2021-10-03 01:38:08 -07:00
WarmUpTill
9ca2f4470b Add opencv as submodule 2021-10-03 01:38:08 -07:00
WarmUpTill
34527b08a9 Fix crash in getSourceSettings() 2021-10-02 14:14:57 -07:00
WarmUpTill
3ae1050488 CI: Switch to obs tag 27.1.1 2021-09-30 12:13:15 -07:00
WarmUpTill
d7ec7c6e40 Limit key press to OBS by default on MacOS 2021-09-30 10:42:57 -07:00
WarmUpTill
e98ee64974 Set canSimulateKeyPresses to false on Macos (not implemented) 2021-09-30 10:42:57 -07:00
WarmUpTill
7c6428b27e Include press duration option and option to limit key press to OBS 2021-09-30 10:42:57 -07:00
WarmUpTill
aca9b84fc6
Fix rapid scene switch restarting certain transitions (#313)
When using certain transition types repeated scene switches to the same target scene will restart a transition that is already in progress.
This can be avoided by using obs_frontend_get_current_scene() instead of switcher->currentScene during the check if the target scene is already active.
obs_frontend_get_current_scene() will already point to the new scene, even if the transition is still in progess, while switcher->currentScene will only be updated once a transition is finished.
2021-09-26 14:04:01 +02:00
WarmUpTill
d397f5e406 Add transition action 2021-09-19 05:15:49 -07:00
WarmUpTill
97cbcd7e61 Add condition "scene has not changed" 2021-09-18 10:21:54 -07:00
WarmUpTill
64fd8dd50d Add "apt update" calls 2021-09-18 10:21:35 -07:00
WarmUpTill
a0dd1cf3ef Remove unused variable 2021-09-16 10:27:32 -07:00
WarmUpTill
25cf51abea Add option to specify lib and data install location 2021-09-13 12:50:10 -07:00
Joao Eriberto Mota Filho
3c8f5088d3 Fix word "unknown" 2021-09-13 10:58:39 -07:00
Joao Eriberto Mota Filho
66f3c74cf3 Fix some mistakes in debian CI test
Some mistakes found when packaging for Debian:
  - Remove trash from rules and enforce hardening.
  - Use the same licensing from Debian package to avoid a misinterpretation
    from FTP Master.
  - Fix target variable in debian/rules
2021-09-13 10:58:39 -07:00
WarmUpTill
6c23110fb9 Strip Linux binary debug symbols to reduce release artifact size 2021-09-12 11:09:00 -07:00
WarmUpTill
c9001df97c Add libxss-dev dependency 2021-09-12 11:09:00 -07:00
WarmUpTill
76fa1f8942 Add backward compatibility check to support OBS 25 2021-09-12 10:20:59 -07:00
Joao Eriberto Mota Filho
55ca146a82 Install missing obs-frontend-api.h 2021-09-12 10:20:59 -07:00
Joao Eriberto Mota Filho
a3625242de Create CI test for Debian packaging (in Ubuntu 20.04) 2021-09-12 10:20:59 -07:00
WarmUpTill
db4214c918 Remove dependency to <util/util.hpp> 2021-09-12 03:11:21 -07:00
WarmUpTill
f024199e2d Add backwards compatibility check 2021-09-12 03:11:21 -07:00
WarmUpTill
299e7bc868 Improve build instructions 2021-09-12 03:11:21 -07:00
WarmUpTill
0262e066bf Update cmake script to work better for out of tree builds
Use package name 'CURL' for out of tree builds.
Removed ObsPluginHelpers.cmake and FindLibObs.cmake as they disturbed
out of tree build.
2021-09-12 03:11:21 -07:00
WarmUpTill
bee75336d0 Add option to for macro condition scene to trigger on any scene change 2021-09-10 15:14:09 -07:00
WarmUpTill
96b472776a Remove unused variable 2021-09-10 15:14:09 -07:00
WarmUpTill
fb457f723a Add macro action scene swap 2021-09-10 14:21:29 -07:00
WarmUpTill
eee3e05c10 Add action to switch preview scene 2021-09-02 10:06:54 -07:00
WarmUpTill
ccc147a1b3 Fix empty paths not saving on file tab 2021-08-27 23:40:00 +02:00
WarmUpTill
45a149f6df Also save window geo when using ESC or the close button 2021-08-27 09:10:50 -07:00
WarmUpTill
076be21d40 Validate window position before setting it 2021-08-27 09:10:50 -07:00
WarmUpTill
ab5bdb32f5 Highlight newly added macro segments 2021-08-27 08:43:28 -07:00
WarmUpTill
8cfed048cc Create copy of previous macro segment when inserting new segment 2021-08-27 08:43:28 -07:00
WarmUpTill
c842595214 Add "size" section to scene item transform info 2021-08-27 08:43:08 -07:00
WarmUpTill
8fa3e8b038 Fix crash on clicking "Get settings" if source or filter is null 2021-08-27 08:43:08 -07:00
WarmUpTill
174c17edea Escape settings when pressing "Get settings" and regex is active 2021-08-27 08:43:08 -07:00
WarmUpTill
9d8fadda80 Remove unused include 2021-08-27 08:43:08 -07:00
WarmUpTill
58028d3c3d Add macro condition "scene transform" 2021-08-27 08:43:08 -07:00
WarmUpTill
3dcabe543f Add matchJson(), escapeRegex() move TransformState functions to utility 2021-08-27 08:43:08 -07:00
WarmUpTill
1a7ebc5569 Fix warning 2021-08-19 12:56:34 -07:00
WarmUpTill
522ab2963e Fix typo 2021-08-19 12:56:34 -07:00
WarmUpTill
d9bd98ce9c Parallelize windows build 2021-08-19 12:56:34 -07:00
WarmUpTill
2af0735a2f Expand date condition functionality
The date condition now supports the condition types "after", "before"
and specifying a time range.
2021-08-12 11:01:45 -07:00
WarmUpTill
556943c293 Fix writing current scene to file 2021-08-11 12:49:07 -07:00
WarmUpTill
e3004184c4 Format json strings of user input and source settings
Source settings and user specified settings might use different json
formatting and thus not match even though the json contents match.

It might not be possible to do the formatting for regex strings so
revert to the originally specified settings string if it cannot.
2021-08-09 11:39:48 -07:00
WarmUpTill
7b2c2e91db Rename function 2021-08-09 11:39:48 -07:00
WarmUpTill
06ea7bf1d9 Fix crash when deleting macro with wait action
Note that this might still not be completely race free but should
improve the situation a lot.
2021-08-09 11:39:20 -07:00
WarmUpTill
1474509cb9
Fix extended sequence abort when using non-instant transitions 2021-07-30 00:47:40 +02:00
WarmUpTill
87aa8d3b40 Remove code used for backwards compatibility 2021-07-29 15:16:29 -07:00
WarmUpTill
d3e8b76fa6 Do not apply MouseWheelWidgetAdjustmentGuard to QScrollBars
Without this change, it will be annoying to interact with expanded
QComboBoxes and there should be no danger of accidentally modifying
macro settings by interacting with QScrollBars
2021-07-29 15:16:19 -07:00
WarmUpTill
99c9b1a4a2 Fix macro video condition save
Logic, collapsed state and time constraint were not saved for video
condition.
2021-07-24 23:47:24 -07:00
WarmUpTill
8c0aad4c96 Add note to network tab
The requirement of the scene names having to match extactly was not made
clear and caused some confusion.
2021-07-24 23:31:35 -07:00
WarmUpTill
c964ed04d3 Clean up includes 2021-07-22 09:40:31 -07:00
WarmUpTill
810235e0b7 Clean up duplicate code 2021-07-22 09:40:31 -07:00
WarmUpTill
e2b3563810 Rename files 2021-07-22 09:40:31 -07:00
WarmUpTill
76c5ec480b Add MacroSegment and MacroSegmentEdit to remove duplicate code 2021-07-22 09:40:31 -07:00
WarmUpTill
84e4b740a8 Prevent accidental edits of actions and conditions when scrolling 2021-07-22 09:40:31 -07:00
WarmUpTill
95409dfa26 Add option to expand or collapse all macro actions or conditions 2021-07-22 09:40:31 -07:00
WarmUpTill
058af0d3bb Move GetShortDesc() and GetId() to MacroSegment class 2021-07-22 09:40:31 -07:00
WarmUpTill
fd789b476b Persist collapse / expand state 2021-07-22 09:40:31 -07:00
WarmUpTill
3fc82df278 Handle macro control signals 2021-07-22 09:40:31 -07:00
WarmUpTill
d541356fd3 Add macro control widget 2021-07-22 09:40:31 -07:00
WarmUpTill
5c2adacca1
Update build instructions and readme(#267)
* Adjust build instructions

* Add install instructions

* Add note regarding QtConcurrent
2021-07-22 18:39:34 +02:00
WarmUpTill
7200668158 Add option to show frame 2021-07-19 12:13:29 -07:00
WarmUpTill
7cf7fd6112 Show current cursor position 2021-07-19 12:13:29 -07:00
WarmUpTill
41821cbeb2 Add macro condition that triggers if cursor position changed
Extend condition previously named "region"
2021-07-19 12:13:29 -07:00
WarmUpTill
9537579235 Rename macro condition "region" to "cursor" 2021-07-19 12:13:29 -07:00
WarmUpTill
40a701a934 Add "--recursive" option to "git clone" calls 2021-07-18 19:37:16 +02:00
WarmUpTill
6c8556c66c
Rework cmake and readme (#264)
* Add missing include

* Rework CMakeLists.txt to support out of tree builds

* Update build instructions

* Fix windows build issue and copy locale on Linux

* Update build instructions

* Add downloads section
2021-07-17 17:17:03 +02:00
WarmUpTill
a467dffd05 Fix crash on Fedora 2021-07-13 13:14:43 -07:00
WarmUpTill
497dbd89d4 Fix warning 2021-07-13 13:14:43 -07:00
WarmUpTill
0fdbce25a1 Clean up minor UI inconsistencies 2021-07-13 13:14:43 -07:00
WarmUpTill
7e3e621ae5 Log long condition checks 2021-07-03 09:12:30 -07:00
WarmUpTill
9dfbd266fc Set timeout for libcurl call 2021-07-03 09:12:30 -07:00
WarmUpTill
8d02f63c36 Adjust scene order condition to support current scene 2021-07-03 08:47:08 -07:00
WarmUpTill
f31c54fd72 Adjust scene condition to use SceneSelection 2021-07-03 08:47:08 -07:00
WarmUpTill
7719087065 Add TODO 2021-07-03 08:47:08 -07:00
WarmUpTill
0b175a41d1 Adjust scene transform action to support current scene 2021-07-03 08:47:08 -07:00
WarmUpTill
0824abc4f5 Adjust scene order action to support current scene 2021-07-03 08:47:08 -07:00
WarmUpTill
efef29603b Display all scene items when selecting "current scene" 2021-07-03 08:47:08 -07:00
WarmUpTill
034a1b0c93 Set current scene in handleSceneChange() and reuse it 2021-07-03 08:47:08 -07:00
WarmUpTill
86fefe1e9e Adjust scene visibility action to support current scene 2021-07-03 08:47:08 -07:00
WarmUpTill
0bc15b4c2d Add support for "current scene" to populateSceneSelection() 2021-07-03 08:47:08 -07:00
WarmUpTill
7cfa956b80 Move GetSceneGroupByName functions to scene-group.hpp 2021-07-03 08:47:08 -07:00
WarmUpTill
9670a01e1a Add scene selection class and widget 2021-07-03 08:47:08 -07:00
WarmUpTill
371f6daf5a Add macro condition "date" 2021-06-26 10:23:18 -07:00
WarmUpTill
1c141abd06 Fix plugin state action values being empty 2021-06-26 10:23:09 -07:00
WarmUpTill
13788c2dfa Fix warning 2021-06-26 10:23:09 -07:00
WarmUpTill
daf36365a8 Only use hardcoded libcurl paths as fallback 2021-06-26 10:23:09 -07:00
WarmUpTill
cea4df90b1 Check for invalid transition settings 2021-06-21 11:01:25 -07:00
WarmUpTill
80b824e0a7 Fix Macro slots not being connected properly
Problem was introduced when adding header info.

To avoid the issue in future forward signals of the main plugin window
via condition and action edit widgets instead of relying on parent()
being the main window.
2021-06-20 11:05:29 -07:00
WarmUpTill
0bfdc3890b Add macro action "file" 2021-06-19 12:30:47 -07:00
WarmUpTill
cc067de021 Expand macro action plugin-state to support changing no-match behaviour 2021-06-19 11:29:35 -07:00
WarmUpTill
57c0734ba6 Display more information about macros in collapsed state 2021-06-19 06:58:06 -07:00
WarmUpTill
913682e128 Add support for arguments for macro action "run" 2021-06-19 05:23:10 -07:00
WarmUpTill
92711c5798 Make cleaning of user input optional 2021-06-19 05:23:10 -07:00
WarmUpTill
80334088d0 Add option to only trigger window condition if foreground window changed 2021-06-19 05:22:50 -07:00
WarmUpTill
bdd9d12257 Add setPreconditions()
The idea is to avoid repeated calls to the same functions which lead to
the same outcome, but just calling them once in the precondition checks.

For now move repeated calls of GetCurrentWindowTitle() and ignoreWindow
checks to this function.
2021-06-19 05:22:50 -07:00
WarmUpTill
decee4647b Add macro action 'scene_transform' 2021-06-18 11:15:15 -07:00
WarmUpTill
4991e74a72 Format json string before showing it to user 2021-06-18 11:15:15 -07:00
WarmUpTill
baa158bb33 Add helper fromatJsonString()
obs_data_get_json() will now dump the json data in JSON_COMPACT format
which makes it rather difficult to read.
2021-06-18 11:15:15 -07:00
WarmUpTill
0975ffabfa Adjust log 2021-06-18 11:15:15 -07:00
WarmUpTill
beec7d5939 Move getSceneItemsWithName() to utility 2021-06-18 11:15:15 -07:00
WarmUpTill
1bf2a154e2 Add macro condition "replay_buffer" 2021-06-18 11:15:03 -07:00
WarmUpTill
aa691cf51c Remove outdated comment 2021-06-18 11:15:03 -07:00
WarmUpTill
8fc12bee99 Initialize hotkeys to OBS_INVALID_HOTKEY_ID 2021-06-18 11:15:03 -07:00
WarmUpTill
5e8a0f92ee Add note regarding planned removal of tabs 2021-06-18 11:14:47 -07:00
WarmUpTill
86029e8e0e Add macro condition "Hotkey" 2021-06-15 13:44:33 -07:00
WarmUpTill
a86d6f1f76 Fix macro refs pointing to wrong entry when reordering 2021-06-15 06:16:04 -07:00
WarmUpTill
8ef798c70c Add macro condition "scene item order" 2021-06-15 06:15:37 -07:00
WarmUpTill
efc8726054 Add macro action "scene item order" 2021-06-15 06:15:37 -07:00
WarmUpTill
7b72abb100 Move populateSceneItemSelection() to utility 2021-06-15 06:15:37 -07:00
WarmUpTill
311ee5d0a0 Add macro condition "timer" (previously known as "interval") 2021-06-15 06:15:25 -07:00
WarmUpTill
5e4258968a Allow matching of empty files 2021-06-14 01:39:27 -07:00
WarmUpTill
ae4e861f7f
Add macro action "hotkey" (#226) 2021-06-14 01:21:23 +02:00
WarmUpTill
d692444687 Add / extend macro filter condition / action 2021-06-13 15:14:57 -07:00
WarmUpTill
6976c98fd8 Fix regex value not saving / loading 2021-06-13 15:14:57 -07:00
WarmUpTill
75f8d0cb07 Move filter / source functions to utility 2021-06-13 15:14:57 -07:00
WarmUpTill
a7e03245bd Add macro condition "Macro" (previously "Count")
The macro condition "Macro" contains the condition type previously named
"Count" and also add the options to check the condition state of other
macros.

This allows nesting of macro conditions.
For example the following can now be configured using this new option:

"If (scene 1 or scene 2 or scene 3 is active) for at least x amount of
time"
2021-06-13 10:25:48 -07:00
WarmUpTill
056e7ef737 Rename files 2021-06-13 10:25:48 -07:00
WarmUpTill
675c23d7cc Place extended sequence widget in scroll area
The previously fixed size only allowed extending the sequence depending
on the available screen space
2021-06-13 10:25:31 -07:00
WarmUpTill
c4b66ef7f6 Fix warnings 2021-06-13 10:25:31 -07:00
WarmUpTill
5cae1bca41 Add macro condition "virtual camera" 2021-06-13 10:25:20 -07:00
WarmUpTill
407d338b8b Add macro action "virtual camera" 2021-06-13 10:25:20 -07:00
WarmUpTill
edd9f18de0
Add scene trigger to control virtual camera (#162) 2021-06-13 19:25:02 +02:00
WarmUpTill
c9769a799d Abort macro if wait was aborted by manual scene change 2021-06-09 12:51:19 -07:00
WarmUpTill
047ca93486 Clean up 2021-06-06 19:05:55 +02:00
WarmUpTill
bd00a3f97e Remove preprocessing / todo 2021-06-04 08:31:28 -07:00
WarmUpTill
72f67705ed Collapse time restriction to clock symbol if no restriction is set 2021-06-03 10:19:19 -07:00
WarmUpTill
38161f63a3 Add helper getDataFilePath()
Used to get absolute file path to files in the plugin's data directory
2021-06-03 10:19:19 -07:00
WarmUpTill
b9f6e47a49 Add backwads compatability check to load() of DurationConstraint 2021-06-03 10:19:19 -07:00
WarmUpTill
c82c56dbb7 Remove {{duration}} placeholder text where longer needed 2021-06-03 10:19:19 -07:00
WarmUpTill
326cc0c46f Add generic time constraint to macro conditions
Almost every macro condition can benefit from having the option to
specify a time constraint.
Instead of adding it to each condition separately add it to all
conditions with the option of excluding it when registering a new
condition type.
2021-06-03 10:19:19 -07:00
WarmUpTill
d9997d374d Add option to un-/pause macros using hotkeys 2021-05-30 11:05:44 -07:00
WarmUpTill
c18d799f4a Remove comment 2021-05-30 11:05:12 -07:00
WarmUpTill
fdb72629db Do not trigger resize if section is collapsed 2021-05-30 11:05:12 -07:00
WarmUpTill
7fda5e3820 Fix empty selection not showing correctly for visibility and filter 2021-05-30 11:05:12 -07:00
WarmUpTill
78966e456a Fix empty selection not showing correctly 2021-05-29 15:51:22 -07:00
WarmUpTill
49a042039e Add ability to set source settings to macro action "source" 2021-05-29 06:48:18 -07:00
WarmUpTill
adb266927f Move getSourceSettings() to utility 2021-05-29 06:48:18 -07:00
WarmUpTill
703f24b8fc Remove unused include 2021-05-29 06:48:18 -07:00
WarmUpTill
de6120c401 Save and load source settings 2021-05-29 06:48:18 -07:00
WarmUpTill
b1f7a255d5 Use same collapse threshold for actions and sources
Actions and conditions are no longer in fixed positions and instead
divided by a separator.
2021-05-29 06:47:16 -07:00
WarmUpTill
d112e92d33 Add scenes with filters to source selection for filter action 2021-05-29 06:47:16 -07:00
WarmUpTill
5c4dd6dae1 Set "select <xyz>" to disabled and sort selection alphabetically 2021-05-29 06:47:16 -07:00
WarmUpTill
546a83ee07 Add macro action "plugin-state" 2021-05-28 10:23:35 -07:00
WarmUpTill
09ab29b4ba Trigger resize of widget 2021-05-28 10:23:24 -07:00
WarmUpTill
86d4e59dc2 Adjust to section widget rework 2021-05-28 10:23:24 -07:00
WarmUpTill
bf03edd391 Adjust size constraints of macro condition / action layouts
The reason for this change is that the macro condition "source" was
introduced which can change its required size drastically depending on
which condition type is selected.
2021-05-28 10:23:24 -07:00
WarmUpTill
aa7714210a Rework section widget to support dynamically sized content 2021-05-28 10:23:24 -07:00
WarmUpTill
2454ea8fa5 Add macro condition "source" 2021-05-28 10:23:24 -07:00
WarmUpTill
a5edbc8b88 Reset macro counters when stopping the plugin 2021-05-27 12:05:44 -07:00
WarmUpTill
ec6cffcd6a Rename MacroActionPause and add action to reset macro counter 2021-05-27 12:05:44 -07:00
WarmUpTill
89849a0792 Rename files 2021-05-27 12:05:44 -07:00
WarmUpTill
48e6bcbb7a Fix conditions and actions referencing macros not loading correctly
The reason is that while loading the required macro might not have been
loaded resulting in the pointer to the macro never being set correctly
in the loading phase.
2021-05-27 12:05:44 -07:00
WarmUpTill
6893d9539e Add MacroSelection widget 2021-05-27 12:05:44 -07:00
WarmUpTill
4a84bede37 Add macro condition "count" 2021-05-27 12:05:44 -07:00
WarmUpTill
77642c54d8 Add macro count member
Used to indicate the number of times the actions were executed.
2021-05-27 12:05:44 -07:00
WarmUpTill
069b0f89d0 Adjust locale 2021-05-27 12:05:32 -07:00
WarmUpTill
e517fa7b39 Sort source selection alphabetically 2021-05-27 12:05:32 -07:00
WarmUpTill
9301713c49 Add option to not scene change msg via network tab 2021-05-25 10:18:36 -07:00
WarmUpTill
66285a0d3d Add option to synchronize preview scene via network tab 2021-05-25 10:18:36 -07:00
WarmUpTill
e83a9e8d94 Clean up
No need to pass switcher as parameter
2021-05-25 10:18:36 -07:00
WarmUpTill
881e197cb2 Fix visibility of scene items in groups not changing
Also allow groups to be selected as target for visibility action
2021-05-24 07:30:24 -07:00
WarmUpTill
e7f031641f Add warning for macro action source 2021-05-24 07:29:56 -07:00
WarmUpTill
198a5dc1ec Move AskBackup() 2021-05-24 07:29:56 -07:00
WarmUpTill
5496c256c0 Move functions not required in advanced-scene-switcher.hpp
Create header for platform specific functions.
Move some UI helper functions to utility.hpp.
2021-05-24 07:29:56 -07:00
WarmUpTill
a93cec2bb9 Fix typo 2021-05-24 07:29:56 -07:00
WarmUpTill
32101627a6 Remove unused settings value 2021-05-23 17:52:15 -07:00
WarmUpTill
c2d2a27d44 Use more const refs where applicable 2021-05-23 17:52:15 -07:00
WarmUpTill
5eb8378612 Run condition check for paused macros
Otherwise conditions might behave in unexpected ways when resuming.
For example, audio could immediately match after unpause, when it
matched before it was paused due to timers not being updated.
2021-05-23 12:15:04 -07:00
WarmUpTill
961ea655fd
Macro pause (#201)
* Add option to pause individual macros
* Add macro action to pause and unpause macros
2021-05-23 08:54:59 +02:00
WarmUpTill
c1704f2164 Fix rapid scene switches by random tab
Wait scene was not set while waiting for scene changes on the random
tab.
If wait scene was ever set by other means (sequence) the scene switcher
would immediately wake up as the wait scene is not the expected value.
2021-05-22 10:49:31 -07:00
WarmUpTill
e4b060976b Add macro action "media" 2021-05-22 10:48:52 -07:00
WarmUpTill
186198bfd4 Reduce macro logging in non-verbose mode 2021-05-22 12:14:56 +02:00
WarmUpTill
283025f1a8 Add helper function to convert to new id format 2021-05-22 03:07:09 -07:00
WarmUpTill
5b4ddfa669 Adjust logging to use new ids 2021-05-22 03:07:09 -07:00
WarmUpTill
572b974b82 Switch to using string as ids for actions and conditions
Using int is an id was getting messy with more and more conditions and
actions beeing added.
It also made the order of conditions and actions in the respective
comboboxes unchangable as there was a 1 to 1 relation of index and id.
2021-05-22 03:07:09 -07:00
WarmUpTill
ae71b24c60 Adjust locale 2021-05-21 16:50:05 -07:00
WarmUpTill
e803ba75f9 CI: Use new windows deps version 2021-05-21 16:49:47 -07:00
WarmUpTill
72bd905e7c Improve logging for macros 2021-05-20 11:36:08 -07:00
WarmUpTill
51680adc20 Add macro condition "interval" 2021-05-19 11:47:32 -07:00
WarmUpTill
4b84850f00 Use splitter to separate actions and conditions 2021-05-19 11:47:22 -07:00
WarmUpTill
6a998934d0 Add macro action "source" 2021-05-18 11:12:22 -07:00
WarmUpTill
b80c16a446 Add macro action filter 2021-05-17 13:16:13 -07:00
WarmUpTill
f4d11dd6e6 Add filter helper functions 2021-05-17 13:16:13 -07:00
WarmUpTill
4248b86705 Add macro action to control scene item visibility 2021-05-17 12:20:54 -07:00
WarmUpTill
305ce96ad0 Adjust includes to new file name 2021-05-17 12:20:54 -07:00
WarmUpTill
74dfd9af30 Rename 2021-05-17 12:20:54 -07:00
WarmUpTill
c911862d8c Add Russian locale 2021-05-17 11:57:12 -07:00
WarmUpTill
2a73583793 Fix fullscreen and implement maximized checks 2021-05-17 11:08:26 -07:00
WarmUpTill
8f16d05a28 Fix potential crash in audio macro action
UpdateEntryData() could be called from ActionChanged() leading to a
potential double lock of switcher->m when triggerin other slots of this
widget
2021-05-16 13:00:06 -07:00
WarmUpTill
2ce0b35921 Add volume to control to audio action 2021-05-15 09:51:20 -07:00
WarmUpTill
33d2def126 Explicitly cast enum class to int 2021-05-15 09:05:43 -07:00
WarmUpTill
c44b0a2ac2 Remove unused verbose parameter 2021-05-15 09:05:43 -07:00
WarmUpTill
3abeb936b3 Fix random order of various macro entries 2021-05-15 01:03:07 -07:00
WarmUpTill
cef513f775 Adjust plugin state macro condition id 2021-05-14 14:03:04 -07:00
WarmUpTill
a66961eac1 Add macro condition "idle" 2021-05-14 14:03:04 -07:00
WarmUpTill
92c8767e1a Move plugin state condition to end 2021-05-14 09:44:49 -07:00
WarmUpTill
5b12468a46 Add macro condition process 2021-05-14 09:44:49 -07:00
WarmUpTill
675021c284
Add Macro tab (#170)
* add action switch scene

* add window condition

* Add macro action wait

* Add macro condition region

* Add audio macro condition

* Add file based macro condition

* Add macro condition media

* Add video macro condition

* Add macro action audio

* Add macro action streaming

* Add macro action recording

* Add replay buffer macro action

* Add stream macro condition

* Add macro condition recording

* Add macro condition plugin state

* Add macro action to run an arbitrary command
2021-05-14 16:37:01 +02:00
WarmUpTill
6bf122d0e8
Add support for transition duration in switchScene() (#178) 2021-05-12 19:50:50 +02:00
Pander
8b8e479098
added system-wide Flatpak paths (#175) 2021-05-06 20:38:11 +02:00
WarmUpTill
717d41a527 Adjust default setting values of transition tab 2021-05-04 11:32:45 -07:00
WarmUpTill
ad5587e084 Fix transition overrides not restoring duration 2021-05-04 11:32:45 -07:00
WarmUpTill
f37f384b5a Move DisplayMessage() to utility.hpp 2021-05-04 11:32:45 -07:00
WarmUpTill
dad36689c4 Move AdvSSScreenshotObj to separate files 2021-05-04 11:32:45 -07:00
WarmUpTill
0bd7d004ad Reduce includes of platform specific files
This is done to avoid build issues in future.
For example previously the class "Duration" class caused build issues on
the MacOS platform due to a name conflict.
2021-05-04 11:32:45 -07:00
WarmUpTill
f8c589c7a2 Only send scene switch msg if scene was switched
This change is to avoid spamming the connected clients with scene change
messages which might not even do anything as the scene change already
took place.
Additionally it allows scene switch messages to be sent by just calling
the switchScene() function.
2021-05-04 11:32:45 -07:00
WarmUpTill
e714df7ad0 Use Duration class and DurationSelection widget 2021-05-04 11:32:45 -07:00
WarmUpTill
6277da1bbd Add Duration class and DurationSelection widget 2021-05-04 11:32:45 -07:00
WarmUpTill
1bef309264 Only try to change transition overrides if needed 2021-05-04 11:32:45 -07:00
WarmUpTill
2e1d660e17 Clean up loading of transition tab settings 2021-05-04 11:32:45 -07:00
WarmUpTill
3f492f468a Move compareIgnoringLineEnding() to utility.hpp 2021-05-04 11:32:45 -07:00
WarmUpTill
c86bba84b3 Add scene-group.hpp include to switch-generic
This is to allow easier use of generic scene switch structs and widgets
in other areas. (Macro tab)
2021-05-04 11:32:45 -07:00
WarmUpTill
c468b0698b Move definition of SwitchTargetType 2021-05-04 11:32:45 -07:00
WarmUpTill
2af82fe22a Fix ignoring match of checkSwitchInfoFromFile() if checkFileContent() does not match 2021-05-04 11:32:45 -07:00
WarmUpTill
5d720219bf Clean up transition tab save and load 2021-05-04 11:32:45 -07:00
WarmUpTill
484e1aa191 Remove unnused function 2021-05-04 11:32:45 -07:00
WarmUpTill
0fdfe757b4 Reset tab order if config is invalid 2021-05-04 11:32:45 -07:00
WarmUpTill
bc5a04651f Remove unnecessary indirection 2021-05-04 11:32:45 -07:00
WarmUpTill
d9dfc1913d Fix previous scene not working for some sequences
If a duration for a transition is used that is longer than the scene
switcher check interval it could happen that the "incorrect" previous
scene could be chosen for uninterruptible scene sequences, as at the
time the sequence check was preformed the "previous scene" variable
was not yet updated as the transition was still ongoing.
2021-05-04 11:32:45 -07:00
WarmUpTill
1310d0b3f3 Add comment 2021-05-04 11:32:45 -07:00
WarmUpTill
139df8a641 Adjust function signature
Don't pass bool by reference if not necessary.
2021-05-04 11:32:45 -07:00
WarmUpTill
acf1ae63aa Drop support for old settings format 2021-05-04 11:32:45 -07:00
WarmUpTill
041a9e7f19
Add option to set transition duration (#171) 2021-05-01 00:20:25 +02:00
Pander
427ed34a1b
added Flatpak paths for Ubuntu (#172) 2021-04-27 18:35:04 +02:00
WarmUpTill
45fa4dac8f
Add option "has changed" to video tab (#168) 2021-04-22 20:51:35 +02:00
WarmUpTill
e4bf5fa749
Add option to use transition overrides for transition changes (#164)
* Adjust switchScene() signature to support adjustActiveTransitionType and verbose parameters and only change the transition type if adjustActiveTransitionType, otherwise rely on transition overrides

* Add new adjustActiveTransitionType checkbox

* save and load adjustActiveTransitionType

* Add check to either enable transition type change or use of transition
overrides

* Add locale

* Adjust layout and locale
2021-04-10 19:58:17 +02:00
WarmUpTill
eb346da6f4
CI: Fix macOS build by disabling browser build (#163) 2021-04-09 20:57:35 +02:00
WarmUpTill
866480cde6
Fix crash on Linux if no ewmh is available (#159) 2021-04-07 21:03:54 +02:00
WarmUpTill
10e1c7b3a3
Resolve asio network crashes on macOS (#157)
* Reenable network tab functionality for macOS

* Set asio to b73dc1d and  websocketpp to c6d7e29
2021-04-03 22:02:42 +02:00
WarmUpTill
beb482bd5a
Disable Network tab functionality on macOS (#155)
The asio library ran into issues when the obs-websocket plugin was also running leading to a crash in the obs-websocket's listen() calls.

As the use obs-websocket plugin is more widespread than the use of the advanced scene switcher the network tab functionality will be disabled for macOS for the time being.
2021-04-03 18:52:16 +02:00
WarmUpTill
e561d378dd
CI: Disable PipeWire on Ubuntu (#156) 2021-04-03 12:43:52 +02:00
WarmUpTill
73ce88e2f0
Add option to save window size and position (#154) 2021-04-03 11:55:42 +02:00
WarmUpTill
dfccc4b16d
Add network tab (#149)
The network tab allows you to open a web-socket or connect to web-socket to synchronize the active scene between two or more instances of OBS.
The functionality is mostly based on https://github.com/Palakis/obs-websocket.

An OBS instance running a server will send its currently active scene to all connected clients on scene change.
By default all scene switches will trigger a message to be sent to all clients, but you also have the option to limit sending these messages only when an automated scene change is triggered by the advanced scene switcher.
2021-03-24 20:51:22 +01:00
WarmUpTill
b0ef1fee71
Fix window check always testing for focus (#152) 2021-03-22 23:06:44 +01:00
WarmUpTill
1ef8ce4b4a
Resolve Qt runtime warning by renaming function. (#151) 2021-03-22 22:31:29 +01:00
WarmUpTill
1bf4bff014
Merge pull request #150 from WarmUpTill/CI
CI: Improve format check and init submodules for build
2021-03-21 21:48:21 +01:00
WarmUpTill
4b6e00b2b2 CI: Init submodules for build 2021-03-21 21:39:11 +01:00
WarmUpTill
c99cbb0c0f CI: Improve format check.
The format check used to check too many files, which would be worsened
when introducing additional submodules.
2021-03-21 21:37:10 +01:00
WarmUpTill
2a87334d38
Init noMatchDelay to zero. (#148)
A non-zero value might be confusing for users which set up the plugin
for the first time.
2021-03-21 14:44:42 +01:00
WarmUpTill
1a4724ff21
Fix audio tab not supporting mono audio output. (#145) 2021-03-19 20:01:15 +01:00
WarmUpTill
59d8fb5d28
Fix MacOS build. (#146) 2021-03-19 19:43:58 +01:00
WarmUpTill
8823c05aeb
Fix scene groups not being selected when using more than one entry on the Random tab. (#143) 2021-03-18 21:22:33 +01:00
WarmUpTill
2d0a52f8d1
Enable use of Scene Groups for Random tab (#141) 2021-03-17 20:00:06 +01:00
WarmUpTill
1273446ce5
Add option to configure default transition delay. (#140) 2021-03-17 18:21:42 +01:00
WarmUpTill
177ca4aea2
CI: Build on Ubuntu 18.04, use newer clang-format. (#139) 2021-03-13 17:02:04 +01:00
WarmUpTill
7526cbe1a3
Add option to check volume of 'inactive' audio sources. (#137) 2021-03-12 18:48:06 +01:00
WarmUpTill
e4bb034303
Add video tab (#131)
This tab will allow switching scenes based on the video output of sources.
2021-03-05 14:08:17 +01:00
WarmUpTill
78e14df620
Add german locale for extended sequences (#135) 2021-03-01 20:25:18 +01:00
WarmUpTill
34f07bfb07
Clean up extended sequence (#134)
* Update original switch widget status if changed in extend edit

* Clean up

* Add more comments

* Clean up unecessary code.

Sleep no longer happens inside the sequence switch check so we don't
need to stop / start the switcher after importing new entries or deleting
existing entries.
2021-02-28 15:38:33 +01:00
WarmUpTill
ee74d39424
Fixes and Minor rework (#132)
* Fix warning in scene trigger log functions.
* Use GetWeakSourceName() when saving scene trigger sources.
* Fix prioFuncsValid().
2021-02-26 19:21:02 +01:00
WarmUpTill
33667a1f23
Fix crash on advancing to unset scene for extended sequence (#130) 2021-02-24 18:53:52 +01:00
WarmUpTill
7947ad2608
Add option to extend scene sequences (#121)
Extending a scene sequence allows for more complex switching setups, but should also simplify some setups.
Sequences like "A -> B -> A -> C", which previously were only possible by creating a copy of A, can now be specified in a single entry.
To extend a sequence either select the sequence you want to modify and click the extend sequence button or simply double click the entry.
2021-02-24 18:19:23 +01:00
WarmUpTill
920c188213
Add scene trigger for starting and stopping the scene switcher (#129) 2021-02-23 21:00:25 +01:00
WarmUpTill
28fbff1adc
Allow specifying transition when reading scenes from file. (#128)
The transition can be specified on the second line of the file.
For example:
Scene 1
Slide
2021-02-21 20:17:32 +01:00
WarmUpTill
326617aad7
Fix checkSwitchInfoFromFile ignoring file switch puase (#127) 2021-02-21 20:16:51 +01:00
WarmUpTill
499ba7dd21
Update the UI's status element if the status changed externally (#126) 2021-02-20 18:58:07 +01:00
WarmUpTill
f4902933ab
Fix getCurrentScene() returning garbage if scene group has type random (#125) 2021-02-20 18:08:47 +01:00
WarmUpTill
9aa0b31bff
Add scene trigger to unmute source (#124) 2021-02-20 18:08:35 +01:00
WarmUpTill
6d5086b971
Add option to select 'current transition' (#123)
* move addSelectionEntry to AdvSceneSwitcher class and allow select entry to be 'selectable'

Can be useful for implementing 'current transition' as an option or just allowing to select 'None' for screen region ignore

* Add option to select 'current transition'
2021-02-19 19:03:38 +01:00
WarmUpTill
f32f47db4b
Install qtbase5-private-dev on Linux (#122) 2021-02-13 19:28:24 +01:00
WarmUpTill
74c0cd1736
Adjust sleep log message and comment for sceneChangedDuringWait() (#120) 2021-02-13 19:14:28 +01:00
WarmUpTill
a74a952b1d
Fix log messages containing two '[adv-ss]' tags (#118) 2021-02-07 18:41:47 +01:00
WarmUpTill
5bbfef81e0
Improve scene trigger handling (#117) 2021-02-06 18:23:57 +01:00
WarmUpTill
c31d1cd975
Delay setting of default scene transitions (#116) 2021-02-06 18:23:41 +01:00
WarmUpTill
81d91a9139
resovle name conflict (#115) 2021-02-04 07:24:52 +01:00
WarmUpTill
a354daa71d
Fix regex matching for window tab (#113)
Regex matches could never match if full-screen or maximized was selected due to only checking for direct matches during these checks.
2021-02-03 20:46:25 +01:00
WarmUpTill
a84a205608
Minor style changes (#114)
* use GetWeakSourceName() where possible

* add getCurrentScene() to scene group

* silence OBS warning log and fix typo in audio switch

* extract showing initial status of widgets to function in generic switch
2021-02-03 20:27:25 +01:00
WarmUpTill
a5f0eb8da8
Add option to automatically start scene switcher on recording / streaming start (#112) 2021-02-03 20:02:07 +01:00
WarmUpTill
35151ea134
Add scene trigger tab (#110) 2021-02-03 19:50:37 +01:00
Kevin Nash
1510a2c2fa
Specify scenes to exclude from Region triggers (#111)
Adds an option to exclude a region triggered scene switch if you're
currently in the specified Scene.
2021-02-03 19:49:18 +01:00
WarmUpTill
8e8cb4bf3e use exportWindowTitle on export of settings 2021-01-27 19:05:46 +01:00
WarmUpTill
a480be3ea0
Update installation instructions 2021-01-25 22:15:40 +01:00
WarmUpTill
27ae5107cd
Add help messages if tab is empty (#107) 2021-01-24 16:04:40 +01:00
WarmUpTill
69d452f978
allow selection of previous scene for exe,file,region,window and scene group for idle switches (#106) 2021-01-23 23:21:59 +01:00
WarmUpTill
fe9457427f
add linger variable instead of sleeping inside sequence match (#105)
This solves issues with the busy loop detection and adds the possibility of other switching methods to delay the scene switch
2021-01-23 20:32:32 +01:00
WarmUpTill
d989c2b570
Add scene groups and rework save and load (#103) 2021-01-23 17:39:35 +01:00
WarmUpTill
1f4679433e
ask for backup of settings if a new version detected (#104) 2021-01-23 17:08:17 +01:00
WarmUpTill
b42de8d5c8
fix crash on settings import (#102)
This crash could happen if the scene switcher was currently stuck waiting in a scene sequence causing while the import of new settings took place potentially invalidating the settings of the sequence after wakeup.
2021-01-20 19:01:56 +01:00
WarmUpTill
0950d93828
allow selection of target for auto stop of recoding or streaming 2021-01-18 01:20:56 +01:00
WarmUpTill
5156c66b26
add warning if translation cannot be found (#99)
* add warning if translation cannot be found

* extract displaying message boxes to separate function
2021-01-09 14:27:51 +01:00
WarmUpTill
346240473a
use maximum peak value during switch interval for audio match (#98)
This change should in theory improve the situation, so "pauses" - like they happen in human speech - in the range less than the configured scene switcher check interval will still result in a match, if there was at least a short moment where the configured volume threshold was reached.

Also extract attaching of the volmeter to an audio source to a separate function
2021-01-09 09:10:15 +01:00
WarmUpTill
17c4fefb37
add fallback option if multiple audio matches are active (#95) 2021-01-07 18:59:06 +01:00
WarmUpTill
2b90493ae9
add switch cooldown option (#97)
* add switch cooldown functionality

* slightly adjust sequence check for cooldown

* add UI implementation for cooldown feature
2021-01-07 18:58:35 +01:00
WarmUpTill
bf97975fa8
link to Transition Table instead of Transition Matrix plugin (#96) 2021-01-06 12:25:45 +01:00
WarmUpTill
4e971f59a9
add option to allow scene sequence to be interrupted (#93) 2021-01-02 14:32:18 +01:00
WarmUpTill
2f0b900745 fix invalid audio matches 2020-12-31 16:59:52 +01:00
WarmUpTill
c6a25f9d85 fix typo 2020-12-31 16:19:58 +01:00
WarmUpTill
e78383d3ed
clean up build and build instructions (#92)
* fix build issue with atomic bool initialization

* clean up cmake

* fix warning

* add missing '\' to linux instructions
2020-12-31 15:45:08 +01:00
WarmUpTill
281e9325dd
update locale (#91)
* add german locale

* adjust description of ignore window functionality

* adjust order of readWriteSceneFile

* allow translation of 'previous scene'
2020-12-31 14:59:05 +01:00
WarmUpTill
caa2833272
allow pause individual switching methods (#90)
* allow pausing individual switching methods

* clean up pause tab

* allow import of old pauseScenes and pauseWindows
2020-12-31 14:24:09 +01:00
WarmUpTill
fae50024ea rename mediaSources 2020-12-28 17:38:34 +01:00
WarmUpTill
a05e38d3cb fix typos 2020-12-28 17:28:57 +01:00
WarmUpTill
d73749fc3a update README.txt 2020-12-28 17:14:11 +01:00
WarmUpTill
d20cdac5e4
add duration and 'below' condition type options to audio tab (#85) 2020-12-28 17:06:30 +01:00
WarmUpTill
e377be3999
Minor UI changes (#89)
* automatically scroll to new entry

* fix remote file check always matching

* sort combobox entries alphabetically (meida / processes / audio)

* fix some visual issues on non-default OBS themes
2020-12-28 17:03:55 +01:00
WarmUpTill
80e2b3dd14 fix new time matching if QTime is not initialized 2020-12-28 17:02:32 +01:00
WarmUpTill
3a05e61814
add windows installer (#88) 2020-12-23 01:51:48 +01:00
WarmUpTill
dda44a2931
create release artifact (#84) 2020-12-21 22:52:25 +01:00
shugen002
8ba78b12c1
I18n Support (#72)
* adapt UI for i18n

* add placeWidgets() helper function to ease translation

* add hint about Transition Matrix plugin on Transition tab

* translate

* rework UI of file tab

* write status of plugin to scene info file
2020-12-21 11:24:04 +01:00
WarmUpTill
07b95cb8ae
do not sleep less than 1ms (#82) 2020-12-13 17:26:59 +01:00
WarmUpTill
faca5f8863
add option to only match if file content changed (#80) 2020-12-12 16:31:07 +01:00
WarmUpTill
084c263260 always match checkRandom() if random tab only has one entry 2020-12-10 20:14:07 +01:00
WarmUpTill
a1c592f1ec format 2020-12-10 20:14:07 +01:00
WarmUpTill
41f34f8f40 remove runtime of check() functions from interval sleep 2020-12-10 20:14:07 +01:00
WarmUpTill
9711390aac
add no match delay option (#78) 2020-12-06 14:10:17 +01:00
WarmUpTill
25f28b9796
Add media state played to end (#58) 2020-12-06 14:09:21 +01:00
WarmUpTill
a1484f9621 fix warning 2020-12-06 14:03:04 +01:00
WarmUpTill
b54506c5ee
add 'OBS' entry to GetWindowList() on Windows(#76) 2020-11-28 16:23:17 +01:00
WarmUpTill
4af7540497
hide guide frames when switching to a different tab (#75) 2020-11-28 12:36:58 +01:00
Guillaume Turchini
ba15e6812f
Add a log when auto stopping stream / record (#74)
* Add a log when auto stopping stream / record

I had a hard time deciphering why the stream stopped automatically for someone when using the plugin as the logs contained nothing indicating an error or an action from the plugin.
He activated the checkbox to auto stop stream when a scene is activated (which I didn't know) so the plugin was doing exactly what asked.
I think adding a log is a good idea for an action as important as stopping the stream.
I added the same for starting stream for the same reasons.
2020-11-27 17:34:17 +01:00
WarmUpTill
22a90c7d64
fix crash on deleting last screen region entry when guide frame was active (#70) 2020-11-24 22:57:52 +01:00
WarmUpTill
f6c3c65e26
resolve potential deadlocks (#66)
A deadlock could occur if the save callback is called just before the frontend set functions are used.
Thus unlock() is necessary before setting current scene or transition.
(e.g. if start recording is activated just before using the above functions, as this apparently triggers a save() call)
2020-11-21 01:40:24 +01:00
WarmUpTill
4f6275619a
Recommend building in-tree 2020-11-20 22:02:12 +01:00
WarmUpTill
d461342835
Update github actions (#65)
* fix macOS build

* remove unused BUILD_CAPTIONS variable
2020-11-20 22:00:33 +01:00
shugen002
16c4a2d5a9
Adjust UI And Improve (#63) 2020-11-20 19:10:06 +01:00
WarmUpTill
45a880d8f8
Add version info log (#61)
add generated version info log on startup of the plugin using the "GetGitRevisionDescription" cmake module from https://github.com/rpavlik/cmake-modules
2020-11-15 20:34:11 +01:00
WarmUpTill
bcf132685b
Update CI (#60)
* Remove deprecated use of set-env in Github Actions

* use newer versions of checkout / upload-artifact / setup-msbuild
2020-11-14 19:32:16 +01:00
WarmUpTill
e5c1e81d81 clean up and silence warnings 2020-11-14 18:45:25 +01:00
WarmUpTill
2ae97cd90e Merge branch 'master' of https://github.com/WarmUpTill/SceneSwitcher 2020-11-14 17:11:21 +01:00
WarmUpTill
e5fffa0b82 log if sequence is canceled if verbose 2020-11-10 18:31:42 +01:00
WarmUpTill
a0119426d6 remove dead code 2020-11-10 18:31:42 +01:00
WarmUpTill
45e5738d2c do not hold main lock in callback handling 2020-11-10 18:31:42 +01:00
WarmUpTill
cdd1259f12 style changes 2020-11-09 22:20:58 +01:00
WarmUpTill
e5d6f2eef0 Merge branch 'master' of https://github.com/WarmUpTill/SceneSwitcher 2020-11-07 18:57:00 +01:00
WarmUpTill
e026bd7420 fix crash on first startup on fresh install of OBS 2020-11-07 18:56:08 +01:00
WarmUpTill
4cc1a53244
fix build by enabling BUILD_CAPTIONS (#56) 2020-11-02 19:44:30 +01:00
WarmUpTill
8eb99a3fde fix comment 2020-11-02 19:06:51 +01:00
WarmUpTill
bf30a058ee fix crash on deleting scene sequences
This crash could occur when a scene sequence was currently in progress and the entries were changed while in the 'wait for ...' state.
2020-11-02 19:05:19 +01:00
WarmUpTill
0c6a7b140e add comment about use of 'matched' 2020-11-02 19:00:50 +01:00
WarmUpTill
d279b35086 fix crash on importing scene sequence
This crash could occur when a scene sequence was currently in progress and the entries were changed while in the 'wait for ...' state.
2020-11-02 18:38:26 +01:00
WarmUpTill
8e26148255
fix media states being retriggered multiple times (#54) 2020-11-01 18:53:48 +01:00
WarmUpTill
1a3ed0d09c
add clang format check to CI and adjust formatting (#55) 2020-11-01 12:39:14 +01:00
WarmUpTill
214821b69f
UI rework (#44)
* rework general tab UI

* rework audio tab UI

* rework media tab UI

* rework time tab UI

* rework random tab UI

* rework window tab UI

* rework sreen region tab UI

* rework sequence tab UI

* rework transition tab UI

* adjust log messages to new format

* fix include path and warning

* highlight widgets to guide users (can be disabled)

* add helper frame for screen region tab

* rename main SceneSwitcher widget to AdvSceneSwitcher to resolve naming conflicts with the frontend tools on certain platforms (e.g. Debian 10)

* add media state 'any'

* adjust media switch handling to support vlc source
2020-10-31 16:25:44 +01:00
WarmUpTill
7edb6eb6c1 add handling of window title of metro apps 2020-10-24 15:23:08 +02:00
WarmUpTill
46916dc5d3
workaround for MacOS CI issue (#52) 2020-10-22 21:56:54 +02:00
WarmUpTill
8aed15f3a8 allow WS_EX_TOOLWINDOW as valid windows to match 'Task Switching' 2020-10-22 19:44:23 +02:00
WarmUpTill
1e6a022787
improve hotkey handling (#49) 2020-10-12 20:55:51 +02:00
WarmUpTill
fb1eac5268
fix crash on exit when on autoStart scene (#47) 2020-10-10 01:56:08 +02:00
WarmUpTill
787b664d29
Add vlc source to media tab (#42) 2020-09-30 19:07:40 +02:00
WarmUpTill
dd63ff846c
Refactor, fixes and maximized option for title tab (#40)
* move definitions of switcher structs to separate files

* remove useless comment

* cleanup and silence warnings

* add generic switch

* removed delay on main thread startup as it served no purpose

* clean up ultility.hpp

* do not save switchStr to file as it could cause issues when scenes are renamed

* rename sceneRoundTrip to sceneSequence

* add option to switch if window is maximized to title tab
2020-09-25 21:42:58 +02:00
WarmUpTill
1559d437ec
adjust install_name_tool calls to new qt dir (#39) 2020-09-21 22:24:47 +02:00
WarmUpTill
8d023ee385
Add audio tab (#36)
* add volumemeter widget

* add audio tab UI

* add checkAudioSwitch functionality

* use constexpr instead of preprocessing
2020-09-21 00:52:42 +02:00
WarmUpTill
3fd3801e56
load libcurl at runtime (#33)
* load libcurl at runtime

* add warning to file tab if curl cant be loaded
2020-09-13 09:13:09 +02:00
WarmUpTill
3ec1e99f4b
fix MacOS CI issues due to QT dependency (#35)
* fix MacOS CI issues due to QT deps

* adjust to new name of deps archive

* use MACOS_DEPS_VERSION instead of OSX_DEPS_VERSION

* disable python dependency during build
2020-09-13 01:30:08 +02:00
WarmUpTill
21a788b48b
Improve time tab (#34)
* add support for weekdays and allow reordering on time tab

* add option to use time relative to streaming/recording start on time tab
2020-09-13 00:03:38 +02:00
WarmUpTill
a5c8d776f3 only try auto start streaming/recording once on scene chagne 2020-08-24 20:55:54 +02:00
WarmUpTill
95261ce9bb add first draft of auto start of recording / streaming 2020-08-16 19:48:54 +02:00
752 changed files with 560134 additions and 10819 deletions

View File

@ -1,6 +1,6 @@
# please use clang-format version 8 or later
# please use clang-format version 16 or later
Standard: Cpp11
Standard: c++17
AccessModifierOffset: -8
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
@ -8,14 +8,14 @@ AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
#AllowAllArgumentsOnNextLine: false # requires clang-format 9
#AllowAllConstructorInitializersOnNextLine: false # requires clang-format 9
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
#AllowShortLambdasOnASingleLine: Inline # requires clang-format 9
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
@ -52,11 +52,12 @@ ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
FixNamespaceComments: false
ForEachMacros:
FixNamespaceComments: true
ForEachMacros:
- 'json_object_foreach'
- 'json_object_foreach_safe'
- 'json_array_foreach'
- 'HASH_ITER'
IncludeBlocks: Preserve
IndentCaseLabels: false
IndentPPDirectives: None
@ -65,7 +66,7 @@ IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
#ObjCBinPackProtocolList: Auto # requires clang-format 7
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 8
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
@ -83,13 +84,13 @@ ReflowComments: false
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
#SpaceAfterLogicalNot: false # requires clang-format 9
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
#SpaceBeforeCtorInitializerColon: true # requires clang-format 7
#SpaceBeforeInheritanceColon: true # requires clang-format 7
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true # requires clang-format 7
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
@ -97,11 +98,111 @@ SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
#StatementMacros: # requires clang-format 8
# - 'Q_OBJECT'
StatementMacros:
- 'Q_OBJECT'
TabWidth: 8
#TypenameMacros: # requires clang-format 9
# - 'DARRAY'
TypenameMacros:
- 'DARRAY'
UseTab: ForContinuationAndIndentation
---
Language: ObjC
AccessModifierOffset: 2
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AttributeMacros: ['__unused', '__autoreleasing', '_Nonnull', '__bridge']
BitFieldColonSpacing: Both
#BreakBeforeBraces: Webkit
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakArrays: false
BreakBeforeConceptDeclarations: Allowed
BreakBeforeInlineASMColon: OnlyMultiline
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterComma
ColumnLimit: 120
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: Indent
IndentGotoLabels: false
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: false
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
NamespaceIndentation: All
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: false
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PPIndentWidth: -1
PackConstructorInitializers: NextLine
QualifierAlignment: Leave
ReferenceAlignment: Right
RemoveSemicolon: false
RequiresClausePosition: WithPreceding
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 1
SortIncludes: false
#SortUsingDeclarations: LexicographicNumeric
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInConditionalStatement: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
Standard: c++17
TabWidth: 4
UseTab: Never

31
.cmake-format.json Normal file
View File

@ -0,0 +1,31 @@
{
"format": {
"line_width": 80,
"tab_size": 2,
"enable_sort": true,
"autosort": true
},
"additional_commands": {
"set_target_properties_obs": {
"pargs": 1,
"flags": [],
"kwargs": {
"PROPERTIES": {
"kwargs": {
"PREFIX": 1,
"OUTPUT_NAME": 1,
"FOLDER": 1,
"VERSION": 1,
"SOVERSION": 1,
"AUTOMOC": 1,
"AUTOUIC": 1,
"AUTORCC": 1,
"AUTOUIC_SEARCH_PATHS": 1,
"BUILD_RPATH": 1,
"INSTALL_RPATH": 1
}
}
}
}
}
}

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
/build-aux/*.zsh eol=lf
/build-aux/.functions/* eol=lf

112
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View File

@ -0,0 +1,112 @@
# Based on the OBS issue templates
# https://github.com/obsproject/.github/tree/master/.github/ISSUE_TEMPLATE
name: Bug Report
description: Report a bug or crash
body:
- type: markdown
id: md_welcome
attributes:
value: This form is for reporting bugs for Advanced Scene Switcher!
- type: dropdown
id: os_info
attributes:
label: Operating System Info
description: What Operating System are you running?
options:
- Windows 11
- Windows 10
- macOS 14
- macOS 13
- macOS 12
- macOS 11
- Ubuntu 24.04
- Ubuntu 23.10
- Ubuntu 22.04
- Other
validations:
required: true
- type: input
id: os_info_other
attributes:
label: Other OS
description: "If \"Other\" was selected above, what OS are you using?"
placeholder: "e.g., Arch Linux, FreeBSD"
validations:
required: false
- type: input
id: obs_version
attributes:
label: OBS Studio Version
description: What version of OBS Studio are you using?
placeholder: 30.2.2
validations:
required: true
- type: input
id: advss_version
attributes:
label: Advanced Scene Switcher Version
description: What version of the Advanced Scene Switcher are you using?
placeholder: 1.27.2
validations:
required: true
- type: input
id: settings
attributes:
label: Plugin settings
description: |
Please provide the plugin settings used.
Either only [export the macros](https://github.com/WarmUpTill/SceneSwitcher/wiki/Exporting-and-importing-individual-macros) relevant to this issue or [export all settings](https://github.com/WarmUpTill/SceneSwitcher/wiki/Saving-and-loading-settings#how-to-create-and-import-a-backup-of-your-settings) on the General tab of the plugin.
validations:
required: false
- type: input
id: obs_log_url
attributes:
label: OBS Studio Log URL
description: Please provide the obsproject.com URL (from Help menu > Log Files > Upload Current/Previous Log File) to the OBS log file where this issue occurred.
validations:
required: false
- type: input
id: obs_crash_log_url
attributes:
label: OBS Studio Crash Log URL
description: If this is a crash report, please provide the obsproject.com URL to the OBS crash log file where this issue occurred.
validations:
required: false
- type: textarea
id: expected_behavior
attributes:
label: Expected Behavior
description: "What did you expect to happen?"
validations:
required: true
- type: textarea
id: current_behavior
attributes:
label: Current Behavior
description: "What actually happened?"
validations:
required: true
- type: textarea
id: steps_to_reproduce
attributes:
label: Steps to Reproduce
description: "How do you trigger this bug? Please walk us through it step by step."
placeholder: |
1.
2.
3.
...
value: |
1.
2.
3.
...
validations:
required: true
- type: textarea
id: additional_notes
attributes:
label: Anything else we should know?
validations:
required: false

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: 📚 Wiki
url: https://github.com/WarmUpTill/SceneSwitcher/wiki
about: For explanations on how the plugin works or to see example guides, check out the wiki.
- name: 💬 OBS Forum Thread
url: https://obsproject.com/forum/threads/advanced-scene-switcher.48264
about: To discuss the plugin or get assistance, feel free to use the OBS forum thread or the GitHub discussions page.

View File

@ -0,0 +1,37 @@
# Based on the OBS issue templates
# https://github.com/obsproject/.github/tree/master/.github/ISSUE_TEMPLATE
name: Feature request
description: Suggest an idea for this project
body:
- type: markdown
id: md_welcome
attributes:
value: This form is for requesting new features for Advanced Scene Switcher!
- type: textarea
id: background
attributes:
label: Background
description: "Is your feature request related to a problem? Please describe."
validations:
required: false
- type: textarea
id: solution
attributes:
label: Solution
description: "Describe the solution you'd like."
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives
description: "Describe alternatives you've considered."
validations:
required: false
- type: textarea
id: additional_notes
attributes:
label: Anything else we should know?
validations:
required: false

View File

@ -0,0 +1,80 @@
name: 'Setup plugin build dependencies'
description: 'Builds the plugin build dependencies'
inputs:
target:
description: 'Build target for dependencies'
required: true
config:
description: 'Build configuration'
required: false
default: 'Release'
visualStudio:
description: 'Visual Studio version (Windows only)'
required: false
default: 'Visual Studio 16 2019'
workingDirectory:
description: 'Working directory for packaging'
required: false
default: ${{ github.workspace }}
runs:
using: 'composite'
steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.x.x'
- name: Restore cached dependencies
id: restore-cache
uses: actions/cache@v4
with:
path: ${{ env.DEP_DIR }}
key: ${{ env.DEP_DIR }}-${{ runner.os }}-${{ inputs.target }}
- name: Run macOS Build
if: ${{ runner.os == 'macOS' && steps.restore-cache.outputs.cache-hit != 'true' }}
shell: zsh {0}
run: |
build_args=(
-c ${{ inputs.config }}
-t ${{ inputs.target }}
-o ${{ env.DEP_DIR }}
)
if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug)
.github/scripts/build-deps-macos.zsh -o ${{ env.DEP_DIR }} ${build_args}
- name: Run Linux Build
if: ${{ runner.os == 'Linux' && steps.restore-cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
build_args=(
-c ${{ inputs.config }}
-t linux-${{ inputs.target }}
)
if [[ -n "${CI}" && -n "${RUNNER_DEBUG}" ]]; then
build_args+=(--debug)
fi
.github/scripts/build-deps-linux.sh -o ${{ env.DEP_DIR }} "${build_args[@]}"
- name: Run Windows Build
if: ${{ runner.os == 'Windows' && steps.restore-cache.outputs.cache-hit != 'true' }}
shell: pwsh
run: |
$BuildArgs = @{
Target = '${{ inputs.target }}'
Configuration = '${{ inputs.config }}'
OutDirName = '${{ env.DEP_DIR }}'
}
if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) {
$BuildArgs += @{
Debug = $true
}
}
.github/scripts/Build-Deps-Windows.ps1 -OutDirName ${{ env.DEP_DIR }} @BuildArgs

110
.github/actions/build-plugin/action.yaml vendored Normal file
View File

@ -0,0 +1,110 @@
name: 'Set up and build plugin'
description: 'Builds the plugin for specified architecture and build config'
inputs:
target:
description: 'Target architecture for dependencies'
required: true
config:
description: 'Build configuration'
required: false
default: 'RelWithDebInfo'
codesign:
description: 'Enable codesigning (macOS only)'
required: false
default: 'false'
codesignIdent:
description: 'Developer ID for application codesigning (macOS only)'
required: false
default: '-'
workingDirectory:
description: 'Working directory for packaging'
required: false
default: ${{ github.workspace }}
runs:
using: composite
steps:
- name: Run macOS Build
if: runner.os == 'macOS'
shell: zsh --no-rcs --errexit --pipefail {0}
working-directory: ${{ inputs.workingDirectory }}
env:
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
CODESIGN_TEAM: ${{ inputs.codesignTeam }}
run: |
: Run macOS Build
local -a build_args=(
--config ${{ inputs.config }}
--dep ${{ env.DEP_DIR }}
)
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
if [[ '${{ inputs.codesign }}' == 'true' ]] build_args+=(--codesign)
.github/scripts/build-macos ${build_args}
- name: Install Dependencies 🛍️
if: runner.os == 'Linux'
shell: bash
run: |
: Install Dependencies 🛍️
echo ::group::Install Dependencies
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
brew install --quiet zsh
echo ::endgroup::
- name: Run Ubuntu Build
if: runner.os == 'Linux'
shell: zsh --no-rcs --errexit --pipefail {0}
working-directory: ${{ inputs.workingDirectory }}
run: |
: Run Ubuntu Build
local -a build_args=(
--target linux-${{ inputs.target }}
--config ${{ inputs.config }}
)
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
.github/scripts/build-linux ${build_args}
- name: Run Windows Build
if: runner.os == 'Windows'
shell: pwsh
run: |
# Run Windows Build
if ( $Env:RUNNER_DEBUG -ne $null ) {
Set-PSDebug -Trace 1
}
$BuildArgs = @{
Target = '${{ inputs.target }}'
Configuration = '${{ inputs.config }}'
ADVSSDepName = '${{ env.DEP_DIR }}'
}
.github/scripts/Build-Windows.ps1 @BuildArgs
- name: Create Summary 📊
if: contains(fromJSON('["Linux", "macOS"]'),runner.os)
shell: zsh --no-rcs --errexit --pipefail {0}
env:
CCACHE_CONFIGPATH: ${{ inputs.workingDirectory }}/.ccache.conf
run: |
: Create Summary 📊
local -a ccache_data
if (( ${+RUNNER_DEBUG} )) {
setopt XTRACE
ccache_data=("${(fA)$(ccache -s -vv)}")
} else {
ccache_data=("${(fA)$(ccache -s)}")
}
print '### ${{ runner.os }} Ccache Stats (${{ inputs.target }})' >> $GITHUB_STEP_SUMMARY
print '```' >> $GITHUB_STEP_SUMMARY
for line (${ccache_data}) {
print ${line} >> $GITHUB_STEP_SUMMARY
}
print '```' >> $GITHUB_STEP_SUMMARY

View File

@ -0,0 +1,117 @@
name: 'Package plugin'
description: 'Packages the plugin for specified architecture and build config.'
inputs:
target:
description: 'Build target for dependencies'
required: true
config:
description: 'Build configuration'
required: false
default: 'RelWithDebInfo'
codesign:
description: 'Enable codesigning (macOS only)'
required: false
default: 'false'
notarize:
description: 'Enable notarization (macOS only)'
required: false
default: 'false'
codesignIdent:
description: 'Developer ID for application codesigning (macOS only)'
required: false
default: '-'
installerIdent:
description: 'Developer ID for installer package codesigning (macOS only)'
required: false
default: ''
codesignTeam:
description: 'Developer team for codesigning (macOS only)'
required: false
default: ''
codesignUser:
description: 'Apple ID username for notarization (macOS only)'
required: false
default: ''
codesignPass:
description: 'Apple ID password for notarization (macOS only)'
required: false
default: ''
package:
description: 'Create Windows or macOS installation package'
required: false
default: 'true'
workingDirectory:
description: 'Working directory for packaging'
required: false
default: ${{ github.workspace }}
runs:
using: composite
steps:
- name: Run macOS Packaging
if: runner.os == 'macOS'
shell: zsh --no-rcs --errexit --pipefail {0}
working-directory: ${{ inputs.workingDirectory }}
env:
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
CODESIGN_IDENT_INSTALLER: ${{ inputs.installerIdent }}
CODESIGN_TEAM: ${{ inputs.codesignTeam }}
CODESIGN_IDENT_USER: ${{ inputs.codesignUser }}
CODESIGN_IDENT_PASS: ${{ inputs.codesignPass }}
run: |
: Run macOS Packaging
local -a package_args=(--config ${{ inputs.config }})
if (( ${+RUNNER_DEBUG} )) package_args+=(--debug)
if [[ '${{ inputs.codesign }}' == 'true' ]] package_args+=(--codesign)
if [[ '${{ inputs.notarize }}' == 'true' ]] package_args+=(--notarize)
if [[ '${{ inputs.package }}' == 'true' ]] package_args+=(--package)
.github/scripts/package-macos ${package_args}
- name: Install Dependencies 🛍️
if: runner.os == 'Linux'
shell: bash
run: |
: Install Dependencies 🛍️
echo ::group::Install Dependencies
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
brew install --quiet zsh
echo ::endgroup::
- name: Run Ubuntu Packaging
if: runner.os == 'Linux'
shell: zsh --no-rcs --errexit --pipefail {0}
working-directory: ${{ inputs.workingDirectory }}
run: |
: Run Ubuntu Packaging
package_args=(
--target linux-${{ inputs.target }}
--config ${{ inputs.config }}
)
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
if [[ '${{ inputs.package }}' == 'true' ]] package_args+=(--package)
.github/scripts/package-linux ${package_args}
- name: Run Windows Packaging
if: runner.os == 'Windows'
shell: pwsh
run: |
# Run Windows Packaging
if ( $Env:RUNNER_DEBUG -ne $null ) {
Set-PSDebug -Trace 1
}
$PackageArgs = @{
Target = '${{ inputs.target }}'
Configuration = '${{ inputs.config }}'
}
if ( '${{ inputs.package }}' -eq 'true' ) {
$PackageArgs += @{BuildInstaller = $true}
}
.github/scripts/Package-Windows.ps1 @PackageArgs

View File

@ -0,0 +1,61 @@
name: Run clang-format
description: Runs clang-format and checks for any changes introduced by it
inputs:
failCondition:
description: Controls whether failed checks also fail the workflow run
required: false
default: 'never'
workingDirectory:
description: Working directory for checks
required: false
default: ${{ github.workspace }}
runs:
using: composite
steps:
- name: Check Runner Operating System 🏃‍♂️
if: runner.os == 'Windows'
shell: bash
run: |
: Check Runner Operating System 🏃‍♂️
echo "::notice::run-clang-format action requires a macOS-based or Linux-based runner."
exit 2
- name: Install Dependencies 🛍️
if: runner.os == 'Linux'
shell: bash
run: |
: Install Dependencies 🛍️
echo ::group::Install Dependencies
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@16/bin" >> $GITHUB_PATH
brew install --quiet zsh
echo ::endgroup::
- name: Run clang-format 🐉
id: result
shell: zsh --no-rcs --errexit --pipefail {0}
working-directory: ${{ inputs.workingDirectory }}
env:
GITHUB_EVENT_FORCED: ${{ github.event.forced }}
GITHUB_REF_BEFORE: ${{ github.event.before }}
run: |
: Run clang-format 🐉
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
local -a changes=($(git diff --name-only HEAD~1 HEAD))
case ${GITHUB_EVENT_NAME} {
pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;;
push) if [[ ${GITHUB_EVENT_FORCED} != true ]] changes=($(git diff --name-only ${GITHUB_REF_BEFORE} HEAD)) ;;
*) ;;
}
if (( ${changes[(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)]} )) {
echo ::group::Install clang-format-16
brew install --quiet obsproject/tools/clang-format@16
echo ::endgroup::
echo ::group::Run clang-format-16
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check
echo ::endgroup::
}

View File

@ -0,0 +1,59 @@
name: Run cmake-format
description: Runs cmake-format and checks for any changes introduced by it
inputs:
failCondition:
description: Controls whether failed checks also fail the workflow run
required: false
default: 'never'
workingDirectory:
description: Working directory for checks
required: false
default: ${{ github.workspace }}
runs:
using: composite
steps:
- name: Check Runner Operating System 🏃‍♂️
if: runner.os == 'Windows'
shell: bash
run: |
: Check Runner Operating System 🏃‍♂️
echo "::notice::run-cmake-format action requires a macOS-based or Linux-based runner."
exit 2
- name: Install Dependencies 🛍️
if: runner.os == 'Linux'
shell: bash
run: |
: Install Dependencies 🛍️
echo ::group::Install Dependencies
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
brew install --quiet zsh
echo ::endgroup::
- name: Run cmake-format 🎛️
id: result
shell: zsh --no-rcs --errexit --pipefail {0}
working-directory: ${{ github.workspace }}
env:
GITHUB_EVENT_FORCED: ${{ github.event.forced }}
GITHUB_REF_BEFORE: ${{ github.event.before }}
run: |
: Run cmake-format 🎛️
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
local -a changes=($(git diff --name-only HEAD~1 HEAD))
case ${GITHUB_EVENT_NAME} {
pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;;
push) if [[ ${GITHUB_EVENT_FORCED} != true ]] changes=($(git diff --name-only ${GITHUB_REF_BEFORE} HEAD)) ;;
*) ;;
}
if (( ${changes[(I)*.cmake|*CMakeLists.txt]} )) {
echo ::group::Install cmakelang
pip3 install cmakelang
echo ::endgroup::
echo ::group::Run cmake-format
./build-aux/run-cmake-format --fail-${{ inputs.failCondition }} --check
echo ::endgroup::
}

41
.github/actions/run-tests/action.yaml vendored Normal file
View File

@ -0,0 +1,41 @@
name: "Run tests"
description: "Run tests."
inputs:
target:
description: "Build target"
required: true
workingDirectory:
description: "Working directory"
required: false
default: ${{ github.workspace }}
config:
description: "Build config"
required: false
default: ""
runs:
using: "composite"
steps:
- name: Run macOS tests
if: ${{ runner.os == 'macOS' }}
shell: zsh {0}
run: |
if [[ '${{ inputs.target }}' != 'macos-universal' ]]; then
echo tests skipped!
exit 0
fi
${{ inputs.workingDirectory }}/build_macos/tests/${{ inputs.config }}/advanced-scene-switcher-tests
- name: Run Linux packaging
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
if [[ '${{ inputs.target }}' != 'x86_64' ]]; then
exit 0
fi
${{ inputs.workingDirectory }}/build_x86_64/tests/advanced-scene-switcher-tests
- name: Run Windows packaging
if: ${{ runner.os == 'Windows' }}
shell: pwsh
run: |
${{ inputs.workingDirectory }}/build_x64/tests/${{ inputs.config }}/advanced-scene-switcher-tests.exe

View File

@ -0,0 +1,154 @@
name: Set up macOS codesigning
description: Sets up code signing certificates, provisioning profiles, and notarization information
inputs:
codesignIdentity:
description: Codesigning identity
required: true
installerIdentity:
description: Codesigning identity for package installer
required: false
codesignCertificate:
description: PKCS12 certificate in base64 format
required: true
certificatePassword:
description: Password required to install PKCS12 certificate
required: true
keychainPassword:
description: Password to use for temporary keychain
required: false
notarizationUser:
description: Apple ID to use for notarization
required: false
notarizationPassword:
description: Application password for notarization
provisioningProfile:
description: Provisioning profile in base64 format
required: false
outputs:
haveCodesignIdent:
description: True if necessary codesigning credentials were found
value: ${{ steps.codesign.outputs.haveCodesignIdent }}
haveProvisioningProfile:
description: True if necessary provisioning profile credentials were found
value: ${{ steps.provisioning.outputs.haveProvisioningProfile }}
haveNotarizationUser:
description: True if necessary notarization credentials were found
value: ${{ steps.notarization.outputs.haveNotarizationUser }}
codesignIdent:
description: Codesigning identity
value: ${{ steps.codesign.outputs.codesignIdent }}
installerIdent:
description: Codesigning identity for package installer
value: ${{ steps.codesign.outputs.installerIdent }}
codesignTeam:
description: Codesigning team
value: ${{ steps.codesign.outputs.codesignTeam }}
runs:
using: composite
steps:
- name: Check Runner Operating System 🏃‍♂️
if: runner.os != 'macOS'
shell: bash
run: |
: Check Runner Operating System 🏃‍♂️
echo "setup-macos-codesigning action requires a macOS-based runner."
exit 2
- name: macOS Codesigning ✍️
shell: zsh --no-rcs --errexit --pipefail {0}
id: codesign
env:
MACOS_SIGNING_IDENTITY: ${{ inputs.codesignIdentity }}
MACOS_SIGNING_IDENTITY_INSTALLER: ${{ inputs.installerIdentity}}
MACOS_SIGNING_CERT: ${{ inputs.codesignCertificate }}
MAOCS_SIGNING_CERT_PASSWORD: ${{ inputs.certificatePassword }}
MACOS_KEYCHAIN_PASSWORD: ${{ inputs.keychainPassword }}
run: |
: macOS Codesigning ✍️
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
if [[ ${MACOS_SIGNING_IDENTITY} && ${MACOS_SIGNING_IDENTITY_INSTALLER} && ${MACOS_SIGNING_CERT} ]] {
print 'haveCodesignIdent=true' >> $GITHUB_OUTPUT
local -r certificate_path="${RUNNER_TEMP}/build_certificate.p12"
local -r keychain_path="${RUNNER_TEMP}/app-signing.keychain-db"
print -n "${MACOS_SIGNING_CERT}" | base64 --decode --output="${certificate_path}"
: "${MACOS_KEYCHAIN_PASSWORD:="$(print ${RANDOM} | shasum | head -c 32)"}"
print '::group::Keychain setup'
security create-keychain -p "${MACOS_KEYCHAIN_PASSWORD}" ${keychain_path}
security set-keychain-settings -lut 21600 ${keychain_path}
security unlock-keychain -p "${MACOS_KEYCHAIN_PASSWORD}" ${keychain_path}
security import "${certificate_path}" -P "${MAOCS_SIGNING_CERT_PASSWORD}" -A \
-t cert -f pkcs12 -k ${keychain_path} \
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/xcrun
security set-key-partition-list -S 'apple-tool:,apple:' -k "${MACOS_KEYCHAIN_PASSWORD}" \
${keychain_path} &> /dev/null
security list-keychain -d user -s ${keychain_path} 'login-keychain'
print '::endgroup::'
local -r team_id="${${MACOS_SIGNING_IDENTITY##* }//(\(|\))/}"
print "codesignIdent=${MACOS_SIGNING_IDENTITY}" >> $GITHUB_OUTPUT
print "installerIdent=${MACOS_SIGNING_IDENTITY_INSTALLER}" >> $GITHUB_OUTPUT
print "MACOS_KEYCHAIN_PASSWORD=${MACOS_KEYCHAIN_PASSWORD}" >> $GITHUB_ENV
print "codesignTeam=${team_id}" >> $GITHUB_OUTPUT
} else {
print 'haveCodesignIdent=false' >> $GITHUB_OUTPUT
}
- name: Provisioning Profile 👤
shell: zsh --no-rcs --errexit --pipefail {0}
id: provisioning
if: ${{ fromJSON(steps.codesign.outputs.haveCodesignIdent) }}
env:
MACOS_SIGNING_PROVISIONING_PROFILE: ${{ inputs.provisioningProfile }}
run: |
: Provisioning Profile 👤
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
if [[ ${MACOS_SIGNING_PROVISIONING_PROFILE} ]] {
print 'haveProvisioningProfile=true' >> $GITHUB_OUTPUT
local -r profile_path="${RUNNER_TEMP}/build_profile.provisionprofile"
print -n "${MACOS_SIGNING_PROVISIONING_PROFILE}" \
| base64 --decode --output ${profile_path}
print '::group::Provisioning Profile Setup'
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
security cms -D -i ${profile_path} -o ${RUNNER_TEMP}/build_profile.plist
local -r uuid="$(plutil -extract UUID raw ${RUNNER_TEMP}/build_profile.plist)"
local -r team_id="$(plutil -extract TeamIdentifier.0 raw -expect string ${RUNNER_TEMP}/build_profile.plist)"
if [[ ${team_id} != '${{ steps.codesign.codesignTeam }}' ]] {
print '::notice::Code Signing team in provisioning profile does not match certificate.'
}
cp ${profile_path} ~/Library/MobileDevice/Provisioning\ Profiles/${uuid}.provisionprofile
print "provisioningProfileUUID=${uuid}" >> $GITHUB_OUTPUT
print '::endgroup::'
} else {
print 'haveProvisioningProfile=false' >> $GITHUB_OUTPUT
}
- name: Notarization 🧑‍💼
shell: zsh --no-rcs --errexit --pipefail {0}
id: notarization
if: ${{ fromJSON(steps.codesign.outputs.haveCodesignIdent) }}
env:
MACOS_NOTARIZATION_USERNAME: ${{ inputs.notarizationUser }}
MACOS_NOTARIZATION_PASSWORD: ${{ inputs.notarizationPassword }}
run: |
: Notarization 🧑‍💼
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
if [[ ${MACOS_NOTARIZATION_USERNAME} && ${MACOS_NOTARIZATION_PASSWORD} ]] {
print 'haveNotarizationUser=true' >> $GITHUB_OUTPUT
} else {
print 'haveNotarizationUser=false' >> $GITHUB_OUTPUT
}

18
.github/scripts/.Aptfile vendored Normal file
View File

@ -0,0 +1,18 @@
package 'cmake'
package 'ccache'
package 'git'
package 'jq'
package 'ninja-build', bin: 'ninja'
package 'pkg-config'
package 'libcurl4-openssl-dev'
package 'libxtst-dev'
package 'libxss-dev'
package 'libopencv-dev'
package 'libtesseract-dev'
package 'libproc2-dev'
package 'libusb-1.0-0-dev'
package 'libpaho-mqttpp-dev'
package 'libpaho-mqtt-dev'
package 'libpaho-mqtt-dev'
package 'libasound2-dev'
package 'libpipewire-0.3-dev'

7
.github/scripts/.Brewfile vendored Normal file
View File

@ -0,0 +1,7 @@
brew "ccache"
brew "coreutils"
brew "cmake"
brew "jq"
brew "xcbeautify"
brew "automake"
brew "libtool"

4
.github/scripts/.Wingetfile vendored Normal file
View File

@ -0,0 +1,4 @@
package 'cmake', path: 'Cmake\bin', bin: 'cmake'
package 'innosetup', path: 'Inno Setup 6', bin: 'iscc'
package 'OpenSSL', path: 'OpenSSL', bin: 'openssl'
package 'Microsoft.VisualStudio.Locator', path: 'vswhere', bin: 'vswhere'

523
.github/scripts/.build-deps.zsh vendored Executable file
View File

@ -0,0 +1,523 @@
#!/usr/bin/env zsh
builtin emulate -L zsh
setopt EXTENDED_GLOB
setopt PUSHD_SILENT
setopt ERR_EXIT
setopt ERR_RETURN
setopt NO_UNSET
setopt PIPE_FAIL
setopt NO_AUTO_PUSHD
setopt NO_PUSHD_IGNORE_DUPS
setopt FUNCTION_ARGZERO
## Enable for script debugging
# setopt WARN_CREATE_GLOBAL
# setopt WARN_NESTED_VAR
# setopt XTRACE
autoload -Uz is-at-least && if ! is-at-least 5.2; then
print -u2 -PR "%F{1}${funcstack[1]##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue."
exit 1
fi
_trap_error() {
print -u2 -PR '%F{1} ✖︎ script execution error%f'
print -PR -e "
Callstack:
${(j:\n :)funcfiletrace}
"
exit 2
}
build() {
if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h}
local host_os=${${(s:-:)ZSH_ARGZERO:t:r}[3]}
local project_root=${SCRIPT_HOME:A:h:h}
local buildspec_file="${project_root}/buildspec.json"
trap '_trap_error' ZERR
fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath})
autoload -Uz log_info log_error log_output set_loglevel check_${host_os} setup_${host_os} setup_obs setup_ccache
if [[ ! -r ${buildspec_file} ]] {
log_error \
'No buildspec.json found. Please create a build specification for your project.' \
'A buildspec.json.template file is provided in the repository to get you started.'
return 2
}
typeset -g -a skips=()
local -i _verbosity=1
local -r _version='1.0.0'
local -r -a _valid_targets=(
macos-universal
linux-x86_64
)
local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel)
if [[ ${host_os} == 'macos' ]] {
local -r -a _valid_generators=(Xcode Ninja 'Unix Makefiles')
local generator="${${CI:+Ninja}:-Xcode}"
} else {
local -r -a _valid_generators=(Ninja 'Unix Makefiles')
local generator='Ninja'
}
local -r _usage="
Usage: %B${functrace[1]%:*}%b <option> [<options>]
%BOptions%b:
%F{yellow} Build configuration options%f
-----------------------------------------------------------------------------
%B-t | --target%b Specify target - default: %B%F{green}${host_os}-${CPUTYPE}%f%b
%B-c | --config%b Build configuration - default: %B%F{green}RelWithDebInfo%f%b
%B-o | --out%b Output directory - default: %B%F{green}RelWithDebInfo%f%b
%B--generator%b Specify build system to generate - default: %B%F{green}Ninja%f%b
Available generators:
- Ninja
- Unix Makefiles
- Xcode (macOS only)
%F{yellow} Output options%f
-----------------------------------------------------------------------------
%B-q | --quiet%b Quiet (error output only)
%B-v | --verbose%b Verbose (more detailed output)
%B--skip-[all|build|deps|unpack]%b Skip all|building OBS|checking for dependencies|unpacking dependencies
%B--debug%b Debug (very detailed and added output)
%F{yellow} General options%f
-----------------------------------------------------------------------------
%B-h | --help%b Print this usage help
%B-V | --version%b Print script version information"
local -a args
while (( # )) {
case ${1} {
-t|--target|-c|--config|--generator)
if (( # == 1 )) || [[ ${2:0:1} == '-' ]] {
log_error "Missing value for option %B${1}%b"
log_output ${_usage}
exit 2
}
;;
}
case ${1} {
--)
shift
args+=($@)
break
;;
-t|--target)
if (( ! ${_valid_targets[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
target=${2}
shift 2
;;
-c|--config)
if (( ! ${_valid_configs[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
config=${2}
shift 2
;;
-o|--out)
OUT_DIR="${2}"
shift 2
;;
-q|--quiet) (( _verbosity -= 1 )) || true; shift ;;
-v|--verbose) (( _verbosity += 1 )); shift ;;
-h|--help) log_output ${_usage}; exit 0 ;;
-V|--version) print -Pr "${_version}"; exit 0 ;;
--debug) _verbosity=3; shift ;;
--generator)
if (( ! ${_valid_generators[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
generator=${2}
shift 2
;;
--skip-*)
local _skip="${${(s:-:)1}[-1]}"
local _check=(all deps unpack build)
(( ${_check[(Ie)${_skip}]} )) || log_warning "Invalid skip mode %B${_skip}%b supplied"
typeset -g -a skips=(${skips} ${_skip})
shift
;;
*) log_error "Unknown option: %B${1}%b"; log_output ${_usage}; exit 2 ;;
}
}
set -- ${(@)args}
set_loglevel ${_verbosity}
check_${host_os}
setup_ccache
local product_name
local product_version
local git_tag="$(git describe --tags)"
read -r product_name product_version <<< \
"$(jq -r '. | {name, version} | join(" ")' ${buildspec_file})"
if [[ "${git_tag}" =~ '^([0-9]+\.){0,2}(\*|[0-9]+)$' ]] {
log_info "Using git tag as version identifier '${git_tag}'"
product_version="${git_tag}"
} else {
log_info "Using buildspec.json version identifier '${product_version}'"
}
case ${host_os} {
macos)
sed -i '' \
"s/project(\(.*\) VERSION \(.*\))/project(${product_name} VERSION ${product_version})/" \
"${project_root}/CMakeLists.txt"
;;
linux)
sed -i'' \
"s/project(\(.*\) VERSION \(.*\))/project(${product_name} VERSION ${product_version})/"\
"${project_root}/CMakeLists.txt"
;;
}
log_info "Run plugin configure step to download OBS deps ..."
pushd ${project_root}
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)build]}) )) {
log_group "Configuring ${product_name}..."
local -a cmake_args=()
local -a cmake_build_args=(--build)
local -a cmake_install_args=(--install)
case ${_loglevel} {
0) cmake_args+=(-Wno_deprecated -Wno-dev --log-level=ERROR) ;;
1) ;;
2) cmake_build_args+=(--verbose) ;;
*) cmake_args+=(--debug-output) ;;
}
local -r _preset="${target%%-*}${CI:+-ci}"
case ${target} {
macos-*)
if (( ${+CI} )) typeset -gx NSUnbufferedIO=YES
cmake_args+=(
-DENABLE_TWITCH_PLUGIN=OFF
--preset ${_preset}
)
if (( codesign )) {
autoload -Uz read_codesign_team && read_codesign_team
if [[ -z ${CODESIGN_TEAM} ]] {
autoload -Uz read_codesign && read_codesign
}
}
cmake_args+=(
-DCODESIGN_TEAM=${CODESIGN_TEAM:-}
-DCODESIGN_IDENTITY=${CODESIGN_IDENT:--}
)
cmake_build_args+=(--preset ${_preset} --parallel --config ${config} -- ONLY_ACTIVE_ARCH=NO -arch arm64 -arch x86_64)
cmake_install_args+=(build_macos --config ${config} --prefix "${project_root}/release/${config}")
local -a xcbeautify_opts=()
if (( _loglevel == 0 )) xcbeautify_opts+=(--quiet)
;;
linux-*)
cmake_args+=(
--preset ${_preset}-${target##*-}
-G "${generator}"
-DQT_VERSION=${QT_VERSION:-6}
-DCMAKE_BUILD_TYPE=${config}
)
local cmake_version
read -r _ _ cmake_version <<< "$(cmake --version)"
if [[ ${CPUTYPE} != ${target##*-} ]] {
if is-at-least 3.21.0 ${cmake_version}; then
cmake_args+=(--toolchain "${project_root}/cmake/linux/toolchains/${target##*-}-linux-gcc.cmake")
else
cmake_args+=(-D"CMAKE_TOOLCHAIN_FILE=${project_root}/cmake/linux/toolchains/${target##*-}-linux-gcc.cmake")
fi
}
cmake_build_args+=(--preset ${_preset}-${target##*-} --config ${config})
if [[ ${generator} == 'Unix Makefiles' ]] {
cmake_build_args+=(--parallel $(( $(nproc) + 1 )))
} else {
cmake_build_args+=(--parallel)
}
cmake_install_args+=(build_${target##*-} --prefix ${project_root}/release/${config})
;;
}
log_debug "Attempting to configure with CMake arguments: ${cmake_args}"
cmake ${cmake_args}
}
popd
log_group
if [[ -z "${OUT_DIR}" ]] {
OUT_DIR=".deps/advss-build-dependencies"
}
mkdir -p "${project_root}/${OUT_DIR}"
local advss_dep_path="$(realpath ${project_root}/${OUT_DIR})"
local deps_version=$(jq -r '.dependencies.prebuilt.version' ${buildspec_file})
local qt_deps_version=$(jq -r '.dependencies.qt6.version' ${buildspec_file})
local _plugin_deps="${project_root:h}/.deps/obs-deps-${deps_version}-${target##*-};${project_root:h}/.deps/obs-deps-qt6-${qt_deps_version}-${target##*-}"
case ${host_os} {
macos)
local opencv_dir="${project_root}/deps/opencv"
local opencv_build_dir="${opencv_dir}/build_${target##*-}"
local -a opencv_cmake_args=(
-DCMAKE_BUILD_TYPE=Release
-DBUILD_LIST=core,imgproc,objdetect
-DCMAKE_OSX_ARCHITECTURES=${${target##*-}//universal/x86_64;arm64}
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
-DCMAKE_PREFIX_PATH="${advss_dep_path};${_plugin_deps}"
-DCMAKE_INSTALL_PREFIX="${advss_dep_path}"
)
if [ "${target}" != "macos-x86_64" ]; then
opencv_cmake_args+=(-DWITH_IPP=OFF)
fi
pushd ${opencv_dir}
log_info "Configure OpenCV ..."
cmake -S . -B ${opencv_build_dir} ${opencv_cmake_args}
log_info "Building OpenCV ..."
cmake --build ${opencv_build_dir} --config Release
log_info "Installing OpenCV ..."
cmake --install ${opencv_build_dir} --prefix "${advss_dep_path}" --config Release || true
popd
local leptonica_dir="${project_root}/deps/leptonica"
local leptonica_build_dir="${leptonica_dir}/build_${target##*-}"
local -a leptonica_cmake_args=(
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_OSX_ARCHITECTURES=${${target##*-}//universal/x86_64;arm64}
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
-DSW_BUILD=OFF
-DOPENJPEG_SUPPORT=OFF
-DLIBWEBP_SUPPORT=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_GIF=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_JPEG=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_TIFF=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE
-DCMAKE_PREFIX_PATH="${advss_dep_path};${_plugin_deps}"
-DCMAKE_INSTALL_PREFIX="${advss_dep_path}"
)
pushd ${leptonica_dir}
log_info "Configure Leptonica ..."
cmake -S . -B ${leptonica_build_dir} ${leptonica_cmake_args}
log_info "Building Leptonica ..."
cmake --build ${leptonica_build_dir} --config Release
log_info "Installing Leptonica ..."
# Workaround for "unknown file attribute: H" errors when running install
cmake --install ${leptonica_build_dir} --prefix "${advss_dep_path}" --config Release || :
popd
local tesseract_dir="${project_root}/deps/tesseract"
local tesseract_build_dir_x86_64="${tesseract_dir}/build_x86_64"
pushd ${tesseract_dir}
log_info "Configure Tesseract (x86_64) ..."
local -a tesseract_cmake_args=(
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_SYSTEM_NAME="Darwin"
-DCMAKE_OSX_ARCHITECTURES=x86_64
-DCMAKE_SYSTEM_PROCESSOR=x86_64
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
-DSW_BUILD=OFF
-DBUILD_TRAINING_TOOLS=OFF
-DCMAKE_PREFIX_PATH="${advss_dep_path};${_plugin_deps}"
-DCMAKE_INSTALL_PREFIX="${advss_dep_path}"
)
cmake -S . -B ${tesseract_build_dir_x86_64} ${tesseract_cmake_args}
log_info "Building Tesseract (x86_64) ..."
cmake --build ${tesseract_build_dir_x86_64} --config Release
log_info "Configure Tesseract (arm64) ..."
git checkout .
local tesseract_build_dir_arm64="${tesseract_dir}/build_arm64"
local -a tesseract_cmake_args=(
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_SYSTEM_NAME="Darwin"
-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_SYSTEM_PROCESSOR=arm64
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
-DSW_BUILD=OFF
-DBUILD_TRAINING_TOOLS=OFF
-DCMAKE_PREFIX_PATH="${advss_dep_path};${_plugin_deps}"
-DCMAKE_INSTALL_PREFIX="${advss_dep_path}"
)
cmake -S . -B ${tesseract_build_dir_arm64} ${tesseract_cmake_args}
log_info "Building Tesseract (arm64) ..."
cmake --build ${tesseract_build_dir_arm64} --config Release
log_info "Combine arm and x86 libtesseract binaries ..."
mv ${tesseract_build_dir_arm64}/libtesseract.a ${tesseract_build_dir_arm64}/libtesseract_arm.a
lipo -create ${tesseract_build_dir_x86_64}/libtesseract.a ${tesseract_build_dir_arm64}/libtesseract_arm.a -output ${tesseract_build_dir_arm64}/libtesseract.a
log_info "Installing Tesseract..."
cmake --install ${tesseract_build_dir_arm64} --prefix "${advss_dep_path}" --config Release
popd
log_info "Prepare openssl ..."
rm -rf ${advss_dep_path}/openssl ${advss_dep_path}/openssl_build
mkdir ${advss_dep_path}/openssl_build
pushd ${advss_dep_path}/openssl_build
rm -rf openssl
git clone https://github.com/openssl/openssl.git --branch openssl-3.1.2 --depth 1
mv openssl openssl_x86
cp -r openssl_x86 openssl_arm
log_info "Building openssl x86 ..."
export MACOSX_DEPLOYMENT_TARGET=10.9
pushd openssl_x86
./Configure darwin64-x86_64-cc no-shared no-module no-zlib --prefix=${advss_dep_path}
make -j$(nproc)
popd
log_info "Building openssl arm ..."
export MACOSX_DEPLOYMENT_TARGET=10.15
pushd openssl_arm
./Configure enable-rc5 darwin64-arm64-cc no-shared no-module no-asm no-zlib --prefix=${advss_dep_path}
make -j$(nproc)
log_info "Install openssl ..."
make install
popd
log_info "Combine arm and x86 openssl binaries ..."
lipo -create openssl_x86/libcrypto.a openssl_arm/libcrypto.a -output ${advss_dep_path}/lib/libcrypto.a
lipo -create openssl_x86/libssl.a openssl_arm/libssl.a -output ${advss_dep_path}/lib/libssl.a
log_info "Clean up openssl dir ..."
rm -rf openssl_x86 openssl_arm
popd
pushd ${project_root}/deps/libusb
log_info "Configure libusb x86 ..."
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export CC=$(xcrun --sdk macosx --find clang)
export CXX=$(xcrun --sdk macosx --find clang++)
export CFLAGS="-arch x86_64 -isysroot $SDKROOT"
export CXXFLAGS="-arch x86_64 -isysroot $SDKROOT"
export LDFLAGS="-arch x86_64 -isysroot $SDKROOT"
export MACOSX_DEPLOYMENT_TARGET=10.15
log_info "Building libusb x86 ..."
mkdir ${project_root}/deps/libusb/out_x86
./autogen.sh
./configure --host=x86_64-apple-darwin --prefix=${advss_dep_path}
make -j$(nproc)
make install
log_info "Configure libusb arm ..."
make clean
rm -r ${project_root}/deps/libusb/out_x86
mkdir ${project_root}/deps/libusb/out_x86
./configure --host=aarch64-apple-darwin --prefix=${project_root}/deps/libusb/out_x86
make -j$(nproc)
make install
log_info "Building libusb arm ..."
make clean
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export CC=$(xcrun --sdk macosx --find clang)
export CXX=$(xcrun --sdk macosx --find clang++)
export CFLAGS="-arch arm64 -isysroot $SDKROOT"
export CXXFLAGS="-arch arm64 -isysroot $SDKROOT"
export LDFLAGS="-arch arm64 -isysroot $SDKROOT"
export MACOSX_DEPLOYMENT_TARGET=10.15
mkdir ${project_root}/deps/libusb/out_arm
./configure --host=aarch64-apple-darwin --prefix=${project_root}/deps/libusb/out_arm
make -j$(nproc)
make install
log_info "Combine arm and x86 libusb binaries ..."
lipo -create ${project_root}/deps/libusb/out_x86/lib/libusb-1.0.0.dylib \
${project_root}/deps/libusb/out_arm/lib/libusb-1.0.0.dylib \
-output ${advss_dep_path}/lib/temp-libusb-1.0.0.dylib
mv ${advss_dep_path}/lib/temp-libusb-1.0.0.dylib ${advss_dep_path}/lib/libusb-1.0.0.dylib
install_name_tool -id @rpath/libusb-1.0.0.dylib ${advss_dep_path}/lib/libusb-1.0.0.dylib
log_info "Clean up libusb ..."
unset SDKROOT
unset CC
unset CXX
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
unset MACOSX_DEPLOYMENT_TARGET
popd
local mqtt_dir="${project_root}/deps/paho.mqtt.cpp"
local mqtt_build_dir="${mqtt_dir}/build_${target##*-}"
local -a mqtt_cmake_args=(
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_OSX_ARCHITECTURES=${${target##*-}//universal/x86_64;arm64}
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
-DCMAKE_PREFIX_PATH="${advss_dep_path};${_plugin_deps}"
-DCMAKE_INSTALL_PREFIX="${advss_dep_path}"
-DPAHO_BUILD_SHARED=OFF
-DPAHO_BUILD_STATIC=ON
-DPAHO_WITH_MQTT_C=ON
-DPAHO_WITH_SSL=ON
-DOPENSSL_USE_STATIC_LIBS=ON
)
pushd ${mqtt_dir}
log_info "Configure paho.mqtt.cpp ..."
cmake -S . -B ${mqtt_build_dir} ${mqtt_cmake_args}
log_info "Building paho.mqtt.cpp ..."
cmake --build ${mqtt_build_dir} --config Release
log_info "Installing paho.mqtt.cpp ..."
cmake --install ${mqtt_build_dir} --prefix "${advss_dep_path}" --config Release
popd
;;
linux)
# Nothing to do for now
;;
}
}
build ${@}

334
.github/scripts/.build.zsh vendored Executable file
View File

@ -0,0 +1,334 @@
#!/usr/bin/env zsh
builtin emulate -L zsh
setopt EXTENDED_GLOB
setopt PUSHD_SILENT
setopt ERR_EXIT
setopt ERR_RETURN
setopt NO_UNSET
setopt PIPE_FAIL
setopt NO_AUTO_PUSHD
setopt NO_PUSHD_IGNORE_DUPS
setopt FUNCTION_ARGZERO
## Enable for script debugging
# setopt WARN_CREATE_GLOBAL
# setopt WARN_NESTED_VAR
# setopt XTRACE
autoload -Uz is-at-least && if ! is-at-least 5.2; then
print -u2 -PR "${CI:+::error::}%F{1}${funcstack[1]##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue."
exit 1
fi
TRAPEXIT() {
local return_value=$?
if (( ${+CI} )) unset NSUnbufferedIO
return ${return_value}
}
TRAPZERR() {
if (( ${_loglevel:-3} > 2 )) {
print -u2 -PR "${CI:+::error::}%F{1} ✖︎ script execution error%f"
print -PR -e "
Callstack:
${(j:\n :)funcfiletrace}
"
}
exit 2
}
build() {
if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h}
local host_os=${${(s:-:)ZSH_ARGZERO:t:r}[2]}
local project_root=${SCRIPT_HOME:A:h:h}
local buildspec_file=${project_root}/buildspec.json
local dep_dir=""
fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath})
autoload -Uz log_group log_info log_error log_output set_loglevel check_${host_os} setup_ccache
if [[ ! -r ${buildspec_file} ]] {
log_error \
'No buildspec.json found. Please create a build specification for your project.'
return 2
}
typeset -g -a skips=()
local -i verbosity=1
local -r _version='2.0.0'
local -r -a _valid_targets=(
macos-universal
linux-x86_64
linux-aarch64
)
local target
local config='RelWithDebInfo'
local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel)
local -i codesign=0
if [[ ${host_os} == linux ]] {
local -r -a _valid_generators=(Ninja 'Unix Makefiles')
local generator='Ninja'
local -r _usage_host="
%F{yellow} Additional options for Linux builds%f
-----------------------------------------------------------------------------
%B--generator%b Specify build system to generate
Available generators:
- Ninja
- Unix Makefiles"
} elif [[ ${host_os} == macos ]] {
local -r _usage_host="
%F{yellow} Additional options for macOS builds%f
-----------------------------------------------------------------------------
%B-s | --codesign%b Enable codesigning (macOS only)"
}
local -i print_config=0
local -r _usage="
Usage: %B${functrace[1]%:*}%b <option> [<options>]
%BOptions%b:
%F{yellow} Build configuration options%f
-----------------------------------------------------------------------------
%B-t | --target%b Specify target
%B-c | --config%b Build configuration
%B-p | --portable%b Enable portable mode (Linux only)
%B-d | --dep%b Dependency directory name - default: %B%F{green}advss-build-dependencies%f%b
%B--skip-[all|build|deps]%b Skip all|building|checking for dependencies
%F{yellow} Output options%f
-----------------------------------------------------------------------------
%B-q | --quiet%b Quiet (error output only)
%B-v | --verbose%b Verbose (more detailed output)
%B--debug%b Debug (very detailed and added output)
%F{yellow} General options%f
-----------------------------------------------------------------------------
%B-h | --help%b Print this usage help
%B-V | --version%b Print script version information
${_usage_host:-}"
local -a args
while (( # )) {
case ${1} {
-t|--target|-c|--config|--generator)
if (( # == 1 )) || [[ ${2:0:1} == '-' ]] {
log_error "Missing value for option %B${1}%b"
log_output ${_usage}
exit 2
}
;;
}
case ${1} {
--)
shift
args+=($@)
break
;;
-t|--target)
if (( ! ${_valid_targets[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
target=${2}
shift 2
;;
-c|--config)
if (( ! ${_valid_configs[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
config=${2}
shift 2
;;
-s|--codesign) codesign=1; shift ;;
-d|--dep)
dep_dir="${2}"
shift 2
;;
-p|--portable) typeset -g PORTABLE=1; shift ;;
-q|--quiet) (( verbosity -= 1 )) || true; shift ;;
-v|--verbose) (( verbosity += 1 )); shift ;;
-h|--help) log_output ${_usage}; exit 0 ;;
-V|--version) print -Pr "${_version}"; exit 0 ;;
--debug) verbosity=3; shift ;;
--generator)
if [[ ${host_os} == linux ]] {
if (( ! ${_valid_generators[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
generator=${2}
}
shift 2
;;
--print-config) print_config=1; skips+=(deps); shift ;;
--skip-*)
local -r _skip="${${(s:-:)1}[-1]}"
local -r -a _check=(all build deps)
(( ${_check[(Ie)${_skip}]} )) || log_warning "Invalid skip mode %B${_skip}%b supplied"
typeset -g -a skips=(${skips} ${_skip})
shift
;;
*) log_error "Unknown option: %B${1}%b"; log_output ${_usage}; exit 2 ;;
}
}
: "${target:="${host_os}-${CPUTYPE}"}"
set -- ${(@)args}
set_loglevel ${verbosity}
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) {
check_${host_os}
setup_ccache
}
if [[ ${host_os} == linux ]] {
autoload -Uz setup_linux && setup_linux
}
local advss_deps_path
if [[ -z "${dep_dir}" ]] {
log_info "Building advss deps ..."
dep_dir=".deps/advss-build-dependencies"
${SCRIPT_HOME}/build-deps-${host_os}.zsh -c "${BUILD_CONFIG:-RelWithDebInfo}" -t "${target}" --generator "${generator}" -o "${dep_dir}"
}
advss_deps_path=$(realpath ${project_root}/${dep_dir})
log_info "Using advss deps at $advss_deps_path ..."
local product_name
local product_version
local git_tag="$(git describe --tags)"
read -r product_name product_version <<< \
"$(jq -r '. | {name, version} | join(" ")' ${buildspec_file})"
if [[ "${git_tag}" =~ '^([0-9]+\.){0,2}(\*|[0-9]+)$' ]] {
log_info "Using git tag as version identifier '${git_tag}'"
product_version="${git_tag}"
} else {
log_info "Using buildspec.json version identifier '${product_version}'"
}
case ${host_os} {
macos)
sed -i '' \
"s/project(\(.*\) VERSION \(.*\))/project(${product_name} VERSION ${product_version})/" \
"${project_root}/CMakeLists.txt"
;;
linux)
sed -i'' \
"s/project(\(.*\) VERSION \(.*\))/project(${product_name} VERSION ${product_version})/"\
"${project_root}/CMakeLists.txt"
;;
}
pushd ${project_root}
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)build]}) )) {
log_group "Configuring ${product_name}..."
local -a cmake_args=(
-DCMAKE_PREFIX_PATH="${advss_deps_path}"
)
local -a cmake_build_args=(--build)
local -a cmake_install_args=(--install)
case ${_loglevel} {
0) cmake_args+=(-Wno_deprecated -Wno-dev --log-level=ERROR) ;;
1) ;;
2) cmake_build_args+=(--verbose) ;;
*) cmake_args+=(--debug-output) ;;
}
local -r _preset="${target%%-*}${CI:+-ci}"
case ${target} {
macos-*)
if (( ${+CI} )) typeset -gx NSUnbufferedIO=YES
cmake_args+=(
-DCMAKE_PREFIX_PATH="${advss_deps_path}"
--preset ${_preset}
)
if (( codesign )) {
autoload -Uz read_codesign_team && read_codesign_team
if [[ -z ${CODESIGN_TEAM} ]] {
autoload -Uz read_codesign && read_codesign
}
}
cmake_args+=(
-DCODESIGN_TEAM=${CODESIGN_TEAM:-}
-DCODESIGN_IDENTITY=${CODESIGN_IDENT:--}
)
cmake_build_args+=(--preset ${_preset} --parallel --config ${config} -- ONLY_ACTIVE_ARCH=NO -arch arm64 -arch x86_64)
cmake_install_args+=(build_macos --config ${config} --prefix "${project_root}/release/${config}")
local -a xcbeautify_opts=()
if (( _loglevel == 0 )) xcbeautify_opts+=(--quiet)
;;
linux-*)
cmake_args+=(
--preset ${_preset}-${target##*-}
-G "${generator}"
-DQT_VERSION=${QT_VERSION:-6}
-DCMAKE_BUILD_TYPE=${config}
-DCMAKE_INSTALL_PREFIX=/usr
)
local cmake_version
read -r _ _ cmake_version <<< "$(cmake --version)"
if [[ ${CPUTYPE} != ${target##*-} ]] {
if is-at-least 3.21.0 ${cmake_version}; then
cmake_args+=(--toolchain "${project_root}/cmake/linux/toolchains/${target##*-}-linux-gcc.cmake")
else
cmake_args+=(-D"CMAKE_TOOLCHAIN_FILE=${project_root}/cmake/linux/toolchains/${target##*-}-linux-gcc.cmake")
fi
}
cmake_build_args+=(--preset ${_preset}-${target##*-} --config ${config})
if [[ ${generator} == 'Unix Makefiles' ]] {
cmake_build_args+=(--parallel $(( $(nproc) + 1 )))
} else {
cmake_build_args+=(--parallel)
}
cmake_install_args+=(build_${target##*-} --prefix ${project_root}/release/${config})
;;
}
log_debug "Attempting to configure with CMake arguments: ${cmake_args}"
cmake ${cmake_args}
log_group "Building ${product_name}..."
if [[ ${host_os} == macos ]] {
if (( _loglevel > 1 )) {
cmake ${cmake_build_args}
} else {
cmake ${cmake_build_args} 2>&1 | xcbeautify ${xcbeautify_opts}
}
} else {
cmake ${cmake_build_args}
}
}
log_group "Installing ${product_name}..."
if (( _loglevel > 1 )) cmake_install_args+=(--verbose)
cmake ${cmake_install_args}
popd
log_group
}
build ${@}

283
.github/scripts/.package.zsh vendored Executable file
View File

@ -0,0 +1,283 @@
#!/usr/bin/env zsh
builtin emulate -L zsh
setopt EXTENDED_GLOB
setopt PUSHD_SILENT
setopt ERR_EXIT
setopt ERR_RETURN
setopt NO_UNSET
setopt PIPE_FAIL
setopt NO_AUTO_PUSHD
setopt NO_PUSHD_IGNORE_DUPS
setopt FUNCTION_ARGZERO
## Enable for script debugging
# setopt WARN_CREATE_GLOBAL
# setopt WARN_NESTED_VAR
# setopt XTRACE
autoload -Uz is-at-least && if ! is-at-least 5.2; then
print -u2 -PR "${CI:+::error::}%F{1}${funcstack[1]##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue."
exit 1
fi
TRAPEXIT() {
local return_value=$?
if (( ${+CI} )) {
unset NSUnbufferedIO
}
return ${return_value}
}
TRAPZERR() {
if (( ${_loglevel:-3} > 2 )) {
print -u2 -PR "${CI:+::error::}%F{1} ✖︎ script execution error%f"
print -PR -e "
Callstack:
${(j:\n :)funcfiletrace}
"
}
exit 2
}
package() {
if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h}
local host_os=${${(s:-:)ZSH_ARGZERO:t:r}[2]}
local project_root=${SCRIPT_HOME:A:h:h}
local buildspec_file=${project_root}/buildspec.json
fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath})
autoload -Uz set_loglevel log_info log_group log_error log_output check_${host_os}
if [[ ! -r ${buildspec_file} ]] {
log_error \
'No buildspec.json found. Please create a build specification for your project.'
return 2
}
local -i verbosity=1
local -r _version='2.0.0'
local -r -a _valid_targets=(
macos-universal
linux-x86_64
)
local target
local config='RelWithDebInfo'
local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel)
local -i codesign=0
local -i notarize=0
local -i package=0
local -i skip_deps=0
if [[ ${host_os} == macos ]] {
local -r _usage_host="
%F{yellow} Additional options for macOS builds%f
-----------------------------------------------------------------------------
%B-s | --codesign%b Enable codesigning (macOS only)
%B-n | --notarize%b Enable notarization (macOS only)
%B-p | --package%b Create package installer (macOS only)"
}
local -r _usage="
Usage: %B${functrace[1]%:*}%b <option> [<options>]
%BOptions%b:
%F{yellow} Package configuration options%f
-----------------------------------------------------------------------------
%B-t | --target%b Specify target
%B-c | --config%b Build configuration
%B--skip-deps%b Skip checking for dependencies
%F{yellow} Output options%f
-----------------------------------------------------------------------------
%B-q | --quiet%b Quiet (error output only)
%B-v | --verbose%b Verbose (more detailed output)
%B--debug%b Debug (very detailed and added output)
%F{yellow} General options%f
-----------------------------------------------------------------------------
%B-h | --help%b Print this usage help
%B-V | --version%b Print script version information
${_usage_host:-}"
local -a args
while (( # )) {
case ${1} {
-t|--target|-c|--config)
if (( # == 1 )) || [[ ${2:0:1} == '-' ]] {
log_error "Missing value for option %B${1}%b"
log_output ${_usage}
exit 2
}
;;
}
case ${1} {
--)
shift
args+=($@)
break
;;
-t|--target)
if (( ! ${_valid_targets[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
target=${2}
shift 2
;;
-c|--config)
if (( !${_valid_configs[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
config=${2}
shift 2
;;
-s|--codesign) typeset -g codesign=1; shift ;;
-n|--notarize) typeset -g notarize=1; typeset -g codesign=1; shift ;;
-p|--package) typeset -g package=1; shift ;;
--skip-deps) typeset -g skip_deps=1; shift ;;
-q|--quiet) (( verbosity -= 1 )) || true; shift ;;
-v|--verbose) (( verbosity += 1 )); shift ;;
-h|--help) log_output ${_usage}; exit 0 ;;
-V|--version) print -Pr "${_version}"; exit 0 ;;
--debug) verbosity=3; shift ;;
*) log_error "Unknown option: %B${1}%b"; log_output ${_usage}; exit 2 ;;
}
}
: "${target:="${host_os}-${CPUTYPE}"}"
set -- ${(@)args}
set_loglevel ${verbosity}
if (( ! skip_deps )) {
check_${host_os}
}
local product_name
local product_version
local git_tag="$(git describe --tags)"
read -r product_name product_version <<< \
"$(jq -r '. | {name, version} | join(" ")' ${buildspec_file})"
log_info "Using git tag as version identifier '${git_tag}'"
product_version="${git_tag}"
if [[ ${host_os} == macos ]] {
autoload -Uz check_packages read_codesign read_codesign_installer read_codesign_pass
local output_name="${product_name}-${product_version}-${host_os}-universal"
if [[ ! -d ${project_root}/release/${config}/${product_name}.plugin ]] {
log_error 'No release artifact found. Run the build script or the CMake install procedure first.'
return 2
}
local _tarflags='cJf'
if (( _loglevel > 1 || ${+CI} )) _tarflags="v${_tarflags}"
if (( package )) {
if [[ ! -f ${project_root}/release/${config}/${product_name}.pkg ]] {
log_error 'Installer Package not found. Run the build script or the CMake build and install procedures first.'
return 2
}
log_group "Packaging ${product_name}..."
pushd ${project_root}
if (( codesign )) {
read_codesign_installer
productsign \
--sign "${CODESIGN_IDENT_INSTALLER}" \
${project_root}/release/${config}/${product_name}.pkg \
${project_root}/release/${output_name}.pkg
rm ${project_root}/release/${config}/${product_name}.pkg
} else {
mv ${project_root}/release/${config}/${product_name}.pkg \
${project_root}/release/${output_name}.pkg
}
if (( codesign && notarize )) {
if [[ ! -f ${project_root}/release/${output_name}.pkg ]] {
log_error "No package for notarization found."
return 2
}
read_codesign_installer
read_codesign_pass
xcrun notarytool submit ${project_root}/release/${output_name}.pkg \
--keychain-profile "OBS-Codesign-Password" --wait
local -i _status=0
xcrun stapler staple ${project_root}/release/${output_name}.pkg || _status=1
if (( _status )) {
log_error "Notarization failed. Use 'xcrun notarytool log <submission ID>' to check for errors."
return 2
}
}
popd
}
log_group "Archiving ${product_name}..."
pushd ${project_root}/release/${config}
XZ_OPT=-T0 tar "-${_tarflags}" ${project_root}/release/${output_name}.tar.xz ${product_name}.plugin
popd
if [[ ${config} == Release ]] {
log_group "Archiving ${product_name} Debug Symbols..."
pushd ${project_root}/release/${config}
XZ_OPT=-T0 tar "-${_tarflags}" ${project_root}/release/${output_name}-dSYMs.tar.xz ${product_name}.plugin.dSYM
popd
}
log_group
} elif [[ ${host_os} == linux ]] {
local -a cmake_args=()
if (( _loglevel > 1 )) cmake_args+=(--verbose)
log_group "Creating source tarball for ${product_name}..."
pushd ${project_root}
cmake --build build_${target##*-} --config ${config} -t package_source ${cmake_args}
popd
local output_name="${product_name}-${product_version}-${target##*-}-linux-gnu"
if (( package )) {
log_group "Packaging ${product_name}..."
pushd ${project_root}
cmake --build build_${target##*-} --config ${config} -t package ${cmake_args}
# Mark certain deps as optional
build-aux/CI/linux/demote-deps.sh ${project_root}/release/*.deb Recommends '(mqtt)|(opencv)|(tesseract)|(usb)|(x11)'
if [ ! -e ${project_root}/release/${output_name}.deb ]; then
mv ${project_root}/release/*.deb ${project_root}/release/${output_name}.deb
mv ${project_root}/release/*.ddeb ${project_root}/release/${output_name}.ddeb
fi
popd
}
log_group "Archiving ${product_name}..."
local _tarflags='cJf'
if (( _loglevel > 1 || ${+CI} )) _tarflags="v${_tarflags}"
pushd ${project_root}/release/${config}
XZ_OPT=-T0 tar "-${_tarflags}" ${project_root}/release/${output_name}.tar.xz (lib|share)
popd
log_group
}
}
package ${@}

273
.github/scripts/Build-Deps-Windows.ps1 vendored Normal file
View File

@ -0,0 +1,273 @@
[CmdletBinding()]
param(
[ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')]
[string] $Configuration = 'RelWithDebInfo',
[ValidateSet('x86', 'x64')]
[string] $Target,
[ValidateSet('Visual Studio 17 2022', 'Visual Studio 16 2019')]
[string] $CMakeGenerator,
[string] $OutDirName,
[switch] $SkipDeps,
[switch] $SkipUnpack
)
$ErrorActionPreference = 'Stop'
if (-not $Target) {
$Target = "x64"
}
if ( $DebugPreference -eq 'Continue' ) {
$VerbosePreference = 'Continue'
$InformationPreference = 'Continue'
}
if ( $PSVersionTable.PSVersion -lt '7.0.0' ) {
Write-Warning 'The obs-deps PowerShell build script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6'
exit 2
}
function Build {
trap {
Pop-Location -Stack BuildTemp -ErrorAction 'SilentlyContinue'
Write-Error $_
exit 2
}
$ScriptHome = $PSScriptRoot
$ProjectRoot = Resolve-Path -Path "$PSScriptRoot/../.."
$BuildSpecFile = "${ProjectRoot}/buildspec.json"
$UtilityFunctions = Get-ChildItem -Path $PSScriptRoot/utils.pwsh/*.ps1 -Recurse
foreach ($Utility in $UtilityFunctions) {
Write-Debug "Loading $($Utility.FullName)"
. $Utility.FullName
}
if ( ! $SkipDeps ) {
Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
}
Log-Information "Run plugin configure step to download OBS deps ..."
Push-Location -Stack BuildTemp
if ( ! ( ( $SkipAll ) -or ( $SkipBuild ) ) ) {
Ensure-Location $ProjectRoot
$CmakeArgs = @(
"-DCMAKE_PREFIX_PATH:PATH=${ADVSSDepPath}"
)
$CmakeBuildArgs = @()
$CmakeInstallArgs = @()
if ( $VerbosePreference -eq 'Continue' ) {
$CmakeBuildArgs += ('--verbose')
$CmakeInstallArgs += ('--verbose')
}
if ( $DebugPreference -eq 'Continue' ) {
$CmakeArgs += ('--debug-output')
}
$Preset = "windows-$(if ( $Env:CI -ne $null ) { 'ci-' })${Target}"
$CmakeArgs += @(
'--preset', $Preset
)
$CmakeBuildArgs += @(
'--build'
'--preset', $Preset
'--config', $Configuration
'--parallel'
'--', '/consoleLoggerParameters:Summary', '/noLogo'
)
$CmakeInstallArgs += @(
'--install', "build_${Target}"
'--prefix', "${ProjectRoot}/release/${Configuration}"
'--config', $Configuration
)
Log-Group "Configuring ${ProductName}..."
Invoke-External cmake @CmakeArgs
}
$BuildSpec = Get-Content -Path ${BuildSpecFile} -Raw | ConvertFrom-Json
$depsVersion = $BuildSpec.dependencies.prebuilt.version
$qtDepsVersion = $BuildSpec.dependencies.qt6.version
$OBSDepPath = "$(Resolve-Path -Path ${ProjectRoot}/.deps/obs-deps-${depsVersion}-${Target});$(Resolve-Path -Path ${ProjectRoot}/.deps/obs-deps-qt6-${qtDepsVersion}-${Target})"
if ( $OutDirName -eq '' ) {
$OutDirName = ".deps/advss-build-dependencies"
}
New-Item -ItemType Directory -Force -Path ${ProjectRoot}/${OutDirName}
$ADVSSDepPath = "$(Resolve-Path -Path ${ProjectRoot}/${OutDirName})"
$OpenCVPath = "${ProjectRoot}/deps/opencv"
$OpenCVBuildPath = "${OpenCVPath}/build"
Push-Location -Stack BuildOpenCVTemp
Ensure-Location $ProjectRoot
$OpenCVCmakeArgs = @(
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_PREFIX_PATH:PATH=${OBSDepPath}"
"-DCMAKE_INSTALL_PREFIX:PATH=${ADVSSDepPath}"
"-DBUILD_LIST=core,imgproc,objdetect"
)
Log-Information "Configuring OpenCV..."
Invoke-External cmake -S ${OpenCVPath} -B ${OpenCVBuildPath} @OpenCVCmakeArgs
$OpenCVCmakeArgs = @(
'--config', "Release"
)
if ( $VerbosePreference -eq 'Continue' ) {
$OpenCVCmakeArgs += ('--verbose')
}
Log-Information "Building OpenCV..."
Invoke-External cmake --build "${OpenCVBuildPath}" @OpenCVCmakeArgs
Log-Information "Install OpenCV}..."
Invoke-External cmake --install "${OpenCVBuildPath}" --prefix "${ADVSSDepPath}" @OpenCVCmakeArgs
$LeptonicaPath = "${ProjectRoot}/deps/leptonica"
$LeptonicaBuildPath = "${LeptonicaPath}/build"
Push-Location -Stack BuildLeptonicaTemp
Ensure-Location $ProjectRoot
$LeptonicaCmakeArgs = @(
"-DCMAKE_BUILD_TYPE=${Configuration}"
"-DCMAKE_PREFIX_PATH:PATH=${OBSDepPath}"
"-DCMAKE_INSTALL_PREFIX:PATH=${ADVSSDepPath}"
"-DSW_BUILD=OFF"
"-DLIBWEBP_SUPPORT=OFF"
)
Log-Information "Configuring leptonica..."
Invoke-External cmake -S ${LeptonicaPath} -B ${LeptonicaBuildPath} @LeptonicaCmakeArgs
$LeptonicaCmakeArgs = @(
'--config', "${Configuration}"
)
if ( $VerbosePreference -eq 'Continue' ) {
$LeptonicaCmakeArgs += ('--verbose')
}
Log-Information "Building leptonica..."
Invoke-External cmake --build "${LeptonicaBuildPath}" @LeptonicaCmakeArgs
Log-Information "Install leptonica..."
Invoke-External cmake --install "${LeptonicaBuildPath}" --prefix "${ADVSSDepPath}" @LeptonicaCmakeArgs
Push-Location -Stack BuildTesseractTemp
Ensure-Location $ProjectRoot
$TesseractPath = "${ProjectRoot}/deps/tesseract"
$TesseractBuildPath = "${TesseractPath}/build"
# Explicitly disable PkgConfig and tiff as it will lead build errors
$TesseractCmakeArgs = @(
"-DCMAKE_BUILD_TYPE=${Configuration}"
"-DCMAKE_PREFIX_PATH:PATH=${OBSDepPath}"
"-DCMAKE_INSTALL_PREFIX:PATH=${ADVSSDepPath}"
"-DSW_BUILD=OFF"
"-DDISABLE_CURL=ON"
"-DBUILD_TRAINING_TOOLS=OFF"
"-DCMAKE_DISABLE_FIND_PACKAGE_TIFF=TRUE"
"-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=TRUE"
)
Log-Information "Configuring tesseract..."
Invoke-External cmake -S ${TesseractPath} -B ${TesseractBuildPath} @TesseractCmakeArgs
$TesseractCmakeArgs = @(
'--config', "${Configuration}"
)
if ( $VerbosePreference -eq 'Continue' ) {
$TesseractCmakeArgs += ('--verbose')
}
Log-Information "Building tesseract..."
Invoke-External cmake --build "${TesseractBuildPath}" @TesseractCmakeArgs
Log-Information "Install tesseract..."
Invoke-External cmake --install "${TesseractBuildPath}" --prefix "${ADVSSDepPath}" @TesseractCmakeArgs
Push-Location -Stack BuildLibusbTemp
Ensure-Location $ProjectRoot
$LibusbPath = "${ProjectRoot}/deps/libusb"
Log-Information "Building libusb..."
$msbuildExe = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1
if ($msbuildExe) {
$env:CL="/wd5287"
Invoke-External $msbuildExe "${LibusbPath}/msvc/libusb.sln" /property:Configuration=Release /property:Platform=x64
Remove-Item Env:CL
$libusbBuildResultDirectory = "${LibusbPath}/build/v143/x64/Release"
if (-not (Test-Path -Path $libusbBuildResultDirectory)) {
$libusbBuildResultDirectory = "${LibusbPath}/x64/Release/dll"
}
Copy-Item -Path "${libusbBuildResultDirectory}/*" -Destination ${ADVSSDepPath} -Recurse -Force
} else {
Log-Information "Failed to locate msbuild.exe - skipping libusb build"
}
Push-Location -Stack BuildMqttTemp
Ensure-Location $ProjectRoot
$MqttPath = "${ProjectRoot}/deps/paho.mqtt.cpp"
$MqttBuildPath = "${MqttPath}/build"
# Explicitly disable PkgConfig and tiff as it will lead build errors
$MqttCmakeArgs = @(
"-DCMAKE_BUILD_TYPE=${Configuration}"
"-DCMAKE_PREFIX_PATH:PATH=${OBSDepPath}"
"-DCMAKE_INSTALL_PREFIX:PATH=${ADVSSDepPath}"
"-DPAHO_WITH_MQTT_C=ON"
"-DPAHO_WITH_SSL=ON"
)
# Try to find OpenSSL installed via winget
$pf64 = Join-Path $Env:ProgramFiles "OpenSSL-Win64"
$pf = Join-Path $Env:ProgramFiles "OpenSSL"
$possibleDirs = @($pf64, $pf)
$opensslDir = $possibleDirs | Where-Object { Test-Path (Join-Path $_ "include\openssl\ssl.h") } | Select-Object -First 1
if ($opensslDir) {
Write-Host "Detected OpenSSL at: $opensslDir"
$MqttCmakeArgs += "-DOPENSSL_ROOT_DIR=$opensslDir"
$MqttCmakeArgs += "-DOPENSSL_CRYPTO_LIBRARY=$opensslDir\lib\VC\x64\MD\libcrypto.lib"
$MqttCmakeArgs += "-DOPENSSL_SSL_LIBRARY=$opensslDir\lib\VC\x64\MD\libssl.lib"
} else {
Write-Warning "OpenSSL not found - maybe cmake will find it ..."
}
Log-Information "Configuring paho.mqtt.cpp..."
Invoke-External cmake -S ${MqttPath} -B ${MqttBuildPath} @MqttCmakeArgs
$MqttCmakeArgs = @(
'--config', "${Configuration}"
)
if ( $VerbosePreference -eq 'Continue' ) {
$MqttCmakeArgs += ('--verbose')
}
Log-Information "Building paho.mqtt.cpp..."
Invoke-External cmake --build "${MqttBuildPath}" @MqttCmakeArgs
Log-Information "Install paho.mqtt.cpp..."
Invoke-External cmake --install "${MqttBuildPath}" --prefix "${ADVSSDepPath}" @MqttCmakeArgs
}
Build

130
.github/scripts/Build-Windows.ps1 vendored Normal file
View File

@ -0,0 +1,130 @@
[CmdletBinding()]
param(
[ValidateSet('x64')]
[string] $Target = 'x64',
[ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')]
[string] $Configuration = 'RelWithDebInfo',
[switch] $SkipAll,
[switch] $SkipBuild,
[switch] $SkipDeps,
[string] $ADVSSDepName
)
$ErrorActionPreference = 'Stop'
if ( $DebugPreference -eq 'Continue' ) {
$VerbosePreference = 'Continue'
$InformationPreference = 'Continue'
}
if ( ! ( [System.Environment]::Is64BitOperatingSystem ) ) {
throw "A 64-bit system is required to build the project."
}
if ( $PSVersionTable.PSVersion -lt '7.0.0' ) {
Write-Warning 'The obs-deps PowerShell build script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6'
exit 2
}
function Build {
trap {
Pop-Location -Stack BuildTemp -ErrorAction 'SilentlyContinue'
Write-Error $_
Log-Group
exit 2
}
$ScriptHome = $PSScriptRoot
$ProjectRoot = Resolve-Path -Path "$PSScriptRoot/../.."
$BuildSpecFile = "${ProjectRoot}/buildspec.json"
$UtilityFunctions = Get-ChildItem -Path $PSScriptRoot/utils.pwsh/*.ps1 -Recurse
foreach($Utility in $UtilityFunctions) {
Write-Debug "Loading $($Utility.FullName)"
. $Utility.FullName
}
$BuildSpec = Get-Content -Path ${BuildSpecFile} -Raw | ConvertFrom-Json
$ProductName = $BuildSpec.name
$ProductVersion = $BuildSpec.version
$GitOutput = git describe --tags
if ($GitOutput -match '^([0-9]+\.){0,2}(\*|[0-9]+)$') {
Log-Information "Using git tag as version identifier '${GitOutput}'"
$ProductVersion = $GitOutput
} else {
Log-Information "Using buildspec.json version identifier '${ProductVersion}'"
}
if ( ! $SkipDeps ) {
Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
}
if ( $ADVSSDepName -eq '' ) {
$ADVSSDepName = ".deps/advss-build-dependencies"
}
if ( -not (Test-Path -LiteralPath "${ProjectRoot}/${ADVSSDepName}") ) {
Log-Information "Building advss deps ${ProjectRoot}/${ADVSSDepName} ..."
invoke-expression -Command "$PSScriptRoot/Build-Deps-Windows.ps1 -Configuration $Configuration -Target $Target -OutDirName $ADVSSDepName"
}
$ADVSSDepPath = "$(Resolve-Path -Path ${ProjectRoot}/${ADVSSDepName})"
Log-Information "Using advss deps at $ADVSSDepPath ..."
(Get-Content -Path ${ProjectRoot}/CMakeLists.txt -Raw) `
-replace "project\((.*) VERSION (.*)\)", "project(${ProductName} VERSION ${ProductVersion})" `
| Out-File -Path ${ProjectRoot}/CMakeLists.txt -NoNewline
Push-Location -Stack BuildTemp
if ( ! ( ( $SkipAll ) -or ( $SkipBuild ) ) ) {
Ensure-Location $ProjectRoot
$CmakeArgs = @()
$CmakeBuildArgs = @()
$CmakeInstallArgs = @()
if ( $VerbosePreference -eq 'Continue' ) {
$CmakeBuildArgs += ('--verbose')
$CmakeInstallArgs += ('--verbose')
}
if ( $DebugPreference -eq 'Continue' ) {
$CmakeArgs += ('--debug-output')
}
$Preset = "windows-$(if ( $Env:CI -ne $null ) { 'ci-' })${Target}"
$CmakeArgs += @(
'--preset', $Preset
"-DCMAKE_PREFIX_PATH:PATH=${ADVSSDepPath}"
)
$CmakeBuildArgs += @(
'--build'
'--preset', $Preset
'--config', $Configuration
'--parallel'
'--', '/consoleLoggerParameters:Summary', '/noLogo'
)
$CmakeInstallArgs += @(
'--install', "build_${Target}"
'--prefix', "${ProjectRoot}/release/${Configuration}"
'--config', $Configuration
)
Log-Group "Configuring ${ProductName}..."
Invoke-External cmake @CmakeArgs
Log-Group "Building ${ProductName}..."
Invoke-External cmake @CmakeBuildArgs
}
Log-Group "Install ${ProductName}..."
Invoke-External cmake @CmakeInstallArgs
Pop-Location -Stack BuildTemp
Log-Group
}
Build

101
.github/scripts/Package-Windows.ps1 vendored Normal file
View File

@ -0,0 +1,101 @@
[CmdletBinding()]
param(
[ValidateSet('x64')]
[string] $Target = 'x64',
[ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')]
[string] $Configuration = 'RelWithDebInfo',
[switch] $BuildInstaller,
[switch] $SkipDeps
)
$ErrorActionPreference = 'Stop'
if ( $DebugPreference -eq 'Continue' ) {
$VerbosePreference = 'Continue'
$InformationPreference = 'Continue'
}
if ( ! ( [System.Environment]::Is64BitOperatingSystem ) ) {
throw "Packaging script requires a 64-bit system to build and run."
}
if ( $PSVersionTable.PSVersion -lt '7.0.0' ) {
Write-Warning 'The packaging script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6'
exit 2
}
function Package {
trap {
Pop-Location -Stack BuildTemp -ErrorAction 'SilentlyContinue'
Write-Error $_
Log-Group
exit 2
}
$ScriptHome = $PSScriptRoot
$ProjectRoot = Resolve-Path -Path "$PSScriptRoot/../.."
$BuildSpecFile = "${ProjectRoot}/buildspec.json"
$UtilityFunctions = Get-ChildItem -Path $PSScriptRoot/utils.pwsh/*.ps1 -Recurse
foreach( $Utility in $UtilityFunctions ) {
Write-Debug "Loading $($Utility.FullName)"
. $Utility.FullName
}
$BuildSpec = Get-Content -Path ${BuildSpecFile} -Raw | ConvertFrom-Json
$ProductName = $BuildSpec.name
$ProductVersion = $BuildSpec.version
$GitOutput = git describe --tags
Log-Information "Using git tag as version identifier '${GitOutput}'"
$ProductVersion = $GitOutput
$OutputName = "${ProductName}-${ProductVersion}-windows-${Target}"
if ( ! $SkipDeps ) {
Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
}
$RemoveArgs = @{
ErrorAction = 'SilentlyContinue'
Path = @(
"${ProjectRoot}/release/${ProductName}-*-windows-*.zip"
"${ProjectRoot}/release/${ProductName}-*-windows-*.exe"
)
}
Remove-Item @RemoveArgs
Log-Group "Archiving ${ProductName}..."
$CompressArgs = @{
Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*")
CompressionLevel = 'Optimal'
DestinationPath = "${ProjectRoot}/release/${OutputName}.zip"
Verbose = ($Env:CI -ne $null)
}
Compress-Archive -Force @CompressArgs
Log-Group
if ( ( $BuildInstaller ) ) {
Log-Group "Packaging ${ProductName}..."
$IsccFile = "${ProjectRoot}/build_${Target}/installer-Windows.generated.iss"
if ( ! ( Test-Path -Path $IsccFile ) ) {
throw 'InnoSetup install script not found. Run the build script or the CMake build and install procedures first.'
}
Log-Information 'Creating InnoSetup installer...'
Push-Location -Stack BuildTemp
Ensure-Location -Path "${ProjectRoot}/release"
Copy-Item -Path ${Configuration} -Destination Package -Recurse
Invoke-External iscc ${IsccFile} /O"${ProjectRoot}/release" /F"${OutputName}-Installer"
Remove-Item -Path Package -Recurse
Pop-Location -Stack BuildTemp
Log-Group
}
}
Package

13
.github/scripts/build-deps-linux.sh vendored Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
if ! type zsh > /dev/null 2>&1; then
echo ' => Installing script dependency Zsh.'
sudo apt-get -y update
sudo apt-get -y install zsh
fi
SCRIPT=$(readlink -f "${0}")
SCRIPT_DIR=$(dirname "${SCRIPT}")
zsh ${SCRIPT_DIR}/build-deps-linux.zsh "${@}"

1
.github/scripts/build-deps-linux.zsh vendored Symbolic link
View File

@ -0,0 +1 @@
.build-deps.zsh

1
.github/scripts/build-deps-macos.zsh vendored Symbolic link
View File

@ -0,0 +1 @@
.build-deps.zsh

1
.github/scripts/build-linux vendored Symbolic link
View File

@ -0,0 +1 @@
.build.zsh

1
.github/scripts/build-macos vendored Symbolic link
View File

@ -0,0 +1 @@
.build.zsh

1
.github/scripts/package-linux vendored Symbolic link
View File

@ -0,0 +1 @@
.package.zsh

1
.github/scripts/package-macos vendored Symbolic link
View File

@ -0,0 +1 @@
.package.zsh

View File

@ -0,0 +1,29 @@
function Ensure-Location {
<#
.SYNOPSIS
Ensures current location to be set to specified directory.
.DESCRIPTION
If specified directory exists, switch to it. Otherwise create it,
then switch.
.EXAMPLE
Ensure-Location "My-Directory"
Ensure-Location -Path "Path-To-My-Directory"
#>
param(
[Parameter(Mandatory)]
[string] $Path
)
if ( ! ( Test-Path $Path ) ) {
$_Params = @{
ItemType = "Directory"
Path = ${Path}
ErrorAction = "SilentlyContinue"
}
New-Item @_Params | Set-Location
} else {
Set-Location -Path ${Path}
}
}

View File

@ -0,0 +1,70 @@
function Expand-ArchiveExt {
<#
.SYNOPSIS
Expands archive files.
.DESCRIPTION
Allows extraction of zip, 7z, gz, and xz archives.
Requires tar and 7-zip to be available on the system.
Archives ending with .zip but created using LZMA compression are
expanded using 7-zip as a fallback.
.EXAMPLE
Expand-ArchiveExt -Path <Path-To-Your-Archive>
Expand-ArchiveExt -Path <Path-To-Your-Archive> -DestinationPath <Expansion-Path>
#>
param(
[Parameter(Mandatory)]
[string] $Path,
[string] $DestinationPath = [System.IO.Path]::GetFileNameWithoutExtension($Path),
[switch] $Force
)
switch ( [System.IO.Path]::GetExtension($Path) ) {
.zip {
try {
Expand-Archive -Path $Path -DestinationPath $DestinationPath -Force:$Force
} catch {
if ( Get-Command 7z ) {
Invoke-External 7z x -y $Path "-o${DestinationPath}"
} else {
throw "Fallback utility 7-zip not found. Please install 7-zip first."
}
}
break
}
{ ( $_ -eq ".7z" ) -or ( $_ -eq ".exe" ) } {
if ( Get-Command 7z ) {
Invoke-External 7z x -y $Path "-o${DestinationPath}"
} else {
throw "Extraction utility 7-zip not found. Please install 7-zip first."
}
break
}
.gz {
try {
Invoke-External tar -x -o $DestinationPath -f $Path
} catch {
if ( Get-Command 7z ) {
Invoke-External 7z x -y $Path "-o${DestinationPath}"
} else {
throw "Fallback utility 7-zip not found. Please install 7-zip first."
}
}
break
}
.xz {
try {
Invoke-External tar -x -o $DestinationPath -f $Path
} catch {
if ( Get-Command 7z ) {
Invoke-External 7z x -y $Path "-o${DestinationPath}"
} else {
throw "Fallback utility 7-zip not found. Please install 7-zip first."
}
}
}
default {
throw "Unsupported archive extension provided."
}
}
}

View File

@ -0,0 +1,70 @@
function Install-BuildDependencies {
<#
.SYNOPSIS
Installs required build dependencies.
.DESCRIPTION
Additional packages might be needed for successful builds. This module contains additional
dependencies available for installation via winget and, if possible, adds their locations
to the environment path for future invocation.
.EXAMPLE
Install-BuildDependencies
#>
param(
[string] $WingetFile = "$PSScriptRoot/.Wingetfile"
)
if ( ! ( Test-Path function:Log-Warning ) ) {
. $PSScriptRoot/Logger.ps1
}
$Prefixes = @{
'x64' = ${Env:ProgramFiles}
'x86' = ${Env:ProgramFiles(x86)}
'arm64' = ${Env:ProgramFiles(arm)}
}
$Paths = $Env:Path -split [System.IO.Path]::PathSeparator
$WingetOptions = @('install', '--accept-package-agreements', '--accept-source-agreements')
if ( $script:Quiet ) {
$WingetOptions += '--silent'
}
Log-Group 'Check Windows build requirements'
Get-Content $WingetFile | ForEach-Object {
$_, $Package, $_, $Path, $_, $Binary, $_, $Version = $_ -replace ',','' -split " +(?=(?:[^\']*\'[^\']*\')*[^\']*$)" -replace "'",''
$Prefixes.GetEnumerator() | ForEach-Object {
$Prefix = $_.value
$FullPath = "${Prefix}\${Path}"
if ( ( Test-Path $FullPath ) -and ! ( $Paths -contains $FullPath ) ) {
$Paths = @($FullPath) + $Paths
$Env:Path = $Paths -join [System.IO.Path]::PathSeparator
}
}
Log-Debug "Checking for command ${Binary}"
$Found = Get-Command -ErrorAction SilentlyContinue $Binary
if ( $Found ) {
Log-Status "Found dependency ${Binary} as $($Found.Source)"
} else {
Log-Status "Installing package ${Package} $(if ( $Version -ne $null ) { "Version: ${Version}" } )"
if ( $Version -ne $null ) {
$WingetOptions += @('--version', ${Version})
}
try {
$Params = $WingetOptions + $Package
winget @Params
} catch {
throw "Error while installing winget package ${Package}: $_"
}
}
}
Log-Group
}

View File

@ -0,0 +1,40 @@
function Invoke-External {
<#
.SYNOPSIS
Invokes a non-PowerShell command.
.DESCRIPTION
Runs a non-PowerShell command, and captures its return code.
Throws an exception if the command returns non-zero.
.EXAMPLE
Invoke-External 7z x $MyArchive
#>
if ( $args.Count -eq 0 ) {
throw 'Invoke-External called without arguments.'
}
if ( ! ( Test-Path function:Log-Information ) ) {
. $PSScriptRoot/Logger.ps1
}
$Command = $args[0]
$CommandArgs = @()
if ( $args.Count -gt 1) {
$CommandArgs = $args[1..($args.Count - 1)]
}
$_EAP = $ErrorActionPreference
$ErrorActionPreference = "Continue"
Log-Debug "Invoke-External: ${Command} ${CommandArgs}"
& $command $commandArgs
$Result = $LASTEXITCODE
$ErrorActionPreference = $_EAP
if ( $Result -ne 0 ) {
throw "${Command} ${CommandArgs} exited with non-zero code ${Result}."
}
}

149
.github/scripts/utils.pwsh/Logger.ps1 vendored Normal file
View File

@ -0,0 +1,149 @@
function Log-Debug {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
foreach($m in $Message) {
Write-Debug "$(if ( $env:CI -ne $null ) { '::debug::' })$m"
}
}
}
function Log-Verbose {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
foreach($m in $Message) {
Write-Verbose $m
}
}
}
function Log-Warning {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
foreach($m in $Message) {
Write-Warning "$(if ( $env:CI -ne $null ) { '::warning::' })$m"
}
}
}
function Log-Error {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
foreach($m in $Message) {
Write-Error "$(if ( $env:CI -ne $null ) { '::error::' })$m"
}
}
}
function Log-Information {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
if ( ! ( $script:Quiet ) ) {
$StageName = $( if ( $script:StageName -ne $null ) { $script:StageName } else { '' })
$Icon = ' =>'
foreach($m in $Message) {
Write-Host -NoNewLine -ForegroundColor Blue " ${StageName} $($Icon.PadRight(5)) "
Write-Host "${m}"
}
}
}
}
function Log-Group {
[CmdletBinding()]
param(
[Parameter(ValueFromPipeline)]
[string[]] $Message
)
Process {
if ( $Env:CI -ne $null ) {
if ( $script:LogGroup ) {
Write-Output '::endgroup::'
$script:LogGroup = $false
}
if ( $Message.count -ge 1 ) {
Write-Output "::group::$($Message -join ' ')"
$script:LogGroup = $true
}
} else {
if ( $Message.count -ge 1 ) {
Log-Information $Message
}
}
}
}
function Log-Status {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
if ( ! ( $script:Quiet ) ) {
$StageName = $( if ( $StageName -ne $null ) { $StageName } else { '' })
$Icon = ' >'
foreach($m in $Message) {
Write-Host -NoNewLine -ForegroundColor Green " ${StageName} $($Icon.PadRight(5)) "
Write-Host "${m}"
}
}
}
}
function Log-Output {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
if ( ! ( $script:Quiet ) ) {
$StageName = $( if ( $script:StageName -ne $null ) { $script:StageName } else { '' })
$Icon = ''
foreach($m in $Message) {
Write-Output " ${StageName} $($Icon.PadRight(5)) ${m}"
}
}
}
}
$Columns = (Get-Host).UI.RawUI.WindowSize.Width - 5

61
.github/scripts/utils.zsh/check_linux vendored Normal file
View File

@ -0,0 +1,61 @@
autoload -Uz log_info log_status log_error log_debug log_warning log_group
log_group 'Check Linux build requirements'
log_debug 'Checking Linux distribution name and version...'
# Check for Ubuntu version 22.10 or later, which have srt and librist available via apt-get
typeset -g -i UBUNTU_2210_OR_LATER=0
if [[ -f /etc/os_release ]] {
local dist_name
local dist_version
read -r dist_name dist_version <<< "$(source /etc/os_release; print "${NAME} ${VERSION_ID}")"
autoload -Uz is-at-least
if [[ ${dist_name} == Ubuntu ]] && is-at-least 22.10 ${dist_version}; then
typeset -g -i UBUNTU_2210_OR_LATER=1
fi
}
log_debug 'Checking for apt-get...'
if (( ! ${+commands[apt-get]} )) {
log_error 'No apt-get command found. Please install apt'
return 2
} else {
log_debug "Apt-get located at ${commands[apt-get]}"
}
local -a dependencies=("${(fA)$(<${SCRIPT_HOME}/.Aptfile)}")
local -a install_list
local binary
sudo apt-get update -qq
for dependency (${dependencies}) {
local -a tokens=(${=dependency//(,|:|\')/})
if [[ ! ${tokens[1]} == 'package' ]] continue
if [[ ${#tokens} -gt 2 && ${tokens[3]} == 'bin' ]] {
binary=${tokens[4]}
} else {
binary=${tokens[2]}
}
if (( ! ${+commands[${binary}]} )) install_list+=(${tokens[2]})
}
log_debug "List of dependencies to install: ${install_list}"
if (( ${#install_list} )) {
if (( ! ${+CI} )) log_warning 'Dependency installation via apt may require elevated privileges'
local -a apt_args=(
${CI:+-y}
--no-install-recommends
)
if (( _loglevel == 0 )) apt_args+=(--quiet)
sudo apt-get ${apt_args} install ${install_list}
}
rehash
log_group

24
.github/scripts/utils.zsh/check_macos vendored Normal file
View File

@ -0,0 +1,24 @@
autoload -Uz is-at-least log_group log_info log_error log_status read_codesign
local macos_version=$(sw_vers -productVersion)
log_group 'Install macOS build requirements'
log_info 'Checking macOS version...'
if ! is-at-least 11.0 ${macos_version}; then
log_error "Minimum required macOS version is 11.0, but running on macOS ${macos_version}"
return 2
else
log_status "macOS ${macos_version} is recent"
fi
log_info 'Checking for Homebrew...'
if (( ! ${+commands[brew]} )) {
log_error 'No Homebrew command found. Please install Homebrew (https://brew.sh)'
return 2
}
brew bundle --file ${SCRIPT_HOME}/.Brewfile
# Workaround to make sure locally built openssl is picked up by cmake
brew uninstall --ignore-dependencies openssl@3 || true
rehash || true
log_group

3
.github/scripts/utils.zsh/log_debug vendored Normal file
View File

@ -0,0 +1,3 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 2 )) print -PR -e -- "${CI:+::debug::}%F{220}DEBUG: ${@}%f"

3
.github/scripts/utils.zsh/log_error vendored Normal file
View File

@ -0,0 +1,3 @@
local icon=' ✖︎ '
print -u2 -PR "${CI:+::error::}%F{1} ${icon} %f ${@}"

16
.github/scripts/utils.zsh/log_group vendored Normal file
View File

@ -0,0 +1,16 @@
autoload -Uz log_info
if (( ! ${+_log_group} )) typeset -g _log_group=0
if (( ${+CI} )) {
if (( _log_group )) {
print "::endgroup::"
typeset -g _log_group=0
}
if (( # )) {
print "::group::${@}"
typeset -g _log_group=1
}
} else {
if (( # )) log_info ${@}
}

7
.github/scripts/utils.zsh/log_info vendored Normal file
View File

@ -0,0 +1,7 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 0 )) {
local icon=' =>'
print -PR "%F{4} ${(r:5:)icon}%f %B${@}%b"
}

7
.github/scripts/utils.zsh/log_output vendored Normal file
View File

@ -0,0 +1,7 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 0 )) {
local icon=''
print -PR " ${(r:5:)icon} ${@}"
}

7
.github/scripts/utils.zsh/log_status vendored Normal file
View File

@ -0,0 +1,7 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 0 )) {
local icon=' >'
print -PR "%F{2} ${(r:5:)icon}%f ${@}"
}

5
.github/scripts/utils.zsh/log_warning vendored Normal file
View File

@ -0,0 +1,5 @@
if (( _loglevel > 0 )) {
local icon=' =>'
print -PR "${CI:+::warning::}%F{3} ${(r:5:)icon} ${@}%f"
}

1
.github/scripts/utils.zsh/mkcd vendored Normal file
View File

@ -0,0 +1 @@
[[ -n ${1} ]] && mkdir -p ${1} && builtin cd ${1}

View File

@ -0,0 +1,9 @@
autoload -Uz log_info
if (( ! ${+CODESIGN_IDENT} )) {
typeset -g CODESIGN_IDENT
log_info 'Setting up Apple Developer ID for application codesigning...'
read CODESIGN_IDENT'?Apple Developer Application ID: '
}
typeset -g CODESIGN_TEAM=$(print "${CODESIGN_IDENT}" | /usr/bin/sed -En 's/.+\((.+)\)/\1/p')

View File

@ -0,0 +1,7 @@
autoload -Uz log_info
if (( ! ${+CODESIGN_IDENT_INSTALLER} )) {
typeset -g CODESIGN_IDENT_INSTALLER
log_info 'Setting up Apple Developer Installer ID for installer package codesigning...'
read CODESIGN_IDENT_INSTALLER'?Apple Developer Installer ID: '
}

View File

@ -0,0 +1,38 @@
##############################################################################
# Apple Developer credentials necessary:
#
# + Signing for distribution and notarization require an active Apple
# Developer membership
# + An Apple Development identity is needed for code signing
# (i.e. 'Apple Development: YOUR APPLE ID (PROVIDER)')
# + Your Apple developer ID is needed for notarization
# + An app-specific password is necessary for notarization from CLI
# + This password will be stored in your macOS keychain under the identifier
# 'OBS-Codesign-Password'with access Apple's 'altool' only.
##############################################################################
autoload -Uz read_codesign read_codesign_user log_info log_warning
if (( ! ${+CODESIGN_IDENT} )) {
read_codesign
}
if (( ! ${+CODESIGN_IDENT_USER} )) {
read_codesign_user
}
log_info 'Setting up password for notarization keychain...'
if (( ! ${+CODESIGN_IDENT_PASS} )) {
read -s CODESIGN_IDENT_PASS'?Apple Developer ID password: '
}
print ''
log_info 'Setting up notarization keychain...'
log_warning "
+ Your Apple ID and an app-specific password is necessary for notarization from CLI
+ This password will be stored in your macOS keychain under the identifier
'OBS-Codesign-Password' with access Apple's 'altool' only.
"
xcrun notarytool store-credentials 'OBS-Codesign-Password' --apple-id "${CODESIGN_IDENT_USER}" --team-id "${CODESIGN_TEAM}" --password "${CODESIGN_IDENT_PASS}"

View File

@ -0,0 +1,7 @@
autoload -Uz log_info
if (( ! ${+CODESIGN_TEAM} )) {
typeset -g CODESIGN_TEAM
log_info 'Setting up Apple Developer Team ID for codesigning...'
read CODESIGN_TEAM'?Apple Developer Team ID (leave empty to use Apple Developer ID instead): '
}

View File

@ -0,0 +1,7 @@
autoload -Uz log_info
if (( ! ${+CODESIGN_IDENT_USER} )) {
typeset -g CODESIGN_IDENT_USER
log_info 'Setting up Apple ID for notarization...'
read CODESIGN_IDENT_USER'?Apple ID: '
}

17
.github/scripts/utils.zsh/set_loglevel vendored Normal file
View File

@ -0,0 +1,17 @@
autoload -Uz log_debug log_error
local -r _usage="Usage: %B${0}%b <loglevel>
Set log level, following levels are supported: 0 (quiet), 1 (normal), 2 (verbose), 3 (debug)"
if (( ! # )); then
log_error 'Called without arguments.'
log_output ${_usage}
return 2
elif (( ${1} >= 4 )); then
log_error 'Called with loglevel > 3.'
log_output ${_usage}
fi
typeset -g -i -r _loglevel=${1}
log_debug "Log level set to '${1}'"

41
.github/scripts/utils.zsh/setup_ccache vendored Normal file
View File

@ -0,0 +1,41 @@
autoload -Uz log_debug log_warning
if (( ! ${+project_root} )) {
log_error "'project_root' not set. Please set before running ${0}."
return 2
}
if (( ${+commands[ccache]} )) {
log_debug "Found ccache at ${commands[ccache]}"
typeset -gx CCACHE_CONFIGPATH="${project_root}/.ccache.conf"
ccache --set-config=direct_mode=true
ccache --set-config=inode_cache=true
ccache --set-config=compiler_check=content
ccache --set-config=file_clone=true
local -a sloppiness=(
include_file_mtime
include_file_ctime
file_stat_matches
system_headers
)
if [[ ${host_os} == macos ]] {
sloppiness+=(
modules
clang_index_store
)
ccache --set-config=sloppiness=${(j:,:)sloppiness}
}
if (( ${+CI} )) {
ccache --set-config=cache_dir="${GITHUB_WORKSPACE:-${HOME}}/.ccache"
ccache --set-config=max_size="${CCACHE_SIZE:-1G}"
ccache -z > /dev/null
}
} else {
log_warning "No ccache found on the system"
}

66
.github/scripts/utils.zsh/setup_linux vendored Normal file
View File

@ -0,0 +1,66 @@
autoload -Uz log_error log_status log_info mkcd
if (( ! ${+project_root} )) {
log_error "'project_root' not set. Please set before running ${0}."
return 2
}
if (( ! ${+target} )) {
log_error "'target' not set. Please set before running ${0}."
return 2
}
pushd ${project_root}
typeset -g QT_VERSION
local -a apt_args=(
${CI:+-y}
--no-install-recommends
)
if (( _loglevel == 0 )) apt_args+=(--quiet)
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) {
log_group 'Installing obs-studio build dependencies...'
local suffix
if [[ ${CPUTYPE} != "${target##*-}" ]] {
local -A arch_mappings=(
aarch64 arm64
x86_64 amd64
)
suffix=":${arch_mappings[${target##*-}]}"
sudo apt-get install ${apt_args} gcc-${${target##*-}//_/-}-linux-gnu g++-${${target##*-}//_/-}-linux-gnu
}
sudo add-apt-repository --yes ppa:obsproject/obs-studio
sudo apt update
sudo apt-get install ${apt_args} \
build-essential \
libgles2-mesa-dev \
libsimde-dev \
obs-studio
local -a _qt_packages=()
if (( QT_VERSION == 5 )) {
_qt_packages+=(
qtbase5-dev${suffix}
libqt5svg5-dev${suffix}
qtbase5-private-dev${suffix}
libqt5x11extras5-dev${suffix}
)
} else {
_qt_packages+=(
qt6-base-dev${suffix}
libqt6svg6-dev${suffix}
qt6-base-private-dev${suffix}
)
}
sudo apt-get install ${apt_args} ${_qt_packages}
log_group
}

56
.github/workflows/build-debian.yml vendored Normal file
View File

@ -0,0 +1,56 @@
name: debian-build
on:
push:
paths-ignore:
- '**.md'
- 'data/locale/**'
branches:
- master
tags:
- '*'
pull_request:
paths-ignore:
- '**.md'
- 'data/locale/**'
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: check_libobs_revision
run: |
sudo apt update
sudo apt install devscripts libobs-dev
mkdir source
cd source
dpkg -l libobs-dev | tr -s " "| grep libobs | cut -d" " -f3 > libobs.rev
- name: create_tarball
run: |
cd ..
tar --exclude=.git -cvzf obs-scene-switcher_0.1+testonly.orig.tar.gz SceneSwitcher
- name: create_debian_dir
run: |
cp -a build-aux/CI/linux/debian .
- name: install_dependencies
run: |
# devscripts and libobs-dev are needed but they were already installed
# from check_libobs_revision and install_frontend_header sections.
sudo apt update
sudo apt install build-essential cmake debhelper libcurl4-openssl-dev libxss-dev libxtst-dev qt6-base-dev libopencv-dev libproc2-dev
- name: build
run: |
debuild --no-lintian --no-sign
mv ../*.deb .
- name: Publish
if: success()
uses: actions/upload-artifact@v4
with:
name: "obs-scene-switcher.deb"
path: ${{ github.workspace }}/*.deb

317
.github/workflows/build-project.yaml vendored Normal file
View File

@ -0,0 +1,317 @@
name: Build Project
on:
workflow_call:
outputs:
pluginName:
description: "Project name detected by parsing build spec file"
value: ${{ jobs.check-event.outputs.pluginName }}
env:
DEP_DIR: .deps/advss-build-dependencies-3
jobs:
check-event:
name: Check GitHub Event Data 🔎
runs-on: ubuntu-latest
defaults:
run:
shell: bash
outputs:
package: ${{ steps.setup.outputs.package }}
codesign: ${{ steps.setup.outputs.codesign }}
notarize: ${{ steps.setup.outputs.notarize }}
config: ${{ steps.setup.outputs.config }}
commitHash: ${{ steps.setup.outputs.commitHash }}
pluginName: ${{ steps.setup.outputs.pluginName }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check Event Data ☑️
id: setup
env:
GH_TOKEN: ${{ github.token }}
run: |
: Check Event Data ☑️
if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
case "${GITHUB_EVENT_NAME}" in
pull_request)
config_data=('codesign:false' 'notarize:false' 'package:true' 'config:RelWithDebInfo')
if gh pr view ${{ github.event.number }} --json labels \
| jq -e -r '.labels[] | select(.name == "Seeking Testers")' > /dev/null; then
config_data[0]='codesign:true'
config_data[2]='package:true'
fi
;;
push)
config_data=('codesign:true' 'notarize:false' 'package:true' 'config:RelWithDebInfo')
if [[ ${GITHUB_REF_NAME} =~ [0-9]+.[0-9]+.[0-9]+(-(rc|beta).+)? ]]; then
config_data[1]='notarize:false'
config_data[3]='config:RelWithDebInfo'
fi
;;
workflow_dispatch)
config_data=('codesign:true' 'notarize:false' 'package:true' 'config:RelWithDebInfo')
;;
schedule)
config_data=('codesign:true' 'notarize:false' 'package:true' 'config:RelWithDebInfo')
;;
*) ;;
esac
for config in "${config_data[@]}"; do
IFS=':' read -r key value <<< "${config}"
echo "${key}=${value}" >> $GITHUB_OUTPUT
done
echo "commitHash=${GITHUB_SHA:0:9}" >> $GITHUB_OUTPUT
plugin_name="$(grep 'name' buildspec.json | sed -E -e 's/^.+"name":[^"]+"(.+)",?$/\1/g')"
plugin_display_name="$(grep 'displayName' buildspec.json | sed -E -e 's/^.+"displayName":[^"]+"(.+)",?$/\1/g' || echo "")"
if [[ "${plugin_display_name}" ]]; then
echo "pluginName=${plugin_display_name}" >> $GITHUB_OUTPUT
else
echo "pluginName=${plugin_name}" >> $GITHUB_OUTPUT
fi
macos-build:
name: Build for macOS 🍏
runs-on: macos-15
needs: check-event
defaults:
run:
shell: zsh --no-rcs --errexit --pipefail {0}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set Up Environment 🔧
id: setup
run: |
: Set Up Environment 🔧
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
print '::group::Clean Homebrew Environment'
local -a to_remove=()
if (( #to_remove )) brew uninstall --ignore-dependencies ${to_remove}
print '::endgroup::'
local product_name
local product_version
read -r product_name product_version <<< \
"$(jq -r '. | {name, version} | join(" ")' buildspec.json)"
local git_tag="$(git describe --tags)"
print "pluginName=${product_name}" >> $GITHUB_OUTPUT
print "pluginVersion=${git_tag}" >> $GITHUB_OUTPUT
print '::group::Enable Xcode 16.1'
sudo xcode-select --switch /Applications/Xcode_16.1.0.app/Contents/Developer
print '::endgroup::'
- uses: actions/cache@v4
id: ccache-cache
with:
path: ${{ github.workspace }}/.ccache
key: ${{ runner.os }}-ccache-${{ needs.check-event.outputs.config }}
restore-keys: |
${{ runner.os }}-ccache-
- name: Build Dependencies 🏗️
uses: ./.github/actions/build-dependencies
with:
workingDirectory: ${{ github.workspace }}/plugin
target: macos-universal
config: ${{ needs.check-event.outputs.config }}
- name: Set Up Codesigning 🔑
uses: ./.github/actions/setup-macos-codesigning
if: fromJSON(needs.check-event.outputs.codesign)
id: codesign
with:
codesignIdentity: ${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}
installerIdentity: ${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}
codesignCertificate: ${{ secrets.MACOS_SIGNING_CERT }}
certificatePassword: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
keychainPassword: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
provisioningProfile: ${{ secrets.MACOS_SIGNING_PROVISIONING_PROFILE }}
notarizationUser: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
notarizationPassword: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
- name: Build Plugin 🧱
uses: ./.github/actions/build-plugin
with:
target: macos-universal
config: ${{ needs.check-event.outputs.config }}
codesign: ${{ fromJSON(needs.check-event.outputs.codesign) }}
codesignIdent: ${{ steps.codesign.outputs.codesignIdent }}
- name: Package Plugin 📀
uses: ./.github/actions/package-plugin
with:
target: macos-universal
config: ${{ needs.check-event.outputs.config }}
package: ${{ fromJSON(needs.check-event.outputs.package) }}
codesign: ${{ fromJSON(needs.check-event.outputs.codesign) && fromJSON(steps.codesign.outputs.haveCodesignIdent) }}
codesignIdent: ${{ steps.codesign.outputs.codesignIdent }}
installerIdent: ${{ steps.codesign.outputs.installerIdent }}
codesignTeam: ${{ steps.codesign.outputs.codesignTeam }}
notarize: ${{ fromJSON(needs.check-event.outputs.notarize) && fromJSON(steps.codesign.outputs.haveNotarizationUser) }}
codesignUser: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
- name: Upload Artifacts 📡
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-*-macos-universal.*
- name: Upload Debug Symbol Artifacts 🪲
uses: actions/upload-artifact@v4
if: ${{ needs.check-event.outputs.config == 'Release' }}
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal-${{ needs.check-event.outputs.commitHash }}-dSYMs
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-*-macos-universal-dSYMs.*
ubuntu-build:
name: Build for Ubuntu 🐧
runs-on: ubuntu-latest
needs: check-event
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set Up Environment 🔧
id: setup
run: |
: Set Up Environment 🔧
if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
git_tag="$(git describe --tags)"
read -r product_name product_version <<< \
"$(jq -r '. | {name, version} | join(" ")' buildspec.json)"
echo "pluginName=${product_name}" >> $GITHUB_OUTPUT
echo "pluginVersion=${git_tag}" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: ccache-cache
with:
path: ${{ github.workspace }}/.ccache
key: ${{ runner.os }}-ccache-x86_64-${{ needs.check-event.outputs.config }}
restore-keys: |
${{ runner.os }}-ccache-x86_64-
- name: Set up CMake 🏗️
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.x.x'
- name: Set up Homebrew 🍺
uses: Homebrew/actions/setup-homebrew@master
- name: Build Plugin 🧱
uses: ./.github/actions/build-plugin
with:
target: x86_64
config: ${{ needs.check-event.outputs.config }}
- name: Run tests
uses: ./.github/actions/run-tests
with:
target: x86_64
config: ${{ needs.check-event.outputs.config }}
- name: Package Plugin 📀
uses: ./.github/actions/package-plugin
with:
package: ${{ fromJSON(needs.check-event.outputs.package) }}
target: x86_64
config: ${{ needs.check-event.outputs.config }}
- name: Upload Source Tarball 🗜️
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-sources-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-*-source.*
- name: Upload Artifacts 📡
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-24.04-x86_64-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-*-x86_64*.*
- name: Upload debug symbol artifacts 🪲
uses: actions/upload-artifact@v4
if: ${{ fromJSON(needs.check-event.outputs.package) }}
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-24.04-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-*-x86_64*-dbgsym.ddeb
windows-build:
name: Build for Windows 🪟
runs-on: windows-2022
needs: check-event
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set Up Environment 🔧
id: setup
run: |
# Set Up Environment 🔧
if ( $Env:RUNNER_DEBUG -ne $null ) {
Set-PSDebug -Trace 1
}
$BuildSpec = Get-Content -Path buildspec.json -Raw | ConvertFrom-Json
$ProductName = $BuildSpec.name
$GitOutput = git describe --tags
"pluginName=${ProductName}" >> $env:GITHUB_OUTPUT
"pluginVersion=${GitOutput}" >> $env:GITHUB_OUTPUT
- name: Build Dependencies 🏗️
uses: ./.github/actions/build-dependencies
with:
workingDirectory: ${{ github.workspace }}/plugin
target: x64
config: ${{ needs.check-event.outputs.config }}
- name: Build Plugin 🧱
uses: ./.github/actions/build-plugin
with:
target: x64
config: ${{ needs.check-event.outputs.config }}
- name: Run tests
uses: ./.github/actions/run-tests
with:
target: x64
config: ${{ needs.check-event.outputs.config }}
- name: Package Plugin 📀
uses: ./.github/actions/package-plugin
with:
target: x64
config: ${{ needs.check-event.outputs.config }}
package: ${{ fromJSON(needs.check-event.outputs.package) }}
- name: Upload Artifacts 📡
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-*-windows-x64*.*

View File

@ -1,285 +0,0 @@
name: build obs plugin
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
PLUGIN_NAME: SceneSwitcher
LIB_NAME: advanced-scene-switcher
jobs:
macos64:
name: "macOS 64-bit"
runs-on: [macos-latest]
env:
QT_VERSION: 5.14.1
OSX_DEPS_VERSION: '2020-04-07'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
submodules: 'recursive'
- name: "Checkout plugin"
uses: actions/checkout@v2
with:
path: UI/frontend-plugins/${{ env.PLUGIN_NAME }}
- name: Fetch Git Tags
run: |
cd UI/frontend-plugins/${{ env.PLUGIN_NAME }}
git fetch --prune --tags --unshallow
- name: 'Install prerequisites (Homebrew)'
shell: bash
run: |
cd UI/frontend-plugins/${{ env.PLUGIN_NAME }}/CI/macos
brew update
brew bundle
cd -
- name: 'Install prerequisite: Pre-built dependencies'
shell: bash
run: |
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.OSX_DEPS_VERSION }}/osx-deps-${{ env.OSX_DEPS_VERSION }}.tar.gz
tar -xf ./osx-deps-${{ env.OSX_DEPS_VERSION }}.tar.gz -C "/tmp"
- name: Configure
shell: bash
run: |
echo "add_subdirectory(${{ env.PLUGIN_NAME }})" >> UI/frontend-plugins/CMakeLists.txt
mkdir ./build
cd ./build
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DDepsPath="/tmp/obsdeps" -DQTDIR="/usr/local/Cellar/qt/${{ env.QT_VERSION }}" ..
cd -
- name: Build
shell: bash
run: |
set -e
cd ./build
make -j4
cd -
- name: 'Install prerequisite: Packages app'
if: success()
shell: bash
run: |
curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg
sudo installer -pkg ./Packages.pkg -target /
- name: Package
if: success()
shell: bash
run: |
cd UI/frontend-plugins/${{ env.PLUGIN_NAME }}
install_name_tool -change @rpath/libobs-frontend-api.dylib @executable_path/../Frameworks/libobs-frontend-api.dylib ../../../build/UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so
install_name_tool -change @rpath/libobs.0.dylib @executable_path/../Frameworks/libobs.0.dylib ../../../build/UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so
install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ../../../build/UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so
install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ../../../build/UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so
install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ../../../build/UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so
FILE_DATE=$(date +%Y-%m-%d)
FILE_NAME=${{ env.PLUGIN_NAME }}-$FILE_DATE-${{ github.sha }}-macos.pkg
echo "::set-env name=FILE_NAME::${FILE_NAME}"
packagesbuild ./CI/macos/${{ env.PLUGIN_NAME }}.pkgproj
cd -
mkdir ./nightly
mv UI/frontend-plugins/${{ env.PLUGIN_NAME }}/${{ env.PLUGIN_NAME }}.pkg ./nightly/${FILE_NAME}
- name: Publish
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.FILE_NAME }}'
path: ./nightly/*.pkg
ubuntu64:
name: 'Linux/Ubuntu 64-bit'
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
submodules: 'recursive'
- name: "Checkout plugin"
uses: actions/checkout@v2
with:
path: UI/frontend-plugins/${{ env.PLUGIN_NAME }}
- name: Add plugin to obs cmake
shell: bash
run: echo "add_subdirectory(${{ env.PLUGIN_NAME }})" >> UI/frontend-plugins/CMakeLists.txt
- name: Fetch Git Tags
run: git fetch --prune --tags --unshallow
- name: Install prerequisites (Apt)
shell: bash
run: |
sudo dpkg --add-architecture amd64
sudo apt-get -qq update
sudo apt-get install -y \
build-essential \
checkinstall \
cmake \
libasound2-dev \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libcurl4-openssl-dev \
libfdk-aac-dev \
libfontconfig-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libjack-jackd2-dev \
libjansson-dev \
libluajit-5.1-dev \
libpulse-dev \
libqt5x11extras5-dev \
libspeexdsp-dev \
libswresample-dev \
libswscale-dev \
libudev-dev \
libv4l-dev \
libva-dev \
libvlc-dev \
libx11-dev \
libx264-dev \
libxcb-randr0-dev \
libxcb-shm0-dev \
libxcb-xinerama0-dev \
libxcomposite-dev \
libxinerama-dev \
libmbedtls-dev \
pkg-config \
python3-dev \
qtbase5-dev \
libqt5svg5-dev \
swig \
libxss-dev
- name: 'Configure'
shell: bash
run: |
mkdir ./build
cd ./build
cmake -DUNIX_STRUCTURE=0 -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/obs-studio-portable" -DBUILD_CAPTIONS=OFF -DWITH_RTMPS=OFF -DBUILD_BROWSER=OFF ..
- name: 'Build'
shell: bash
working-directory: ${{ github.workspace }}/build
run: make -j4
- name: 'Package'
shell: bash
run: |
FILE_DATE=$(date +%Y-%m-%d)
FILE_NAME=${{ env.PLUGIN_NAME }}-$FILE_DATE-${{ github.sha }}-linux64.tar.gz
echo "::set-env name=FILE_NAME::${FILE_NAME}"
mkdir -p ./${{ env.PLUGIN_NAME }}/bin/64bit/
mv ./build/UI/frontend-plugins/${{ env.PLUGIN_NAME }}/${{ env.LIB_NAME }}.so ./${{ env.PLUGIN_NAME }}/bin/64bit/${{ env.LIB_NAME }}.so
tar -cvzf "${FILE_NAME}" ${{ env.PLUGIN_NAME }}
- name: 'Publish'
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.FILE_NAME }}'
path: '*.tar.gz'
win64:
name: Windows 64-bit
runs-on: [windows-latest]
env:
QT_VERSION: 5.10.1
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_SYSTEM_VERSION: "10.0.18363.657"
steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.0
- name: Checkout obs
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
submodules: 'recursive'
- name: Checkout plugin
uses: actions/checkout@v2
with:
path: UI/frontend-plugins/${{ env.PLUGIN_NAME}}
- name: Add plugin to obs cmake
shell: cmd
run: echo add_subdirectory(${{ env.PLUGIN_NAME }}) >> UI/frontend-plugins/CMakeLists.txt
- name: Fetch Git Tags
run: git fetch --prune --tags --unshallow
- name: 'Install prerequisite: QT'
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C -
7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}/cmbuild/QT"
- name: 'Install prerequisite: Pre-built dependencies'
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies2017.zip -f --retry 5 -C -
7z x dependencies2017.zip -o"${{ github.workspace }}/cmbuild/deps"
- name: Configure
run: |
mkdir ./build
mkdir ./build64
cd ./build64
cmake -G"${{ env.CMAKE_GENERATOR }}" -A"x64" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win64" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2017_64" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE ..
- name: Build
run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-studio.sln
- name: Package
if: success()
run: |
$env:FILE_DATE=(Get-Date -UFormat "%F")
$env:FILE_NAME="${{ env.PLUGIN_NAME }}-${env:FILE_DATE}-${{ github.sha }}-win64.zip"
echo "::set-env name=FILE_NAME::${env:FILE_NAME}"
robocopy .\build64\rundir\RelWithDebInfo\obs-plugins\64bit\ .\build\obs-plugins\64bit ${{ env.LIB_NAME }}.* /E /XF .gitignore
7z a ${env:FILE_NAME} .\build\*
- name: Publish
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.FILE_NAME }}'
path: '*-win64.zip'
win32:
name: Windows 32-bit
runs-on: [windows-latest]
env:
QT_VERSION: 5.10.1
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_SYSTEM_VERSION: "10.0.18363.657"
steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.0
- name: Checkout obs
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
submodules: 'recursive'
- name: Checkout plugin
uses: actions/checkout@v2
with:
path: UI/frontend-plugins/${{ env.PLUGIN_NAME }}
- name: Add plugin to obs cmake
shell: cmd
run: echo add_subdirectory(${{ env.PLUGIN_NAME }}) >> UI/frontend-plugins/CMakeLists.txt
- name: Fetch Git Tags
run: git fetch --prune --tags --unshallow
- name: 'Install prerequisite: QT'
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C -
7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}/cmbuild/QT"
- name: 'Install prerequisite: Pre-built dependencies'
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies2017.zip -f --retry 5 -C -
7z x dependencies2017.zip -o"${{ github.workspace }}/cmbuild/deps"
- name: Configure
run: |
mkdir ./build
mkdir ./build32
cd ./build32
cmake -G"${{ env.CMAKE_GENERATOR }}" -A"Win32" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win32" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2017" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE ..
- name: Build
run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-studio.sln
- name: Package
if: success()
run: |
$env:FILE_DATE=(Get-Date -UFormat "%F")
$env:FILE_NAME="${{ env.PLUGIN_NAME }}-${env:FILE_DATE}-${{ github.sha }}-win32.zip"
echo "::set-env name=FILE_NAME::${env:FILE_NAME}"
robocopy .\build32\rundir\RelWithDebInfo\obs-plugins\32bit\ .\build\obs-plugins\32bit ${{ env.LIB_NAME }}.* /E /XF .gitignore
7z a ${env:FILE_NAME} .\build\*
- name: Publish
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.FILE_NAME }}'
path: '*-win32.zip'

27
.github/workflows/check-format.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Check Code Formatting 🛠️
on:
workflow_call:
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: clang-format check 🐉
id: clang-format
uses: ./.github/actions/run-clang-format
with:
failCondition: error
cmake-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: cmake-format check 🎛️
id: cmake-format
uses: ./.github/actions/run-cmake-format
with:
failCondition: error

18
.github/workflows/dispatch.yaml vendored Normal file
View File

@ -0,0 +1,18 @@
name: Dispatch
run-name: Dispatched Repository Actions - ${{ inputs.job }} ⌛️
on:
workflow_dispatch:
inputs:
job:
description: Dispatch job to run
required: true
type: choice
options:
- build
permissions:
contents: write
jobs:
check-and-build:
if: inputs.job == 'build'
uses: ./.github/workflows/build-project.yaml
secrets: inherit

26
.github/workflows/locale-check.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Check locale
on:
push:
branches:
- master
tags:
- '*'
paths:
- 'data/locale/**'
pull_request:
branches:
- master
paths:
- 'data/locale/**'
jobs:
ubuntu64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check locale files
run: |
python3 ./build-aux/CI/check-locale.py -p data/locale/

27
.github/workflows/pr-pull.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Pull Request
run-name: ${{ github.event.pull_request.title }} pull request run 🚀
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**.md'
branches: [master, main]
types: [ opened, synchronize, reopened ]
permissions:
contents: read
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
check-format:
name: Check Formatting 🔍
uses: ./.github/workflows/check-format.yaml
permissions:
contents: read
build-project:
name: Build Project 🧱
uses: ./.github/workflows/build-project.yaml
secrets: inherit
permissions:
contents: read

122
.github/workflows/push.yaml vendored Normal file
View File

@ -0,0 +1,122 @@
name: Push to master
run-name: ${{ github.ref_name }} push run 🚀
on:
push:
branches:
- master
- main
- 'release/**'
tags:
- '*'
permissions:
contents: write
concurrency:
group: '${{ github.workflow }} @ ${{ github.ref }}'
cancel-in-progress: ${{ github.ref_type == 'tag' }}
jobs:
check-format:
name: Check Formatting 🔍
if: github.ref_name == 'master'
uses: ./.github/workflows/check-format.yaml
permissions:
contents: read
build-project:
name: Build Project 🧱
uses: ./.github/workflows/build-project.yaml
secrets: inherit
permissions:
contents: read
create-release:
name: Create Release 🛫
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
needs: build-project
defaults:
run:
shell: bash
steps:
- name: Check Release Tag ☑️
id: check
run: |
: Check Release Tag ☑️
if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
shopt -s extglob
case "${GITHUB_REF_NAME}" in
+([0-9]).+([0-9]).+([0-9]) )
echo 'validTag=true' >> $GITHUB_OUTPUT
echo 'prerelease=false' >> $GITHUB_OUTPUT
echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
;;
+([0-9]).+([0-9]).+([0-9])-@(beta|rc)*([0-9]) )
echo 'validTag=true' >> $GITHUB_OUTPUT
echo 'prerelease=true' >> $GITHUB_OUTPUT
echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
;;
*) echo 'validTag=false' >> $GITHUB_OUTPUT ;;
esac
- name: Download Build Artifacts 📥
uses: actions/download-artifact@v4
if: fromJSON(steps.check.outputs.validTag)
id: download
- name: Rename Files 🏷️
if: fromJSON(steps.check.outputs.validTag)
run: |
: Rename Files 🏷️
if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
shopt -s extglob
shopt -s nullglob
root_dir="$(pwd)"
commit_hash="${GITHUB_SHA:0:9}"
variants=(
'windows-x64;zip|exe'
'macos-universal;tar.xz|pkg'
'ubuntu-24.04-x86_64;tar.xz|deb|ddeb'
'sources;tar.xz'
)
for variant_data in "${variants[@]}"; do
IFS=';' read -r variant suffix <<< "${variant_data}"
candidates=(*-${variant}-${commit_hash}/@(*|*-dbgsym).@(${suffix}))
for candidate in "${candidates[@]}"; do
mv "${candidate}" "${root_dir}"
done
done
- name: Generate Checksums 🪪
if: fromJSON(steps.check.outputs.validTag)
run: |
: Generate Checksums 🪪
if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
shopt -s extglob
echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt
for file in ${{ github.workspace }}/@(*.exe|*.deb|*.ddeb|*.pkg|*.tar.xz|*.zip); do
echo " ${file##*/}: $(sha256sum "${file}" | cut -d " " -f 1)" >> ${{ github.workspace }}/CHECKSUMS.txt
done
- name: Create Release 🛫
if: fromJSON(steps.check.outputs.validTag)
id: create_release
uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b
with:
draft: true
prerelease: ${{ fromJSON(steps.check.outputs.prerelease) }}
tag_name: ${{ steps.check.outputs.version }}
name: ${{ needs.build-project.outputs.pluginName }} ${{ steps.check.outputs.version }}
body_path: ${{ github.workspace }}/CHECKSUMS.txt
files: |
${{ github.workspace }}/*.exe
${{ github.workspace }}/*.zip
${{ github.workspace }}/*.pkg
${{ github.workspace }}/*.deb
${{ github.workspace }}/*.ddeb
${{ github.workspace }}/*.tar.xz

125
.gitignore vendored
View File

@ -1,98 +1,41 @@
# Prerequisites #
#################
*.d
# Exclude everything
/*
# Object files #
################
*.o
*.ko
*.obj
*.elf
*.slo
*.lo
*.obj
# Except for default project files
!/.github
!/build-aux
!/cmake
!/data
!/deps
!/scripting
!/forms
!/lib
!/module
!/plugins
!/tests
!.clang-format
!.cmake-format.json
!.gitattributes
!.gitignore
!.pre-commit-config.yaml
!BUILDING.md
!buildspec.json
!CMakeLists.txt
!CMakePresets.json
!LICENSE
!README.md
# Linker output #
#################
*.ilk
*.map
*.exp
# Exclude .orig leftovers
*.orig
# Precompiled Headers #
#######################
*.gch
*.pch
# Exclude lock files
*.lock.json
# Libraries #
#############
*.lib
*.a
*.la
*.lo
*.lai
# Shared objects (inc. Windows DLLs) #
######################################
*.dll
*.so
*.so.*
*.dylib
# Executables #
###############
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files #
###############
*.dSYM/
*.su
*.idb
*.pdb
# CMake temp files #
####################
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake_install
# OS generated files #
######################
# Exclude macOS legacy resource forks
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.directory
# backup text files generated by an editor #
############################################
**/*~
# Exclude CMake build number cache
/cmake/.CMakeBuildNumber
# Various IDE Files #
#####################
.classpath
.project
.settings
.idea
.metadata
*.iml
*.ipr
*.sublime*
# Directories #
###############
build/
# Exclude python caches
/**/__pycache__

39
.gitmodules vendored Normal file
View File

@ -0,0 +1,39 @@
[submodule "deps/asio"]
path = deps/asio
url = https://github.com/chriskohlhoff/asio.git
[submodule "deps/websocketpp"]
path = deps/websocketpp
url = https://github.com/zaphoyd/websocketpp.git
[submodule "deps/opencv"]
path = deps/opencv
url = https://github.com/opencv/opencv.git
[submodule "deps/openvr"]
path = deps/openvr
url = https://github.com/ValveSoftware/openvr.git
[submodule "deps/leptonica"]
path = deps/leptonica
url = https://github.com/DanBloomberg/leptonica.git
[submodule "deps/tesseract"]
path = deps/tesseract
url = https://github.com/tesseract-ocr/tesseract.git
[submodule "deps/libremidi"]
path = deps/libremidi
url = https://github.com/jcelerier/libremidi.git
[submodule "deps/cpp-httplib"]
path = deps/cpp-httplib
url = https://github.com/yhirose/cpp-httplib.git
[submodule "deps/json"]
path = deps/json
url = https://github.com/nlohmann/json.git
[submodule "deps/libusb"]
path = deps/libusb
url = https://github.com/libusb/libusb.git
[submodule "deps/date"]
path = deps/date
url = https://github.com/HowardHinnant/date.git
[submodule "deps/jsoncons"]
path = deps/jsoncons
url = https://github.com/danielaparker/jsoncons.git
[submodule "deps/paho.mqtt.cpp"]
path = deps/paho.mqtt.cpp
url = https://github.com/eclipse-paho/paho.mqtt.cpp.git

24
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,24 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks:
- id: clang-format
args: [-fallback-style=none]
types_or: [c++, c]
exclude: |
(?x)^(
deps/.*|
tests/catch\.hpp|
.*\.mm
)$
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.2
hooks:
- id: ruff-format
types_or: [python]

221
BUILDING.md Normal file
View File

@ -0,0 +1,221 @@
# Compiling the plugin
You have the option to ...
- either add the plugin to the OBS source tree directly and build the plugin while building OBS itself. (**in tree**)
- or you can move the sources of this plugin outside of the OBS source tree and build it separately from OBS. (**out of tree**)
Both methods require [CMake](https://cmake.org/download/).
The plugin can be compiled for OBS 31 and above, although using the latest version of OBS is recommended to support all features.
## Compiling in tree (recommended for development)
This section assumes that you have a working [OBS Studio development environment](https://obsproject.com/wiki/Building-OBS-Studio).
Add the "SceneSwitcher" source directory to your obs-studio source directory under obs-studio/plugins:
```
cd obs-studio/plugins
git clone --recursive https://github.com/WarmUpTill/SceneSwitcher.git
```
Then modify the obs-studio/plugins/CMakeLists.txt and add an entry for the scene switcher:
```
add_subdirectory(SceneSwitcher)
```
Now follow the [build instructions for obs-studio](https://obsproject.com/wiki/Building-OBS-Studio) for your particular platform.
### Dependencies for plugins
Note that on Linux systems it might be necessary to additionally install the following packages to fulfill the dependencies to `XTest`, `XScreensaver` and `OpenCV` - exact command may differ:
```
sudo apt-get install \
libxtst-dev \
libxss-dev \
libprocps-dev \
libopencv-dev
```
If you have decided to build some dependencies of the plugin yourself (e.g. `OpenCV` for the video condition) you will have to pass the corresponding arguments to the cmake command used to configure OBS.
Here is an example of what the adjusted command might look like on a Windows machine:
```
cd obs-studio
cmake -DOpenCV_DIR="C:/Users/BuildUser/Documents/OBS/opencv/build/" -DLeptonica_DIR="C:/Users/BuildUser/Documents/OBS/leptonica/build" -DTesseract_DIR="C:/Users/BuildUser/Documents/OBS/tesseract/build/lib/cmake/tesseract" --preset windows-x64
```
## Compiling out of tree
First you will need to clone the plugin sources by running the following command:
```
git clone --recursive https://github.com/WarmUpTill/SceneSwitcher.git
```
Next you will need [CMake](https://cmake.org/download/) and run it with suitable arguments for your particular platform.
For example, on Windows you might want to run this command:
```
cd SceneSwitcher
cmake --preset windows-x64
```
Next, you can build the plugin and install the files into a folder named release using the following commands:
```
cmake --build build_x64 --preset windows-x64 --config RelWithDebInfo
cmake --install build_x64 --prefix release --config RelWithDebInfo
```
You can of course also build the plugin in an IDE depending on which generator you chose. (E.g. a Visual Studio solution on Windows)
### Dependencies for plugins
If you also want to include plugins which depend on external libraries you will have to adjust the cmake call in the configuration phase accordingly.
For example, to include the "Video" condition in your build you will have to supply the paths to `OpenCV`, `tesseract`, and `leptonica` binaries.
On a Window system the command might look something like this:
```
cd SceneSwitcher
cmake -DOpenCV_DIR="C:/Users/BuildUser/Documents/OBS/opencv/build/" -DLeptonica_DIR="C:/Users/BuildUser/Documents/OBS/leptonica/build" -DTesseract_DIR="C:/Users/BuildUser/Documents/OBS/tesseract/build/lib/cmake/tesseract" --preset windows-x64
```
You can rely on the CI scripts to build the dependencies for you, although it is not guaranteed that they will function in every environment:
| Platform | Command |
| ----------- | ----------- |
| Windows | `.\.github\scripts\Build-Deps-Windows.ps1` |
| Linux | `./.github/scripts/build-deps-linux.sh` |
| MacOS | `./.github/scripts/build-deps-macos.zsh` |
# Contributing
Contributions to the plugin are always welcome and if you need any assistance do not hesitate to reach out!
If you would like to expand upon the macro system by adding a new condition or action type have a look at the examples in `plugins/base`.
In general changes in the `lib/legacy` folder should be avoided, if possible.
## Macro condition
Macro conditions should inherit from the `MacroCondition` class and must implement the following functions:
```
class MacroConditionExample : public MacroCondition {
public:
MacroConditionExample(Macro *m) : MacroCondition(m) {}
// This function should perform the condition check
bool CheckCondition();
// This function should store the required condition data to "data"
// For example called on OBS shutdown
bool Save(obs_data_t *data);
// This function should load the condition data from "data"
// For example called on OBS startup
bool Load(obs_data_t *data);
// This function should return a unique id for this condition type
// The _id is defined below
std::string GetId() { return _id; };
// Helper function called when new conditions are created
// Will be used later when registering the new condition type
static std::shared_ptr<MacroCondition> Create(Macro *m)
{
return std::make_shared<MacroConditionExample>(m);
}
private:
// Used to register new condition type
static bool _registered;
// Unique id identifying this condition type
static const std::string _id;
};
```
When defining the widget used to control the settings of the condition type, a static `Create()` method is required.
It will be called whenever a new condition MacroConditionExample is created. (See `MacroConditionFactory::Register()`)
```
class MacroConditionExampleEdit : public QWidget {
Q_OBJECT
public:
// ...
MacroConditionExampleEdit(
QWidget *parent,
std::shared_ptr<MacroConditionExample> cond = nullptr);
// Function will be used to create the widget for editing the settings of the condition
static QWidget *Create(QWidget *parent,
std::shared_ptr<MacroCondition> cond)
{
return new MacroConditionExampleEdit(
parent,
std::dynamic_pointer_cast<MacroConditionExample>(cond));
}
// ...
};
```
To finally register the new condition type you will have to add the following call to `MacroConditionFactory::Register()`.
```
bool MacroConditionExample::_registered = MacroConditionFactory::Register(
MacroConditionExample::id, // Unique string identifying this condition type
{
MacroConditionExample::Create, // Function called to create the object performing the condition
MacroConditionExampleEdit::Create, // Function called to create the widget to configure the settings
"AdvSceneSwitcher.condition.example", // User facing name of the condition type (will be translated)
true // Condition type supports duration modifiers (default true)
}
);
```
## Macro action
The process of adding a new action type is very similar to adding a new condition.
The differences are highlighted in the comments below.
```
class MacroActionExample : public MacroAction {
public:
MacroActionExample(Macro *m) : MacroAction(m) {}
static std::shared_ptr<MacroAction> Create(Macro *m);
// Used to create a copy of the action (used for action queues)
std::shared_ptr<MacroAction> Copy() const;
// This function should perform the action
// If false is returned the macro will aborted
bool PerformAction();
bool Save(obs_data_t *data);
bool Load(obs_data_t *data);
std::string GetId() { return _id; };
// Optional:
// Might be called when action is inserted to action queue
void ResolveVariablesToFixedValues();
private:
static bool _registered;
static const std::string _id;
};
```
```
class MacroActionExampleEdit : public QWidget {
Q_OBJECT
public:
// ...
MacroActionExampleEdit(
QWidget *parent,
std::shared_ptr<MacroActionExample> entryData = nullptr);
static QWidget *Create(QWidget *parent,
std::shared_ptr<MacroAction> action)
{
return new MacroActionExampleEdit(
parent,
std::dynamic_pointer_cast<MacroActionExample>(action));
}
// ...
};
```
```
MacroActionFactory::Register(
MacroActionExample::id, // Unique string identifying this action type
{
MacroActionExample::Create, // Function called to create the object performing the action
MacroActionExampleEdit::Create, // Function called to create the widget to configure the settings
"AdvSceneSwitcher.action.example" // User facing name of the action type
}
);
```
## External dependencies
If your intention is to add macro functionality which depends on external libraries, which might not exist on all user environments, have a look at the folders in the `plugins/` directory, which are not named `base`.
For example, `plugins/video` will only be loaded if the `OpenCV` dependencies are met.

View File

@ -1,6 +0,0 @@
brew "jack"
brew "speexdsp"
brew "cmake"
brew "freetype"
brew "fdk-aac"
brew "https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb"

View File

@ -1,760 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PROJECT</key>
<dict>
<key>PACKAGE_FILES</key>
<dict>
<key>DEFAULT_INSTALL_LOCATION</key>
<string>/</string>
<key>HIERARCHY</key>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>../../../../../build/UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so</string>
<key>PATH_TYPE</key>
<integer>3</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>3</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>bin</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>advanced-scene-switcher</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>plugins</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>obs-studio</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Application Support</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Automator</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Documentation</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Extensions</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Filesystems</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Frameworks</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Input Methods</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Internet Plug-Ins</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>LaunchAgents</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>LaunchDaemons</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>PreferencePanes</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Preferences</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Printers</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>PrivilegedHelperTools</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>1005</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>QuickLook</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>QuickTime</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Screen Savers</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Scripts</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Services</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Widgets</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Library</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Shared</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>1023</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Users</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Applications</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>/</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<key>PAYLOAD_TYPE</key>
<integer>0</integer>
<key>PRESERVE_EXTENDED_ATTRIBUTES</key>
<false/>
<key>SHOW_INVISIBLE</key>
<false/>
<key>SPLIT_FORKS</key>
<true/>
<key>TREAT_MISSING_FILES_AS_WARNING</key>
<false/>
<key>VERSION</key>
<integer>5</integer>
</dict>
<key>PACKAGE_SCRIPTS</key>
<dict>
<key>POSTINSTALL_PATH</key>
<dict>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>
<key>PREINSTALL_PATH</key>
<dict>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>
<key>RESOURCES</key>
<array/>
</dict>
<key>PACKAGE_SETTINGS</key>
<dict>
<key>AUTHENTICATION</key>
<integer>1</integer>
<key>CONCLUSION_ACTION</key>
<integer>0</integer>
<key>FOLLOW_SYMBOLIC_LINKS</key>
<false/>
<key>IDENTIFIER</key>
<string>com.warmuptill.SceneSwitcher</string>
<key>LOCATION</key>
<integer>0</integer>
<key>NAME</key>
<string></string>
<key>OVERWRITE_PERMISSIONS</key>
<false/>
<key>PAYLOAD_SIZE</key>
<integer>-1</integer>
<key>REFERENCE_PATH</key>
<string></string>
<key>RELOCATABLE</key>
<false/>
<key>USE_HFS+_COMPRESSION</key>
<false/>
<key>VERSION</key>
<string>0.0.2</string>
</dict>
<key>PROJECT_COMMENTS</key>
<dict>
<key>NOTES</key>
<data>
PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBIVE1M
IDQuMDEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvVFIvaHRtbDQv
c3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KPG1ldGEgaHR0cC1l
cXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7
IGNoYXJzZXQ9VVRGLTgiPgo8bWV0YSBodHRwLWVxdWl2PSJDb250
ZW50LVN0eWxlLVR5cGUiIGNvbnRlbnQ9InRleHQvY3NzIj4KPHRp
dGxlPjwvdGl0bGU+CjxtZXRhIG5hbWU9IkdlbmVyYXRvciIgY29u
dGVudD0iQ29jb2EgSFRNTCBXcml0ZXIiPgo8bWV0YSBuYW1lPSJD
b2NvYVZlcnNpb24iIGNvbnRlbnQ9IjE0MDQuMTMiPgo8c3R5bGUg
dHlwZT0idGV4dC9jc3MiPgo8L3N0eWxlPgo8L2hlYWQ+Cjxib2R5
Pgo8L2JvZHk+CjwvaHRtbD4K
</data>
</dict>
<key>PROJECT_SETTINGS</key>
<dict>
<key>BUILD_PATH</key>
<dict>
<key>PATH</key>
<string>../..</string>
<key>PATH_TYPE</key>
<integer>1</integer>
</dict>
<key>EXCLUDED_FILES</key>
<array>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.DS_Store</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove .DS_Store files</string>
<key>PROXY_TOOLTIP</key>
<string>Remove ".DS_Store" files created by the Finder.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.pbdevelopment</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove .pbdevelopment files</string>
<key>PROXY_TOOLTIP</key>
<string>Remove ".pbdevelopment" files created by ProjectBuilder or Xcode.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>CVS</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.cvsignore</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.cvspass</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.svn</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.git</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.gitignore</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove SCM metadata</string>
<key>PROXY_TOOLTIP</key>
<string>Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>classes.nib</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>designable.db</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>info.nib</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Optimize nib files</string>
<key>PROXY_TOOLTIP</key>
<string>Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>Resources Disabled</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove Resources Disabled folders</string>
<key>PROXY_TOOLTIP</key>
<string>Remove "Resources Disabled" folders.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>SEPARATOR</key>
<true/>
</dict>
</array>
<key>NAME</key>
<string>SceneSwitcher</string>
<key>PAYLOAD_ONLY</key>
<false/>
</dict>
</dict>
<key>TYPE</key>
<integer>1</integer>
<key>VERSION</key>
<integer>2</integer>
</dict>
</plist>

View File

@ -1,234 +1,535 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.21...3.26)
project(advanced-scene-switcher)
project(advanced-scene-switcher VERSION 1.0.0)
message(STATUS "CMAKE_PROJECT_NAME is ${CMAKE_PROJECT_NAME}")
if(${CMAKE_PROJECT_NAME} STREQUAL "obs-studio")
if(NOT DEFINED BUILD_OUT_OF_TREE)
message(STATUS "${PROJECT_NAME} configured for in-tree build")
endif()
else()
set(BUILD_OUT_OF_TREE ON)
message(STATUS "${PROJECT_NAME} configured for out-of-tree build")
endif()
if(BUILD_OUT_OF_TREE)
# out of tree builds
# credits to c3r1c3
set(CMAKE_PREFIX_PATH "${QTDIR}")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/external")
include(external/FindLibObs.cmake)
find_package(LibObs REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Libcurl REQUIRED)
find_path(LIBOBS_FRONTEND_INCLUDE_DIR HINTS ${LIBOBS_INCLUDE_DIRS})
find_file(LIBOBS_FRONTEND_API_LIB NAMES libobs-frontend-api.* HINTS ${LIBOBS_LIB} )
if(APPLE)
find_library(COCOA Cocoa)
find_package(Qt5MacExtras REQUIRED)
include_directories(${COCOA})
add_link_options("-v")
endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
endif()
set(advanced-scene-switcher_HEADERS
${advanced-scene-switcher_HEADERS}
src/headers/advanced-scene-switcher.hpp
src/headers/switcher-data-structs.hpp
src/headers/utility.hpp
)
set(advanced-scene-switcher_SOURCES
${advanced-scene-switcher_SOURCES}
src/advanced-scene-switcher.cpp
src/advanced-scene-switcher-module.c
src/scene-transitions.cpp
src/screen-region-switch.cpp
src/priority.cpp
src/executable-switch.cpp
src/idle-switch.cpp
src/scene-round-trip.cpp
src/file-switch.cpp
src/window-title-switch.cpp
src/media-switch.cpp
src/hotkey.cpp
src/general.cpp
src/pause-switch.cpp
src/random.cpp
src/time-switch.cpp
)
set(advanced-scene-switcher_UI
${advanced-scene-switcher_UI}
forms/advanced-scene-switcher.ui
)
if(WIN32)
set(advanced-scene-switcher_PLATFORM_SOURCES
src/win/advanced-scene-switcher-win.cpp)
elseif(APPLE)
set(advanced-scene-switcher_PLATFORM_SOURCES
src/osx/advanced-scene-switcher-osx.mm)
set_source_files_properties(advanced-scene-switcher-osx.mm
PROPERTIES COMPILE_FLAGS "-fobjc-arc")
set(advanced-scene-switcher_PLATFORM_LIBS
${COCOA})
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set(advanced-scene-switcher_PLATFORM_SOURCES
src/linux/advanced-scene-switcher-nix.cpp)
set(advanced-scene-switcher_PLATFORM_LIBS
Xss)
endif()
qt5_wrap_ui(advanced-scene-switcher_UI_HEADERS
${advanced-scene-switcher_UI}
${advanced-scene-switcher_PLATFORM_UI})
add_library(advanced-scene-switcher MODULE
${advanced-scene-switcher_HEADERS}
${advanced-scene-switcher_SOURCES}
${advanced-scene-switcher_UI_HEADERS}
${advanced-scene-switcher_PLATFORM_SOURCES}
${advanced-scene-switcher_PLATFORM_HEADERS}
)
include_directories(
"${LIBOBS_INCLUDE_DIRS}"
"${LIBOBS_FRONTEND_INCLUDE_DIR}"
${Qt5Core_INCLUDES}
${Qt5Widgets_INCLUDES}
${LIBCURL_INCLUDE_DIRS})
target_link_libraries(advanced-scene-switcher
${advanced-scene-switcher_PLATFORM_LIBS}
${LIBOBS_LIB}
${LIBOBS_FRONTEND_API_LIB}
Qt5::Core
Qt5::Widgets
${LIBCURL_LIBRARIES})
# Additional commands to install the module in the correct place.
# Find all the translation files so we can copy them to the correct
# place later on.
file(GLOB ASS_TRANSLATION_FILES
"data/locale/*.ini"
)
# Windows
if(WIN32)
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
message("${CMAKE_CXX_FLAGS_RELEASE}")
find_package(w32-pthreads REQUIRED)
target_link_libraries(advanced-scene-switcher
w32-pthreads)
endif()
# OSX
if(APPLE)
set_target_properties(advanced-scene-switcher PROPERTIES PREFIX "")
endif()
# Linux
if(UNIX AND NOT APPLE)
set(CMAKE_C_FLAGS "-Wall -Wextra -Wvla -Wno-unused-function -Werror-implicit-function-declaration -Wno-missing-braces -Wno-missing-field-initializers ${CMAKE_C_FLAGS} -std=c99 -fno-strict-aliasing")
if(ARCH EQUAL 64)
set(ARCH_NAME "x86_64")
else()
set(ARCH_NAME "i686")
endif()
set_target_properties(advanced-scene-switcher PROPERTIES PREFIX "")
install(TARGETS advanced-scene-switcher
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/obs-plugins)
install(FILES ${ASS_TRANSLATION_FILES}
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/obs/obs-plugins/advanced-scene-switcher/locale")
endif()
else ()
# in-tree build
if(APPLE)
find_library(COCOA Cocoa)
include_directories(${COCOA})
endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})
endif()
set(advanced-scene-switcher_HEADERS
${advanced-scene-switcher_HEADERS}
src/headers/advanced-scene-switcher.hpp
src/headers/switcher-data-structs.hpp
src/headers/utility.hpp
)
set(advanced-scene-switcher_SOURCES
${advanced-scene-switcher_SOURCES}
src/advanced-scene-switcher.cpp
src/advanced-scene-switcher-module.c
src/scene-transitions.cpp
src/screen-region-switch.cpp
src/priority.cpp
src/executable-switch.cpp
src/idle-switch.cpp
src/scene-round-trip.cpp
src/file-switch.cpp
src/window-title-switch.cpp
src/media-switch.cpp
src/hotkey.cpp
src/general.cpp
src/pause-switch.cpp
src/random.cpp
src/time-switch.cpp
)
set(advanced-scene-switcher_UI
${advanced-scene-switcher_UI}
forms/advanced-scene-switcher.ui
)
if(WIN32)
set(advanced-scene-switcher_PLATFORM_SOURCES
src/win/advanced-scene-switcher-win.cpp)
elseif(APPLE)
set(advanced-scene-switcher_PLATFORM_SOURCES
src/osx/advanced-scene-switcher-osx.mm)
set_source_files_properties(advanced-scene-switcher-osx.mm
PROPERTIES COMPILE_FLAGS "-fobjc-arc")
set(advanced-scene-switcher_PLATFORM_LIBS
${COCOA})
else()
set(advanced-scene-switcher_PLATFORM_SOURCES
src/linux/advanced-scene-switcher-nix.cpp)
set(advanced-scene-switcher_PLATFORM_LIBS
Xss)
endif()
qt5_wrap_ui(advanced-scene-switcher_UI_HEADERS
${advanced-scene-switcher_UI}
${advanced-scene-switcher_PLATFORM_UI})
add_library(advanced-scene-switcher MODULE
${advanced-scene-switcher_HEADERS}
${advanced-scene-switcher_SOURCES}
${advanced-scene-switcher_UI_HEADERS}
${advanced-scene-switcher_PLATFORM_SOURCES}
${advanced-scene-switcher_PLATFORM_HEADERS}
)
target_link_libraries(advanced-scene-switcher
${advanced-scene-switcher_PLATFORM_LIBS}
obs-frontend-api
Qt5::Widgets
libobs
${LIBCURL_LIBRARIES})
install_obs_plugin(advanced-scene-switcher data)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake"
NO_POLICY_SCOPE)
include(compilerconfig)
include(defaults)
include(helpers)
endif()
# OBS 31 no longer defines find_qt so check if we need to include it for in-tree
# builds
if(NOT COMMAND find_qt)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/helpers_common.cmake")
endif()
set(LIB_NAME "${PROJECT_NAME}-lib")
add_library(${PROJECT_NAME} MODULE)
add_library(${LIB_NAME} SHARED)
include(cmake/common/get_git_revision_description.cmake)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
git_describe(GIT_TAG)
# Helper for OpenSSL
if(OS_WINDOWS)
include(cmake/windows/wingetssl.cmake)
endif()
if(${GIT_TAG} STREQUAL "GIT-NOTFOUND")
set(GIT_TAG ${PROJECT_VERSION})
endif()
message(STATUS "${PROJECT_NAME} version: ${GIT_TAG}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/version.cpp.in"
"${CMAKE_CURRENT_BINARY_DIR}/lib/version.cpp" @ONLY)
# --- Set target sources ---
# Module sources
target_sources(${PROJECT_NAME} PRIVATE module/advanced-scene-switcher-module.c)
# Generic sources
target_sources(
${LIB_NAME}
PRIVATE lib/advanced-scene-switcher.cpp
lib/advanced-scene-switcher.hpp
lib/general.cpp
lib/platform-funcs.hpp
lib/switcher-data.cpp
lib/switcher-data.hpp
lib/version.cpp
lib/version.h)
# Legacy function sources
target_sources(
${LIB_NAME}
PRIVATE lib/legacy/scene-group.cpp
lib/legacy/scene-group.hpp
lib/legacy/switch-audio.cpp
lib/legacy/switch-audio.hpp
lib/legacy/switch-executable.cpp
lib/legacy/switch-executable.hpp
lib/legacy/switch-file.cpp
lib/legacy/switch-file.hpp
lib/legacy/switch-generic.cpp
lib/legacy/switch-generic.hpp
lib/legacy/switch-idle.cpp
lib/legacy/switch-idle.hpp
lib/legacy/switch-media.cpp
lib/legacy/switch-media.hpp
lib/legacy/switch-pause.cpp
lib/legacy/switch-pause.hpp
lib/legacy/switch-random.cpp
lib/legacy/switch-random.hpp
lib/legacy/switch-screen-region.cpp
lib/legacy/switch-screen-region.hpp
lib/legacy/switch-sequence.cpp
lib/legacy/switch-sequence.hpp
lib/legacy/switch-time.cpp
lib/legacy/switch-time.hpp
lib/legacy/switch-transitions.cpp
lib/legacy/switch-transitions.hpp
lib/legacy/switch-video.cpp
lib/legacy/switch-video.hpp
lib/legacy/switch-window.cpp
lib/legacy/switch-window.hpp)
# Maro sources
target_sources(
${LIB_NAME}
PRIVATE lib/macro/macro-action-edit.cpp
lib/macro/macro-action-edit.hpp
lib/macro/macro-action-factory.cpp
lib/macro/macro-action-factory.hpp
lib/macro/macro-action-macro.cpp
lib/macro/macro-action-macro.hpp
lib/macro/macro-action-queue.cpp
lib/macro/macro-action-queue.hpp
lib/macro/macro-action-variable.cpp
lib/macro/macro-action-variable.hpp
lib/macro/macro-action.cpp
lib/macro/macro-action.hpp
lib/macro/macro-condition-edit.cpp
lib/macro/macro-condition-edit.hpp
lib/macro/macro-condition-factory.cpp
lib/macro/macro-condition-factory.hpp
lib/macro/macro-condition-macro.cpp
lib/macro/macro-condition-macro.hpp
lib/macro/macro-condition-queue.cpp
lib/macro/macro-condition-queue.hpp
lib/macro/macro-condition-tempvar.cpp
lib/macro/macro-condition-tempvar.hpp
lib/macro/macro-condition-variable.cpp
lib/macro/macro-condition-variable.hpp
lib/macro/macro-condition.cpp
lib/macro/macro-condition.hpp
lib/macro/macro-dock.cpp
lib/macro/macro-dock.hpp
lib/macro/macro-dock-settings.hpp
lib/macro/macro-dock-settings.cpp
lib/macro/macro-dock-window.cpp
lib/macro/macro-dock-window.hpp
lib/macro/macro-edit.cpp
lib/macro/macro-edit.hpp
lib/macro/macro-export-import-dialog.cpp
lib/macro/macro-export-import-dialog.hpp
lib/macro/macro-helpers.cpp
lib/macro/macro-helpers.hpp
lib/macro/macro-input.cpp
lib/macro/macro-input.hpp
lib/macro/macro-list.cpp
lib/macro/macro-list.hpp
lib/macro/macro-ref.cpp
lib/macro/macro-ref.hpp
lib/macro/macro-run-button.cpp
lib/macro/macro-run-button.hpp
lib/macro/macro-search.cpp
lib/macro/macro-search.hpp
lib/macro/macro-segment-copy-paste.cpp
lib/macro/macro-segment-copy-paste.hpp
lib/macro/macro-segment-list.cpp
lib/macro/macro-segment-list.hpp
lib/macro/macro-segment-selection.cpp
lib/macro/macro-segment-selection.hpp
lib/macro/macro-segment-unknown.hpp
lib/macro/macro-segment.cpp
lib/macro/macro-segment.hpp
lib/macro/macro-selection.cpp
lib/macro/macro-selection.hpp
lib/macro/macro-settings.cpp
lib/macro/macro-settings.hpp
lib/macro/macro-signals.cpp
lib/macro/macro-signals.hpp
lib/macro/macro-tab.cpp
lib/macro/macro-tree.cpp
lib/macro/macro-tree.hpp
lib/macro/macro-websocket-trigger.cpp
lib/macro/macro.cpp
lib/macro/macro.hpp)
# Utility function sources
target_sources(
${LIB_NAME}
PRIVATE lib/queue/action-queue.cpp
lib/queue/action-queue.hpp
lib/queue/action-queue-tab.cpp
lib/queue/action-queue-tab.hpp
lib/utils/auto-update-tooltip-label.cpp
lib/utils/auto-update-tooltip-label.hpp
lib/utils/backup.cpp
lib/utils/backup.hpp
lib/utils/canvas-helpers.cpp
lib/utils/canvas-helpers.hpp
lib/utils/condition-logic.cpp
lib/utils/condition-logic.hpp
lib/utils/crash-handler.cpp
lib/utils/crash-handler.hpp
lib/utils/curl-helper.cpp
lib/utils/curl-helper.hpp
lib/utils/cursor-shape-changer.cpp
lib/utils/cursor-shape-changer.hpp
lib/utils/double-slider.cpp
lib/utils/double-slider.hpp
lib/utils/duration-control.cpp
lib/utils/duration-control.hpp
lib/utils/duration-modifier.cpp
lib/utils/duration-modifier.hpp
lib/utils/duration.cpp
lib/utils/duration.hpp
lib/utils/export-symbol-helper.hpp
lib/utils/file-selection.cpp
lib/utils/file-selection.hpp
lib/utils/filter-combo-box.cpp
lib/utils/filter-combo-box.hpp
lib/utils/first-run-wizard.cpp
lib/utils/first-run-wizard.hpp
lib/utils/help-icon.hpp
lib/utils/help-icon.cpp
lib/utils/item-selection-helpers.cpp
lib/utils/item-selection-helpers.hpp
lib/utils/json-helpers.cpp
lib/utils/json-helpers.hpp
lib/utils/layout-helpers.cpp
lib/utils/layout-helpers.hpp
lib/utils/list-controls.cpp
lib/utils/list-controls.hpp
lib/utils/list-editor.cpp
lib/utils/list-editor.hpp
lib/utils/log-helper.cpp
lib/utils/log-helper.hpp
lib/utils/math-helpers.cpp
lib/utils/math-helpers.hpp
lib/utils/message-buffer.hpp
lib/utils/message-dispatcher.hpp
lib/utils/mouse-wheel-guard.cpp
lib/utils/mouse-wheel-guard.hpp
lib/utils/name-dialog.cpp
lib/utils/name-dialog.hpp
lib/utils/non-modal-dialog.cpp
lib/utils/non-modal-dialog.hpp
lib/utils/obs-module-helper.cpp
lib/utils/obs-module-helper.hpp
lib/utils/path-helpers.cpp
lib/utils/path-helpers.hpp
lib/utils/plugin-state-helpers.cpp
lib/utils/plugin-state-helpers.hpp
lib/utils/priority-helper.cpp
lib/utils/priority-helper.hpp
lib/utils/regex-config.cpp
lib/utils/regex-config.hpp
lib/utils/resizable-widget.cpp
lib/utils/resizable-widget.hpp
lib/utils/resizing-text-edit.cpp
lib/utils/resizing-text-edit.hpp
lib/utils/resource-table.cpp
lib/utils/resource-table.hpp
lib/utils/scene-selection.cpp
lib/utils/scene-selection.hpp
lib/utils/scene-switch-helpers.cpp
lib/utils/scene-switch-helpers.hpp
lib/utils/screenshot-helper.cpp
lib/utils/screenshot-helper.hpp
lib/utils/section.cpp
lib/utils/section.hpp
lib/utils/selection-helpers.cpp
lib/utils/selection-helpers.hpp
lib/utils/single-char-selection.cpp
lib/utils/single-char-selection.hpp
lib/utils/slider-spinbox.cpp
lib/utils/slider-spinbox.hpp
lib/utils/source-helpers.cpp
lib/utils/source-helpers.hpp
lib/utils/source-selection.cpp
lib/utils/source-selection.hpp
lib/utils/splitter-helpers.cpp
lib/utils/splitter-helpers.hpp
lib/utils/status-control.cpp
lib/utils/status-control.hpp
lib/utils/string-list.cpp
lib/utils/string-list.hpp
lib/utils/switch-button.cpp
lib/utils/switch-button.hpp
lib/utils/sync-helpers.cpp
lib/utils/sync-helpers.hpp
lib/utils/tab-helpers.cpp
lib/utils/tab-helpers.hpp
lib/utils/temp-variable.cpp
lib/utils/temp-variable.hpp
lib/utils/time-helpers.cpp
lib/utils/time-helpers.hpp
lib/utils/ui-helpers.cpp
lib/utils/ui-helpers.hpp
lib/utils/utility.cpp
lib/utils/utility.hpp
lib/utils/volume-control.cpp
lib/utils/volume-control.hpp
lib/utils/websocket-api.cpp
lib/utils/websocket-api.hpp
lib/variables/variable-line-edit.cpp
lib/variables/variable-line-edit.hpp
lib/variables/variable-number.hpp
lib/variables/variable-number.tpp
lib/variables/variable-spinbox.cpp
lib/variables/variable-spinbox.hpp
lib/variables/variable-string.cpp
lib/variables/variable-string.hpp
lib/variables/variable-tab.cpp
lib/variables/variable-tab.hpp
lib/variables/variable-text-edit.cpp
lib/variables/variable-text-edit.hpp
lib/variables/variable.cpp
lib/variables/variable.hpp)
# --- End of section ---
# Subfolder for advanced scene switcher plugins
set(ADVSS_PLUGIN_FOLDER "advanced-scene-switcher-plugins")
target_compile_definitions(
${LIB_NAME} PRIVATE ADVSS_PLUGIN_FOLDER=\"${ADVSS_PLUGIN_FOLDER}\")
include(cmake/common/advss_helpers.cmake)
setup_obs_lib_dependency(${LIB_NAME})
setup_obs_lib_dependency(${PROJECT_NAME})
find_package(Qt6 REQUIRED COMPONENTS Widgets Core)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets)
target_link_libraries(${LIB_NAME} PRIVATE Qt6::Core Qt6::Widgets)
# Ignore QCheckBox::stateChanged deprecation warning until minimum supported Qt
# version is at least Qt 6.7, which introduces QCheckBox::checkStateChanged
if(Qt6_VERSION VERSION_GREATER "6.0.0")
target_compile_definitions(${LIB_NAME} PRIVATE QT_NO_DEPRECATED_WARNINGS)
endif()
target_compile_options(
${PROJECT_NAME}
PRIVATE
$<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-quoted-include-in-framework-header
-Wno-comma>)
set_target_properties(
${PROJECT_NAME}
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON)
target_link_libraries(${PROJECT_NAME} PUBLIC ${LIB_NAME})
# --- Platform-independent build settings ---
target_include_directories(
${LIB_NAME}
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/lib"
"${CMAKE_CURRENT_SOURCE_DIR}/lib/legacy"
"${CMAKE_CURRENT_SOURCE_DIR}/lib/macro"
"${CMAKE_CURRENT_SOURCE_DIR}/lib/queue"
"${CMAKE_CURRENT_SOURCE_DIR}/lib/utils"
"${CMAKE_CURRENT_SOURCE_DIR}/lib/variables"
"${CMAKE_CURRENT_BINARY_DIR}/forms")
set_target_properties(
${LIB_NAME}
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/forms")
set_target_properties(${LIB_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
target_compile_features(${LIB_NAME} PUBLIC cxx_std_17)
target_include_directories(
${LIB_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/deps/obs-websocket/lib"
"${CMAKE_CURRENT_SOURCE_DIR}/deps/exprtk")
if(NOT nlohmann_json_DIR
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/deps/json/CMakeLists.txt")
add_subdirectory(deps/json)
else()
find_package(nlohmann_json REQUIRED)
endif()
target_link_libraries(${LIB_NAME} PUBLIC nlohmann_json::nlohmann_json)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/deps/jsoncons/CMakeLists.txt")
# Don't build jsoncons unit tests as they are causing compilation issues and
# won't be executed either way
if(OS_MACOS)
cmake_policy(SET CMP0077 NEW)
endif()
set(JSONCONS_BUILD_TESTS
OFF
CACHE BOOL "" FORCE)
add_subdirectory(deps/jsoncons EXCLUDE_FROM_ALL)
target_link_libraries(${LIB_NAME} PRIVATE jsoncons)
target_compile_definitions(${LIB_NAME} PRIVATE JSONPATH_SUPPORT=1)
endif()
find_package(CURL QUIET)
find_package(Libcurl QUIET)
if(CURL_FOUND)
if(NOT DEFINED CURL_INCLUDE_DIRS AND TARGET CURL::libcurl)
get_target_property(CURL_INCLUDE_DIR CURL::libcurl
INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(${LIB_NAME} PUBLIC "${CURL_INCLUDE_DIR}")
else()
target_include_directories(${LIB_NAME} PUBLIC "${CURL_INCLUDE_DIRS}")
endif()
elseif(Libcurl_FOUND)
target_include_directories(${LIB_NAME} PUBLIC "${LIBCURL_INCLUDE_DIRS}")
else()
message(FATAL_ERROR "Couldn't find CURL or Libcurl - abort")
endif()
target_compile_definitions(${LIB_NAME} PRIVATE ADVSS_EXPORT_SYMBOLS=1)
# --- End of section ---
# --- Windows-specific build settings and tasks ---
if(OS_WINDOWS)
target_compile_definitions(${LIB_NAME} PRIVATE UNICODE _UNICODE)
if(MSVC)
target_compile_options(${LIB_NAME} PUBLIC /MP /d2FH4- /wd4267 /wd4267
/bigobj)
# Workaround for MSVC incompatibility in CI environment
add_compile_definitions(${target_name} _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
endif()
target_sources(${LIB_NAME} PRIVATE lib/win/advanced-scene-switcher-win.cpp)
add_definitions(-D_WEBSOCKETPP_CPP11_STL_)
# --- End of section ---
# -- macOS specific build settings and tasks --
elseif(OS_MACOS)
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "" SUFFIX ".so")
find_library(COCOA Cocoa)
target_include_directories(${LIB_NAME} PRIVATE ${COCOA})
target_link_libraries(${LIB_NAME} PRIVATE ${COCOA})
target_sources(${LIB_NAME} PRIVATE lib/osx/advanced-scene-switcher-osx.mm)
set_source_files_properties(advanced-scene-switcher-osx.mm
PROPERTIES COMPILE_FLAGS "-fobjc-arc")
# --- End of section ---
# --- Linux-specific build settings and tasks ---
else()
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "")
set_target_properties(${LIB_NAME} PROPERTIES SOVERSION 1)
find_package(Qt6 REQUIRED COMPONENTS DBus)
find_package(X11 REQUIRED COMPONENTS Xss)
target_include_directories(${LIB_NAME} PRIVATE "${X11_INCLUDE_DIR}"
"${X11_Xss_INCLUDE_PATH}")
target_link_libraries(${LIB_NAME} PRIVATE ${X11_LIBRARIES})
find_path(PROCPS_INCLUDE_DIR NAMES proc/procps.h)
find_path(PROCPS2_INCLUDE_DIR NAMES libproc2/pids.h)
if(PROCPS_INCLUDE_DIR)
message(STATUS "${PROJECT_NAME} using procps")
set(PROC_INCLUDE_DIR "${PROCPS_INCLUDE_DIR}")
target_compile_definitions(${LIB_NAME} PRIVATE PROCPS_AVAILABLE)
set(PROCESS_CONDITION_SUPPORTED 1)
endif()
if(PROCPS2_INCLUDE_DIR)
find_package(PkgConfig REQUIRED)
pkg_check_modules(libproc2 REQUIRED IMPORTED_TARGET libproc2)
set(PROC_INCLUDE_DIR "${PROCPS2_INCLUDE_DIR}")
target_compile_definitions(${LIB_NAME} PRIVATE PROCPS2_AVAILABLE)
set(PROCESS_CONDITION_SUPPORTED 1)
# Check if PIDS_VAL takes 4 arguments (old API, pre-4.0.5) or 3 (new API)
include(CheckCSourceCompiles)
set(CMAKE_REQUIRED_INCLUDES "${PROCPS2_INCLUDE_DIR}")
set(CMAKE_REQUIRED_LIBRARIES proc2)
check_c_source_compiles(
"
#include <libproc2/pids.h>
int main(void) {
struct pids_stack *s = 0;
struct pids_info *i = 0;
(void)PIDS_VAL(0, str, s, i);
return 0;
}
"
PROCPS2_PIDS_VAL_TAKES_INFO)
if(PROCPS2_PIDS_VAL_TAKES_INFO)
target_compile_definitions(${LIB_NAME} PRIVATE PROCPS2_USE_INFO)
endif()
endif()
if(NOT DEFINED PROCESS_CONDITION_SUPPORTED)
message(
WARNING
"found neither procps nor libproc2! Process condition will not be functional!"
)
endif()
target_include_directories(${LIB_NAME} PRIVATE "${PROC_INCLUDE_DIR}")
target_sources(${LIB_NAME} PRIVATE lib/linux/advanced-scene-switcher-nix.cpp
lib/linux/kwin-helpers.cpp)
# Don't include irrelevant folders into sources archive
list(APPEND CPACK_SOURCE_IGNORE_FILES "\\.deps/.*")
endif()
if(NOT OS_WINDOWS)
target_compile_options(
${LIB_NAME}
PUBLIC -Wno-error=unused-parameter -Wno-error=conversion -Wno-error=shadow
-Wno-error=float-conversion -Wno-error=enum-conversion)
endif()
# --- End of section ---
add_subdirectory(plugins)
add_subdirectory(tests)
# --- Install ---
if(DEB_INSTALL)
file(GLOB ASS_TRANSLATION_FILES "data/locale/*.ini")
if(NOT LIB_OUT_DIR)
set(LIB_OUT_DIR "/lib/obs-plugins")
endif()
if(NOT DATA_OUT_DIR)
set(DATA_OUT_DIR "/share/obs/obs-plugins/${PROJECT_NAME}")
endif()
install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR})
install(TARGETS ${LIB_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR})
install(DIRECTORY data/locale
DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_OUT_DIR})
install(DIRECTORY data/res
DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_OUT_DIR})
else()
install_advss_lib(${LIB_NAME})
if(BUILD_OUT_OF_TREE)
set_target_properties_plugin(${PROJECT_NAME} PROPERTIES OUTPUT_NAME
${_name})
else()
set_target_properties_obs(${PROJECT_NAME} PROPERTIES PREFIX "")
endif()
endif()

190
CMakePresets.json Normal file
View File

@ -0,0 +1,190 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 22,
"patch": 0
},
"configurePresets": [
{
"name": "template",
"hidden": true,
"cacheVariables": {
"ENABLE_FRONTEND_API": true,
"ENABLE_QT": true
}
},
{
"name": "macos",
"displayName": "macOS Universal",
"description": "Build for macOS 11.0+ (Universal binary)",
"inherits": ["template"],
"binaryDir": "${sourceDir}/build_macos",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
},
"generator": "Xcode",
"warnings": {"dev": true, "deprecated": true},
"cacheVariables": {
"QT_VERSION": "6",
"CMAKE_OSX_DEPLOYMENT_TARGET": "11.0",
"CODESIGN_IDENTITY": "$penv{CODESIGN_IDENT}",
"CODESIGN_TEAM": "$penv{CODESIGN_TEAM}"
}
},
{
"name": "macos-ci",
"inherits": ["macos"],
"displayName": "macOS Universal CI build",
"description": "Build for macOS 11.0+ (Universal binary) for CI",
"generator": "Xcode",
"cacheVariables": {
"CMAKE_COMPILE_WARNING_AS_ERROR": true
}
},
{
"name": "windows-x64",
"displayName": "Windows x64",
"description": "Build for Windows x64",
"inherits": ["template"],
"binaryDir": "${sourceDir}/build_x64",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"generator": "Visual Studio 17 2022",
"architecture": "x64",
"warnings": {"dev": true, "deprecated": true},
"cacheVariables": {
"QT_VERSION": "6",
"CMAKE_SYSTEM_VERSION": "10.0.18363.657"
}
},
{
"name": "windows-ci-x64",
"inherits": ["windows-x64"],
"displayName": "Windows x64 CI build",
"description": "Build for Windows x64 on CI",
"cacheVariables": {
"CMAKE_COMPILE_WARNING_AS_ERROR": true
}
},
{
"name": "linux-x86_64",
"displayName": "Linux x86_64",
"description": "Build for Linux x86_64",
"inherits": ["template"],
"binaryDir": "${sourceDir}/build_x86_64",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"generator": "Ninja",
"warnings": {"dev": true, "deprecated": true},
"cacheVariables": {
"QT_VERSION": "6",
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "linux-ci-x86_64",
"inherits": ["linux-x86_64"],
"displayName": "Linux x86_64 CI build",
"description": "Build for Linux x86_64 on CI",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_COMPILE_WARNING_AS_ERROR": true
}
},
{
"name": "linux-aarch64",
"displayName": "Linux aarch64",
"description": "Build for Linux aarch64",
"inherits": ["template"],
"binaryDir": "${sourceDir}/build_aarch64",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"generator": "Ninja",
"warnings": {"dev": true, "deprecated": true},
"cacheVariables": {
"QT_VERSION": "6",
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "linux-ci-aarch64",
"inherits": ["linux-aarch64"],
"displayName": "Linux aarch64 CI build",
"description": "Build for Linux aarch64 on CI",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_COMPILE_WARNING_AS_ERROR": true
}
}
],
"buildPresets": [
{
"name": "macos",
"configurePreset": "macos",
"displayName": "macOS Universal",
"description": "macOS build for Universal architectures",
"configuration": "Release"
},
{
"name": "macos-ci",
"configurePreset": "macos-ci",
"displayName": "macOS Universal CI",
"description": "macOS CI build for Universal architectures",
"configuration": "RelWithDebInfo"
},
{
"name": "windows-x64",
"configurePreset": "windows-x64",
"displayName": "Windows x64",
"description": "Windows build for x64",
"configuration": "RelWithDebInfo"
},
{
"name": "windows-ci-x64",
"configurePreset": "windows-ci-x64",
"displayName": "Windows x64 CI",
"description": "Windows CI build for x64 (RelWithDebInfo configuration)",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-x86_64",
"configurePreset": "linux-x86_64",
"displayName": "Linux x86_64",
"description": "Linux build for x86_64",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-ci-x86_64",
"configurePreset": "linux-ci-x86_64",
"displayName": "Linux x86_64 CI",
"description": "Linux CI build for x86_64",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-aarch64",
"configurePreset": "linux-aarch64",
"displayName": "Linux aarch64",
"description": "Linux build for aarch64",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-ci-aarch64",
"configurePreset": "linux-ci-aarch64",
"displayName": "Linux aarch64 CI",
"description": "Linux CI build for aarch64",
"configuration": "RelWithDebInfo"
}
]
}

127
README.md
View File

@ -1,118 +1,29 @@
# SceneSwitcher
An automated scene switcher for OBS Studio
An automation plugin for OBS Studio.
More information can be found in the [OBS forums](https://obsproject.com/forum/resources/automatic-scene-switching.395/) or the plugin's [wiki](https://github.com/WarmUpTill/SceneSwitcher/wiki).
More information can be found on https://obsproject.com/forum/resources/automatic-scene-switching.395/
## Downloads
## Compiling in tree
Add the "SceneSwitcher" source directory to your obs-studio source directory under obs-studio/UI/frontend-plugins/:
Binaries for Windows, MacOS, and Linux are available in the [Releases](https://github.com/WarmUpTill/SceneSwitcher/releases) section.
## Installing the plugin
For the **Windows** and **MacOS** platforms, it is recommended to run the provided installers.
On Linux the plugin is available via the **Flatpak** package manager for users who installed OBS via Flatpak:
```
cd obs-studio/UI/frontend-plugins/
git clone https://github.com/WarmUpTill/SceneSwitcher.git
flatpak install com.obsproject.Studio.Plugin.SceneSwitcher
```
Then modify the obs-studio/UI/frontend-plugins/CMakeLists.txt file and add an entry for the scene switcher:
add_subdirectory(SceneSwitcher)
## Compiling out of tree
### Prerequisites
You'll need CMake and a working development environment for OBS Studio installed
on your computer. Once you've done that, do the following:
The **Snap** package manager offers an OBS Studio installation which is bundled with the plugin:
```
git clone https://github.com/WarmUpTill/SceneSwitcher.git
cd SceneSwitcher
mkdir build && cd build
sudo snap install obs-studio
```
### Windows
In cmake-gui, you'll have to set these CMake variables :
- **BUILD_OUT_OF_TREE** (bool) : true
- **LIBOBS_INCLUDE_DIR** (path) : location of the libobs subfolder in the source
code of OBS Studio, located at [source_directory]/libobs/.
- **LIBOBS_LIB** (filepath) : location of the obs.dll file (usually set to
C:\Program Files\obs-studio\bin\64bit\obs.dll)
More information can be found [here](https://github.com/WarmUpTill/SceneSwitcher/wiki/Installation).
Assuming that you installed Qt via the regular Qt App way:
- **Qt5Core_DIR** (path) : C:/Qt/5.10.1/msvc2017_64/lib/cmake/Qt5Core
- **Qt5Gui_DIR** (path): C:/Qt/5.10.1/msvc2017_64/lib/cmake/Qt5Gui
- **Qt5Widgets_DIR** (path) : C:/Qt/5.10.1/msvc2017_64/lib/cmake/Qt5Widgets
## Contributing
- **LIBOBS_FRONTEND_API_LIB** (filepath) : location of the libobs-frontend-api.dll
file, usually C:/Program Files/obs-studio/bin/64bit/obs-frontend-api.dll
(usually in the same place as LIBOBS_LIB)
- **LIBOBS_FRONTEND_INCLUDE_DIR** (path) : location of the obs-frontend-api
subfolder in the source code of OBS Studio, located at [source_directory]/UI/obs-frontend-api.
Just keep hitting configure until all the vars are filled out. Then hit generate.
### Linux
Most versions of Linux you can use cmake-gui or the command line.
**For the command line:**
```
cmake -DBUILD_OUT_OF_TREE=1 -DLIBOBS_INCLUDE_DIR="<path to the libobs/ sub-folder in obs-studio's source code>"
-DLIBOBS_FRONTEND_INCLUDE_DIR="<path to the UI/obs-frontend-api/ sub-folder in obs-studio's source code>"
-DLIBOBS_FRONTEND_API_LIB="< path to the libobs-frontend-api.so file (usually in the same place as LIBOBS_LIB)>"
-DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install
```
For cmake-gui you'll have to set the following variables:
- **BUILD_OUT_OF_TREE** (bool) : true
- **LIBOBS_INCLUDE_DIR** (path) : location of the libobs subfolder in the source
code of OBS Studio, located at [source_directory]/libobs/.
- **LIBOBS_LIB** (filepath) : location of the libobs.so file (usually CMake finds
this, but if not it'll usually be in /usr/lib/libobs.so)
Assuming that you installed Qt via your system package manager, it should be
found automatically. If not, then usually you'll find it in something like:
- **Qt5Core_DIR** (path) : /usr/lib64/cmake/Qt5Core
- **Qt5Gui_DIR** (path): /usr/lib64/cmake/Qt5Gui
- **Qt5Widgets_DIR** (path) : /usr/lib64/cmake/Qt5Widgets
- **LIBOBS_FRONTEND_API_LIB** (filepath) : location of the libobs-frontend-api.so
file (usually in the same place as LIBOBS_LIB)
- **LIBOBS_FRONTEND_INCLUDE_DIR** (path) : location of the obs-frontend-api
subfolder in the source code of OBS Studio, located at
[source_directory]/UI/obs-frontend-api.
Just keep hitting configure until all the vars are filled out. Then hit generate.
Then open a terminal in the build folder and type:
```
make -j4
sudo make install
```
NOTE: The Linux version of this plugin is dependent on libXScrnSaver.
### OS X
In cmake-gui, you'll have to set these CMake variables :
- **BUILD_OUT_OF_TREE** (bool) : true
- **LIBOBS_INCLUDE_DIR** (path) : location of the libobs subfolder in the source
code of OBS Studio, located at [source_directory]/libobs/.
- **LIBOBS_LIB** (filepath) : location of the libobs.0.dylib file (usually
in /Applications/OBS.app/Contents/Resources/bin/libobs.0.dylib)
Assuming that you installed Qt via the regular Qt App way:
- **Qt5Core_DIR** (path) : Usually /Applications/Qt/5.10.1/clang_64/lib/cmake/Qt5Core
- **Qt5Widgets_DIR** (path) : Usually /Applications/Qt/5.10.1/clang_64/lib/cmake/Qt5Widgets
- **Qt5MacExtras_DIR** (path) : Usually /Applications/Qt/5.10.1/clang_64/lib/cmake/Qt5MacExtras
- **LIBOBS_FRONTEND_API_LIB** (filepath) : location of the libobs-frontend-api.0.dylib
file (usually in usually in /Applications/OBS.app/Contents/Resources/bin/libobs-frontend-api.0.dylib)
- **LIBOBS_FRONTEND_INCLUDE_DIR** (path) : location of the obs-frontend-api subfolder
in the source code of OBS Studio, located at [source_directory]/UI/obs-frontend-api.
Just keep hitting configure until all the vars are filled out. Then hit generate.
Open xcode (or a terminal, depending on the build type you chose), build and copy
the advanced-scene-switcher.so file to /Applications/OBS.app/Contents/PlugIns
Note that you might have to adjust the library search paths using the install_name_tool if you want the plugin to run on machines other than your build machine:
```
install_name_tool -change @rpath/libobs-frontend-api.dylib @executable_path/../Frameworks/libobs-frontend-api.dylib UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so
install_name_tool -change @rpath/libobs.0.dylib @executable_path/../Frameworks/libobs.0.dylib UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so
install_name_tool -change /usr/local/opt/qt5/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so
install_name_tool -change /usr/local/opt/qt5/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so
install_name_tool -change /usr/local/opt/qt5/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so
```
- If you wish to contribute code to the project, have a look at this [section](BUILDING.md) describing how to compile the plugin.
- You can add custom conditions and actions at runtime using the API described [here](https://github.com/WarmUpTill/SceneSwitcher/wiki/Scripting).
- You can optionally use [pre-commit](https://pre-commit.com) to automatically handle formatting.
- If you wish to contribute translations, feel free to submit pull requests for the corresponding files under `data/locale`.

View File

@ -0,0 +1,3 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 2 )) print -PR -e -- "${CI:+::debug::}%F{220}DEBUG: ${@}%f"

View File

@ -0,0 +1,3 @@
local icon=' ✖︎ '
print -u2 -PR "${CI:+::error::}%F{1} ${icon} %f ${@}"

View File

@ -0,0 +1,16 @@
autoload -Uz log_info
if (( ! ${+_log_group} )) typeset -g _log_group=0
if (( ${+CI} )) {
if (( _log_group )) {
print "::endgroup::"
typeset -g _log_group=0
}
if (( # )) {
print "::group::${@}"
typeset -g _log_group=1
}
} else {
if (( # )) log_info ${@}
}

View File

@ -0,0 +1,7 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 0 )) {
local icon=' =>'
print -PR "%F{4} ${(r:5:)icon}%f %B${@}%b"
}

View File

@ -0,0 +1,7 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 0 )) {
local icon=''
print -PR " ${(r:5:)icon} ${@}"
}

View File

@ -0,0 +1,7 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 0 )) {
local icon=' >'
print -PR "%F{2} ${(r:5:)icon}%f ${@}"
}

View File

@ -0,0 +1,7 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 0 )) {
local icon=' =>'
print -PR "${CI:+::warning::}%F{3} ${(r:5:)icon} ${@}%f"
}

View File

@ -0,0 +1,17 @@
autoload -Uz log_debug log_error
local -r _usage="Usage: %B${0}%b <loglevel>
Set log level, following levels are supported: 0 (quiet), 1 (normal), 2 (verbose), 3 (debug)"
if (( ! # )); then
log_error 'Called without arguments.'
log_output ${_usage}
return 2
elif (( ${1} >= 4 )); then
log_error 'Called with loglevel > 3.'
log_output ${_usage}
fi
typeset -g -i -r _loglevel=${1}
log_debug "Log level set to '${1}'"

197
build-aux/.run-format.zsh Executable file
View File

@ -0,0 +1,197 @@
#!/usr/bin/env zsh
builtin emulate -L zsh
setopt EXTENDED_GLOB
setopt PUSHD_SILENT
setopt ERR_EXIT
setopt ERR_RETURN
setopt NO_UNSET
setopt PIPE_FAIL
setopt NO_AUTO_PUSHD
setopt NO_PUSHD_IGNORE_DUPS
setopt FUNCTION_ARGZERO
## Enable for script debugging
# setopt WARN_CREATE_GLOBAL
# setopt WARN_NESTED_VAR
# setopt XTRACE
autoload -Uz is-at-least && if ! is-at-least 5.2; then
print -u2 -PR "%F{1}${funcstack[1]##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade zsh to fix this issue."
exit 1
fi
invoke_formatter() {
if (( # < 1 )) {
log_error "Usage invoke_formatter [formatter_name]"
exit 2
}
case ${1} {
clang)
if (( ${+commands[clang-format-16]} )) {
local formatter=clang-format-16
} elif (( ${+commands[clang-format]} )) {
local formatter=clang-format
local -a formatter_version=($(clang-format --version))
if ! is-at-least 16.0.5 ${formatter_version[-1]}; then
log_error "clang-format is not version 16.0.5 or above (found ${formatter_version[-1]}."
exit 2
fi
if ! is-at-least ${formatter_version[-1]} 16.0.5; then
log_error "clang-format is more recent than version 16.0.5 (found ${formatter_version[-1]})."
exit 2
fi
} else {
log_error "No viable clang-format version found (required 16.0.5)"
exit 2
}
local -a source_files=()
for folder ("lib" "module" "plugins" "tests") {
source_files+=(${folder}/**/*.(c|cpp|h|hpp)(.N))
}
for file (${source_files}) {
if [[ $file == *"catch.hpp" ]]; then
source_files=("${source_files[@]/$file}")
fi
}
local -a format_args=(-style=file -fallback-style=none)
if (( _loglevel > 2 )) format_args+=(--verbose)
;;
cmake)
local formatter=cmake-format
if (( ${+commands[cmake-format]} )) {
local cmake_format_version=$(cmake-format --version)
if ! is-at-least 0.6.13 ${cmake_format_version}; then
log_error "cmake-format is not version 0.6.13 or above (found ${cmake_format_version})."
exit 2
fi
} else {
log_error "No viable cmake-format version found (required 0.6.13)"
exit 2
}
local -a source_files=(**/(CMakeLists.txt|*.cmake)(.N))
source_files=(${source_files:#(build_*)/*})
local -a format_args=()
if (( _loglevel > 2 )) format_args+=(--log-level debug)
;;
swift)
local formatter=swift-format
if (( ${+commands[swift-format]} )) {
local swift_format_version=$(swift-format --version)
if ! is-at-least 508.0.0 ${swift_format_version}; then
log_error "swift-format is not version 508.0.0 or above (found ${swift_format_version})."
exit 2
fi
} else {
log_error "No viable swift-format version found (required 508.0.0)"
exit 2
}
local -a source_files=(**/*.swift(.N))
local -a format_args=()
;;
*) log_error "Invalid formatter specified: ${1}. Valid options are clang-format, cmake-format, and swift-format."; exit 2 ;;
}
local file
local -i num_failures=0
if (( check_only )) {
for file (${source_files}) {
if (( _loglevel > 1 )) log_info "Checking format of ${file}..."
if ! "${formatter}" ${format_args} "${file}" | diff -q "${file}" - &> /dev/null; then
log_error "${file} requires formatting changes."
if (( fail_on_error == 2 )) return 2;
num_failures=$(( num_failures + 1 ))
else
if (( _loglevel > 1 )) log_status "${file} requires no formatting changes."
fi
}
if (( fail_on_error && num_failures )) return 2;
} elif (( ${#source_files} )) {
format_args+=(-i)
"${formatter}" ${format_args} ${source_files}
}
}
run_format() {
if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h}
if (( ! ${+FORMATTER_NAME} )) typeset -g FORMATTER_NAME=${${(s:-:)ZSH_ARGZERO:t:r}[2]}
typeset -g host_os=${${(L)$(uname -s)}//darwin/macos}
local -i fail_on_error=0
local -i check_only=0
local -i verbosity=1
local -r _version='1.0.0'
fpath=("${SCRIPT_HOME}/.functions" ${fpath})
autoload -Uz log_info log_error log_output set_loglevel log_status log_warning
local -r _usage="
Usage: %B${functrace[1]%:*}%b <option>
%BOptions%b:
%F{yellow} Formatting options%f
-----------------------------------------------------------------------------
%B-c | --check%b Check only, no actual formatting takes place
%F{yellow} Output options%f
-----------------------------------------------------------------------------
%B-v | --verbose%b Verbose (more detailed output)
%B--fail-[never|error] Fail script never/on formatting change - default: %B%F{green}never%f%b
%B--debug%b Debug (very detailed and added output)
%F{yellow} General options%f
-----------------------------------------------------------------------------
%B-h | --help%b Print this usage help
%B-V | --version%b Print script version information"
local -a args
while (( # )) {
case ${1} {
--)
shift
args+=($@)
break
;;
-c|--check) check_only=1; shift ;;
-v|--verbose) (( _verbosity += 1 )); shift ;;
-h|--help) log_output ${_usage}; exit 0 ;;
-V|--version) print -Pr "${_version}"; exit 0 ;;
--debug) verbosity=3; shift ;;
--fail-never)
fail_on_error=0
shift
;;
--fail-error)
fail_on_error=1
shift
;;
--fail-fast)
fail_on_error=2
shift
;;
*) log_error "Unknown option: %B${1}%b"; log_output ${_usage}; exit 2 ;;
}
}
set -- ${(@)args}
set_loglevel ${verbosity}
invoke_formatter ${FORMATTER_NAME}
}
run_format ${@}

View File

@ -0,0 +1,168 @@
#!/usr/bin/env python3
import argparse
import os
import re
import sys
defaultLocaleFile = "en-US.ini"
commentChars = ";#"
class localeEntry:
locale = ""
widgetPlaceholders = []
qStringArgs = []
lineNum = -1
def __init__(self, locale, widgetPlaceholders, qStringArgs, lineNum) -> None:
self.locale = locale
self.widgetPlaceholders = widgetPlaceholders
self.qStringArgs = qStringArgs
self.lineNum = lineNum
def isCommentLine(line):
for char in commentChars:
if line.startswith(char):
return True
return False
def getNonDefaultLocales(dir):
files = []
for filename in os.listdir(dir):
f = os.path.join(dir, filename)
if os.path.isfile(f) and not f.endswith(defaultLocaleFile):
files.append(f)
return files
def getAllLocaleEntries(file):
localeEntries = []
with open(file, "r", encoding="UTF-8") as f:
for lineNum, line in enumerate(f):
widgetPlaceholders = []
qStringArgs = []
if isCommentLine(line):
continue
for word in line.split("{{"):
if not "}}" in word:
continue
placeholder = "{{" + word[: word.rfind("}}")] + "}}"
widgetPlaceholders.append(placeholder)
for match in re.finditer(r"%\d+", line):
qStringArgs.append(match.group(0))
localeEntries.append(
localeEntry(
line.split("=")[0], widgetPlaceholders, qStringArgs, lineNum + 1
)
)
return localeEntries
def getLocaleEntryFrom(entry, list):
for element in list:
if element.locale == entry.locale:
return element
return None
def checkLocaleEntries(file, expectedLocaleEntries):
localeEntries = getAllLocaleEntries(file)
result = True
for localeEntry in localeEntries:
expectedLocaleEntry = getLocaleEntryFrom(localeEntry, expectedLocaleEntries)
if expectedLocaleEntry is None:
result = False
print(
'ERROR: Locale entry "{}" from "{}:{}" not found in "{}"'.format(
localeEntry.locale, file, localeEntry.lineNum, defaultLocaleFile
)
)
continue
for placeholder in localeEntry.widgetPlaceholders:
if placeholder not in expectedLocaleEntry.widgetPlaceholders:
result = False
print(
'ERROR: Locale entry "{}" from "{}:{}" does contain "{}" widget placeholder while "{}:{}" does not'.format(
localeEntry.locale,
file,
localeEntry.lineNum,
placeholder,
defaultLocaleFile,
expectedLocaleEntry.lineNum,
)
)
for placeholder in expectedLocaleEntry.widgetPlaceholders:
if placeholder not in localeEntry.widgetPlaceholders:
result = False
print(
'ERROR: Locale entry "{}" from "{}:{}" does not contain "{}" widget placeholder'.format(
localeEntry.locale, file, localeEntry.lineNum, placeholder
)
)
for arg in localeEntry.qStringArgs:
if arg not in expectedLocaleEntry.qStringArgs:
result = False
print(
'ERROR: Locale entry "{}" from "{}:{}" does contain "{}" QString arg while "{}:{}" does not'.format(
localeEntry.locale,
file,
localeEntry.lineNum,
arg,
defaultLocaleFile,
expectedLocaleEntry.lineNum,
)
)
for arg in expectedLocaleEntry.qStringArgs:
if arg not in localeEntry.qStringArgs:
result = False
print(
'ERROR: Locale entry "{}" from "{}:{}" does not contain "{}" QString arg'.format(
localeEntry.locale, file, localeEntry.lineNum, arg
)
)
return result
def main():
parser = argparse.ArgumentParser(
description="Checks for inconsistencies regarding widget placeholders in the different locale files."
)
parser.add_argument("-p", "--path", help="Path to locale folder", required=True)
args = parser.parse_args()
defaultLocaleEntries = getAllLocaleEntries(
os.path.join(args.path, defaultLocaleFile)
)
nonDefaultLocales = getNonDefaultLocales(args.path)
result = True
for file in nonDefaultLocales:
if checkLocaleEntries(file, defaultLocaleEntries) == False:
result = False
if result == False:
sys.exit(1)
print("SUCCESS: No issues found!")
sys.exit(0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,5 @@
obs-scene-switcher (0.1+testonly) focal; urgency=medium
* Initial release (Closes: #123456)
-- Joao Eriberto Mota Filho <eriberto@debian.org> Fri, 03 Sep 2021 11:39:52 -0300

View File

@ -0,0 +1,22 @@
Source: obs-scene-switcher
Section: video
Priority: optional
Maintainer: Joao Eriberto Mota Filho <eriberto@debian.org>
Build-Depends: cmake,
debhelper-compat (= 12),
libcurl4-openssl-dev,
libobs-dev,
libxtst-dev,
qt6-base-dev,
libxss-dev,
libopencv-dev
Standards-Version: 4.6.0
Homepage: https://obsproject.com/forum/resources/advanced-scene-switcher.395/
Rules-Requires-Root: no
Package: obs-scene-switcher
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: automated scene switcher for OBS Studio (plugin)
Advanced Scene Switcher is based on the built in scene switcher. It extends
its functionality by adding several features.

View File

@ -0,0 +1,60 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: SceneSwitcher
Upstream-Contact: https://github.com/WarmUpTill/SceneSwitcher/issues
Source: https://github.com/WarmUpTill/SceneSwitcher
Files: *
Copyright: 2016-2021 WarmUpTill <WarmUpTill@web.de>
License: GPL-2
Files: cmake/GetGitRevisionDescription.cmake
cmake/GetGitRevisionDescription.cmake.in
Copyright: 2009-2013 Iowa State University
2013-2020 Contributors
2013-2020 Ryan Pavlik
License: BSL-1.0
Files: debian/*
Copyright: 2021 Joao Eriberto Mota Filho <eriberto@debian.org>
License: BSL-1.0
License: GPL-2
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
License: BSL-1.0
Boost Software License - Version 1.0 - August 17th, 2003
.
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
.
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,16 @@
#!/usr/bin/make -f
#export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export QT_SELECT = qt6
%:
dh $@
dh_auto_configure -- -DBUILD_OUT_OF_TREE=1 \
-DLIBOBS_INCLUDE_DIR=/usr/include/obs \
-DLIBOBS_LIB=/usr/lib/${DEB_TARGET_MULTIARCH}/libobs.so \
-DLIBOBS_FRONTEND_INCLUDE_DIR=/usr/include/obs \
-DLIBOBS_FRONTEND_API_LIB=/usr/lib/${DEB_TARGET_MULTIARCH}/libobs-frontend-api.so

View File

@ -0,0 +1 @@
3.0 (native)

126
build-aux/CI/linux/demote-deps.sh Executable file
View File

@ -0,0 +1,126 @@
#!/usr/bin/env bash
# Usage: demote_deps.sh <in.deb> [Recommends|Suggests] [regex]
# Example: demote_deps.sh build/advanced-scene-switcher_1.31.0_amd64.deb Recommends 'opencv'
set -euo pipefail
if [[ $# -lt 1 ]]; then
echo "Usage: $0 <in.deb> [Recommends|Suggests] [regex]" >&2
exit 1
fi
IN_DEB="$1"
DEST_FIELD="${2:-Recommends}" # Recommends or Suggests
MATCH_REGEX="${3:-opencv}" # regex to match packages to demote
echo "Demoting dependencies matching '${MATCH_REGEX}' to ${DEST_FIELD}"
TMPDIR="$(mktemp -d)"
trap 'rm -rf "$TMPDIR"' EXIT
dpkg-deb -R "$IN_DEB" "$TMPDIR"
CONTROL="$TMPDIR/DEBIAN/control"
# Read a field (single line value), handling continuation lines starting with a space.
get_field() {
local key="$1"
awk -v key="$key" '
BEGIN { val=""; collecting=0 }
$0 ~ "^" key ":" {
collecting=1
sub("^" key ":[[:space:]]*", "", $0)
val=$0
next
}
collecting==1 {
if ($0 ~ "^[[:space:]]") {
sub("^[[:space:]]+", "", $0)
val = val " " $0
next
} else {
collecting=0
}
}
END { print val }
' "$CONTROL"
}
# Split a comma-separated list into lines, trimming whitespace
split_csv() {
tr ',' '\n' | sed -E 's/^[[:space:]]+//; s/[[:space:]]+$//' | sed '/^$/d'
}
# Join with ", "
join_csv() {
awk 'BEGIN{first=1}{ if(!first) printf(", "); printf("%s",$0); first=0 } END{print ""}'
}
# Deduplicate while preserving order
dedup() {
awk '!seen[$0]++'
}
DEPENDS_VAL="$(get_field Depends)"
EXIST_DEST_VAL="$(get_field "$DEST_FIELD")"
# Separate opencv-matching vs the rest (preserve tokens exactly)
mapfile -t DEPENDS_ARR < <(printf "%s\n" "$DEPENDS_VAL" | split_csv)
declare -a MOVED=()
declare -a KEPT=()
for item in "${DEPENDS_ARR[@]}"; do
# Skip empty just in case
[[ -z "$item" ]] && continue
if [[ "$item" =~ $MATCH_REGEX ]]; then
MOVED+=("$item")
else
KEPT+=("$item")
fi
done
# Merge with existing dest field
if [[ -n "$EXIST_DEST_VAL" ]]; then
mapfile -t EXIST_DEST_ARR < <(printf "%s\n" "$EXIST_DEST_VAL" | split_csv)
MOVED+=("${EXIST_DEST_ARR[@]}")
fi
# De-duplicate
mapfile -t MOVED < <(printf "%s\n" "${MOVED[@]:-}" | sed '/^$/d' | dedup)
mapfile -t KEPT < <(printf "%s\n" "${KEPT[@]:-}" | sed '/^$/d' | dedup)
# Rebuild values
NEW_DEPENDS="$(printf "%s\n" "${KEPT[@]:-}" | join_csv || true)"
NEW_DEST="$(printf "%s\n" "${MOVED[@]:-}" | join_csv || true)"
# Write a cleaned control (remove existing Depends/Recommends/Suggests incl. continuations)
awk '
BEGIN { skip=0 }
{
if ($0 ~ "^(Depends|Recommends|Suggests):") { skip=1; next }
if (skip==1) {
if ($0 ~ "^[[:space:]]") { next } else { skip=0 }
}
print
}
' "$CONTROL" > "$CONTROL.clean"
# Append the rebuilt fields
{
cat "$CONTROL.clean"
if [[ -n "$NEW_DEPENDS" ]]; then
echo "Depends: $NEW_DEPENDS"
fi
if [[ -n "$NEW_DEST" ]]; then
echo "$DEST_FIELD: $NEW_DEST"
fi
} > "$CONTROL.new"
# Clean up empty lines
sed -i '/^[[:space:]]*$/d' "$CONTROL.new"
mv "$CONTROL.new" "$CONTROL"
rm -f "$CONTROL.clean"
# Repack
rm -f "${IN_DEB}"
OUT_DEB="${IN_DEB}"
dpkg-deb -b "$TMPDIR" "$OUT_DEB" >/dev/null
echo "$OUT_DEB"

1
build-aux/run-clang-format Symbolic link
View File

@ -0,0 +1 @@
.run-format.zsh

1
build-aux/run-cmake-format Symbolic link
View File

@ -0,0 +1 @@
.run-format.zsh

1
build-aux/run-swift-format Symbolic link
View File

@ -0,0 +1 @@
.run-format.zsh

48
buildspec.json Normal file
View File

@ -0,0 +1,48 @@
{
"dependencies": {
"obs-studio": {
"version": "31.1.1",
"baseUrl": "https://github.com/obsproject/obs-studio/archive/refs/tags",
"label": "OBS sources",
"hashes": {
"macos": "39751f067bacc13d44b116c5138491b5f1391f91516d3d590d874edd21292291",
"windows-x64": "2c8427c10b55ac6d68008df2e9a3e82f4647aaad18f105e30d4713c2de678ccf"
}
},
"prebuilt": {
"version": "2025-07-11",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-Built obs-deps",
"hashes": {
"macos": "495687e63383d1a287684b6e2e9bfe246bb8f156fe265926afb1a325af1edd2a",
"windows-x64": "c8c642c1070dc31ce9a0f1e4cef5bb992f4bff4882255788b5da12129e85caa7"
}
},
"qt6": {
"version": "2025-07-11",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-Built Qt6",
"hashes": {
"macos": "d3f5f04b6ea486e032530bdf0187cbda9a54e0a49621a4c8ba984c5023998867",
"windows-x64": "0e76bf0555dd5382838850b748d3dcfab44a1e1058441309ab54e1a65b156d0a"
},
"debugSymbols": {
"windows-x64": "11b7be92cf66a273299b8f3515c07a5cfb61614b59a4e67f7fc5ecba5e2bdf21"
}
}
},
"platformConfig": {
"macos": {
"bundleId": "com.warmuptill.advanced-scene-switcher"
}
},
"name": "advanced-scene-switcher",
"displayName": "Advanced Scene Switcher",
"version": "1.0.0",
"author": "WarmUpTill",
"website": "https://github.com/WarmUpTill/SceneSwitcher",
"email": "noone@nothing.com",
"uuids": {
"windowsApp": "A4ADDF26-4426-4D2E-B26A-C7C878DA8FC9"
}
}

View File

@ -0,0 +1,349 @@
# --- Helper functions ---#
if(BUILD_OUT_OF_TREE)
if(OS_WINDOWS)
set(OBS_PLUGIN_DESTINATION "obs-plugins/64bit")
else()
set(OBS_PLUGIN_DESTINATION "${CMAKE_INSTALL_LIBDIR}/obs-plugins")
endif()
endif()
# --- MACOS section ---
if(OS_MACOS)
set(ADVSS_BUNDLE_DIR "advanced-scene-switcher.plugin")
set(ADVSS_BUNDLE_MODULE_DIR "${ADVSS_BUNDLE_DIR}/Contents/MacOS")
set(ADVSS_BUNDLE_PLUGIN_DIR ${ADVSS_BUNDLE_MODULE_DIR}/${ADVSS_PLUGIN_FOLDER})
function(install_advss_lib_helper target where)
install(
TARGETS ${target}
RUNTIME DESTINATION "${where}" COMPONENT advss_plugins
LIBRARY DESTINATION "${where}" COMPONENT advss_plugins
FRAMEWORK DESTINATION "${where}" COMPONENT advss_plugins)
endfunction()
function(install_advss_lib target)
install_advss_lib_helper(${target} "${ADVSS_BUNDLE_MODULE_DIR}")
# Tell the advanced scene switcher plugin where to find the lib
string(JSON _name GET ${buildspec} name)
add_custom_command(
TARGET ${_name}
POST_BUILD
COMMAND
${CMAKE_INSTALL_NAME_TOOL} -change @rpath/$<TARGET_FILE_NAME:${target}>
@loader_path/$<TARGET_FILE_NAME:${target}> $<TARGET_FILE:${_name}>)
endfunction()
function(install_advss_plugin target)
install_advss_lib_helper(${target} "${ADVSS_BUNDLE_PLUGIN_DIR}")
endfunction()
function(install_advss_plugin_dependency_target target dep)
install(
IMPORTED_RUNTIME_ARTIFACTS
${dep}
RUNTIME
DESTINATION
"${ADVSS_BUNDLE_PLUGIN_DIR}"
COMPONENT
${dep}_Runtime
LIBRARY
DESTINATION
"${ADVSS_BUNDLE_PLUGIN_DIR}"
COMPONENT
${dep}_Runtime
NAMELINK_COMPONENT
${dep}_Development)
endfunction()
function(install_advss_plugin_dependency_file target dep)
get_filename_component(_FILENAME ${dep} NAME)
string(REGEX REPLACE "\\.[^.]*$" "" _FILENAMENOEXT ${_FILENAME})
set(_DEP_NAME "${target}-${_FILENAMENOEXT}")
install(
FILES "${dep}"
DESTINATION "${ADVSS_BUNDLE_PLUGIN_DIR}"
COMPONENT ${_DEP_NAME}_Runtime
DESTINATION "${ADVSS_BUNDLE_PLUGIN_DIR}"
COMPONENT ${_DEP_NAME}_Runtime
NAMELINK_COMPONENT ${_DEP_NAME}_Development)
install(
FILES "${dep}"
DESTINATION "${ADVSS_BUNDLE_PLUGIN_DIR}"
COMPONENT obs_${_DEP_NAME}
EXCLUDE_FROM_ALL
DESTINATION "${ADVSS_BUNDLE_PLUGIN_DIR}"
COMPONENT obs_${_DEP_NAME}
EXCLUDE_FROM_ALL)
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND
"${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config
$<CONFIG> --prefix ${CMAKE_INSTALL_PREFIX} --component obs_${_DEP_NAME}
COMMENT "Installing ${_DEP_NAME} to OBS rundir\n"
VERBATIM)
endfunction()
# --- End of section ---
else()
# --- Windows / Linux section ---
function(plugin_install_helper what where where_deb)
if(DEB_INSTALL)
if(NOT LIB_OUT_DIR)
set(LIB_OUT_DIR "/lib/obs-plugins")
endif()
install(
TARGETS ${what}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR}/${where_deb})
else()
install(
TARGETS ${what}
LIBRARY DESTINATION "${where}"
COMPONENT ${what}_Runtime
NAMELINK_COMPONENT ${what}_Development
RUNTIME DESTINATION "${where}")
install(
FILES $<TARGET_FILE:${what}>
DESTINATION $<CONFIG>/${where}
COMPONENT ${what}_rundir
EXCLUDE_FROM_ALL)
endif()
if(OS_WINDOWS)
install(
FILES $<TARGET_PDB_FILE:${what}>
CONFIGURATIONS "RelWithDebInfo" "Debug"
DESTINATION ${where}
COMPONENT ${what}_Runtime
OPTIONAL)
install(
FILES $<TARGET_PDB_FILE:${what}>
CONFIGURATIONS "RelWithDebInfo" "Debug"
DESTINATION $<CONFIG>/${where}
COMPONENT ${what}_rundir
OPTIONAL EXCLUDE_FROM_ALL)
endif()
if(OBS_OUTPUT_DIR)
add_custom_command(
TARGET ${what}
POST_BUILD
COMMAND
"${CMAKE_COMMAND}" -DCMAKE_INSTALL_PREFIX=${OBS_OUTPUT_DIR}
-DCMAKE_INSTALL_COMPONENT=${what}_rundir
-DCMAKE_INSTALL_CONFIG_NAME=$<CONFIG> -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake
COMMENT
"Installing ${what} to plugin rundir ${OBS_OUTPUT_DIR}/${where}\n"
VERBATIM)
endif()
endfunction()
function(install_advss_lib target)
plugin_install_helper("${target}" "${OBS_PLUGIN_DESTINATION}" "")
if(NOT OS_WINDOWS)
set_target_properties(${target} PROPERTIES INSTALL_RPATH "$ORIGIN")
endif()
endfunction()
function(install_advss_plugin target)
plugin_install_helper(
"${target}" "${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
"${ADVSS_PLUGIN_FOLDER}")
if(NOT OS_WINDOWS)
set_target_properties(${target} PROPERTIES INSTALL_RPATH
"$ORIGIN:$ORIGIN/..")
endif()
message(STATUS "ADVSS: ENABLED PLUGIN ${target}")
endfunction()
function(install_advss_plugin_dependency_target target dep)
install(
IMPORTED_RUNTIME_ARTIFACTS
${dep}
RUNTIME
DESTINATION
"${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
COMPONENT
${dep}_Runtime
LIBRARY
DESTINATION
"${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
COMPONENT
${dep}_Runtime
NAMELINK_COMPONENT
${dep}_Development)
install(
IMPORTED_RUNTIME_ARTIFACTS
${dep}
RUNTIME
DESTINATION
"${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
COMPONENT
obs_${dep}
EXCLUDE_FROM_ALL
LIBRARY
DESTINATION
"${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
COMPONENT
obs_${dep}
EXCLUDE_FROM_ALL)
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND
"${CMAKE_COMMAND}" --install .. --config $<CONFIG> --prefix
${OBS_OUTPUT_DIR}/$<CONFIG> --component obs_${dep} >
"$<IF:$<PLATFORM_ID:Windows>,nul,/dev/null>"
COMMENT "Installing ${dep} to OBS rundir\n"
VERBATIM)
endfunction()
function(install_advss_plugin_dependency_file target dep)
get_filename_component(_FILENAME ${dep} NAME)
string(REGEX REPLACE "\\.[^.]*$" "" _FILENAMENOEXT ${_FILENAME})
set(_DEP_NAME "${target}-${_FILENAMENOEXT}")
install(
FILES "${dep}"
DESTINATION "${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
COMPONENT ${_DEP_NAME}_Runtime
DESTINATION "${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
COMPONENT ${_DEP_NAME}_Runtime
NAMELINK_COMPONENT ${_DEP_NAME}_Development)
install(
FILES "${dep}"
DESTINATION "${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
COMPONENT obs_${_DEP_NAME}
EXCLUDE_FROM_ALL
DESTINATION "${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
COMPONENT obs_${_DEP_NAME}
EXCLUDE_FROM_ALL)
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND
"${CMAKE_COMMAND}" --install .. --config $<CONFIG> --prefix
${OBS_OUTPUT_DIR}/$<CONFIG> --component obs_${_DEP_NAME} >
"$<IF:$<PLATFORM_ID:Windows>,nul,/dev/null>"
COMMENT "Installing ${_DEP_NAME} to OBS rundir\n"
VERBATIM)
endfunction()
endif()
# --- End of section ---
function(setup_obs_lib_dependency target)
if(BUILD_OUT_OF_TREE)
find_package(libobs)
if(libobs_FOUND AND NOT LIBOBS_LIB)
target_link_libraries(${target} PUBLIC OBS::libobs)
else()
if(NOT LIBOBS_LIB)
message(FATAL_ERROR "obs library not found - please set LIBOBS_LIB")
endif()
target_link_libraries(${target} PUBLIC ${LIBOBS_LIB})
if(NOT LIBOBS_INCLUDE_DIR)
message(
FATAL_ERROR "obs.hpp header not found - please set LIBOBS_INCLUDE_DIR"
)
endif()
target_include_directories(${target} PRIVATE ${LIBOBS_INCLUDE_DIR})
endif()
find_package(obs-frontend-api)
if(obs-frontend-api_FOUND AND NOT LIBOBS_FRONTEND_API_LIB)
target_link_libraries(${target} PUBLIC OBS::obs-frontend-api)
else()
if(NOT LIBOBS_FRONTEND_API_LIB)
message(
FATAL_ERROR
"libobs frontend-api library not found - please set LIBOBS_FRONTEND_API_LIB"
)
endif()
target_link_libraries(${target} PUBLIC ${LIBOBS_FRONTEND_API_LIB})
if(NOT LIBOBS_FRONTEND_INCLUDE_DIR)
message(
FATAL_ERROR
" obs-frontend-api.h not found - please set LIBOBS_FRONTEND_INCLUDE_DIR"
)
endif()
target_include_directories(${target}
PRIVATE ${LIBOBS_FRONTEND_INCLUDE_DIR})
endif()
else()
target_link_libraries(${target} PUBLIC OBS::libobs OBS::frontend-api)
endif()
endfunction()
function(setup_advss_plugin target)
setup_obs_lib_dependency(${target})
find_package(Qt6 REQUIRED COMPONENTS Widgets Core)
target_link_libraries(${target} PRIVATE Qt6::Core Qt6::Widgets)
# Ignore QCheckBox::stateChanged deprecation warning until minimum supported
# Qt version is at least Qt 6.7, which introduces QCheckBox::checkStateChanged
if(Qt6_VERSION VERSION_GREATER "6.7.0")
target_compile_definitions(${target} PRIVATE QT_NO_DEPRECATED_WARNINGS)
endif()
set_target_properties(
${target}
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON)
target_compile_features(${target} PUBLIC cxx_std_17)
set_target_properties(${target} PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_link_libraries(${target} PRIVATE advanced-scene-switcher-lib)
get_target_property(ADVSS_SOURCE_DIR advanced-scene-switcher-lib SOURCE_DIR)
get_target_property(ADVSS_BINARY_DIR advanced-scene-switcher-lib BINARY_DIR)
if(OS_MACOS)
set(_COMMAND
"${CMAKE_INSTALL_NAME_TOOL} -add_rpath @loader_path \\\"$<TARGET_FILE:${target}>\\\""
)
install(CODE "execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")")
endif()
# Set up include directories for headers generated by Qt
target_include_directories(
${target}
PRIVATE "${ADVSS_BINARY_DIR}/advanced-scene-switcher-lib_autogen/include")
foreach(_CONF Release RelWithDebInfo Debug MinSizeRe)
target_include_directories(
${target}
PRIVATE
"${ADVSS_BINARY_DIR}/advanced-scene-switcher-lib_autogen/include_${_CONF}"
)
endforeach()
# General includes
target_include_directories(
${target}
PRIVATE "${ADVSS_SOURCE_DIR}/lib" "${ADVSS_SOURCE_DIR}/lib/legacy"
"${ADVSS_SOURCE_DIR}/lib/macro" "${ADVSS_SOURCE_DIR}/lib/utils"
"${ADVSS_SOURCE_DIR}/lib/variables" "${ADVSS_SOURCE_DIR}/forms")
endfunction()
function(install_advss_plugin_dependency)
cmake_parse_arguments(PARSED_ARGS "" "TARGET" "DEPENDENCIES" ${ARGN})
if(NOT PARSED_ARGS_TARGET)
message(FATAL_ERROR "You must provide a target")
endif()
foreach(_DEPENDENCY ${PARSED_ARGS_DEPENDENCIES})
if(EXISTS ${_DEPENDENCY})
install_advss_plugin_dependency_file(${PARSED_ARGS_TARGET} ${_DEPENDENCY})
else()
install_advss_plugin_dependency_target(${PARSED_ARGS_TARGET}
${_DEPENDENCY})
endif()
endforeach()
endfunction()

View File

@ -0,0 +1,83 @@
cmake_minimum_required(VERSION 3.16...3.26)
include_guard(GLOBAL)
# Enable automatic PUSH and POP of policies to parent scope
if(POLICY CMP0011)
cmake_policy(SET CMP0011 NEW)
endif()
# Enable distinction between Clang and AppleClang
if(POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif()
# Enable strict checking of "break()" usage
if(POLICY CMP0055)
cmake_policy(SET CMP0055 NEW)
endif()
# Honor visibility presets for all target types (executable, shared, module,
# static)
if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
# Disable export function calls to populate package registry by default
if(POLICY CMP0090)
cmake_policy(SET CMP0090 NEW)
endif()
# Prohibit in-source builds
if("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
message(
FATAL_ERROR
"In-source builds are not supported. "
"Specify a build directory via 'cmake -S <SOURCE DIRECTORY> -B <BUILD_DIRECTORY>' instead."
)
file(REMOVE_RECURSE "${CMAKE_CURRENT_SOURCE_DIR}/CMakeCache.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeFiles")
endif()
# Use folders for source file organization with IDE generators (Visual
# Studio/Xcode)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Add common module directories to default search path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/common")
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec)
# cmake-format: off
string(JSON _name GET ${buildspec} name)
string(JSON _website GET ${buildspec} website)
string(JSON _author GET ${buildspec} author)
string(JSON _email GET ${buildspec} email)
string(JSON _version GET ${buildspec} version)
string(JSON _bundleId GET ${buildspec} platformConfig macos bundleId)
string(JSON _windowsAppUUID GET ${buildspec} uuids windowsApp)
# cmake-format: on
set(PLUGIN_AUTHOR ${_author})
set(PLUGIN_WEBSITE ${_website})
set(PLUGIN_EMAIL ${_email})
set(PLUGIN_VERSION ${_version})
set(MACOS_BUNDLEID ${_bundleId})
include(buildnumber)
include(osconfig)
# Allow selection of common build types via UI
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE
"RelWithDebInfo"
CACHE STRING
"OBS build type [Release, RelWithDebInfo, Debug, MinSizeRel]" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Release RelWithDebInfo
Debug MinSizeRel)
endif()
# Disable exports automatically going into the CMake package registry
set(CMAKE_EXPORT_PACKAGE_REGISTRY FALSE)
# Enable default inclusion of targets' source and binary directory
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)

View File

@ -0,0 +1,27 @@
# CMake build number module
include_guard(GLOBAL)
# Define build number cache file
set(_BUILD_NUMBER_CACHE
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/.CMakeBuildNumber"
CACHE INTERNAL "OBS build number cache file")
# Read build number from cache file or manual override
if(NOT DEFINED PLUGIN_BUILD_NUMBER AND EXISTS "${_BUILD_NUMBER_CACHE}")
file(READ "${_BUILD_NUMBER_CACHE}" PLUGIN_BUILD_NUMBER)
math(EXPR PLUGIN_BUILD_NUMBER "${PLUGIN_BUILD_NUMBER}+1")
elseif(NOT DEFINED PLUGIN_BUILD_NUMBER)
if($ENV{CI})
if($ENV{GITHUB_RUN_ID})
set(PLUGIN_BUILD_NUMBER "$ENV{GITHUB_RUN_ID}")
elseif($ENV{GITLAB_RUN_ID})
set(PLUGIN_BUILD_NUMBER "$ENV{GITLAB_RUN_ID}")
else()
set(PLUGIN_BUILD_NUMBER "1")
endif()
else()
set(PLUGIN_BUILD_NUMBER "1")
endif()
endif()
file(WRITE "${_BUILD_NUMBER_CACHE}" "${PLUGIN_BUILD_NUMBER}")

View File

@ -0,0 +1,257 @@
# Common build dependencies module
# cmake-format: off
# cmake-lint: disable=C0103
# cmake-lint: disable=E1126
# cmake-lint: disable=R0912
# cmake-lint: disable=R0915
# cmake-format: on
include_guard(GLOBAL)
# _check_deps_version: Checks for obs-deps VERSION file in prefix paths
function(_check_deps_version version)
# cmake-format: off
set(found FALSE PARENT_SCOPE)
# cmake-format: on
foreach(path IN LISTS CMAKE_PREFIX_PATH)
if(EXISTS "${path}/share/obs-deps/VERSION")
if(dependency STREQUAL qt6 AND NOT EXISTS
"${path}/lib/cmake/Qt6/Qt6Config.cmake")
# cmake-format: off
set(found FALSE PARENT_SCOPE)
# cmake-format: on
continue()
endif()
file(READ "${path}/share/obs-deps/VERSION" _check_version)
string(REPLACE "\n" "" _check_version "${_check_version}")
string(REPLACE "-" "." _check_version "${_check_version}")
string(REPLACE "-" "." version "${version}")
if(_check_version VERSION_EQUAL version)
# cmake-format: off
set(found TRUE PARENT_SCOPE)
# cmake-format: on
break()
elseif(_check_version VERSION_LESS version)
message(AUTHOR_WARNING "Older ${label} version detected in ${path}: \n"
"Found ${_check_version}, require ${version}")
list(REMOVE_ITEM CMAKE_PREFIX_PATH "${path}")
list(APPEND CMAKE_PREFIX_PATH "${path}")
# cmake-format: off
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
# cmake-format: on
continue()
else()
message(AUTHOR_WARNING "Newer ${label} version detected in ${path}: \n"
"Found ${_check_version}, require ${version}")
# cmake-format: off
set(found TRUE PARENT_SCOPE)
# cmake-format: on
break()
endif()
endif()
endforeach()
endfunction()
# _setup_obs_studio: Create obs-studio build project, then build libobs and
# obs-frontend-api
function(_setup_obs_studio)
if(NOT libobs_DIR)
set(_is_fresh --fresh)
endif()
if(OS_WINDOWS)
set(_cmake_generator "${CMAKE_GENERATOR}")
set(_cmake_arch
"-A ${arch},version=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
set(_cmake_extra
"-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} -DCMAKE_ENABLE_SCRIPTING=OFF"
)
elseif(OS_MACOS)
set(_cmake_generator "Xcode")
set(_cmake_arch "-DCMAKE_OSX_ARCHITECTURES:STRING='arm64;x86_64'")
set(_cmake_extra
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
message(STATUS "Configure ${label} (${arch})")
execute_process(
COMMAND
"${CMAKE_COMMAND}" -S "${dependencies_dir}/${_obs_destination}" -B
"${dependencies_dir}/${_obs_destination}/build_${arch}" -G
${_cmake_generator} "${_cmake_arch}" -DOBS_CMAKE_VERSION:STRING=3.0.0
-DENABLE_PLUGINS:BOOL=OFF -DENABLE_FRONTEND:BOOL=OFF
-DOBS_VERSION_OVERRIDE:STRING=${_obs_version}
"-DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATH}'" ${_is_fresh} ${_cmake_extra}
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
OUTPUT_QUIET)
message(STATUS "Configure ${label} (${arch}) - done")
message(STATUS "Build ${label} (Debug - ${arch})")
execute_process(
COMMAND "${CMAKE_COMMAND}" --build build_${arch} --target obs-frontend-api
--config Debug --parallel
WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
OUTPUT_QUIET)
message(STATUS "Build ${label} (Debug - ${arch}) - done")
message(STATUS "Build ${label} (Release - ${arch})")
execute_process(
COMMAND "${CMAKE_COMMAND}" --build build_${arch} --target obs-frontend-api
--config Release --parallel
WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
OUTPUT_QUIET)
message(STATUS "Build ${label} (Reelase - ${arch}) - done")
message(STATUS "Install ${label} (${arch})")
execute_process(
COMMAND "${CMAKE_COMMAND}" --install build_${arch} --component Development
--config Debug --prefix "${dependencies_dir}"
WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
OUTPUT_QUIET)
execute_process(
COMMAND "${CMAKE_COMMAND}" --install build_${arch} --component Development
--config Release --prefix "${dependencies_dir}"
WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
OUTPUT_QUIET)
message(STATUS "Install ${label} (${arch}) - done")
endfunction()
# _check_dependencies: Fetch and extract pre-built OBS build dependencies
function(_check_dependencies)
if(NOT buildspec)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec)
endif()
# cmake-format: off
string(JSON dependency_data GET ${buildspec} dependencies)
# cmake-format: on
foreach(dependency IN LISTS dependencies_list)
# cmake-format: off
string(JSON data GET ${dependency_data} ${dependency})
string(JSON version GET ${data} version)
string(JSON hash GET ${data} hashes ${platform})
string(JSON url GET ${data} baseUrl)
string(JSON label GET ${data} label)
string(JSON revision ERROR_VARIABLE error GET ${data} revision ${platform})
# cmake-format: on
message(STATUS "Setting up ${label} (${arch})")
set(file "${${dependency}_filename}")
set(destination "${${dependency}_destination}")
string(REPLACE "VERSION" "${version}" file "${file}")
string(REPLACE "VERSION" "${version}" destination "${destination}")
string(REPLACE "ARCH" "${arch}" file "${file}")
string(REPLACE "ARCH" "${arch}" destination "${destination}")
if(revision)
string(REPLACE "_REVISION" "_v${revision}" file "${file}")
string(REPLACE "-REVISION" "-v${revision}" file "${file}")
else()
string(REPLACE "_REVISION" "" file "${file}")
string(REPLACE "-REVISION" "" file "${file}")
endif()
set(skip FALSE)
if(dependency STREQUAL prebuilt OR dependency STREQUAL qt6)
_check_deps_version(${version})
if(found)
set(skip TRUE)
endif()
endif()
if(skip)
message(STATUS "Setting up ${label} (${arch}) - skipped")
continue()
endif()
if(dependency STREQUAL obs-studio)
set(url ${url}/${file})
else()
set(url ${url}/${version}/${file})
endif()
set(MAX_DOWNLOAD_RETRIES 3)
set(RETRY_DELAY 60) # seconds
if(NOT EXISTS "${dependencies_dir}/${file}")
message(STATUS "Downloading ${url}")
set(download_success FALSE)
foreach(i RANGE 1 ${MAX_DOWNLOAD_RETRIES})
message(STATUS "Attempt ${i}/${MAX_DOWNLOAD_RETRIES} for ${url}")
file(
DOWNLOAD "${url}" "${dependencies_dir}/${file}"
STATUS download_status
EXPECTED_HASH SHA256=${hash})
list(GET download_status 0 error_code)
list(GET download_status 1 error_message)
if(error_code EQUAL 0)
message(STATUS "Downloading ${url} - success on attempt ${i}")
set(download_success TRUE)
break()
else()
message(WARNING "Download failed (attempt ${i}): ${error_message}")
file(REMOVE "${dependencies_dir}/${file}")
if(NOT i EQUAL MAX_DOWNLOAD_RETRIES)
message(STATUS "Retrying in ${RETRY_DELAY} seconds...")
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${RETRY_DELAY})
endif()
endif()
endforeach()
if(NOT download_success)
message(
FATAL_ERROR
"Unable to download ${url} after ${MAX_DOWNLOAD_RETRIES} attempts")
endif()
message(STATUS "Downloading ${url} - done")
endif()
if(NOT EXISTS "${dependencies_dir}/${destination}")
file(MAKE_DIRECTORY "${dependencies_dir}/${destination}")
if(dependency STREQUAL obs-studio)
file(ARCHIVE_EXTRACT INPUT "${dependencies_dir}/${file}" DESTINATION
"${dependencies_dir}")
else()
file(ARCHIVE_EXTRACT INPUT "${dependencies_dir}/${file}" DESTINATION
"${dependencies_dir}/${destination}")
endif()
endif()
if(dependency STREQUAL prebuilt)
list(APPEND CMAKE_PREFIX_PATH "${dependencies_dir}/${destination}")
elseif(dependency STREQUAL qt6)
list(APPEND CMAKE_PREFIX_PATH "${dependencies_dir}/${destination}")
elseif(dependency STREQUAL obs-studio)
set(_obs_version ${version})
set(_obs_destination "${destination}")
list(APPEND CMAKE_PREFIX_PATH "${dependencies_dir}")
endif()
message(STATUS "Setting up ${label} (${arch}) - done")
endforeach()
list(REMOVE_DUPLICATES CMAKE_PREFIX_PATH)
# cmake-format: off
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} CACHE PATH "CMake prefix search path" FORCE)
# cmake-format: on
_setup_obs_studio()
endfunction()

22
cmake/common/ccache.cmake Normal file
View File

@ -0,0 +1,22 @@
# CMake ccache module
include_guard(GLOBAL)
if(NOT DEFINED CCACHE_PROGRAM)
message(DEBUG "Trying to find ccache on build host...")
find_program(CCACHE_PROGRAM "ccache")
mark_as_advanced(CCACHE_PROGRAM)
endif()
if(CCACHE_PROGRAM)
message(DEBUG "Ccache found as ${CCACHE_PROGRAM}...")
option(ENABLE_CCACHE "Enable compiler acceleration with ccache" ON)
if(ENABLE_CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_OBJC_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
endif()
endif()

View File

@ -0,0 +1,87 @@
# CMake common compiler options module
include_guard(GLOBAL)
# Set C and C++ language standards to C17 and C++17
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.21)
set(CMAKE_C_STANDARD 17)
else()
set(CMAKE_C_STANDARD 11)
endif()
set(CMAKE_C_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
# Set symbols to be hidden by default for C and C++
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
# clang options for C
set(_obs_clang_c_options
# cmake-format: sortable
-fno-strict-aliasing
-Wbool-conversion
-Wcomma
-Wconstant-conversion
-Wdeprecated-declarations
-Wempty-body
-Wenum-conversion
-Werror=return-type
-Wextra
-Wformat
-Wformat-security
-Wfour-char-constants
-Winfinite-recursion
-Wint-conversion
-Wnewline-eof
-Wno-conversion
-Wno-float-conversion
-Wno-implicit-fallthrough
-Wno-missing-braces
-Wno-missing-field-initializers
-Wno-missing-prototypes
-Wno-semicolon-before-method-body
-Wno-shadow
-Wno-sign-conversion
-Wno-strict-prototypes
-Wno-trigraphs
-Wno-unknown-pragmas
-Wno-unused-function
-Wno-unused-label
-Wnon-literal-null-conversion
-Wobjc-literal-conversion
-Wparentheses
-Wpointer-sign
-Wquoted-include-in-framework-header
-Wshadow
-Wshorten-64-to-32
-Wuninitialized
-Wunreachable-code
-Wunused-parameter
-Wunused-value
-Wunused-variable
-Wvla)
# clang options for C++
set(_obs_clang_cxx_options
# cmake-format: sortable
${_obs_clang_c_options}
-Wconversion
-Wdeprecated-implementations
-Wduplicate-method-match
-Wfloat-conversion
-Wfour-char-constants
-Wimplicit-retain-self
-Winvalid-offsetof
-Wmove
-Wno-c++11-extensions
-Wno-exit-time-destructors
-Wno-implicit-atomic-properties
-Wno-objc-interface-ivars
-Wno-overloaded-virtual
-Wrange-loop-analysis)
if(NOT DEFINED CMAKE_COMPILE_WARNING_AS_ERROR)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
endif()

View File

@ -0,0 +1,269 @@
# * Returns a version string from Git
#
# These functions force a re-configure on each git commit so that you can trust
# the values of the variables in your build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git
# describe> ...])
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the source tree, and adjusting the
# output so that it tests false if an error occurs.
#
# git_describe_working_tree(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the working tree (--dirty option), and
# adjusting the output so that it tests false if an error occurs.
#
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree, and
# adjusting the output so that it tests false if there was no exact matching
# tag.
#
# git_local_changes(<var>)
#
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes. Uses
# the return code of "git diff-index --quiet HEAD --". Does not regard untracked
# files.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author: 2009-2020 Ryan Pavlik <ryan.pavlik@gmail.com>
# <abiryan@ryand.net> http://academic.cleardefinition.com
#
# Copyright 2009-2013, Iowa State University. Copyright 2013-2020, Ryan Pavlik
# Copyright 2013-2020, Contributors SPDX-License-Identifier: BSL-1.0 Distributed
# under the Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
if(__get_git_revision_description)
return()
endif()
set(__get_git_revision_description YES)
# We must run the following at "include" time, not at function call time, to
# find the path to this module rather than the path to a calling list file
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
# Function _git_find_closest_git_dir finds the next closest .git directory that
# is part of any directory in the path defined by _start_dir. The result is
# returned in the parent scope variable whose name is passed as variable
# _git_dir_var. If no .git directory can be found, the function returns an empty
# string via _git_dir_var.
#
# Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and
# neither foo nor bar contain a file/directory .git. This wil return C:/bla/.git
#
function(_git_find_closest_git_dir _start_dir _git_dir_var)
set(cur_dir "${_start_dir}")
set(git_dir "${_start_dir}/.git")
while(NOT EXISTS "${git_dir}")
# .git dir not found, search parent directories
set(git_previous_parent "${cur_dir}")
get_filename_component(cur_dir "${cur_dir}" DIRECTORY)
if(cur_dir STREQUAL git_previous_parent)
# We have reached the root directory, we are not in git
set(${_git_dir_var}
""
PARENT_SCOPE)
return()
endif()
set(git_dir "${cur_dir}/.git")
endwhile()
set(${_git_dir_var}
"${git_dir}"
PARENT_SCOPE)
endfunction()
function(get_git_head_revision _refspecvar _hashvar)
_git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR)
if(NOT "${GIT_DIR}" STREQUAL "")
file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}"
"${GIT_DIR}")
if("${_relative_to_source_dir}" MATCHES "[.][.]")
# We've gone above the CMake root dir.
set(GIT_DIR "")
endif()
endif()
if("${GIT_DIR}" STREQUAL "")
set(${_refspecvar}
"GITDIR-NOTFOUND"
PARENT_SCOPE)
set(${_hashvar}
"GITDIR-NOTFOUND"
PARENT_SCOPE)
return()
endif()
# Check if the current source dir is a git submodule or a worktree. In both
# cases .git is a file instead of a directory.
#
if(NOT IS_DIRECTORY ${GIT_DIR})
# The following git command will return a non empty string that points to
# the super project working tree if the current source dir is inside a git
# submodule. Otherwise the command will return an empty string.
#
execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse --show-superproject-working-tree
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT "${out}" STREQUAL "")
# If out is empty, GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a submodule
file(READ ${GIT_DIR} submodule)
string(REGEX REPLACE "gitdir: (.*)$" "\\1" GIT_DIR_RELATIVE ${submodule})
string(STRIP ${GIT_DIR_RELATIVE} GIT_DIR_RELATIVE)
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE}
ABSOLUTE)
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
else()
# GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a worktree
file(READ ${GIT_DIR} worktree_ref)
# The .git directory contains a path to the worktree information directory
# inside the parent git repo of the worktree.
#
string(REGEX REPLACE "gitdir: (.*)$" "\\1" git_worktree_dir
${worktree_ref})
string(STRIP ${git_worktree_dir} git_worktree_dir)
_git_find_closest_git_dir("${git_worktree_dir}" GIT_DIR)
set(HEAD_SOURCE_FILE "${git_worktree_dir}/HEAD")
endif()
else()
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
endif()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()
if(NOT EXISTS "${HEAD_SOURCE_FILE}")
return()
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${HEAD_SOURCE_FILE}" "${HEAD_FILE}" COPYONLY)
configure_file("${_gitdescmoddir}/get_git_revision_description.cmake.in"
"${GIT_DATA}/grabRef.cmake" @ONLY)
include("${GIT_DATA}/grabRef.cmake")
set(${_refspecvar}
"${HEAD_REF}"
PARENT_SCOPE)
set(${_hashvar}
"${HEAD_HASH}"
PARENT_SCOPE)
endfunction()
function(git_describe _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var}
"HEAD-HASH-NOTFOUND"
PARENT_SCOPE)
return()
endif()
# TODO sanitize if((${ARGN}" MATCHES "&&") OR (ARGN MATCHES "||") OR (ARGN
# MATCHES "\\;")) message("Please report the following error to the project!")
# message(FATAL_ERROR "Looks like someone's doing something nefarious with
# git_describe! Passed arguments ${ARGN}") endif()
# message(STATUS "Arguments to execute_process: ${ARGN}")
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --tags --always ${hash} ${ARGN}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_describe_working_tree _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
if(NOT GIT_FOUND)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --dirty ${ARGN}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var}
"${out}"
PARENT_SCOPE)
endfunction()
function(git_local_changes _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var}
"GIT-NOTFOUND"
PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var}
"HEAD-HASH-NOTFOUND"
PARENT_SCOPE)
return()
endif()
execute_process(
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD --
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(res EQUAL 0)
set(${_var}
"CLEAN"
PARENT_SCOPE)
else()
set(${_var}
"DIRTY"
PARENT_SCOPE)
endif()
endfunction()

View File

@ -0,0 +1,41 @@
#
# Internal file for get_git_revision_description.cmake.in
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(HEAD_HASH)
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()
if(NOT HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()

View File

@ -0,0 +1,70 @@
# CMake common helper functions module
# cmake-format: off
# cmake-lint: disable=C0103
# cmake-format: on
include_guard(GLOBAL)
# * Use QT_VERSION value as a hint for desired Qt version
# * If "AUTO" was specified, prefer Qt6 over Qt5
# * Creates versionless targets of desired component if none had been created by
# Qt itself (Qt versions < 5.15)
if(NOT QT_VERSION)
set(QT_VERSION
AUTO
CACHE STRING "OBS Qt version [AUTO, 5, 6]" FORCE)
set_property(CACHE QT_VERSION PROPERTY STRINGS AUTO 5 6)
endif()
# check_uuid: Helper function to check for valid UUID
function(check_uuid uuid_string return_value)
set(valid_uuid TRUE)
set(uuid_token_lengths 8 4 4 4 12)
set(token_num 0)
string(REPLACE "-" ";" uuid_tokens ${uuid_string})
list(LENGTH uuid_tokens uuid_num_tokens)
if(uuid_num_tokens EQUAL 5)
message(DEBUG "UUID ${uuid_string} is valid with 5 tokens.")
foreach(uuid_token IN LISTS uuid_tokens)
list(GET uuid_token_lengths ${token_num} uuid_target_length)
string(LENGTH "${uuid_token}" uuid_actual_length)
if(uuid_actual_length EQUAL uuid_target_length)
string(REGEX MATCH "[0-9a-fA-F]+" uuid_hex_match ${uuid_token})
if(NOT uuid_hex_match STREQUAL uuid_token)
set(valid_uuid FALSE)
break()
endif()
else()
set(valid_uuid FALSE)
break()
endif()
math(EXPR token_num "${token_num}+1")
endforeach()
else()
set(valid_uuid FALSE)
endif()
message(DEBUG "UUID ${uuid_string} valid: ${valid_uuid}")
set(${return_value}
${valid_uuid}
PARENT_SCOPE)
endfunction()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/plugin-support.c.in")
configure_file(src/plugin-support.c.in plugin-support.c @ONLY)
add_library(plugin-support STATIC)
target_sources(
plugin-support
PRIVATE plugin-support.c
PUBLIC src/plugin-support.h)
target_include_directories(plugin-support
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
if(OS_LINUX
OR OS_FREEBSD
OR OS_OPENBSD)
# add fPIC on Linux to prevent shared object errors
set_property(TARGET plugin-support PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
endif()

View File

@ -0,0 +1,23 @@
# CMake operating system bootstrap module
include_guard(GLOBAL)
# Set minimum CMake version specific to host operating system, add OS-specific
# module directory to default search paths, and set helper variables for OS
# detection in other CMake list files.
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(CMAKE_C_EXTENSIONS FALSE)
set(CMAKE_CXX_EXTENSIONS FALSE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows")
set(OS_WINDOWS TRUE)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(CMAKE_C_EXTENSIONS FALSE)
set(CMAKE_CXX_EXTENSIONS FALSE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos")
set(OS_MACOS TRUE)
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
set(CMAKE_CXX_EXTENSIONS FALSE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/linux")
string(TOUPPER "${CMAKE_HOST_SYSTEM_NAME}" _SYSTEM_NAME_U)
set(OS_${_SYSTEM_NAME_U} TRUE)
endif()

View File

@ -0,0 +1,5 @@
#include "version.h"
#define GIT_SHA1 "@GIT_SHA1@"
#define GIT_TAG "@GIT_TAG@"
const char g_GIT_SHA1[] = GIT_SHA1;
const char g_GIT_TAG[] = GIT_TAG;

Some files were not shown because too many files have changed in this diff Show More