mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 01:44:49 -05:00
Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9301ead060 | ||
|
|
bc29ece526 | ||
|
|
4158c7a363 | ||
|
|
944d1059da | ||
|
|
bf18d8e106 | ||
|
|
bf216e0917 | ||
|
|
2405b6dbbf | ||
|
|
e64f2d195e | ||
|
|
f66bec8caf | ||
|
|
3eb79e3adb | ||
|
|
07e2ac3ca0 | ||
|
|
8e2c466c2d | ||
|
|
cc68e2366c | ||
|
|
7a0e08b0d8 | ||
|
|
be8744f0d0 | ||
|
|
d4425df694 | ||
|
|
70e5f6002d | ||
|
|
ff98ec36d6 | ||
|
|
4966802f14 | ||
|
|
b23a90557f | ||
|
|
d6ea815b85 | ||
|
|
f35ef558ee | ||
|
|
d7ff9088f8 | ||
|
|
7048925d6e | ||
|
|
fcb3ea50d3 | ||
|
|
87c45e2b32 | ||
|
|
eb5046a9d6 | ||
|
|
58c05f3f6e | ||
|
|
0b284da3de | ||
|
|
03fe7016e4 | ||
|
|
2ea89912a3 | ||
|
|
78d2efa083 | ||
|
|
149fce1c2b | ||
|
|
2dd9120265 | ||
|
|
3a9f315b67 | ||
|
|
6ba01dca39 | ||
|
|
ad1f1effeb | ||
|
|
0a53a8649f | ||
|
|
7ea721f9f1 | ||
|
|
718a899a98 | ||
|
|
4c493451f4 | ||
|
|
a8d483f5a7 | ||
|
|
dc786a5313 | ||
|
|
628a4d896c | ||
|
|
74a9681c8e | ||
|
|
faf52c38bb | ||
|
|
bad1a548fb | ||
|
|
f706416df5 | ||
|
|
c344c88acd | ||
|
|
2cd9e61717 | ||
|
|
6314de8f37 | ||
|
|
6bfcabc4af | ||
|
|
69711d973a | ||
|
|
225913b44d | ||
|
|
7c6d657fdd | ||
|
|
12e38274f5 | ||
|
|
5d49e8825b | ||
|
|
21c34356ed | ||
|
|
266e470509 | ||
|
|
de20c93b14 | ||
|
|
b0d877db8c | ||
|
|
caf9e59475 | ||
|
|
5f6982b5bb | ||
|
|
ce399cc647 | ||
|
|
03f67534c7 | ||
|
|
246667e65e | ||
|
|
68fe7716e7 | ||
|
|
98cc710b4a | ||
|
|
c602c30c54 | ||
|
|
cc1b89fe1d | ||
|
|
1de4ef7ec2 | ||
|
|
e29060fdea |
|
|
@ -6,18 +6,18 @@ You have the option to ...
|
|||
|
||||
Both methods require [CMake](https://cmake.org/download/).
|
||||
|
||||
The plugin can be compiled for OBS 27 and above, although using the latest version of OBS is recommended to support all features.
|
||||
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/UI/frontend-plugins/:
|
||||
Add the "SceneSwitcher" source directory to your obs-studio source directory under obs-studio/plugins:
|
||||
```
|
||||
cd obs-studio/UI/frontend-plugins/
|
||||
cd obs-studio/plugins
|
||||
git clone --recursive https://github.com/WarmUpTill/SceneSwitcher.git
|
||||
```
|
||||
|
||||
Then modify the obs-studio/UI/frontend-plugins/CMakeLists.txt Example and add an entry for the scene switcher:
|
||||
Then modify the obs-studio/plugins/CMakeLists.txt and add an entry for the scene switcher:
|
||||
```
|
||||
add_subdirectory(SceneSwitcher)
|
||||
```
|
||||
|
|
|
|||
|
|
@ -146,6 +146,8 @@ target_sources(
|
|||
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
|
||||
|
|
@ -164,6 +166,7 @@ target_sources(
|
|||
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)
|
||||
|
||||
|
|
@ -182,6 +185,8 @@ target_sources(
|
|||
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
|
||||
|
|
@ -199,6 +204,8 @@ target_sources(
|
|||
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
|
||||
|
|
@ -449,14 +456,29 @@ else()
|
|||
endif()
|
||||
if(PROCPS2_INCLUDE_DIR)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(libproc2 IMPORTED_TARGET libproc2<4.0.5 QUIET)
|
||||
if(libproc2_FOUND)
|
||||
target_compile_definitions(${LIB_NAME} PRIVATE PROCPS2_USE_INFO)
|
||||
endif()
|
||||
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(
|
||||
|
|
|
|||
|
|
@ -180,24 +180,46 @@ function(_check_dependencies)
|
|||
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}")
|
||||
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 GREATER 0)
|
||||
message(STATUS "Downloading ${url} - Failure")
|
||||
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}, failed with error: ${error_message}")
|
||||
file(REMOVE "${dependencies_dir}/${file}")
|
||||
else()
|
||||
message(STATUS "Downloading ${url} - done")
|
||||
"Unable to download ${url} after ${MAX_DOWNLOAD_RETRIES} attempts")
|
||||
endif()
|
||||
message(STATUS "Downloading ${url} - done")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${dependencies_dir}/${destination}")
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ function(_git_find_closest_git_dir _start_dir _git_dir_var)
|
|||
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)
|
||||
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}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ AdvSceneSwitcher.macroTab.name="Name:"
|
|||
AdvSceneSwitcher.macroTab.run="Makro ausführen"
|
||||
AdvSceneSwitcher.macroTab.runFail="Ausführen von \"%1\" fehlgeschlagen!\nEntweder ist eine der Aktionen fehlgeschlagen oder das Makro wird bereits ausgeführt.\nSoll die aktuelle Ausführung gestoppt werden?"
|
||||
AdvSceneSwitcher.macroTab.runInParallel="Parallel zu anderen Makros ausführen"
|
||||
AdvSceneSwitcher.macroTab.onChange="Nur bei Änderung ausführen"
|
||||
AdvSceneSwitcher.macroTab.defaultname="Makro %1"
|
||||
AdvSceneSwitcher.macroTab.defaultGroupName="Gruppe %1"
|
||||
AdvSceneSwitcher.macroTab.removeGroupPopup.text="Sicher, dass \"%1\" und alle zugehörigen Elemente gelöscht werden?"
|
||||
|
|
@ -291,14 +290,14 @@ AdvSceneSwitcher.condition.replay.state.started="Replay Buffer gestartet"
|
|||
AdvSceneSwitcher.condition.replay.state.saved="Replay Buffer gespeichert"
|
||||
AdvSceneSwitcher.condition.replay.entry="{{state}}"
|
||||
AdvSceneSwitcher.condition.date="Datum"
|
||||
AdvSceneSwitcher.condition.date.anyDay="Beliebiger Tag"
|
||||
AdvSceneSwitcher.condition.date.monday="Montag"
|
||||
AdvSceneSwitcher.condition.date.tuesday="Dienstag"
|
||||
AdvSceneSwitcher.condition.date.wednesday="Mittwoch"
|
||||
AdvSceneSwitcher.condition.date.thursday="Donnerstag"
|
||||
AdvSceneSwitcher.condition.date.friday="Freitag"
|
||||
AdvSceneSwitcher.condition.date.saturday="Samstag"
|
||||
AdvSceneSwitcher.condition.date.sunday="Sonntag"
|
||||
AdvSceneSwitcher.day.any="Beliebiger Tag"
|
||||
AdvSceneSwitcher.day.monday="Montag"
|
||||
AdvSceneSwitcher.day.tuesday="Dienstag"
|
||||
AdvSceneSwitcher.day.wednesday="Mittwoch"
|
||||
AdvSceneSwitcher.day.thursday="Donnerstag"
|
||||
AdvSceneSwitcher.day.friday="Freitag"
|
||||
AdvSceneSwitcher.day.saturday="Samstag"
|
||||
AdvSceneSwitcher.day.sunday="Sonntag"
|
||||
AdvSceneSwitcher.condition.date.state.at="Am"
|
||||
AdvSceneSwitcher.condition.date.state.after="Nach"
|
||||
AdvSceneSwitcher.condition.date.state.before="Vor"
|
||||
|
|
@ -309,12 +308,13 @@ AdvSceneSwitcher.condition.date.ignoreDate="Wenn diese Option nicht aktiviert is
|
|||
AdvSceneSwitcher.condition.date.ignoreTime="Wenn diese Option nicht aktiviert ist, wird die Zeitkomponente ignoriert"
|
||||
AdvSceneSwitcher.condition.date.showAdvancedSettings="Erweiterte Einstellungen anzeigen"
|
||||
AdvSceneSwitcher.condition.date.showSimpleSettings="Einfache Einstellungen anzeigen"
|
||||
AdvSceneSwitcher.condition.date.entry.simple="Am {{dayOfWeek}} {{weekCondition}} {{ignoreWeekTime}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.entry.advanced="{{condition}} {{ignoreDate}}{{date}} {{ignoreTime}}{{time}} {{separator}} {{date2}} {{time2}}"
|
||||
AdvSceneSwitcher.condition.date.entry.repeat="{{repeat}} Wiederholen alle {{duration}} bei Datumsübereinstimmung"
|
||||
AdvSceneSwitcher.condition.date.entry.pattern="Aktuelles Datum \"{{currentDate}}\" entspricht dem Muster {{pattern}}"
|
||||
AdvSceneSwitcher.condition.date.entry.nextMatchDate="Nächster Treffer bei: %1"
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}} Bei Wiederholung ausgewähltes Datum auf Wiederholungsdatum aktualisieren"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.day="Am{{dayOfWeek}}"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.time="{{ignoreWeekTime}}{{weekCondition}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.layout.advanced="{{condition}} {{ignoreDate}}{{date}} {{ignoreTime}}{{time}} {{separator}} {{date2}} {{time2}}"
|
||||
AdvSceneSwitcher.condition.date.layout.repeat="{{repeat}} Wiederholen alle {{duration}} bei Datumsübereinstimmung"
|
||||
AdvSceneSwitcher.condition.date.layout.pattern="Aktuelles Datum \"{{currentDate}}\" entspricht dem Muster {{pattern}}"
|
||||
AdvSceneSwitcher.condition.date.layout.nextMatchDate="Nächster Treffer bei: %1"
|
||||
AdvSceneSwitcher.condition.date.layout.updateOnRepeat="{{updateOnRepeat}} Bei Wiederholung ausgewähltes Datum auf Wiederholungsdatum aktualisieren"
|
||||
AdvSceneSwitcher.condition.sceneTransform="Szenenelement transformieren"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="Transformation erhalten"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.match="entspricht Transformation"
|
||||
|
|
@ -429,7 +429,7 @@ AdvSceneSwitcher.action.sceneVisibility.type.hide="Verstecken"
|
|||
AdvSceneSwitcher.action.sceneVisibility.type.toggle="Umschalten"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.source="Quelle"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.sourceGroup="Beliebig"
|
||||
AdvSceneSwitcher.action.sceneVisibility.entry="Auf{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneVisibility.layout="Auf{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.filter="Filter"
|
||||
AdvSceneSwitcher.action.filter.type.enable="Aktivieren"
|
||||
AdvSceneSwitcher.action.filter.type.disable="Deaktivieren"
|
||||
|
|
@ -834,8 +834,6 @@ AdvSceneSwitcher.status.inactive="Inaktiv"
|
|||
AdvSceneSwitcher.running="Plugin läuft"
|
||||
AdvSceneSwitcher.stopped="Plugin gestoppt"
|
||||
|
||||
AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>Dies scheint das erste Mal zu sein, dass der Erweiterte Szenenwechsler gestartet wurde.<br>Bitte schaue ins <a href=\"https://github.com/WarmUpTill/SceneSwitcher/wiki\"><span style=\" text-decoration: underline; color:#268bd2;\">Wiki</span></a> für eine Liste von Anleitungen und Beispielen.<br>Nicht zögern und Fragen im <a href=\"https://obsproject.com/forum/threads/advanced-scene-switcher.48264\"><span style=\" text-decoration: underline; color:#268bd2;\">Thread</span></a> des Plugins im OBS-Forum stellen!!</p></body></html>"
|
||||
|
||||
AdvSceneSwitcher.deprecatedTabWarning="Die Entwicklung für dieses Tab wurde gestoppt!\nBitte stattdessen zur Verwendung des Makros-Tab übergehen.\nDieser Hinweis kann im Allgemein-Tab deaktiviert werden."
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="Millisekunden"
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailure="Display warni
|
|||
AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailureMessage="<html><body>Loading of the following plugin libraries was unsuccessful, which could result in some Advanced Scene Switcher functions not being available:%1Check the OBS logs for details.<br>This message can be disabled on the General tab.</body></html>"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.warnCorruptedInstallMessage="The plugin installation seems to be corrupted and might crash!\nPlease make sure the plugin was installed correctly!"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.hideLegacyTabs="Hide tabs which can be represented via macros"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.disableMacroWidgetCache="Disable macro widget caching"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowMacroSearch="Always show macro search"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs="Always show all feature tabs"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs.tooltip="Show tabs that are normally hidden until first used in a macro (e.g. Action Queues, Variables, Twitch, Websockets)."
|
||||
AdvSceneSwitcher.generalTab.matchBehavior="Match behavior"
|
||||
AdvSceneSwitcher.generalTab.priority="Priority"
|
||||
AdvSceneSwitcher.generalTab.priority.description="Switching methods priority (Highest priority is at the top)"
|
||||
|
|
@ -74,6 +76,7 @@ AdvSceneSwitcher.generalTab.setTransitionBy="When changing transitions:"
|
|||
AdvSceneSwitcher.generalTab.transitionOverride="Set transition overrides"
|
||||
AdvSceneSwitcher.generalTab.adjustActiveTransitionType="Change active transition type"
|
||||
AdvSceneSwitcher.generalTab.transitionBehaviorSelectionError="At least one option must be enabled:\n\n - Use transition overrides\n\n - Change active transition type"
|
||||
AdvSceneSwitcher.generalTab.uiBehavior="UI settings"
|
||||
|
||||
# Variables Tab
|
||||
AdvSceneSwitcher.variableTab.title="Variables"
|
||||
|
|
@ -157,6 +160,8 @@ AdvSceneSwitcher.macroTab.title="Macro"
|
|||
AdvSceneSwitcher.macroTab.macros="Macros"
|
||||
AdvSceneSwitcher.macroTab.priorityWarning="Note: It is recommended to configure macros to be the highest priority functionality.\nThis setting can be changed on the General tab."
|
||||
AdvSceneSwitcher.macroTab.help="Macros allow you to execute a string of actions depending on multiple conditions.\n\nClick on the highlighted plus symbol to add a new Macro."
|
||||
AdvSceneSwitcher.macroTab.macroLastExecutedTooltip="Was last executed %1 seconds ago."
|
||||
AdvSceneSwitcher.macroTab.macroNotYetExecutedTooltip="Was not yet executed."
|
||||
AdvSceneSwitcher.macroTab.editConditionHelp="This section allows you to define macro conditions.\n\nSelect an existing or add a new macro on the left.\nThen click the plus button below to add a new condition."
|
||||
AdvSceneSwitcher.macroTab.editActionHelp="This section allows you to define macro actions.\nThe actions in this section will be performed when the conditions are met.\n\nSelect an existing or add a new macro on the left.\nThen click the plus button below to add a new action."
|
||||
AdvSceneSwitcher.macroTab.editElseActionHelp="This section allows you to define macro actions.\nThe actions in this section will be performed when the conditions are *not* met.\n\nSelect an existing or add a new macro on the left.\nThen click the plus button below to add a new action."
|
||||
|
|
@ -172,7 +177,12 @@ AdvSceneSwitcher.macroTab.run.tooltip="Run all macro actions regardless of condi
|
|||
AdvSceneSwitcher.macroTab.runElse="Run macro (else)"
|
||||
AdvSceneSwitcher.macroTab.runFail="Running \"%1\" failed!\nEither one of the actions failed or the macro is running already.\nDo you want to stop it?"
|
||||
AdvSceneSwitcher.macroTab.runInParallel="Run macro in parallel to other macros"
|
||||
AdvSceneSwitcher.macroTab.onChange="Perform actions only on condition change"
|
||||
AdvSceneSwitcher.macroTab.actionTriggerMode.label="Perform actions:"
|
||||
AdvSceneSwitcher.macroTab.actionTriggerMode.tooltip="Controls when the actions of this macro are performed.\n\n\"Always\" - actions are performed every time the conditions are met.\n\"Macro result changed\" - actions are only performed when the macro transitions between matching and not matching.\n\"Any condition changed\" - actions are only performed when any individual condition changes its result.\n\"Any condition triggered\" - actions are only performed when any individual condition changes from false to true."
|
||||
AdvSceneSwitcher.macroTab.actionTriggerMode.always="always"
|
||||
AdvSceneSwitcher.macroTab.actionTriggerMode.onOverallChange="only when result changes"
|
||||
AdvSceneSwitcher.macroTab.actionTriggerMode.onAnyConditionChange="only when any condition changes"
|
||||
AdvSceneSwitcher.macroTab.actionTriggerMode.onAnyConditionTriggered="only when any condition becomes true"
|
||||
AdvSceneSwitcher.macroTab.defaultname="Macro %1"
|
||||
AdvSceneSwitcher.macroTab.defaultGroupName="Group %1"
|
||||
AdvSceneSwitcher.macroTab.macroNameExists="The name \"%1\" is already used by a macro."
|
||||
|
|
@ -276,6 +286,13 @@ AdvSceneSwitcher.macroTab.tooltip.elseActionUpButton="Move selected action up in
|
|||
AdvSceneSwitcher.macroTab.tooltip.elseActionDownButton="Move selected action down in the else section"
|
||||
AdvSceneSwitcher.macroTab.tooltip.elseActionBottomButton="Move selected action to the bottom in the else section"
|
||||
AdvSceneSwitcher.macroTab.tooltip.openMacroSettingsButton="Open macro settings"
|
||||
AdvSceneSwitcher.macroTab.search.placeholder="Search ..."
|
||||
AdvSceneSwitcher.macroTab.search.showSettings="Show search settings"
|
||||
AdvSceneSwitcher.macroTab.search.name="Name"
|
||||
AdvSceneSwitcher.macroTab.search.allSegments="Segment type"
|
||||
AdvSceneSwitcher.macroTab.search.conditions="Condition type"
|
||||
AdvSceneSwitcher.macroTab.search.actions="Action type"
|
||||
AdvSceneSwitcher.macroTab.search.label="Segment label"
|
||||
|
||||
AdvSceneSwitcher.macroDock.pause="Pause"
|
||||
AdvSceneSwitcher.macroDock.unpause="Unpause"
|
||||
|
|
@ -577,14 +594,6 @@ AdvSceneSwitcher.condition.replay.state.started="Replay buffer started"
|
|||
AdvSceneSwitcher.condition.replay.state.saved="Replay buffer saved"
|
||||
AdvSceneSwitcher.condition.replay.entry="{{state}}"
|
||||
AdvSceneSwitcher.condition.date="Date"
|
||||
AdvSceneSwitcher.condition.date.anyDay="Any day"
|
||||
AdvSceneSwitcher.condition.date.monday="Monday"
|
||||
AdvSceneSwitcher.condition.date.tuesday="Tuesday"
|
||||
AdvSceneSwitcher.condition.date.wednesday="Wednesday"
|
||||
AdvSceneSwitcher.condition.date.thursday="Thursday"
|
||||
AdvSceneSwitcher.condition.date.friday="Friday"
|
||||
AdvSceneSwitcher.condition.date.saturday="Saturday"
|
||||
AdvSceneSwitcher.condition.date.sunday="Sunday"
|
||||
AdvSceneSwitcher.condition.date.state.at="At"
|
||||
AdvSceneSwitcher.condition.date.state.after="After"
|
||||
AdvSceneSwitcher.condition.date.state.before="Before"
|
||||
|
|
@ -595,12 +604,13 @@ AdvSceneSwitcher.condition.date.ignoreDate="If unchecked the date component will
|
|||
AdvSceneSwitcher.condition.date.ignoreTime="If unchecked the time component will be ignored"
|
||||
AdvSceneSwitcher.condition.date.showAdvancedSettings="Show advanced settings"
|
||||
AdvSceneSwitcher.condition.date.showSimpleSettings="Show simple settings"
|
||||
AdvSceneSwitcher.condition.date.entry.simple="On{{dayOfWeek}}{{weekCondition}}{{ignoreWeekTime}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.entry.advanced="{{condition}}{{ignoreDate}}{{date}}{{ignoreTime}}{{time}}{{separator}}{{date2}}{{time2}}"
|
||||
AdvSceneSwitcher.condition.date.entry.repeat="{{repeat}}Repeat every{{duration}}on date match"
|
||||
AdvSceneSwitcher.condition.date.entry.pattern="Current date \"{{currentDate}}\" matches pattern{{pattern}}"
|
||||
AdvSceneSwitcher.condition.date.entry.nextMatchDate="Next match at: %1"
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}}On repeat update selected date to repeat date"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.day="On{{dayOfWeek}}"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.time="{{ignoreWeekTime}}{{weekCondition}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.layout.advanced="{{condition}}{{ignoreDate}}{{date}}{{ignoreTime}}{{time}}{{separator}}{{date2}}{{time2}}"
|
||||
AdvSceneSwitcher.condition.date.layout.repeat="{{repeat}}Repeat every{{duration}}on date match"
|
||||
AdvSceneSwitcher.condition.date.layout.pattern="Current date \"{{currentDate}}\" matches pattern{{pattern}}"
|
||||
AdvSceneSwitcher.condition.date.layout.nextMatchDate="Next match at: %1"
|
||||
AdvSceneSwitcher.condition.date.layout.updateOnRepeat="{{updateOnRepeat}}On repeat update selected date to repeat date"
|
||||
AdvSceneSwitcher.condition.sceneTransform="Scene item transform"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="Get transform"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getCurrentValue="Get current value"
|
||||
|
|
@ -906,7 +916,9 @@ AdvSceneSwitcher.action.sceneVisibility.type.hide="Hide"
|
|||
AdvSceneSwitcher.action.sceneVisibility.type.toggle="Toggle"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.source="Source"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.sourceGroup="Any"
|
||||
AdvSceneSwitcher.action.sceneVisibility.entry="On{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneVisibility.layout="On{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneVisibility.layout.transition="{{updateTransition}}Set transition to{{transitions}}"
|
||||
AdvSceneSwitcher.action.sceneVisibility.layout.duration="{{updateDuration}}Set transition duration to{{duration}}seconds"
|
||||
AdvSceneSwitcher.action.filter="Filter"
|
||||
AdvSceneSwitcher.action.filter.type.enable="Enable"
|
||||
AdvSceneSwitcher.action.filter.type.disable="Disable"
|
||||
|
|
@ -937,6 +949,8 @@ AdvSceneSwitcher.action.source.type.openPropertiesDialog="Open properties dialog
|
|||
AdvSceneSwitcher.action.source.type.closeInteractionDialog="Close interaction dialog"
|
||||
AdvSceneSwitcher.action.source.type.closeFilterDialog="Close filter dialog"
|
||||
AdvSceneSwitcher.action.source.type.closePropertiesDialog="Close properties dialog"
|
||||
AdvSceneSwitcher.action.source.type.getSetting="Get setting value"
|
||||
AdvSceneSwitcher.action.source.type.getSettings="Get settings JSON"
|
||||
AdvSceneSwitcher.action.source.entry="{{actions}}{{sources}}{{settingsButtons}}{{deinterlaceMode}}{{deinterlaceOrder}}{{refresh}}"
|
||||
AdvSceneSwitcher.action.source.entry.settings="{{settings}}{{settingsInputMethod}}{{settingValue}}{{tempVar}}"
|
||||
AdvSceneSwitcher.action.source.warning="Warning: Enabling and disabling sources globally cannot be controlled by the OBS UI\nYou might be looking for \"Scene item visibility\""
|
||||
|
|
@ -1182,6 +1196,8 @@ AdvSceneSwitcher.action.variable.type.swapValues="Swap variable values"
|
|||
AdvSceneSwitcher.action.variable.type.trim="Trim whitespace"
|
||||
AdvSceneSwitcher.action.variable.type.changeCase="Change case"
|
||||
AdvSceneSwitcher.action.variable.type.randomNumber="Generate random number"
|
||||
AdvSceneSwitcher.action.variable.type.randomListValue="Select random value"
|
||||
AdvSceneSwitcher.action.variable.type.allowRepeat="Allow repeat values"
|
||||
AdvSceneSwitcher.action.variable.case.type.lowerCase="lowercase"
|
||||
AdvSceneSwitcher.action.variable.case.type.upperCase="UPPERCASE"
|
||||
AdvSceneSwitcher.action.variable.case.type.capitalized="Capitalized"
|
||||
|
|
@ -1204,8 +1220,8 @@ AdvSceneSwitcher.action.variable.currentSegmentValue="Current value:"
|
|||
AdvSceneSwitcher.action.variable.layout.other="{{actions}}{{variables}}{{variables2}}{{strValue}}{{numValue}}{{segmentIndex}}{{mathExpression}}{{envVariableName}}{{scenes}}{{tempVars}}{{tempVarsHelp}}{{sceneItemIndex}}{{direction}}{{stringLength}}{{paddingCharSelection}}{{caseType}}{{jsonQuery}}{{jsonQueryHelp}}{{jsonIndex}}"
|
||||
AdvSceneSwitcher.action.variable.layout.pad="{{actions}}of{{variables}}to length{{stringLength}}by adding{{paddingCharSelection}}to the{{direction}}"
|
||||
AdvSceneSwitcher.action.variable.layout.truncate="{{actions}}of{{variables}}to length{{stringLength}}by removing characters from the{{direction}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringIndex="Substring start:{{subStringStart}}Substring size:{{subStringSize}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringRegex="Assign value of{{regexMatchIdx}}match using regular expression:"
|
||||
AdvSceneSwitcher.action.variable.layout.substringIndex="Substring start:{{subStringStart}}Substring size:{{subStringSize}}{{subStringRegex}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringRegex="Assign value of{{regexMatchIdx}}match using regular expression:{{subStringRegex}}"
|
||||
AdvSceneSwitcher.action.variable.layout.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
||||
AdvSceneSwitcher.action.variable.layout.userInput.customPrompt="{{useCustomPrompt}}Use custom prompt{{inputPrompt}}"
|
||||
AdvSceneSwitcher.action.variable.layout.userInput.placeholder="{{useInputPlaceholder}}Fill with placeholder{{inputPlaceholder}}"
|
||||
|
|
@ -1239,21 +1255,52 @@ AdvSceneSwitcher.action.twitch.type.channel.info.category.set="Set stream catego
|
|||
AdvSceneSwitcher.action.twitch.type.channel.info.tags.set="Set stream tags"
|
||||
AdvSceneSwitcher.action.twitch.type.channel.info.language.set="Set stream language"
|
||||
AdvSceneSwitcher.action.twitch.type.raid.start="Start raid"
|
||||
AdvSceneSwitcher.action.twitch.type.raid.end="Cancel raid"
|
||||
AdvSceneSwitcher.action.twitch.type.shoutout.send="Send shoutout"
|
||||
AdvSceneSwitcher.action.twitch.type.shieldMode.start="Enable shield mode"
|
||||
AdvSceneSwitcher.action.twitch.type.shieldMode.end="Disable shield mode"
|
||||
AdvSceneSwitcher.action.twitch.type.commercial.start="Start commercial"
|
||||
AdvSceneSwitcher.action.twitch.type.commercial.snooze="Snooze next ad"
|
||||
AdvSceneSwitcher.action.twitch.type.marker.create="Create stream marker"
|
||||
AdvSceneSwitcher.action.twitch.type.clip.create="Create stream clip"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.announcement.send="Send chat announcement"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.enable="Enable chat's emote-only mode"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.disable="Disable chat's emote-only mode"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.followerOnly.enable="Enable chat's follower-only mode"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.followerOnly.disable="Disable chat's follower-only mode"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.subscriberOnly.enable="Enable chat's subscriber-only mode"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.subscriberOnly.disable="Disable chat's subscriber-only mode"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.slowMode.enable="Enable chat's slow mode"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.slowMode.disable="Disable chat's slow mode"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.nonModeratorDelay.enable="Enable chat's non-moderator message delay"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.nonModeratorDelay.disable="Disable chat's non-moderator message delay"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.uniqueMode.enable="Enable chat's unique message mode"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.uniqueMode.disable="Disable chat's unique message mode"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.sendMessage="Send chat message"
|
||||
AdvSceneSwitcher.action.twitch.type.user.getInfo="Get user information"
|
||||
AdvSceneSwitcher.action.twitch.type.user.ban="Ban user"
|
||||
AdvSceneSwitcher.action.twitch.type.user.unban="Unban user"
|
||||
AdvSceneSwitcher.action.twitch.type.user.block="Block user"
|
||||
AdvSceneSwitcher.action.twitch.type.user.unblock="Unblock user"
|
||||
AdvSceneSwitcher.action.twitch.type.user.moderator.add="Add user as moderator"
|
||||
AdvSceneSwitcher.action.twitch.type.user.moderator.delete="Remove user as moderator"
|
||||
AdvSceneSwitcher.action.twitch.type.user.vip.add="Add user as VIP"
|
||||
AdvSceneSwitcher.action.twitch.type.user.vip.delete="Remove user as VIP"
|
||||
AdvSceneSwitcher.action.twitch.type.reward.getInfo="Get channel points reward information"
|
||||
AdvSceneSwitcher.action.twitch.type.channel.getInfo="Get channel information"
|
||||
AdvSceneSwitcher.action.twitch.reward.toggleControl="Toggle reward name / variable selection control"
|
||||
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Cannot select category without selecting a Twitch account first!"
|
||||
AdvSceneSwitcher.action.twitch.entry.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
|
||||
AdvSceneSwitcher.action.twitch.entry.chat="Using account{{account}}{{actions}}on{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.entry.user.getInfo="Using account{{account}}{{actions}}for{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
||||
AdvSceneSwitcher.action.twitch.entry.reward.getInfo="Using account{{account}}{{actions}}for channel{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{nonModDelayDuration}}{{channel}}{{pointsReward}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.chat="Using account{{account}}{{actions}}on{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.channel.getInfo="Using account{{account}}{{actions}}of{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.getInfo.row1="Using account{{account}}{{actions}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.getInfo.row2="for{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.moderation.row1="Using account{{account}}{{actions}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.moderation.row2="on channel{{channel}}for{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.ban.row1="Using account{{account}}{{actions}}timeout{{duration}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.ban.row2="on channel{{channel}}for{{userInfoQueryType}}{{userLogin}}{{userId}}reason{{banReason}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.reward.getInfo.row1="Using account{{account}}{{actions}}for channel{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.reward.getInfo.row2="{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
|
||||
AdvSceneSwitcher.action.twitch.title.title="Enter title"
|
||||
AdvSceneSwitcher.action.twitch.marker.description="Describe marker"
|
||||
AdvSceneSwitcher.action.twitch.clip.hasDelay="Add a slight delay before capturing the clip"
|
||||
|
|
@ -1274,6 +1321,8 @@ AdvSceneSwitcher.action.twitch.tags.duplicate.info="This tag is already in the l
|
|||
AdvSceneSwitcher.action.twitch.tags.limit="Tag Limit Reached"
|
||||
AdvSceneSwitcher.action.twitch.tags.limit.info="You can only have up to %1 tags."
|
||||
AdvSceneSwitcher.action.twitch.type.channel.info.contentClassification.set="Set content classification labels"
|
||||
AdvSceneSwitcher.action.twitch.type.channel.info.brandedContent.enable="Enable branded content"
|
||||
AdvSceneSwitcher.action.twitch.type.channel.info.brandedContent.disable="Disable branded content"
|
||||
AdvSceneSwitcher.action.twitch.contentClassification.debatedSocialIssuesAndPolitics="Discussions or debates about politics or sensitive social issues such as elections, civic integrity, military conflict, and civil rights."
|
||||
AdvSceneSwitcher.action.twitch.contentClassification.drugsIntoxication="Excessive tobacco glorification or promotion, any marijuana consumption/use, legal drug and alcohol induced intoxication, discussions of illegal drugs."
|
||||
AdvSceneSwitcher.action.twitch.contentClassification.sexualThemes="Content that focuses on sexualized activities, sexual topics, or experiences."
|
||||
|
|
@ -1378,6 +1427,8 @@ AdvSceneSwitcher.hotkey.macro.segment.remove="Remove selected macro segment"
|
|||
AdvSceneSwitcher.askBackup="Detected a new version of the Advanced Scene Switcher.\nShould a backup of the old settings be created?"
|
||||
AdvSceneSwitcher.askForMacro="Select macro{{macroSelection}}"
|
||||
|
||||
AdvSceneSwitcher.crashDetected="OBS did not shut down cleanly (for example, due to a crash or freeze).\n\nThe Advanced Scene Switcher plugin would normally start automatically.\nWould you like to keep it stopped for now?"
|
||||
|
||||
AdvSceneSwitcher.close="Close"
|
||||
AdvSceneSwitcher.browse="Browse"
|
||||
|
||||
|
|
@ -1607,7 +1658,11 @@ AdvSceneSwitcher.twitchToken.moderator.chat.settings.manage="Manage channel's ch
|
|||
AdvSceneSwitcher.twitchToken.user.whispers.manage="Manage user's whispers."
|
||||
AdvSceneSwitcher.twitchToken.chat.read="View live stream chat messages."
|
||||
AdvSceneSwitcher.twitchToken.chat.edit="Send live stream chat messages."
|
||||
AdvSceneSwitcher.twitchToken.validateTimestamps="Validate timestamps of received Twitch event messages. (Recommended)"
|
||||
AdvSceneSwitcher.twitchToken.validateTimestamps="Validate timestamps of received Twitch event messages."
|
||||
AdvSceneSwitcher.twitchToken.validateTimestamps.tooltip="Verifies that incoming Twitch messages have valid timestamps to prevent replayed or spoofed messages.\nDisabling this won’t affect normal functionality, and you can try turning it off if you experience issues with the Twitch connection."
|
||||
AdvSceneSwitcher.twitchToken.warnIfInvalid="Display warning if the token expired or is invalid."
|
||||
AdvSceneSwitcher.twitchToken.warnIfInvalid.doNotShowAgain="Don't show again for this connection"
|
||||
AdvSceneSwitcher.twitchToken.warnIfInvalid.message="The Twitch connection \"%1\" is invalid.\nOpen connection settings or ignore?"
|
||||
|
||||
AdvSceneSwitcher.twitch.selection.channel.open="Open channel"
|
||||
AdvSceneSwitcher.twitch.selection.channel.open.tooltip.details="Open channel in external application handling the HTTPS protocol."
|
||||
|
|
@ -2133,6 +2188,8 @@ AdvSceneSwitcher.tempVar.window.window="Window title"
|
|||
AdvSceneSwitcher.tempVar.window.window.description="The window title of the matching window."
|
||||
AdvSceneSwitcher.tempVar.window.windowClass="Window class"
|
||||
AdvSceneSwitcher.tempVar.window.windowClass.description="The window class of the matching window."
|
||||
AdvSceneSwitcher.tempVar.window.windowText="Window text"
|
||||
AdvSceneSwitcher.tempVar.window.windowText.description="Text contained within the window (won't work on all window types)."
|
||||
|
||||
AdvSceneSwitcher.tempVar.timer.seconds="Seconds"
|
||||
AdvSceneSwitcher.tempVar.timer.minutes="Minutes"
|
||||
|
|
@ -2174,7 +2231,11 @@ AdvSceneSwitcher.tempVar.run.process.none.description="When not waiting for the
|
|||
|
||||
AdvSceneSwitcher.tempVar.recording.durationSeconds="Recording duration"
|
||||
AdvSceneSwitcher.tempVar.recording.durationSeconds.description="Recording duration in seconds.\nThis value does not change while the recording is paused and will be reset to zero if the recording is stopped."
|
||||
AdvSceneSwitcher.tempVar.recording.lastSavePath="Last save path"
|
||||
AdvSceneSwitcher.tempVar.recording.lastSavePath.description="The file path of the last saved recording."
|
||||
|
||||
AdvSceneSwitcher.tempVar.video.similarity="Similarity Rating"
|
||||
AdvSceneSwitcher.tempVar.video.similarity.description="Values range from 0 to 1, where 0 means dissimilar and 1 means highly similar."
|
||||
AdvSceneSwitcher.tempVar.video.patternCount="Pattern count"
|
||||
AdvSceneSwitcher.tempVar.video.patternCount.description="The number of times the given pattern has been found in a given video input frame."
|
||||
AdvSceneSwitcher.tempVar.video.objectCount="Object count"
|
||||
|
|
@ -2326,6 +2387,14 @@ AdvSceneSwitcher.tempVar.cursor.y="Cursor position (Y)"
|
|||
AdvSceneSwitcher.tempVar.replay.lastSavePath="Last save path"
|
||||
AdvSceneSwitcher.tempVar.replay.lastSavePath.description="The file path of the last replay buffer saved."
|
||||
|
||||
AdvSceneSwitcher.tempVar.sequence.macro="Macro"
|
||||
AdvSceneSwitcher.tempVar.sequence.macro.description="The name of the macro executed by the \"Sequence\" action.\nIf no macro was executed the returned value is the empty string."
|
||||
AdvSceneSwitcher.tempVar.sequence.nextMacro="Next Macro"
|
||||
AdvSceneSwitcher.tempVar.sequence.nextMacro.description="The name of the macro which will be executed next after the index was set.\nIf no macro will be executed the returned value is the empty string."
|
||||
|
||||
AdvSceneSwitcher.tempVar.random.macro="Macro"
|
||||
AdvSceneSwitcher.tempVar.random.macro.description="The name of the macro executed by the \"Random\" action.\nIf no macro was executed the returned value is the empty string."
|
||||
|
||||
AdvSceneSwitcher.selectScene="--select scene--"
|
||||
AdvSceneSwitcher.selectCanvas="--select canvas--"
|
||||
AdvSceneSwitcher.selectPreviousScene="Previous Scene"
|
||||
|
|
@ -2415,8 +2484,6 @@ AdvSceneSwitcher.status.inactive="Inactive"
|
|||
AdvSceneSwitcher.running="Plugin running"
|
||||
AdvSceneSwitcher.stopped="Plugin stopped"
|
||||
|
||||
AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>This seems to be the first time the Advanced Scene Switcher was started.<br>Please have a look at the <a href=\"https://github.com/WarmUpTill/SceneSwitcher/wiki\"><span style=\" text-decoration: underline; color:#268bd2;\">Wiki</span></a> for a list of guides and examples.<br>Do not hesitate to ask questions in the plugin's <a href=\"https://obsproject.com/forum/threads/advanced-scene-switcher.48264\"><span style=\" text-decoration: underline; color:#268bd2;\">thread</span></a> on the OBS forums!</p></body></html>"
|
||||
|
||||
AdvSceneSwitcher.deprecatedTabWarning="Development for this tab stopped!\nPlease consider transitioning to using Macros instead.\nThis hint can be disabled on the General tab."
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="milliseconds"
|
||||
|
|
@ -2446,6 +2513,47 @@ AdvSceneSwitcher.clearBufferOnMatch="Clear message buffer when matching message
|
|||
AdvSceneSwitcher.script.settings="Settings"
|
||||
AdvSceneSwitcher.script.timeout="Script timeout:{{timeout}}"
|
||||
|
||||
AdvSceneSwitcher.day.monday="Monday"
|
||||
AdvSceneSwitcher.day.tuesday="Tuesday"
|
||||
AdvSceneSwitcher.day.wednesday="Wednesday"
|
||||
AdvSceneSwitcher.day.thursday="Thursday"
|
||||
AdvSceneSwitcher.day.friday="Friday"
|
||||
AdvSceneSwitcher.day.saturday="Saturday"
|
||||
AdvSceneSwitcher.day.sunday="Sunday"
|
||||
AdvSceneSwitcher.day.none="No day"
|
||||
AdvSceneSwitcher.day.any="Any day"
|
||||
|
||||
# First run wizard
|
||||
FirstRunWizard.windowTitle="Advanced Scene Switcher - Setup Wizard"
|
||||
|
||||
FirstRunWizard.welcome.title="Welcome to Advanced Scene Switcher"
|
||||
FirstRunWizard.welcome.subtitle="Let's create your first automation in a few easy steps."
|
||||
FirstRunWizard.welcome.body="<p>Advanced Scene Switcher lets you build <b>Macros</b> - rules of the form:</p><blockquote><i>When [condition] -> perform [action]</i></blockquote><p>This wizard creates a macro that <b>switches to a chosen OBS scene whenever a specific window comes into focus</b>.</p><p>You can skip at any time. Re-open this wizard later from the <b>General</b> tab inside the Advanced Scene Switcher dialog.</p>"
|
||||
|
||||
FirstRunWizard.scene.title="Choose a Target Scene"
|
||||
FirstRunWizard.scene.subtitle="Which OBS scene should become active when your chosen window comes into focus?"
|
||||
FirstRunWizard.scene.label="Switch to scene:"
|
||||
|
||||
FirstRunWizard.window.title="Choose a Trigger Window"
|
||||
FirstRunWizard.window.subtitle="Enter the title of the window that should trigger the scene switch. Partial matches are fine - \"Firefox\" will match any Firefox window."
|
||||
FirstRunWizard.window.label="Window title contains:"
|
||||
FirstRunWizard.window.placeholder="e.g. \"Firefox\", \"Visual Studio Code\""
|
||||
FirstRunWizard.window.autoDetect="Auto-detect focused window"
|
||||
FirstRunWizard.window.autoDetectTooltip="Click, then switch to the target window. The title will be captured automatically after 3 seconds."
|
||||
FirstRunWizard.window.autoDetectCountdown="Detecting in %1 s - focus your window now..."
|
||||
FirstRunWizard.window.hint="<small>Tip: a short partial title is more robust than the full title, which often changes when you switch tabs.</small>"
|
||||
|
||||
FirstRunWizard.review.title="Review Your Macro"
|
||||
FirstRunWizard.review.subtitle="Click Back to make changes, or Finish to create the macro."
|
||||
FirstRunWizard.review.summary="<b>Macro name:</b> Window -> %1<br><br><b>Condition:</b> Focused window title contains <i>\"%2\"</i> (case-insensitive)<br><br><b>Action:</b> Switch to scene <i>\"%1\"</i>"
|
||||
FirstRunWizard.review.errorTitle="Macro Creation Failed"
|
||||
FirstRunWizard.review.errorBody="The macro could not be created automatically.\n\nYou can create it manually on the Macros tab:\n Condition: Window -> contains \"%1\"\n Action: Switch scene -> \"%2\""
|
||||
|
||||
FirstRunWizard.done.title="You're all set!"
|
||||
FirstRunWizard.done.subtitle="Your first macro has been created and is now active."
|
||||
FirstRunWizard.done.body="<p>You can view and edit it on the <b>Macros</b> tab of the Advanced Scene Switcher dialog.</p><p>To learn more:</p><ul><li><a href=\"https://github.com/WarmUpTill/SceneSwitcher/wiki\">Plugin wiki</a></li><li><a href=\"https://obsproject.com/forum/resources/automatic-scene-switching.395/\">OBS forum thread</a></li></ul>"
|
||||
|
||||
FirstRunWizard.openButton="Open Setup Wizard..."
|
||||
# This secion is copied from the OBS locale files
|
||||
|
||||
# OBS commonly shared locale
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ AdvSceneSwitcher.macroTab.add="Agregar nueva macro"
|
|||
AdvSceneSwitcher.macroTab.name="Nombre:"
|
||||
AdvSceneSwitcher.macroTab.run="Ejecutar macro"
|
||||
AdvSceneSwitcher.macroTab.runInParallel="Ejecutar macro en paralelo a otras macros"
|
||||
AdvSceneSwitcher.macroTab.onChange="Realizar acciones solo en el cambio de condición"
|
||||
AdvSceneSwitcher.macroTab.defaultname="Macro %1"
|
||||
AdvSceneSwitcher.macroTab.copy="Crear copia"
|
||||
AdvSceneSwitcher.macroTab.expandAll="Expandir todo"
|
||||
|
|
@ -241,14 +240,14 @@ AdvSceneSwitcher.condition.replay.state.started="Búfer de reproducción iniciad
|
|||
AdvSceneSwitcher.condition.replay.state.saved="Búfer de reproducción guardado"
|
||||
AdvSceneSwitcher.condition.replay.entry="{{state}}"
|
||||
AdvSceneSwitcher.condition.date="Fecha"
|
||||
AdvSceneSwitcher.condition.date.anyDay="Cualquier día"
|
||||
AdvSceneSwitcher.condition.date.monday="Lunes"
|
||||
AdvSceneSwitcher.condition.date.tuesday="Martes"
|
||||
AdvSceneSwitcher.condition.date.wednesday="Miércoles"
|
||||
AdvSceneSwitcher.condition.date.thursday="Jueves"
|
||||
AdvSceneSwitcher.condition.date.friday="Viernes"
|
||||
AdvSceneSwitcher.condition.date.saturday="Sábado"
|
||||
AdvSceneSwitcher.condition.date.sunday="Domingo"
|
||||
AdvSceneSwitcher.day.any="Cualquier día"
|
||||
AdvSceneSwitcher.day.monday="Lunes"
|
||||
AdvSceneSwitcher.day.tuesday="Martes"
|
||||
AdvSceneSwitcher.day.wednesday="Miércoles"
|
||||
AdvSceneSwitcher.day.thursday="Jueves"
|
||||
AdvSceneSwitcher.day.friday="Viernes"
|
||||
AdvSceneSwitcher.day.saturday="Sábado"
|
||||
AdvSceneSwitcher.day.sunday="Domingo"
|
||||
AdvSceneSwitcher.condition.date.state.at="A las"
|
||||
AdvSceneSwitcher.condition.date.state.after="Después"
|
||||
AdvSceneSwitcher.condition.date.state.before="Antes"
|
||||
|
|
@ -258,11 +257,12 @@ AdvSceneSwitcher.condition.date.ignoreDate="Si no se marca, se ignorará el comp
|
|||
AdvSceneSwitcher.condition.date.ignoreTime="Si no se marca, se ignorará el componente de tiempo"
|
||||
AdvSceneSwitcher.condition.date.showAdvancedSettings="Mostrar configuración avanzada"
|
||||
AdvSceneSwitcher.condition.date.showSimpleSettings="Mostrar configuración simple"
|
||||
AdvSceneSwitcher.condition.date.entry.simple="El {{dayOfWeek}} {{weekCondition}} {{ignoreWeekTime}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.entry.advanced="{{condition}} {{ignoreDate}}{{date}} {{ignoreTime}}{{time}} {{separator}} {{date2}} {{time2}}"
|
||||
AdvSceneSwitcher.condition.date.entry.repeat="{{repeat}} Repetir cada {{duration}} en la coincidencia de fechas"
|
||||
AdvSceneSwitcher.condition.date.entry.nextMatchDate="Próxima coincidencia en: %1"
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}} Al repetir actualizar la fecha seleccionada para repetir la fecha"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.day="El{{dayOfWeek}}"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.time="{{ignoreWeekTime}}{{weekCondition}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.layout.advanced="{{condition}} {{ignoreDate}}{{date}} {{ignoreTime}}{{time}} {{separator}} {{date2}} {{time2}}"
|
||||
AdvSceneSwitcher.condition.date.layout.repeat="{{repeat}} Repetir cada {{duration}} en la coincidencia de fechas"
|
||||
AdvSceneSwitcher.condition.date.layout.nextMatchDate="Próxima coincidencia en: %1"
|
||||
AdvSceneSwitcher.condition.date.layout.updateOnRepeat="{{updateOnRepeat}} Al repetir actualizar la fecha seleccionada para repetir la fecha"
|
||||
AdvSceneSwitcher.condition.sceneTransform="Transformar elemento de escena"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="Obtener transformación"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.match="coincide con la transformación"
|
||||
|
|
@ -350,7 +350,7 @@ AdvSceneSwitcher.action.sceneVisibility.type.show="Mostrar"
|
|||
AdvSceneSwitcher.action.sceneVisibility.type.hide="Ocultar"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.source="Fuente"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.sourceGroup="Cualquiera"
|
||||
AdvSceneSwitcher.action.sceneVisibility.entry="En{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneVisibility.layout="En{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.filter="Filtro"
|
||||
AdvSceneSwitcher.action.filter.type.enable="Habilitar"
|
||||
AdvSceneSwitcher.action.filter.type.disable="Deshabilitar"
|
||||
|
|
@ -680,8 +680,6 @@ AdvSceneSwitcher.status.inactive="Inactivo"
|
|||
AdvSceneSwitcher.running="Iniciar complemento"
|
||||
AdvSceneSwitcher.stopped="Complemento de detención"
|
||||
|
||||
AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>Esta parece ser la primera vez que se inicia el conmutador de escena avanzado.<br>Por favor, eche un vistazo a <a href=\"https:/ /github.com/WarmUpTill/SceneSwitcher/wiki\"><span style=\" text-decoration: underline; color:#268bd2;\">Wiki</span></a> para obtener una lista de guías y ejemplos.<br>No dude en hacer preguntas en el complemento <a href=\"https://obsproject.com /forum/threads/advanced-scene-switcher.48264\"><span style=\" text-decoration: underline; color:#268bd2;\">hilo</span></a> en los foros de OBS!</p></body></html>"
|
||||
|
||||
AdvSceneSwitcher.deprecatedTabWarning="¡Se detuvo el desarrollo de esta pestaña!\nConsidere cambiar a macros en su lugar.\nEsta sugerencia se puede desactivar en la pestaña General".
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="milisegundos"
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ AdvSceneSwitcher.macroTab.add="Ajouter une nouvelle macro"
|
|||
AdvSceneSwitcher.macroTab.name="Nom :"
|
||||
AdvSceneSwitcher.macroTab.run="Exécuter la macro"
|
||||
AdvSceneSwitcher.macroTab.runInParallel="Exécuter la macro en parallèle avec d'autres macros"
|
||||
AdvSceneSwitcher.macroTab.onChange="Exécuter des actions uniquement en cas de changement de condition"
|
||||
AdvSceneSwitcher.macroTab.defaultname="Macro %1"
|
||||
AdvSceneSwitcher.macroTab.defaultGroupName="Groupe %1"
|
||||
AdvSceneSwitcher.macroTab.removeSingleMacroPopup.text="Êtes-vous sûr de vouloir supprimer \"%1\" ?"
|
||||
|
|
@ -356,14 +355,14 @@ AdvSceneSwitcher.condition.replay.state.stopped="Tampon de répétition arrêté
|
|||
AdvSceneSwitcher.condition.replay.state.started="Tampon de répétition démarré"
|
||||
AdvSceneSwitcher.condition.replay.state.saved="Tampon de répétition enregistré"
|
||||
AdvSceneSwitcher.condition.date="Date"
|
||||
AdvSceneSwitcher.condition.date.anyDay="N'importe quel jour"
|
||||
AdvSceneSwitcher.condition.date.monday="Lundi"
|
||||
AdvSceneSwitcher.condition.date.tuesday="Mardi"
|
||||
AdvSceneSwitcher.condition.date.wednesday="Mercredi"
|
||||
AdvSceneSwitcher.condition.date.thursday="Jeudi"
|
||||
AdvSceneSwitcher.condition.date.friday="Vendredi"
|
||||
AdvSceneSwitcher.condition.date.saturday="Samedi"
|
||||
AdvSceneSwitcher.condition.date.sunday="Dimanche"
|
||||
AdvSceneSwitcher.day.any="N'importe quel jour"
|
||||
AdvSceneSwitcher.day.monday="Lundi"
|
||||
AdvSceneSwitcher.day.tuesday="Mardi"
|
||||
AdvSceneSwitcher.day.wednesday="Mercredi"
|
||||
AdvSceneSwitcher.day.thursday="Jeudi"
|
||||
AdvSceneSwitcher.day.friday="Vendredi"
|
||||
AdvSceneSwitcher.day.saturday="Samedi"
|
||||
AdvSceneSwitcher.day.sunday="Dimanche"
|
||||
AdvSceneSwitcher.condition.date.state.at="À"
|
||||
AdvSceneSwitcher.condition.date.state.after="Après"
|
||||
AdvSceneSwitcher.condition.date.state.before="Avant"
|
||||
|
|
@ -374,11 +373,12 @@ AdvSceneSwitcher.condition.date.ignoreDate="Si non cochée, la composante date s
|
|||
AdvSceneSwitcher.condition.date.ignoreTime="Si non cochée, la composante heure sera ignorée"
|
||||
AdvSceneSwitcher.condition.date.showAdvancedSettings="Afficher les paramètres avancés"
|
||||
AdvSceneSwitcher.condition.date.showSimpleSettings="Afficher les paramètres simples"
|
||||
AdvSceneSwitcher.condition.date.entry.simple="Le{{dayOfWeek}}{{weekCondition}}{{ignoreWeekTime}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.entry.repeat="{{repeat}}Répéter toutes les{{duration}}lorsque la date correspond"
|
||||
AdvSceneSwitcher.condition.date.entry.pattern="La date actuelle \"{{currentDate}}\" correspond au motif{{pattern}}"
|
||||
AdvSceneSwitcher.condition.date.entry.nextMatchDate="Prochaine correspondance à : %1"
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}}À la répétition, mettre à jour la date sélectionnée pour la date de répétition"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.day="Le{{dayOfWeek}}"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.time="{{ignoreWeekTime}}{{weekCondition}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.layout.repeat="{{repeat}}Répéter toutes les{{duration}}lorsque la date correspond"
|
||||
AdvSceneSwitcher.condition.date.layout.pattern="La date actuelle \"{{currentDate}}\" correspond au motif{{pattern}}"
|
||||
AdvSceneSwitcher.condition.date.layout.nextMatchDate="Prochaine correspondance à : %1"
|
||||
AdvSceneSwitcher.condition.date.layout.updateOnRepeat="{{updateOnRepeat}}À la répétition, mettre à jour la date sélectionnée pour la date de répétition"
|
||||
AdvSceneSwitcher.condition.sceneTransform="Transformation de l'élément de la scène"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="Obtenir la transformation"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.match="correspond à la transformation"
|
||||
|
|
@ -510,7 +510,7 @@ AdvSceneSwitcher.action.sceneVisibility.type.hide="Masquer"
|
|||
AdvSceneSwitcher.action.sceneVisibility.type.toggle="Basculer"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.source="Source"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.sourceGroup="N'importe"
|
||||
AdvSceneSwitcher.action.sceneVisibility.entry="Sur{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneVisibility.layout="Sur{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.filter="Filtre"
|
||||
AdvSceneSwitcher.action.filter.type.enable="Activer"
|
||||
AdvSceneSwitcher.action.filter.type.disable="Désactiver"
|
||||
|
|
@ -701,8 +701,8 @@ AdvSceneSwitcher.action.variable.invalidSelection="Sélection invalide !"
|
|||
AdvSceneSwitcher.action.variable.actionNoVariableSupport="La récupération de valeurs de variables à partir d'actions %1 n'est pas prise en charge !"
|
||||
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="La récupération de valeurs de variables à partir de conditions %1 n'est pas prise en charge !"
|
||||
AdvSceneSwitcher.action.variable.currentSegmentValue="Valeur actuelle :"
|
||||
AdvSceneSwitcher.action.variable.layout.substringIndex="Début de la sous-chaîne :{{subStringStart}}Taille de la sous-chaîne :{{subStringSize}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringRegex="Attribuer la valeur du match{{regexMatchIdx}}en utilisant une expression régulière :"
|
||||
AdvSceneSwitcher.action.variable.layout.substringIndex="Début de la sous-chaîne :{{subStringStart}}Taille de la sous-chaîne :{{subStringSize}}{{subStringRegex}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringRegex="Attribuer la valeur du match{{regexMatchIdx}}en utilisant une expression régulière:{{subStringRegex}}"
|
||||
AdvSceneSwitcher.action.variable.layout.userInput.customPrompt="{{useCustomPrompt}}Utiliser un message personnalisé{{inputPrompt}}"
|
||||
AdvSceneSwitcher.action.variable.layout.userInput.placeholder="{{useInputPlaceholder}}Remplir avec un indicateur de position{{inputPlaceholder}}"
|
||||
AdvSceneSwitcher.action.projector="Projecteur"
|
||||
|
|
@ -1122,8 +1122,6 @@ AdvSceneSwitcher.status.inactive="Inactif"
|
|||
AdvSceneSwitcher.running="Plugin en cours d'exécution"
|
||||
AdvSceneSwitcher.stopped="Plugin arrêté"
|
||||
|
||||
AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>Il semble que ce soit la première fois que l'Advanced Scene Switcher est démarré.<br>Veuillez consulter le <a href=\"https://github.com/WarmUpTill/SceneSwitcher/wiki\"><span style=\" text-decoration: underline; color:#268bd2;\">Wiki</span></a> pour obtenir une liste de guides et d'exemples.<br>N'hésitez pas à poser des questions dans le <a href=\"https://obsproject.com/forum/threads/advanced-scene-switcher.48264\"><span style=\" text-decoration: underline; color:#268bd2;\">fil de discussion</span></a> du plugin sur les forums OBS !</p></body></html>"
|
||||
|
||||
AdvSceneSwitcher.deprecatedTabWarning="Le développement de cet onglet est terminé !\nVeuillez envisager de passer à l'utilisation des Macros à la place.\nCette astuce peut être désactivée dans l'onglet Général."
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="millisecondes"
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailure="プラグイ
|
|||
AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailureMessage="<html><body>次のプラグイン ライブラリの読み込みに失敗したため、一部の高機能シーンスイッチャーが利用できなくなる可能性があります:%1詳細については、OBS ログを確認してください。<br>このメッセージは、[全般] タブで無効にすることができます。 </body></html>"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.warnCorruptedInstallMessage="プラグインが正しくインストールできておらずクラッシュする可能性があります!\nプラグインが正しくインストールされているか確認してください!"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.hideLegacyTabs="旧来型マクロ設定のタブを非表示にする(廃止予定タブ)"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.disableMacroWidgetCache="マクロウィジェットのキャッシングを無効にする"
|
||||
AdvSceneSwitcher.generalTab.matchBehavior="マッチした場合の動作(廃止予定の設定項目)"
|
||||
AdvSceneSwitcher.generalTab.priority="優先順位"
|
||||
AdvSceneSwitcher.generalTab.priority.description="切り替え方法の優先順位(優先順位が高いものが上)"
|
||||
|
|
@ -165,7 +164,6 @@ AdvSceneSwitcher.macroTab.run.tooltip="条件に関係なくすべてのマク
|
|||
AdvSceneSwitcher.macroTab.runElse="マクロ実行(else)"
|
||||
AdvSceneSwitcher.macroTab.runFail="\"%1\" の実行に失敗しました!\nいずれかのアクションが失敗したか、マクロがすでに実行されています。\n停止しますか?"
|
||||
AdvSceneSwitcher.macroTab.runInParallel="他のマクロと並行してマクロを実行する"
|
||||
AdvSceneSwitcher.macroTab.onChange="条件変更時のみアクションを実行"
|
||||
AdvSceneSwitcher.macroTab.defaultname="マクロ %1"
|
||||
AdvSceneSwitcher.macroTab.defaultGroupName="グループ %1"
|
||||
AdvSceneSwitcher.macroTab.macroNameExists="名前 \"%1\" は既にマクロで使用されています。"
|
||||
|
|
@ -556,14 +554,14 @@ AdvSceneSwitcher.condition.replay.state.started="リプレイバッファを開
|
|||
AdvSceneSwitcher.condition.replay.state.saved="リプレイバッファを保存"
|
||||
; AdvSceneSwitcher.condition.replay.entry="{{state}}"
|
||||
AdvSceneSwitcher.condition.date="日付条件"
|
||||
AdvSceneSwitcher.condition.date.anyDay="いつでも"
|
||||
AdvSceneSwitcher.condition.date.monday="月曜日"
|
||||
AdvSceneSwitcher.condition.date.tuesday="火曜日"
|
||||
AdvSceneSwitcher.condition.date.wednesday="水曜日"
|
||||
AdvSceneSwitcher.condition.date.thursday="木曜日"
|
||||
AdvSceneSwitcher.condition.date.friday="金曜日"
|
||||
AdvSceneSwitcher.condition.date.saturday="土曜日"
|
||||
AdvSceneSwitcher.condition.date.sunday="日曜日"
|
||||
AdvSceneSwitcher.day.any="いつでも"
|
||||
AdvSceneSwitcher.day.monday="月曜日"
|
||||
AdvSceneSwitcher.day.tuesday="火曜日"
|
||||
AdvSceneSwitcher.day.wednesday="水曜日"
|
||||
AdvSceneSwitcher.day.thursday="木曜日"
|
||||
AdvSceneSwitcher.day.friday="金曜日"
|
||||
AdvSceneSwitcher.day.saturday="土曜日"
|
||||
AdvSceneSwitcher.day.sunday="日曜日"
|
||||
; AdvSceneSwitcher.condition.date.state.at="At"
|
||||
AdvSceneSwitcher.condition.date.state.after="アフター"
|
||||
AdvSceneSwitcher.condition.date.state.before="前"
|
||||
|
|
@ -574,12 +572,9 @@ AdvSceneSwitcher.condition.date.ignoreDate="チェックを外すと日付部分
|
|||
AdvSceneSwitcher.condition.date.ignoreTime="チェックを外すと時間要素は無視されます"
|
||||
AdvSceneSwitcher.condition.date.showAdvancedSettings="詳細設定を表示"
|
||||
AdvSceneSwitcher.condition.date.showSimpleSettings="簡単設定を表示"
|
||||
; AdvSceneSwitcher.condition.date.entry.simple="On{{dayOfWeek}}{{weekCondition}}{{ignoreWeekTime}}{{weekTime}}"
|
||||
; AdvSceneSwitcher.condition.date.entry.advanced="{{condition}}{{ignoreDate}}{{date}}{{ignoreTime}}{{time}}{{separator}}{{date2}}{{time2}}"
|
||||
AdvSceneSwitcher.condition.date.entry.repeat="{{repeat}}日付の一致ごとに{{duration}}繰り返します"
|
||||
AdvSceneSwitcher.condition.date.entry.pattern="現在の日付「{{currentDate}}」はパターン{{pattern}}と一致します"
|
||||
; AdvSceneSwitcher.condition.date.entry.nextMatchDate="Next match at: %1"
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}}繰り返しの場合、選択した日付を繰り返しの日付に更新します"
|
||||
AdvSceneSwitcher.condition.date.layout.repeat="{{repeat}}日付の一致ごとに{{duration}}繰り返します"
|
||||
AdvSceneSwitcher.condition.date.layout.pattern="現在の日付「{{currentDate}}」はパターン{{pattern}}と一致します"
|
||||
AdvSceneSwitcher.condition.date.layout.updateOnRepeat="{{updateOnRepeat}}繰り返しの場合、選択した日付を繰り返しの日付に更新します"
|
||||
; AdvSceneSwitcher.condition.sceneTransform="Scene item transform"
|
||||
; AdvSceneSwitcher.condition.sceneTransform.getTransform="Get transform"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getCurrentValue="現在の値を取得"
|
||||
|
|
@ -871,7 +866,6 @@ AdvSceneSwitcher.action.sceneVisibility.type.hide="非表示"
|
|||
AdvSceneSwitcher.action.sceneVisibility.type.toggle="切り替え"
|
||||
; AdvSceneSwitcher.action.sceneVisibility.type.source="Source"
|
||||
; AdvSceneSwitcher.action.sceneVisibility.type.sourceGroup="Any"
|
||||
; AdvSceneSwitcher.action.sceneVisibility.entry="On{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.filter="フィルタ"
|
||||
AdvSceneSwitcher.action.filter.type.enable="有効にする"
|
||||
AdvSceneSwitcher.action.filter.type.disable="無効化"
|
||||
|
|
@ -1150,8 +1144,8 @@ AdvSceneSwitcher.action.variable.currentSegmentValue="現在値:"
|
|||
; AdvSceneSwitcher.action.variable.layout.other="{{actions}}{{variables}}{{variables2}}{{strValue}}{{numValue}}{{segmentIndex}}{{mathExpression}}{{envVariableName}}{{scenes}}{{tempVars}}{{tempVarsHelp}}{{sceneItemIndex}}{{direction}}{{stringLength}}{{paddingCharSelection}}"
|
||||
AdvSceneSwitcher.action.variable.layout.pad="{{actions}}の{{variables}}の長さを{{stringLength}}にするには、{{paddingCharSelection}}を{{direction}}に追加します。"
|
||||
AdvSceneSwitcher.action.variable.layout.truncate="{{actions}}の{{variables}}の長さを{{stringLength}}にするには、{{direction}}から文字を削除します。"
|
||||
AdvSceneSwitcher.action.variable.layout.substringIndex="部分文字列の開始:{{subStringStart}}部分文字列のサイズ:{{subStringSize}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringRegex="正規表現を使用して{{regexMatchIdx}}一致の値を割り当てます:"
|
||||
AdvSceneSwitcher.action.variable.layout.substringIndex="部分文字列の開始:{{subStringStart}}部分文字列のサイズ:{{subStringSize}}{{subStringRegex}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringRegex="正規表現を使用して{{regexMatchIdx}}一致の値を割り当てます:{{subStringRegex}}"
|
||||
; AdvSceneSwitcher.action.variable.layout.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
||||
AdvSceneSwitcher.action.variable.layout.userInput.customPrompt="{{useCustomPrompt}}カスタム プロンプトを使用する{{inputPrompt}}"
|
||||
AdvSceneSwitcher.action.variable.layout.userInput.placeholder="{{useInputPlaceholder}}プレースホルダーを入力{{inputPlaceholder}}"
|
||||
|
|
@ -1194,10 +1188,17 @@ AdvSceneSwitcher.action.twitch.type.user.getInfo="ユーザー情報を取得"
|
|||
AdvSceneSwitcher.action.twitch.type.reward.getInfo="チャンネルポイントリワード情報を取得"
|
||||
AdvSceneSwitcher.action.twitch.reward.toggleControl="リワード名/変数選択コントロールの切り替え"
|
||||
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Twitchアカウントを選択しないとカテゴリを選択できません!"
|
||||
; AdvSceneSwitcher.action.twitch.entry.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.entry.chat="{{channel}}でアカウント{{account}}{{actions}}を使用しています"
|
||||
AdvSceneSwitcher.action.twitch.entry.user.getInfo="{{userInfoQueryType}}{{userLogin}}{{userId}}でアカウント{{account}}{{actions}}を使用"
|
||||
AdvSceneSwitcher.action.twitch.entry.reward.getInfo="チャンネル{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}でアカウント{{account}}{{actions}}を使用"
|
||||
; AdvSceneSwitcher.action.twitch.layout.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.chat="{{channel}}でアカウント{{account}}{{actions}}を使用しています"
|
||||
AdvSceneSwitcher.action.twitch.layout.channel.getInfo="チャンネル{{channel}}でアカウント{{account}}{{actions}}を使用"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.getInfo.row1="アカウント{{account}}{{actions}}を使用"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.getInfo.row2="{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.moderation.row1="アカウント{{account}}{{actions}}を使用"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.moderation.row2="チャンネル{{channel}}{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.ban.row1="アカウント{{account}}{{actions}}を使用 タイムアウト{{duration}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.ban.row2="チャンネル{{channel}}{{userInfoQueryType}}{{userLogin}}{{userId}} 理由{{banReason}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.reward.getInfo.row1="チャンネル{{channel}}でアカウント{{account}}{{actions}}を使用"
|
||||
AdvSceneSwitcher.action.twitch.layout.reward.getInfo.row2="{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
|
||||
AdvSceneSwitcher.action.twitch.title.title="タイトルを入力"
|
||||
AdvSceneSwitcher.action.twitch.marker.description="マーカーの説明"
|
||||
AdvSceneSwitcher.action.twitch.clip.hasDelay="クリップをキャプチャする前にわずかな遅延を追加します"
|
||||
|
|
@ -2257,8 +2258,6 @@ AdvSceneSwitcher.status.inactive="停止中"
|
|||
AdvSceneSwitcher.running="プラグイン実行中"
|
||||
AdvSceneSwitcher.stopped="プラグイン停止しました"
|
||||
|
||||
AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>高機能シーンスイッチャーが初めて起動したようです。<br>ガイドと使用例については <a href=\"https://github.com/WarmUpTill/SceneSwitcher/wiki\"><span style=\" text-decoration: underline; color:#268bd2;\">Wiki</span></a> をご覧ください。<br>質問は <a href=\"https://obsproject.com/forum/threads/advanced-scene-switcher.48264\"><span style=\" text-decoration: underline; color:#268bd2;\">OBSフォーラムのプラグインのスレッド</span></a> で遠慮なくどうぞ!</p></body></html>"
|
||||
|
||||
AdvSceneSwitcher.deprecatedTabWarning="このタブの開発は停止しました!\n代わりにマクロの使用に移行することを検討してください。\nこのヒントは [全般] タブで無効にすることができます。"
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="ミリ秒"
|
||||
|
|
|
|||
|
|
@ -147,7 +147,6 @@ AdvSceneSwitcher.macroTab.run.tooltip="Execute todas as ações da macro indepen
|
|||
AdvSceneSwitcher.macroTab.runElse="Executar macro (alternativa)"
|
||||
AdvSceneSwitcher.macroTab.runFail="Falha ao executar \"%1\"!\nUma das ações falhou ou a macro já está em execução.\nDeseja interrompê-la?"
|
||||
AdvSceneSwitcher.macroTab.runInParallel="Executar macro em paralelo com outras macros"
|
||||
AdvSceneSwitcher.macroTab.onChange="Executar ações apenas quando houver mudança na condição"
|
||||
AdvSceneSwitcher.macroTab.defaultname="Macro %1"
|
||||
AdvSceneSwitcher.macroTab.defaultGroupName="Grupo %1"
|
||||
AdvSceneSwitcher.macroTab.macroNameExists="O nome \"%1\" já está em uso por uma macro."
|
||||
|
|
@ -502,14 +501,14 @@ AdvSceneSwitcher.condition.replay.state.started="Buffer de replay iniciado"
|
|||
AdvSceneSwitcher.condition.replay.state.saved="Buffer de replay salvo"
|
||||
AdvSceneSwitcher.condition.replay.entry="{{state}}"
|
||||
AdvSceneSwitcher.condition.date="Data"
|
||||
AdvSceneSwitcher.condition.date.anyDay="Qualquer dia"
|
||||
AdvSceneSwitcher.condition.date.monday="Segunda-feira"
|
||||
AdvSceneSwitcher.condition.date.tuesday="Terça-feira"
|
||||
AdvSceneSwitcher.condition.date.wednesday="Quarta-feira"
|
||||
AdvSceneSwitcher.condition.date.thursday="Quinta-feira"
|
||||
AdvSceneSwitcher.condition.date.friday="Sexta-feira"
|
||||
AdvSceneSwitcher.condition.date.saturday="Sábado"
|
||||
AdvSceneSwitcher.condition.date.sunday="Domingo"
|
||||
AdvSceneSwitcher.day.any="Qualquer dia"
|
||||
AdvSceneSwitcher.day.monday="Segunda-feira"
|
||||
AdvSceneSwitcher.day.tuesday="Terça-feira"
|
||||
AdvSceneSwitcher.day.wednesday="Quarta-feira"
|
||||
AdvSceneSwitcher.day.thursday="Quinta-feira"
|
||||
AdvSceneSwitcher.day.friday="Sexta-feira"
|
||||
AdvSceneSwitcher.day.saturday="Sábado"
|
||||
AdvSceneSwitcher.day.sunday="Domingo"
|
||||
AdvSceneSwitcher.condition.date.state.at="Às"
|
||||
AdvSceneSwitcher.condition.date.state.after="Após"
|
||||
AdvSceneSwitcher.condition.date.state.before="Antes"
|
||||
|
|
@ -520,12 +519,13 @@ AdvSceneSwitcher.condition.date.ignoreDate="Se desmarcado, o componente de data
|
|||
AdvSceneSwitcher.condition.date.ignoreTime="Se desmarcado, o componente de tempo será ignorado"
|
||||
AdvSceneSwitcher.condition.date.showAdvancedSettings="Mostrar configurações avançadas"
|
||||
AdvSceneSwitcher.condition.date.showSimpleSettings="Mostrar configurações simples"
|
||||
AdvSceneSwitcher.condition.date.entry.simple="Em{{dayOfWeek}}{{weekCondition}}{{ignoreWeekTime}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.entry.advanced="{{condition}}{{ignoreDate}}{{date}}{{ignoreTime}}{{time}}{{separator}}{{date2}}{{time2}}"
|
||||
AdvSceneSwitcher.condition.date.entry.repeat="{{repeat}}Repetir a cada{{duration}}em correspondência de data"
|
||||
AdvSceneSwitcher.condition.date.entry.pattern="Data atual \"{{currentDate}}\" corresponde ao padrão{{pattern}}"
|
||||
AdvSceneSwitcher.condition.date.entry.nextMatchDate="Próxima correspondência em: %1"
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}}Ao repetir, atualize a data selecionada para a data de repetição"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.day="Em{{dayOfWeek}}"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.time="{{ignoreWeekTime}}{{weekCondition}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.layout.advanced="{{condition}}{{ignoreDate}}{{date}}{{ignoreTime}}{{time}}{{separator}}{{date2}}{{time2}}"
|
||||
AdvSceneSwitcher.condition.date.layout.repeat="{{repeat}}Repetir a cada{{duration}}em correspondência de data"
|
||||
AdvSceneSwitcher.condition.date.layout.pattern="Data atual \"{{currentDate}}\" corresponde ao padrão{{pattern}}"
|
||||
AdvSceneSwitcher.condition.date.layout.nextMatchDate="Próxima correspondência em: %1"
|
||||
AdvSceneSwitcher.condition.date.layout.updateOnRepeat="{{updateOnRepeat}}Ao repetir, atualize a data selecionada para a data de repetição"
|
||||
AdvSceneSwitcher.condition.sceneTransform="Transformação do item de cena"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="Obter transformação"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getCurrentValue="Obter valor atual"
|
||||
|
|
@ -781,7 +781,7 @@ AdvSceneSwitcher.action.sceneVisibility.type.hide="Ocultar"
|
|||
AdvSceneSwitcher.action.sceneVisibility.type.toggle="Alternar"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.source="Fonte"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.sourceGroup="Qualquer"
|
||||
AdvSceneSwitcher.action.sceneVisibility.entry="Em{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneVisibility.layout="Em{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.filter="Filtro"
|
||||
AdvSceneSwitcher.action.filter.type.enable="Habilitar"
|
||||
AdvSceneSwitcher.action.filter.type.disable="Desabilitar"
|
||||
|
|
@ -1030,8 +1030,8 @@ AdvSceneSwitcher.action.variable.conditionNoVariableSupport="Obter valores de va
|
|||
AdvSceneSwitcher.action.variable.currentSegmentValue="Valor atual:"
|
||||
AdvSceneSwitcher.action.variable.layout.pad="{{actions}}de{{variables}}para comprimento{{stringLength}}adicionando{{paddingCharSelection}}ao{{direction}}"
|
||||
AdvSceneSwitcher.action.variable.layout.truncate="{{actions}}de{{variables}}para comprimento{{stringLength}}removendo caracteres da{{direction}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringIndex="Início da substring:{{subStringStart}}Tamanho da substring:{{subStringSize}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringRegex="Atribuir valor do{{regexMatchIdx}}correspondência usando expressão regular:"
|
||||
AdvSceneSwitcher.action.variable.layout.substringIndex="Início da substring:{{subStringStart}}Tamanho da substring:{{subStringSize}}{{subStringRegex}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringRegex="Atribuir valor do{{regexMatchIdx}}correspondência usando expressão regular:{{subStringRegex}}"
|
||||
AdvSceneSwitcher.action.variable.layout.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
||||
AdvSceneSwitcher.action.variable.layout.userInput.customPrompt="{{useCustomPrompt}}Usar prompt personalizado{{inputPrompt}}"
|
||||
AdvSceneSwitcher.action.variable.layout.userInput.placeholder="{{useInputPlaceholder}}Preencher com placeholder{{inputPlaceholder}}"
|
||||
|
|
@ -1065,8 +1065,8 @@ AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.enable="Habilitar modo apenas
|
|||
AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.disable="Desabilitar modo apenas emotes no chat"
|
||||
AdvSceneSwitcher.action.twitch.type.chat.sendMessage="Enviar mensagem de chat"
|
||||
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Não é possível selecionar categoria sem selecionar uma conta Twitch primeiro!"
|
||||
AdvSceneSwitcher.action.twitch.entry.default="Em{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
|
||||
AdvSceneSwitcher.action.twitch.entry.chat="Usando conta{{account}}{{actions}}em{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.default="Em{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}{{nonModDelayDuration}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.chat="Usando conta{{account}}{{actions}}em{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.title.title="Digite o título"
|
||||
AdvSceneSwitcher.action.twitch.marker.description="Descreva o marcador"
|
||||
AdvSceneSwitcher.action.twitch.clip.hasDelay="Adicionar um leve atraso antes de capturar o clipe"
|
||||
|
|
@ -1871,8 +1871,6 @@ AdvSceneSwitcher.status.inactive="Inativo"
|
|||
AdvSceneSwitcher.running="Plugin em execução"
|
||||
AdvSceneSwitcher.stopped="Plugin parado"
|
||||
|
||||
AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>Parece que esta é a primeira vez que o Advanced Scene Switcher está sendo iniciado.<br>Por favor, consulte o <a href=\"https://github.com/WarmUpTill/SceneSwitcher/wiki\"><span style=\" text-decoration: underline; color:#268bd2;\">Wiki</span></a> para uma lista de guias e exemplos.<br>Não hesite em fazer perguntas no <a href=\"https://obsproject.com/forum/threads/advanced-scene-switcher.48264\"><span style=\" text-decoration: underline; color:#268bd2;\">tópico</span></a> do plugin nos fóruns do OBS!</p></body></html>"
|
||||
|
||||
AdvSceneSwitcher.deprecatedTabWarning="Desenvolvimento para esta aba interrompido!\nPor favor, considere a transição para o uso de Macros em vez disso.\nEsta dica pode ser desativada na aba Geral."
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="milissegundos"
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ AdvSceneSwitcher.macroTab.add="Yeni Makro ekle"
|
|||
AdvSceneSwitcher.macroTab.name="İsim:"
|
||||
AdvSceneSwitcher.macroTab.run="Makro Çalıştırma"
|
||||
AdvSceneSwitcher.macroTab.runInParallel="Makroyu diğer makrolara paralel olarak çalıştırın"
|
||||
AdvSceneSwitcher.macroTab.onChange="Eylemleri yalnızca koşul değişikliğinde gerçekleştirin"
|
||||
AdvSceneSwitcher.macroTab.defaultname="Makro %1"
|
||||
AdvSceneSwitcher.macroTab.copy="Kopya oluştur"
|
||||
AdvSceneSwitcher.macroTab.expandAll="Hepsini Genişlet"
|
||||
|
|
@ -281,7 +280,7 @@ AdvSceneSwitcher.action.sceneVisibility.type.show="Göster"
|
|||
AdvSceneSwitcher.action.sceneVisibility.type.hide="Gizle"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.source="Kayıt"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.sourceGroup="Herhangi"
|
||||
AdvSceneSwitcher.action.sceneVisibility.entry="Açık{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneVisibility.layout="Açık{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.filter="Filtrele"
|
||||
AdvSceneSwitcher.action.filter.type.enable="Etkin"
|
||||
AdvSceneSwitcher.action.filter.type.disable="Etkisiz"
|
||||
|
|
@ -587,8 +586,6 @@ AdvSceneSwitcher.status.inactive="İnaktif"
|
|||
AdvSceneSwitcher.running="Eklenti çalışıyor"
|
||||
AdvSceneSwitcher.stopped="Eklenti durdu"
|
||||
|
||||
AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>Gelişmiş Sahne Değiştirici ilk kez başlatılıyor gibi görünüyor.<br>Lütfen <a href=\"https://github.com/ adresine bir göz atın. WarmUpTill/SceneSwitcher/wiki\"><span style=\" text-decoration: underline; color:#268bd2;\">Wiki</span></a> için kılavuzlar ve örnekler listesi.<br>Yapmayın. eklentinin <a href=\"https://obsproject.com/forum/threads/advanced-scene-switcher.48264\"><span style=\" text-decoration: underline; color:# sayfasında soru sormaktan çekinmeyin OBS forumlarında 268bd2;\">konu</span></a>!</p></body></html>"
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="millisaniye"
|
||||
AdvSceneSwitcher.unit.seconds="saniye"
|
||||
AdvSceneSwitcher.unit.minutes="dakika"
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ AdvSceneSwitcher.macroTab.run.tooltip="无论条件如何,都运行所有宏
|
|||
AdvSceneSwitcher.macroTab.runElse="运行宏(不满足条件)"
|
||||
AdvSceneSwitcher.macroTab.runFail="运行 \"%1\" 失败!\n要么其中一个操作失败,要么宏已在运行中.\n你想停止它吗?"
|
||||
AdvSceneSwitcher.macroTab.runInParallel="与其他宏并行运行宏"
|
||||
AdvSceneSwitcher.macroTab.onChange="仅在条件结果发生变化时执行操作(条件结果不变时只执行一次操作)"
|
||||
AdvSceneSwitcher.macroTab.defaultname="宏 %1"
|
||||
AdvSceneSwitcher.macroTab.defaultGroupName="分组 %1"
|
||||
AdvSceneSwitcher.macroTab.macroNameExists="名称 \"%1\" 已被宏使用."
|
||||
|
|
@ -530,14 +529,14 @@ AdvSceneSwitcher.condition.replay.state.started="回放缓存已启动"
|
|||
AdvSceneSwitcher.condition.replay.state.saved="已保存回放缓存"
|
||||
AdvSceneSwitcher.condition.replay.entry="{{state}}"
|
||||
AdvSceneSwitcher.condition.date="日期"
|
||||
AdvSceneSwitcher.condition.date.anyDay="每一天"
|
||||
AdvSceneSwitcher.condition.date.monday="周一"
|
||||
AdvSceneSwitcher.condition.date.tuesday="周二"
|
||||
AdvSceneSwitcher.condition.date.wednesday="周三"
|
||||
AdvSceneSwitcher.condition.date.thursday="周四"
|
||||
AdvSceneSwitcher.condition.date.friday="周五"
|
||||
AdvSceneSwitcher.condition.date.saturday="周六"
|
||||
AdvSceneSwitcher.condition.date.sunday="周日"
|
||||
AdvSceneSwitcher.day.any="每一天"
|
||||
AdvSceneSwitcher.day.monday="周一"
|
||||
AdvSceneSwitcher.day.tuesday="周二"
|
||||
AdvSceneSwitcher.day.wednesday="周三"
|
||||
AdvSceneSwitcher.day.thursday="周四"
|
||||
AdvSceneSwitcher.day.friday="周五"
|
||||
AdvSceneSwitcher.day.saturday="周六"
|
||||
AdvSceneSwitcher.day.sunday="周日"
|
||||
AdvSceneSwitcher.condition.date.state.at="现在"
|
||||
AdvSceneSwitcher.condition.date.state.after="之后"
|
||||
AdvSceneSwitcher.condition.date.state.before="之前"
|
||||
|
|
@ -548,12 +547,13 @@ AdvSceneSwitcher.condition.date.ignoreDate="如果未选中,日期组件将被
|
|||
AdvSceneSwitcher.condition.date.ignoreTime="如果未选中,时间组件将被忽略"
|
||||
AdvSceneSwitcher.condition.date.showAdvancedSettings="显示高级设置"
|
||||
AdvSceneSwitcher.condition.date.showSimpleSettings="显示简单设置"
|
||||
AdvSceneSwitcher.condition.date.entry.simple="{{dayOfWeek}}{{weekCondition}}{{ignoreWeekTime}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.entry.advanced="{{condition}}{{ignoreDate}}{{date}}{{ignoreTime}}{{time}}{{separator}}{{date2}}{{time2}}"
|
||||
AdvSceneSwitcher.condition.date.entry.repeat="{{repeat}} 每 {{duration}} 重复一次时间/日期匹配"
|
||||
AdvSceneSwitcher.condition.date.entry.pattern="当前日期 \"{{currentDate}}\" 与 {{pattern}} 模式匹配 , 例子:2025 03 18 24 00 00 = .... .. .. .. .. .. ,难崩,我测试了一段时间才明白"
|
||||
AdvSceneSwitcher.condition.date.entry.nextMatchDate="下一次匹配 在: %1"
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}} 在重复时将选定日期更新为重复日期"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.day="{{dayOfWeek}}"
|
||||
AdvSceneSwitcher.condition.date.layout.simple.time="{{ignoreWeekTime}}{{weekCondition}}{{weekTime}}"
|
||||
AdvSceneSwitcher.condition.date.layout.advanced="{{condition}}{{ignoreDate}}{{date}}{{ignoreTime}}{{time}}{{separator}}{{date2}}{{time2}}"
|
||||
AdvSceneSwitcher.condition.date.layout.repeat="{{repeat}} 每 {{duration}} 重复一次时间/日期匹配"
|
||||
AdvSceneSwitcher.condition.date.layout.pattern="当前日期 \"{{currentDate}}\" 与 {{pattern}} 模式匹配 , 例子:2025 03 18 24 00 00 = .... .. .. .. .. .. ,难崩,我测试了一段时间才明白"
|
||||
AdvSceneSwitcher.condition.date.layout.nextMatchDate="下一次匹配 在: %1"
|
||||
AdvSceneSwitcher.condition.date.layout.updateOnRepeat="{{updateOnRepeat}} 在重复时将选定日期更新为重复日期"
|
||||
AdvSceneSwitcher.condition.sceneTransform="场景项目变换"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="获取变换"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getCurrentValue="获取当前值"
|
||||
|
|
@ -840,7 +840,7 @@ AdvSceneSwitcher.action.sceneVisibility.type.hide="隐藏"
|
|||
AdvSceneSwitcher.action.sceneVisibility.type.toggle="切换可见性"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.source="源"
|
||||
AdvSceneSwitcher.action.sceneVisibility.type.sourceGroup="任何"
|
||||
AdvSceneSwitcher.action.sceneVisibility.entry="{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneVisibility.layout="{{scenes}}{{actions}}{{sources}}"
|
||||
AdvSceneSwitcher.action.filter="滤镜"
|
||||
AdvSceneSwitcher.action.filter.type.enable="开启"
|
||||
AdvSceneSwitcher.action.filter.type.disable="关闭"
|
||||
|
|
@ -1100,8 +1100,8 @@ AdvSceneSwitcher.action.variable.conditionNoVariableSupport="不支持从 %1 条
|
|||
AdvSceneSwitcher.action.variable.currentSegmentValue="当前值:"
|
||||
AdvSceneSwitcher.action.variable.layout.pad="{{actions}}于{{variables}}的{{direction}}起,内容为{{paddingCharSelection}}将其变量值长度增加至{{stringLength}}."
|
||||
AdvSceneSwitcher.action.variable.layout.truncate="{{actions}}于{{variables}}的{{direction}}起,将变量长度缩减至{{stringLength}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringIndex="截取字符串开始位置:{{subStringStart}} 截取字符串长度:{{subStringSize}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringRegex="使用正则表达式为 {{regexMatchIdx}} 匹配的值:"
|
||||
AdvSceneSwitcher.action.variable.layout.substringIndex="截取字符串开始位置:{{subStringStart}} 截取字符串长度:{{subStringSize}}{{subStringRegex}}"
|
||||
AdvSceneSwitcher.action.variable.layout.substringRegex="使用正则表达式为 {{regexMatchIdx}} 匹配的值:{{subStringRegex}}"
|
||||
AdvSceneSwitcher.action.variable.layout.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
||||
AdvSceneSwitcher.action.variable.layout.userInput.customPrompt="{{useCustomPrompt}}使用自定义提示{{inputPrompt}}"
|
||||
AdvSceneSwitcher.action.variable.layout.userInput.placeholder="{{useInputPlaceholder}}用占位符填充{{inputPlaceholder}}"
|
||||
|
|
@ -1139,10 +1139,17 @@ AdvSceneSwitcher.action.twitch.type.user.getInfo="获取用户信息"
|
|||
AdvSceneSwitcher.action.twitch.type.reward.getInfo="获取频道积分奖励信息"
|
||||
AdvSceneSwitcher.action.twitch.reward.toggleControl="切换奖励名称/变量选择控制"
|
||||
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="在未选择 Twitch 帐户的情况下无法选择类别!"
|
||||
AdvSceneSwitcher.action.twitch.entry.default="{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
|
||||
AdvSceneSwitcher.action.twitch.entry.chat="使用账户{{account}}{{actions}}{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.entry.user.getInfo="使用账户{{account}}{{actions}}{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
||||
AdvSceneSwitcher.action.twitch.entry.reward.getInfo="使用账户{{account}}{{actions}} 频道{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.default="{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}{{nonModDelayDuration}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.chat="使用账户{{account}}{{actions}}{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.channel.getInfo="使用账户{{account}}{{actions}}频道{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.getInfo.row1="使用账户{{account}}{{actions}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.getInfo.row2="{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.moderation.row1="使用账户{{account}}{{actions}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.moderation.row2="频道{{channel}}{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.ban.row1="使用账户{{account}}{{actions}}超时{{duration}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.user.ban.row2="频道{{channel}}{{userInfoQueryType}}{{userLogin}}{{userId}}原因{{banReason}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.reward.getInfo.row1="使用账户{{account}}{{actions}} 频道{{channel}}"
|
||||
AdvSceneSwitcher.action.twitch.layout.reward.getInfo.row2="{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
|
||||
AdvSceneSwitcher.action.twitch.title.title="输入标题"
|
||||
AdvSceneSwitcher.action.twitch.marker.description="标记描述"
|
||||
AdvSceneSwitcher.action.twitch.clip.hasDelay="在捕捉视频片段前稍加延迟"
|
||||
|
|
@ -2115,8 +2122,6 @@ AdvSceneSwitcher.status.inactive="已停止"
|
|||
AdvSceneSwitcher.running="插件正在运行"
|
||||
AdvSceneSwitcher.stopped="插件已停止"
|
||||
|
||||
AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>这似乎是您第一次启动高级场景切换器.<br>请看一下 <a href=\"https://github.com/WarmUpTill/SceneSwitcher/wiki\"><span style=\" text-decoration: underline; color:#268bd2;\">Wiki</span></a> 查看指南和示例列表.<br>如果有问题,在在OBS论坛插件帖子内提问 <a href=\"https://obsproject.com/forum/threads/advanced-scene-switcher.48264\"><span style=\" text-decoration: underline; color:#268bd2;\">thread</span></a></p></body></html>"
|
||||
|
||||
AdvSceneSwitcher.deprecatedTabWarning="此选项卡的开发已停止!请考虑转换为使用宏来代替。\n可以在“常规”选项卡上禁用此提示."
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="毫秒"
|
||||
|
|
|
|||
|
|
@ -68,365 +68,162 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>962</width>
|
||||
<height>1057</height>
|
||||
<height>1190</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_19">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_31">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="statusBox">
|
||||
<property name="title">
|
||||
<string>AdvSceneSwitcher.generalTab.status</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="statusLayout">
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="autoStartEvent"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.status.autoStart.startup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_33">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.status.checkInterval</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="checkIntervalTooLowWarning">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="startupBehavior"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QWidget" name="placeholder3" native="true"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QWidget" name="placeholder" native="true"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_64">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.status.onStartup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QWidget" name="placeholder2" native="true"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.status.hotkeytips</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="checkInterval">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string notr="true">ms</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>20000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>300</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="autoStartSceneEnable">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.status.autoStart.scene</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<layout class="QHBoxLayout" name="autoStartSceneLayout">
|
||||
<item>
|
||||
<widget class="advss::SceneSelectionWidget" name="autoStartScene" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="advss::VariableLineEdit" name="autoStartSceneName"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="advss::RegexConfigWidget" name="autoStartSceneNameRegex" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QGroupBox" name="statusBox">
|
||||
<property name="title">
|
||||
<string>AdvSceneSwitcher.generalTab.status</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="statusLayout">
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="autoStartEvent"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.status.autoStart.startup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_33">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.status.checkInterval</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="checkIntervalTooLowWarning">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="generalSettingsBox">
|
||||
<property name="title">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_32">
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="startupBehavior"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QWidget" name="placeholder3" native="true"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QWidget" name="placeholder" native="true"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_64">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.status.onStartup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QWidget" name="placeholder2" native="true"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.status.hotkeytips</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="checkInterval">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string notr="true">ms</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>20000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>300</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="autoStartSceneEnable">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.status.autoStart.scene</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<layout class="QHBoxLayout" name="autoStartSceneLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_52">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.logLevel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="logLevel"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_49">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="advss::SceneSelectionWidget" name="autoStartScene" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_50">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="saveWindowGeo">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_55">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="advss::VariableLineEdit" name="autoStartSceneName"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showTrayNotifications">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_48">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="uiHintsDisable">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_52">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="disableComboBoxFilter">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.comboBoxFilterDisable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="disableMacroWidgetCache">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableMacroWidgetCache</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_26">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="warnPluginLoadFailure">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_19">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_24">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="hideLegacyTabs">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.hideLegacyTabs</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_16">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="advss::RegexConfigWidget" name="autoStartSceneNameRegex" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_18">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="saveLoadBox">
|
||||
<property name="title">
|
||||
<string>AdvSceneSwitcher.generalTab.saveOrLoadsettings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_17">
|
||||
<item>
|
||||
<widget class="QPushButton" name="exportSettings">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.saveOrLoadsettings.export</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="importSettings">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.saveOrLoadsettings.import</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_6">
|
||||
<widget class="QGroupBox" name="saveLoadBox">
|
||||
<property name="title">
|
||||
<string>AdvSceneSwitcher.generalTab.matchBehavior</string>
|
||||
<string>AdvSceneSwitcher.generalTab.saveOrLoadsettings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_37">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_17">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="cooldownLayout">
|
||||
<widget class="QPushButton" name="exportSettings">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.saveOrLoadsettings.export</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="importSettings">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.saveOrLoadsettings.import</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="generalSettingsBox">
|
||||
<property name="title">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_32">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_52">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="enableCooldown">
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.cooldown</string>
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.logLevel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="advss::DurationSelection" name="cooldownTime" native="true"/>
|
||||
<widget class="QComboBox" name="logLevel"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_21">
|
||||
<spacer name="horizontalSpacer_49">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
|
|
@ -441,80 +238,72 @@
|
|||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_43">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="noMatchDontSwitch">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_45">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="noMatchRandomSwitch">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="noMatchSwitch">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="advss::SceneSelectionWidget" name="noMatchSwitchScene">
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="noMatchLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QCheckBox" name="showTrayNotifications">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="warnPluginLoadFailure">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_6">
|
||||
<property name="title">
|
||||
<string>AdvSceneSwitcher.generalTab.uiBehavior</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="saveWindowGeo">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="alwaysShowMacroSearch">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowMacroSearch</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="alwaysShowFeatureTabs">
|
||||
<property name="toolTip">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs.tooltip</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="disableComboBoxFilter">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.comboBoxFilterDisable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="uiHintsDisable">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="hideLegacyTabs">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.hideLegacyTabs</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
@ -562,6 +351,109 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="matchBehaviorBox">
|
||||
<property name="title">
|
||||
<string>AdvSceneSwitcher.generalTab.matchBehavior</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_37">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="cooldownLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="enableCooldown">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.cooldown</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="advss::DurationSelection" name="cooldownTime" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_21">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="2">
|
||||
<widget class="QRadioButton" name="noMatchDontSwitch">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QRadioButton" name="noMatchRandomSwitch">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="noMatchSwitch">
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="advss::SceneSelectionWidget" name="noMatchSwitchScene" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="noMatchLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="priorityBox">
|
||||
<property name="title">
|
||||
|
|
@ -576,15 +468,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_41">
|
||||
<item>
|
||||
<widget class="QListWidget" name="priorityList"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QListWidget" name="priorityList"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_32">
|
||||
|
|
@ -681,6 +565,13 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="openSetupWizard">
|
||||
<property name="text">
|
||||
<string>FirstRunWizard.openButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
@ -706,7 +597,7 @@
|
|||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
<widget class="QGroupBox" name="macroListBox">
|
||||
<property name="title">
|
||||
<string>AdvSceneSwitcher.macroTab.macros</string>
|
||||
</property>
|
||||
|
|
@ -721,6 +612,55 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="macroSearchLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="macroSearchText">
|
||||
<property name="placeholderText">
|
||||
<string>AdvSceneSwitcher.macroTab.search.placeholder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="macroSearchClear">
|
||||
<property name="toolTip">
|
||||
<string>AdvSceneSwitcher.variableTab.clear</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="macroSearchType"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="advss::RegexConfigWidget" name="macroSearchRegex" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="macroSearchShowSettings">
|
||||
<property name="toolTip">
|
||||
<string>AdvSceneSwitcher.macroTab.search.showSettings</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="advss::MacroTree" name="macros">
|
||||
<property name="showDropIndicator" stdset="0">
|
||||
|
|
@ -853,25 +793,19 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="runMacroOnChange">
|
||||
<property name="toolTip">
|
||||
<string>AdvSceneSwitcher.macroTab.onChange</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>AdvSceneSwitcher.macroTab.actionTriggerMode.label</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_18">
|
||||
<widget class="QComboBox" name="actionTriggerMode">
|
||||
<property name="toolTip">
|
||||
<string>AdvSceneSwitcher.macroTab.onChange</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.macroTab.onChange</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
<string>AdvSceneSwitcher.macroTab.actionTriggerMode.tooltip</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -4164,12 +4098,7 @@
|
|||
<tabstop>autoStartSceneName</tabstop>
|
||||
<tabstop>autoStartSceneNameRegex</tabstop>
|
||||
<tabstop>logLevel</tabstop>
|
||||
<tabstop>saveWindowGeo</tabstop>
|
||||
<tabstop>showTrayNotifications</tabstop>
|
||||
<tabstop>uiHintsDisable</tabstop>
|
||||
<tabstop>disableComboBoxFilter</tabstop>
|
||||
<tabstop>warnPluginLoadFailure</tabstop>
|
||||
<tabstop>hideLegacyTabs</tabstop>
|
||||
<tabstop>exportSettings</tabstop>
|
||||
<tabstop>importSettings</tabstop>
|
||||
<tabstop>noMatchDontSwitch</tabstop>
|
||||
|
|
@ -4190,7 +4119,7 @@
|
|||
<tabstop>macroName</tabstop>
|
||||
<tabstop>runMacro</tabstop>
|
||||
<tabstop>runMacroInParallel</tabstop>
|
||||
<tabstop>runMacroOnChange</tabstop>
|
||||
<tabstop>actionTriggerMode</tabstop>
|
||||
<tabstop>macroSettings</tabstop>
|
||||
<tabstop>macroEdit</tabstop>
|
||||
<tabstop>sceneGroups</tabstop>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "advanced-scene-switcher.hpp"
|
||||
#include "backup.hpp"
|
||||
#include "crash-handler.hpp"
|
||||
#include "log-helper.hpp"
|
||||
#include "macro-helpers.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
|
|
@ -191,25 +192,21 @@ static void SaveSceneSwitcher(obs_data_t *save_data, bool saving, void *)
|
|||
|
||||
switcher->m.lock();
|
||||
if (switcher->VersionChanged(data, g_GIT_SHA1)) {
|
||||
auto json = obs_data_get_json(data);
|
||||
static QString jsonQString = json ? json : "";
|
||||
std::thread t([]() {
|
||||
obs_queue_task(
|
||||
OBS_TASK_UI,
|
||||
[](void *) {
|
||||
AskForBackup(jsonQString);
|
||||
},
|
||||
nullptr, false);
|
||||
});
|
||||
t.detach();
|
||||
AskForBackup(data);
|
||||
}
|
||||
|
||||
switcher->LoadSettings(data);
|
||||
switcher->m.unlock();
|
||||
|
||||
if (!switcher->stop) {
|
||||
switcher->Start();
|
||||
if (switcher->stop) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ShouldSkipPluginStartOnUncleanShutdown()) {
|
||||
return;
|
||||
}
|
||||
|
||||
switcher->Start();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,12 +65,12 @@ public slots:
|
|||
void on_showTrayNotifications_stateChanged(int state);
|
||||
void on_uiHintsDisable_stateChanged(int state);
|
||||
void on_disableComboBoxFilter_stateChanged(int state);
|
||||
void on_disableMacroWidgetCache_stateChanged(int state);
|
||||
void on_warnPluginLoadFailure_stateChanged(int state);
|
||||
void on_hideLegacyTabs_stateChanged(int state);
|
||||
void on_priorityUp_clicked();
|
||||
void on_priorityDown_clicked();
|
||||
void on_threadPriority_currentTextChanged(const QString &text);
|
||||
void on_openSetupWizard_clicked();
|
||||
|
||||
/* --- End of legacy tab section --- */
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ public slots:
|
|||
void on_macroDown_clicked() const;
|
||||
void on_macroName_editingFinished();
|
||||
void on_runMacroInParallel_stateChanged(int value) const;
|
||||
void on_runMacroOnChange_stateChanged(int value) const;
|
||||
void on_actionTriggerMode_currentIndexChanged(int index) const;
|
||||
void MacroSelectionChanged();
|
||||
void ShowMacroContextMenu(const QPoint &);
|
||||
void CopyMacro();
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
#include "advanced-scene-switcher.hpp"
|
||||
#include "file-selection.hpp"
|
||||
#include "filter-combo-box.hpp"
|
||||
#include "first-run-wizard.hpp"
|
||||
#include "layout-helpers.hpp"
|
||||
#include "macro.hpp"
|
||||
#include "macro-search.hpp"
|
||||
#include "macro-settings.hpp"
|
||||
#include "path-helpers.hpp"
|
||||
#include "selection-helpers.hpp"
|
||||
#include "source-helpers.hpp"
|
||||
#include "splitter-helpers.hpp"
|
||||
#include "status-control.hpp"
|
||||
#include "switcher-data.hpp"
|
||||
#include "tab-helpers.hpp"
|
||||
#include "ui-helpers.hpp"
|
||||
#include "utility.hpp"
|
||||
#include "variable.hpp"
|
||||
#include "version.h"
|
||||
|
||||
|
|
@ -185,16 +185,6 @@ void AdvSceneSwitcher::on_disableComboBoxFilter_stateChanged(int state)
|
|||
FilterComboBox::SetFilterBehaviourEnabled(!state);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_disableMacroWidgetCache_stateChanged(int state)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
switcher->disableMacroWidgetCache = state;
|
||||
MacroSegmentList::SetCachingEnabled(!state);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_warnPluginLoadFailure_stateChanged(int state)
|
||||
{
|
||||
if (loading) {
|
||||
|
|
@ -370,14 +360,46 @@ void AdvSceneSwitcher::RestoreWindowGeo()
|
|||
}
|
||||
}
|
||||
|
||||
static void renameMacroIfNecessary(const std::shared_ptr<Macro> ¯o)
|
||||
{
|
||||
if (!GetMacroByName(macro->Name().c_str())) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto name = macro->Name();
|
||||
int i = 2;
|
||||
while (GetMacroByName((name + " " + std::to_string(i)).c_str())) {
|
||||
i++;
|
||||
}
|
||||
|
||||
macro->SetName(name + " " + std::to_string(i));
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::CheckFirstTimeSetup()
|
||||
{
|
||||
if (switcher->firstBoot && !switcher->disableHints) {
|
||||
switcher->firstBoot = false;
|
||||
DisplayMessage(
|
||||
obs_module_text("AdvSceneSwitcher.firstBootMessage"));
|
||||
switcher->Start();
|
||||
if (!IsFirstRun() || !GetTopLevelMacros().empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto macro = FirstRunWizard::ShowWizard(this);
|
||||
if (macro) {
|
||||
renameMacroIfNecessary(macro);
|
||||
QTimer::singleShot(0, this,
|
||||
[this, macro]() { ui->macros->Add(macro); });
|
||||
}
|
||||
switcher->Start();
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_openSetupWizard_clicked()
|
||||
{
|
||||
auto macro = FirstRunWizard::ShowWizard(this);
|
||||
if (!macro) {
|
||||
return;
|
||||
}
|
||||
|
||||
renameMacroIfNecessary(macro);
|
||||
ui->macros->Add(macro);
|
||||
ui->tabWidget->setCurrentWidget(ui->macroTab);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_tabWidget_currentChanged(int)
|
||||
|
|
@ -531,8 +553,6 @@ void SwitcherData::SaveGeneralSettings(obs_data_t *obj)
|
|||
obs_data_set_bool(obj, "disableHints", disableHints);
|
||||
obs_data_set_bool(obj, "disableFilterComboboxFilter",
|
||||
disableFilterComboboxFilter);
|
||||
obs_data_set_bool(obj, "disableMacroWidgetCache",
|
||||
disableMacroWidgetCache);
|
||||
obs_data_set_bool(obj, "warnPluginLoadFailure", warnPluginLoadFailure);
|
||||
obs_data_set_bool(obj, "hideLegacyTabs", hideLegacyTabs);
|
||||
|
||||
|
|
@ -602,8 +622,6 @@ void SwitcherData::LoadGeneralSettings(obs_data_t *obj)
|
|||
disableHints = obs_data_get_bool(obj, "disableHints");
|
||||
disableFilterComboboxFilter =
|
||||
obs_data_get_bool(obj, "disableFilterComboboxFilter");
|
||||
disableMacroWidgetCache =
|
||||
obs_data_get_bool(obj, "disableMacroWidgetCache");
|
||||
obs_data_set_default_bool(obj, "warnPluginLoadFailure", true);
|
||||
warnPluginLoadFailure = obs_data_get_bool(obj, "warnPluginLoadFailure");
|
||||
obs_data_set_default_bool(obj, "hideLegacyTabs", true);
|
||||
|
|
@ -927,9 +945,6 @@ void AdvSceneSwitcher::SetupGeneralTab()
|
|||
switcher->disableFilterComboboxFilter);
|
||||
FilterComboBox::SetFilterBehaviourEnabled(
|
||||
!switcher->disableFilterComboboxFilter);
|
||||
ui->disableMacroWidgetCache->setChecked(
|
||||
switcher->disableMacroWidgetCache);
|
||||
MacroSegmentList::SetCachingEnabled(!switcher->disableMacroWidgetCache);
|
||||
ui->warnPluginLoadFailure->setChecked(switcher->warnPluginLoadFailure);
|
||||
ui->hideLegacyTabs->setChecked(switcher->hideLegacyTabs);
|
||||
|
||||
|
|
@ -1013,6 +1028,19 @@ void AdvSceneSwitcher::SetupGeneralTab()
|
|||
switcher->CheckAutoStart();
|
||||
});
|
||||
|
||||
ui->alwaysShowMacroSearch->setChecked(
|
||||
GetMacroSearchSettings().showAlways);
|
||||
|
||||
connect(ui->alwaysShowMacroSearch, &QCheckBox::stateChanged, this,
|
||||
[this](int enabled) {
|
||||
GetMacroSearchSettings().showAlways = enabled;
|
||||
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
CheckMacroSearchVisibility();
|
||||
});
|
||||
|
||||
// Set up status control
|
||||
auto statusControl = new StatusControl(this, true);
|
||||
ui->statusLayout->addWidget(statusControl->StatusPrefixLabel(), 1, 0);
|
||||
|
|
@ -1032,6 +1060,8 @@ void AdvSceneSwitcher::SetupGeneralTab()
|
|||
setTabOrder(ui->importSettings, ui->cooldownTime);
|
||||
setTabOrder(ui->cooldownTime, ui->noMatchDontSwitch);
|
||||
|
||||
SetupShowAllTabsCheckBox(ui->alwaysShowFeatureTabs, ui->tabWidget);
|
||||
|
||||
MinimizeSizeOfColumn(ui->statusLayout, 0);
|
||||
setWindowTitle(windowTitle() + " - " + g_GIT_TAG);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ static inline void populateActionSelection(QComboBox *list)
|
|||
}
|
||||
|
||||
MacroActionEdit::MacroActionEdit(QWidget *parent,
|
||||
std::shared_ptr<MacroAction> *entryData,
|
||||
const std::string &id)
|
||||
std::shared_ptr<MacroAction> *entryData)
|
||||
: MacroSegmentEdit(parent),
|
||||
_actionSelection(new FilterComboBox()),
|
||||
_enable(new SwitchButton()),
|
||||
|
|
|
|||
|
|
@ -13,10 +13,8 @@ class MacroActionEdit : public MacroSegmentEdit {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MacroActionEdit(
|
||||
QWidget *parent = nullptr,
|
||||
std::shared_ptr<MacroAction> * = nullptr,
|
||||
const std::string &id = MacroAction::GetDefaultID().data());
|
||||
MacroActionEdit(QWidget *parent = nullptr,
|
||||
std::shared_ptr<MacroAction> * = nullptr);
|
||||
void SetupWidgets(bool basicSetup = false);
|
||||
void SetEntryData(std::shared_ptr<MacroAction> *);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,33 +93,46 @@ bool MacroActionMacro::PerformAction()
|
|||
return true;
|
||||
}
|
||||
|
||||
switch (_action) {
|
||||
case Action::PAUSE:
|
||||
macro->SetPaused();
|
||||
break;
|
||||
case Action::UNPAUSE:
|
||||
macro->SetPaused(false);
|
||||
break;
|
||||
case Action::TOGGLE_PAUSE:
|
||||
macro->SetPaused(!macro->Paused());
|
||||
break;
|
||||
case Action::RESET_COUNTER:
|
||||
macro->ResetRunCount();
|
||||
break;
|
||||
case Action::RUN_ACTIONS:
|
||||
RunActions(macro.get());
|
||||
break;
|
||||
case Action::STOP:
|
||||
macro->Stop();
|
||||
break;
|
||||
case Action::DISABLE_ACTION:
|
||||
case Action::ENABLE_ACTION:
|
||||
case Action::TOGGLE_ACTION:
|
||||
AdjustActionState(macro.get());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
const auto performActionForMacro = [this](Macro *macro) {
|
||||
switch (_action) {
|
||||
case Action::PAUSE:
|
||||
macro->SetPaused();
|
||||
break;
|
||||
case Action::UNPAUSE:
|
||||
macro->SetPaused(false);
|
||||
break;
|
||||
case Action::TOGGLE_PAUSE:
|
||||
macro->SetPaused(!macro->Paused());
|
||||
break;
|
||||
case Action::RESET_COUNTER:
|
||||
macro->ResetRunCount();
|
||||
break;
|
||||
case Action::RUN_ACTIONS:
|
||||
RunActions(macro);
|
||||
break;
|
||||
case Action::STOP:
|
||||
macro->Stop();
|
||||
break;
|
||||
case Action::DISABLE_ACTION:
|
||||
case Action::ENABLE_ACTION:
|
||||
case Action::TOGGLE_ACTION:
|
||||
AdjustActionState(macro);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
if (!IsGroupMacro(macro.get())) {
|
||||
performActionForMacro(macro.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
auto macros = GetGroupMacroEntries(macro.get());
|
||||
for (const auto ¯o : macros) {
|
||||
performActionForMacro(macro.get());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -404,6 +417,7 @@ MacroActionMacroEdit::MacroActionMacroEdit(
|
|||
populateActionTypes(_actionTypes);
|
||||
|
||||
_conditionMacros->HideSelectedMacro();
|
||||
_conditionMacros->HideGroups();
|
||||
|
||||
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
|
||||
this, SLOT(MacroChanged(const QString &)));
|
||||
|
|
|
|||
|
|
@ -219,6 +219,43 @@ void MacroActionVariable::GenerateRandomNumber(Variable *var)
|
|||
}
|
||||
}
|
||||
|
||||
void MacroActionVariable::PickRandomValue(Variable *var)
|
||||
{
|
||||
static std::random_device rd;
|
||||
static std::mt19937 gen(rd());
|
||||
static const uint8_t maxIter = 255;
|
||||
|
||||
if (_randomValues.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_randomValues.size() == 1) {
|
||||
const auto &value = _randomValues.at(0);
|
||||
var->SetValue(value);
|
||||
_lastRandomValue = value;
|
||||
}
|
||||
|
||||
std::uniform_int_distribution<int> dis(0, _randomValues.size() - 1);
|
||||
StringVariable value = _randomValues.at(dis(gen));
|
||||
|
||||
uint8_t iter = 0;
|
||||
for (; !_allowRepeatValues && iter < maxIter &&
|
||||
_lastRandomValue.has_value() &&
|
||||
std::string(value) == _lastRandomValue.value();
|
||||
iter++) {
|
||||
value = _randomValues.at(dis(gen));
|
||||
}
|
||||
|
||||
if (iter == maxIter) {
|
||||
blog(LOG_INFO,
|
||||
"giving up picking non-repeat random value after %d tries",
|
||||
maxIter);
|
||||
}
|
||||
|
||||
var->SetValue(value);
|
||||
_lastRandomValue = value;
|
||||
}
|
||||
|
||||
struct AskForInputParams {
|
||||
AskForInputParams(const QString &prompt_, const QString &placeholder_)
|
||||
: prompt(prompt_),
|
||||
|
|
@ -458,6 +495,9 @@ bool MacroActionVariable::PerformAction()
|
|||
case Action::RANDOM_NUMBER:
|
||||
GenerateRandomNumber(var.get());
|
||||
return true;
|
||||
case Action::RANDOM_LIST_VALUE:
|
||||
PickRandomValue(var.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -498,6 +538,8 @@ bool MacroActionVariable::Save(obs_data_t *obj) const
|
|||
_randomNumberStart.Save(obj, "randomNumberStart");
|
||||
_randomNumberEnd.Save(obj, "randomNumberEnd");
|
||||
obs_data_set_bool(obj, "generateInteger", _generateInteger);
|
||||
_randomValues.Save(obj, "randomValues", "value");
|
||||
obs_data_set_bool(obj, "allowRepeatValues", _allowRepeatValues);
|
||||
_jsonQuery.Save(obj, "jsonQuery");
|
||||
_jsonIndex.Save(obj, "jsonIndex");
|
||||
|
||||
|
|
@ -556,6 +598,8 @@ bool MacroActionVariable::Load(obs_data_t *obj)
|
|||
_randomNumberStart.Load(obj, "randomNumberStart");
|
||||
_randomNumberEnd.Load(obj, "randomNumberEnd");
|
||||
_generateInteger = obs_data_get_bool(obj, "generateInteger");
|
||||
_randomValues.Load(obj, "randomValues", "value");
|
||||
_allowRepeatValues = obs_data_get_bool(obj, "allowRepeatValues");
|
||||
_jsonQuery.Load(obj, "jsonQuery");
|
||||
_jsonIndex.Load(obj, "jsonIndex");
|
||||
|
||||
|
|
@ -724,6 +768,8 @@ static inline void populateActionSelection(QComboBox *list)
|
|||
"AdvSceneSwitcher.action.variable.type.roundToInt"},
|
||||
{MacroActionVariable::Action::RANDOM_NUMBER,
|
||||
"AdvSceneSwitcher.action.variable.type.randomNumber"},
|
||||
{MacroActionVariable::Action::RANDOM_LIST_VALUE,
|
||||
"AdvSceneSwitcher.action.variable.type.randomListValue"},
|
||||
{true, ""}, // Separator
|
||||
|
||||
{MacroActionVariable::Action::USER_INPUT,
|
||||
|
|
@ -801,11 +847,10 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
_segmentValueStatus(new QLabel()),
|
||||
_segmentValue(new ResizingPlainTextEdit(this, 10, 1, 1)),
|
||||
_substringLayout(new QVBoxLayout()),
|
||||
_subStringIndexEntryLayout(new QHBoxLayout()),
|
||||
_subStringRegexEntryLayout(new QHBoxLayout()),
|
||||
_subStringControlsLayout(new QHBoxLayout()),
|
||||
_subStringStart(new VariableSpinBox(this)),
|
||||
_subStringSize(new VariableSpinBox(this)),
|
||||
_substringRegex(new RegexConfigWidget(parent)),
|
||||
_subStringRegex(new RegexConfigWidget(parent)),
|
||||
_regexPattern(new ResizingPlainTextEdit(this, 10, 1, 1)),
|
||||
_regexMatchIdx(new VariableSpinBox(this)),
|
||||
_findReplaceLayout(new QHBoxLayout()),
|
||||
|
|
@ -837,7 +882,13 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.variable.generateInteger"),
|
||||
this)),
|
||||
_randomLayout(new QVBoxLayout()),
|
||||
_randomNumberLayout(new QVBoxLayout()),
|
||||
_randomValues(new StringListEdit(this)),
|
||||
_allowRepeatValues(new QCheckBox(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.variable.type.allowRepeat"),
|
||||
this)),
|
||||
_randomValueLayout(new QVBoxLayout()),
|
||||
_jsonQuery(new VariableLineEdit(this)),
|
||||
_jsonQueryHelp(new HelpIcon(
|
||||
obs_module_text(
|
||||
|
|
@ -873,6 +924,7 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
_randomNumberStart->setMaximum(9999999999);
|
||||
_randomNumberEnd->setMinimum(-9999999999);
|
||||
_randomNumberEnd->setMaximum(9999999999);
|
||||
_randomValues->SetMaxStringSize(99999999);
|
||||
_jsonIndex->setMaximum(999);
|
||||
|
||||
QWidget::connect(_variables, SIGNAL(SelectionChanged(const QString &)),
|
||||
|
|
@ -901,7 +953,7 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
_subStringSize,
|
||||
SIGNAL(NumberVariableChanged(const NumberVariable<int> &)),
|
||||
this, SLOT(SubStringSizeChanged(const NumberVariable<int> &)));
|
||||
QWidget::connect(_substringRegex,
|
||||
QWidget::connect(_subStringRegex,
|
||||
SIGNAL(RegexConfigChanged(const RegexConfig &)), this,
|
||||
SLOT(SubStringRegexChanged(const RegexConfig &)));
|
||||
QWidget::connect(_regexPattern, SIGNAL(textChanged()), this,
|
||||
|
|
@ -961,6 +1013,11 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
SLOT(RandomNumberEndChanged(const NumberVariable<double> &)));
|
||||
QWidget::connect(_generateInteger, SIGNAL(stateChanged(int)), this,
|
||||
SLOT(GenerateIntegerChanged(int)));
|
||||
QWidget::connect(_randomValues,
|
||||
SIGNAL(StringListChanged(const StringList &)), this,
|
||||
SLOT(RandomValueListChanged(const StringList &)));
|
||||
QWidget::connect(_allowRepeatValues, SIGNAL(stateChanged(int)), this,
|
||||
SLOT(AllowRepeatValuesChanged(int)));
|
||||
QWidget::connect(_jsonQuery, SIGNAL(editingFinished()), this,
|
||||
SLOT(JsonQueryChanged()));
|
||||
QWidget::connect(
|
||||
|
|
@ -975,9 +1032,6 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
{"{{strValue}}", _strValue},
|
||||
{"{{numValue}}", _numValue},
|
||||
{"{{segmentIndex}}", _segmentIdx},
|
||||
{"{{subStringStart}}", _subStringStart},
|
||||
{"{{subStringSize}}", _subStringSize},
|
||||
{"{{regexMatchIdx}}", _regexMatchIdx},
|
||||
{"{{findRegex}}", _findRegex},
|
||||
{"{{findStr}}", _findStr},
|
||||
{"{{replaceStr}}", _replaceStr},
|
||||
|
|
@ -1009,12 +1063,7 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.variable.layout.substringIndex"),
|
||||
_subStringIndexEntryLayout, widgetPlaceholders);
|
||||
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.variable.layout.substringRegex"),
|
||||
_subStringRegexEntryLayout, widgetPlaceholders);
|
||||
_subStringControlsLayout, widgetPlaceholders);
|
||||
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
|
|
@ -1035,15 +1084,17 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.variable.layout.randomNumber"),
|
||||
randomLayout, widgetPlaceholders);
|
||||
_randomLayout->addLayout(randomLayout);
|
||||
_randomLayout->addWidget(_generateInteger);
|
||||
_randomNumberLayout->addLayout(randomLayout);
|
||||
_randomNumberLayout->addWidget(_generateInteger);
|
||||
|
||||
_randomValueLayout->addWidget(_randomValues);
|
||||
_randomValueLayout->addWidget(_allowRepeatValues);
|
||||
|
||||
auto regexConfigLayout = new QHBoxLayout;
|
||||
regexConfigLayout->addWidget(_substringRegex);
|
||||
regexConfigLayout->addWidget(_subStringRegex);
|
||||
regexConfigLayout->addStretch();
|
||||
|
||||
_substringLayout->addLayout(_subStringIndexEntryLayout);
|
||||
_substringLayout->addLayout(_subStringRegexEntryLayout);
|
||||
_substringLayout->addLayout(_subStringControlsLayout);
|
||||
_substringLayout->addWidget(_regexPattern);
|
||||
_substringLayout->addLayout(regexConfigLayout);
|
||||
|
||||
|
|
@ -1056,7 +1107,8 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
layout->addWidget(_mathExpressionResult);
|
||||
layout->addLayout(_promptLayout);
|
||||
layout->addLayout(_placeholderLayout);
|
||||
layout->addLayout(_randomLayout);
|
||||
layout->addLayout(_randomNumberLayout);
|
||||
layout->addLayout(_randomValueLayout);
|
||||
setLayout(layout);
|
||||
|
||||
_entryData = entryData;
|
||||
|
|
@ -1090,7 +1142,7 @@ void MacroActionVariableEdit::UpdateEntryData()
|
|||
: MacroSegmentSelection::Type::ACTION);
|
||||
_subStringStart->SetValue(_entryData->_subStringStart);
|
||||
_subStringSize->SetValue(_entryData->_subStringSize);
|
||||
_substringRegex->SetRegexConfig(_entryData->_subStringRegex);
|
||||
_subStringRegex->SetRegexConfig(_entryData->_subStringRegex);
|
||||
_findRegex->SetRegexConfig(_entryData->_findRegex);
|
||||
_regexPattern->setPlainText(
|
||||
QString::fromStdString(_entryData->_regexPattern));
|
||||
|
|
@ -1115,6 +1167,8 @@ void MacroActionVariableEdit::UpdateEntryData()
|
|||
_randomNumberStart->SetValue(_entryData->_randomNumberStart);
|
||||
_randomNumberEnd->SetValue(_entryData->_randomNumberEnd);
|
||||
_generateInteger->setChecked(_entryData->_generateInteger);
|
||||
_allowRepeatValues->setChecked(_entryData->_allowRepeatValues);
|
||||
_randomValues->SetStringList(_entryData->_randomValues);
|
||||
_jsonQuery->setText(_entryData->_jsonQuery);
|
||||
_jsonIndex->SetValue(_entryData->_jsonIndex);
|
||||
|
||||
|
|
@ -1457,6 +1511,18 @@ void MacroActionVariableEdit::GenerateIntegerChanged(int value)
|
|||
_entryData->_generateInteger = value;
|
||||
}
|
||||
|
||||
void MacroActionVariableEdit::RandomValueListChanged(const StringList &values)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_randomValues = values;
|
||||
}
|
||||
|
||||
void MacroActionVariableEdit::AllowRepeatValuesChanged(int value)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_allowRepeatValues = value;
|
||||
}
|
||||
|
||||
void MacroActionVariableEdit::JsonQueryChanged()
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
|
|
@ -1495,8 +1561,20 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
|||
{"{{jsonQuery}}", _jsonQuery},
|
||||
{"{{jsonQueryHelp}}", _jsonQueryHelp},
|
||||
{"{{jsonIndex}}", _jsonIndex},
|
||||
{"{{subStringRegex}}", _subStringRegex},
|
||||
{"{{subStringStart}}", _subStringStart},
|
||||
{"{{subStringSize}}", _subStringSize},
|
||||
{"{{regexMatchIdx}}", _regexMatchIdx},
|
||||
};
|
||||
|
||||
for (const auto &[_, widget] : widgetPlaceholders) {
|
||||
_entryLayout->removeWidget(widget);
|
||||
_subStringControlsLayout->removeWidget(widget);
|
||||
}
|
||||
|
||||
ClearLayout(_entryLayout);
|
||||
ClearLayout(_subStringControlsLayout);
|
||||
|
||||
const char *layoutString = "";
|
||||
if (_entryData->_action == MacroActionVariable::Action::PAD) {
|
||||
layoutString = obs_module_text(
|
||||
|
|
@ -1510,11 +1588,6 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
|||
"AdvSceneSwitcher.action.variable.layout.other");
|
||||
}
|
||||
|
||||
for (const auto &[_, widget] : widgetPlaceholders) {
|
||||
_entryLayout->removeWidget(widget);
|
||||
}
|
||||
|
||||
ClearLayout(_entryLayout);
|
||||
PlaceWidgets(layoutString, _entryLayout, widgetPlaceholders);
|
||||
|
||||
if (_entryData->_action == MacroActionVariable::Action::SET_VALUE ||
|
||||
|
|
@ -1561,15 +1634,25 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
|||
MacroActionVariable::Action::SET_ACTION_VALUE ||
|
||||
_entryData->_action ==
|
||||
MacroActionVariable::Action::SET_CONDITION_VALUE);
|
||||
|
||||
bool showRegex = _entryData->_subStringRegex.Enabled();
|
||||
layoutString =
|
||||
showRegex
|
||||
? "AdvSceneSwitcher.action.variable.layout.substringRegex"
|
||||
: "AdvSceneSwitcher.action.variable.layout.substringIndex";
|
||||
PlaceWidgets(obs_module_text(layoutString), _subStringControlsLayout,
|
||||
widgetPlaceholders);
|
||||
_subStringStart->setVisible(!showRegex);
|
||||
_subStringSize->setVisible(!showRegex);
|
||||
_regexMatchIdx->setVisible(showRegex);
|
||||
|
||||
SetLayoutVisible(_substringLayout,
|
||||
_entryData->_action ==
|
||||
MacroActionVariable::Action::SUBSTRING);
|
||||
if (_entryData->_action == MacroActionVariable::Action::SUBSTRING) {
|
||||
bool showRegex = _entryData->_subStringRegex.Enabled();
|
||||
SetLayoutVisible(_subStringIndexEntryLayout, !showRegex);
|
||||
SetLayoutVisible(_subStringRegexEntryLayout, showRegex);
|
||||
_regexPattern->setVisible(showRegex);
|
||||
}
|
||||
_regexPattern->setVisible(
|
||||
showRegex &&
|
||||
_entryData->_action == MacroActionVariable::Action::SUBSTRING);
|
||||
|
||||
SetLayoutVisible(_findReplaceLayout,
|
||||
_entryData->_action ==
|
||||
MacroActionVariable::Action::FIND_AND_REPLACE);
|
||||
|
|
@ -1634,9 +1717,13 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
|||
MacroActionVariable::Action::PAD);
|
||||
_caseType->setVisible(_entryData->_action ==
|
||||
MacroActionVariable::Action::CHANGE_CASE);
|
||||
SetLayoutVisible(_randomLayout,
|
||||
SetLayoutVisible(_randomNumberLayout,
|
||||
_entryData->_action ==
|
||||
MacroActionVariable::Action::RANDOM_NUMBER);
|
||||
SetLayoutVisible(
|
||||
_randomValueLayout,
|
||||
_entryData->_action ==
|
||||
MacroActionVariable::Action::RANDOM_LIST_VALUE);
|
||||
_jsonQuery->setVisible(_entryData->_action ==
|
||||
MacroActionVariable::Action::QUERY_JSON);
|
||||
_jsonQueryHelp->setVisible(_entryData->_action ==
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include "resizing-text-edit.hpp"
|
||||
#include "scene-selection.hpp"
|
||||
#include "single-char-selection.hpp"
|
||||
#include "string-list.hpp"
|
||||
#include "variable-line-edit.hpp"
|
||||
#include "variable-text-edit.hpp"
|
||||
#include "variable-spinbox.hpp"
|
||||
|
|
@ -56,6 +57,7 @@ public:
|
|||
QUERY_JSON,
|
||||
ARRAY_JSON,
|
||||
COPY_VAR,
|
||||
RANDOM_LIST_VALUE,
|
||||
};
|
||||
|
||||
Action _action = Action::SET_VALUE;
|
||||
|
|
@ -107,6 +109,10 @@ public:
|
|||
DoubleVariable _randomNumberEnd = 100;
|
||||
bool _generateInteger = true;
|
||||
|
||||
StringList _randomValues = {"value1", "value2", "value3"};
|
||||
bool _allowRepeatValues = true;
|
||||
std::optional<std::string> _lastRandomValue;
|
||||
|
||||
StringVariable _jsonQuery = "$.some.nested.value";
|
||||
IntVariable _jsonIndex = 0;
|
||||
|
||||
|
|
@ -119,6 +125,7 @@ private:
|
|||
void HandleCaseChange(Variable *);
|
||||
void SetToSceneItemName(Variable *);
|
||||
void GenerateRandomNumber(Variable *);
|
||||
void PickRandomValue(Variable *);
|
||||
|
||||
std::weak_ptr<MacroSegment> _macroSegment;
|
||||
int _segmentIdxLoadValue = -1;
|
||||
|
|
@ -175,6 +182,8 @@ private slots:
|
|||
void RandomNumberStartChanged(const NumberVariable<double> &);
|
||||
void RandomNumberEndChanged(const NumberVariable<double> &);
|
||||
void GenerateIntegerChanged(int);
|
||||
void RandomValueListChanged(const StringList &);
|
||||
void AllowRepeatValuesChanged(int);
|
||||
void JsonQueryChanged();
|
||||
void JsonIndexChanged(const NumberVariable<int> &);
|
||||
|
||||
|
|
@ -194,11 +203,10 @@ private:
|
|||
QLabel *_segmentValueStatus;
|
||||
ResizingPlainTextEdit *_segmentValue;
|
||||
QVBoxLayout *_substringLayout;
|
||||
QHBoxLayout *_subStringIndexEntryLayout;
|
||||
QHBoxLayout *_subStringRegexEntryLayout;
|
||||
QHBoxLayout *_subStringControlsLayout;
|
||||
VariableSpinBox *_subStringStart;
|
||||
VariableSpinBox *_subStringSize;
|
||||
RegexConfigWidget *_substringRegex;
|
||||
RegexConfigWidget *_subStringRegex;
|
||||
ResizingPlainTextEdit *_regexPattern;
|
||||
VariableSpinBox *_regexMatchIdx;
|
||||
QHBoxLayout *_findReplaceLayout;
|
||||
|
|
@ -225,7 +233,10 @@ private:
|
|||
VariableDoubleSpinBox *_randomNumberStart;
|
||||
VariableDoubleSpinBox *_randomNumberEnd;
|
||||
QCheckBox *_generateInteger;
|
||||
QVBoxLayout *_randomLayout;
|
||||
QVBoxLayout *_randomNumberLayout;
|
||||
StringListEdit *_randomValues;
|
||||
QCheckBox *_allowRepeatValues;
|
||||
QVBoxLayout *_randomValueLayout;
|
||||
VariableLineEdit *_jsonQuery;
|
||||
QLabel *_jsonQueryHelp;
|
||||
VariableSpinBox *_jsonIndex;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ void DurationModifierEdit::Collapse(bool collapse)
|
|||
|
||||
MacroConditionEdit::MacroConditionEdit(
|
||||
QWidget *parent, std::shared_ptr<MacroCondition> *entryData,
|
||||
const std::string &id, bool isRootCondition)
|
||||
bool isRootCondition)
|
||||
: MacroSegmentEdit(parent),
|
||||
_logicSelection(new QComboBox()),
|
||||
_conditionSelection(new FilterComboBox()),
|
||||
|
|
|
|||
|
|
@ -34,11 +34,9 @@ class MacroConditionEdit : public MacroSegmentEdit {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MacroConditionEdit(
|
||||
QWidget *parent = nullptr,
|
||||
std::shared_ptr<MacroCondition> * = nullptr,
|
||||
const std::string &id = MacroCondition::GetDefaultID().data(),
|
||||
bool root = true);
|
||||
MacroConditionEdit(QWidget *parent = nullptr,
|
||||
std::shared_ptr<MacroCondition> * = nullptr,
|
||||
bool root = true);
|
||||
bool IsRootNode() const;
|
||||
void SetRootNode(bool);
|
||||
void SetupWidgets(bool basicSetup = false);
|
||||
|
|
|
|||
|
|
@ -315,6 +315,7 @@ MacroConditionMacroEdit::MacroConditionMacroEdit(
|
|||
_actionIndex(new MacroSegmentSelection(
|
||||
this, MacroSegmentSelection::Type::ACTION))
|
||||
{
|
||||
_macros->HideGroups();
|
||||
_count->setMaximum(10000000);
|
||||
populateTypeSelection(_types);
|
||||
populateCounterConditionSelection(_counterConditions);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,17 @@ MacroCondition::MacroCondition(Macro *m, bool supportsVariableValue)
|
|||
{
|
||||
}
|
||||
|
||||
bool MacroCondition::EvaluateCondition()
|
||||
{
|
||||
bool newValue = CheckCondition();
|
||||
_changed = _previousValue.has_value() && (*_previousValue != newValue);
|
||||
const bool negate = _logic.IsNegationType(GetLogicType());
|
||||
_risingEdge = _changed &&
|
||||
((!negate && newValue) || (negate && !newValue));
|
||||
_previousValue = newValue;
|
||||
return newValue;
|
||||
}
|
||||
|
||||
bool MacroCondition::Save(obs_data_t *obj) const
|
||||
{
|
||||
MacroSegment::Save(obj);
|
||||
|
|
|
|||
|
|
@ -4,13 +4,19 @@
|
|||
#include "duration-modifier.hpp"
|
||||
#include "macro-ref.hpp"
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace advss {
|
||||
|
||||
class EXPORT MacroCondition : public MacroSegment {
|
||||
public:
|
||||
MacroCondition(Macro *m, bool supportsVariableValue = false);
|
||||
virtual ~MacroCondition() = default;
|
||||
virtual bool CheckCondition() = 0;
|
||||
|
||||
bool EvaluateCondition();
|
||||
bool HasChanged() const { return _changed; }
|
||||
bool IsRisingEdge() const { return _risingEdge; }
|
||||
|
||||
virtual bool Save(obs_data_t *obj) const = 0;
|
||||
virtual bool Load(obs_data_t *obj) = 0;
|
||||
|
||||
|
|
@ -28,9 +34,15 @@ public:
|
|||
|
||||
static std::string_view GetDefaultID();
|
||||
|
||||
protected:
|
||||
virtual bool CheckCondition() = 0;
|
||||
|
||||
private:
|
||||
Logic _logic = Logic(Logic::Type::ROOT_NONE);
|
||||
DurationModifier _durationModifier;
|
||||
std::optional<bool> _previousValue;
|
||||
bool _changed = false;
|
||||
bool _risingEdge = false;
|
||||
};
|
||||
|
||||
class EXPORT MacroRefCondition : virtual public MacroCondition {
|
||||
|
|
|
|||
|
|
@ -418,8 +418,7 @@ void MacroEdit::PopulateMacroActions(Macro &m, uint32_t afterIdx)
|
|||
ui->actionsList->SetVisibilityCheckEnable(false);
|
||||
|
||||
for (; afterIdx < actions.size(); afterIdx++) {
|
||||
auto newEntry = new MacroActionEdit(this, &actions[afterIdx],
|
||||
actions[afterIdx]->GetId());
|
||||
auto newEntry = new MacroActionEdit(this, &actions[afterIdx]);
|
||||
ui->actionsList->Add(newEntry);
|
||||
}
|
||||
|
||||
|
|
@ -444,8 +443,7 @@ void MacroEdit::PopulateMacroElseActions(Macro &m, uint32_t afterIdx)
|
|||
ui->elseActionsList->SetVisibilityCheckEnable(false);
|
||||
|
||||
for (; afterIdx < actions.size(); afterIdx++) {
|
||||
auto newEntry = new MacroActionEdit(this, &actions[afterIdx],
|
||||
actions[afterIdx]->GetId());
|
||||
auto newEntry = new MacroActionEdit(this, &actions[afterIdx]);
|
||||
ui->elseActionsList->Add(newEntry);
|
||||
}
|
||||
|
||||
|
|
@ -472,8 +470,7 @@ void MacroEdit::PopulateMacroConditions(Macro &m, uint32_t afterIdx)
|
|||
|
||||
for (; afterIdx < conditions.size(); afterIdx++) {
|
||||
auto newEntry = new MacroConditionEdit(
|
||||
this, &conditions[afterIdx],
|
||||
conditions[afterIdx]->GetId(), root);
|
||||
this, &conditions[afterIdx], root);
|
||||
ui->conditionsList->Add(newEntry);
|
||||
root = false;
|
||||
}
|
||||
|
|
@ -1083,13 +1080,17 @@ void MacroEdit::AddMacroAction(Macro *macro, int idx, const std::string &id,
|
|||
RunAndClearPostLoadSteps();
|
||||
macro->UpdateActionIndices();
|
||||
ui->actionsList->Insert(
|
||||
idx,
|
||||
new MacroActionEdit(this, ¯o->Actions()[idx], id));
|
||||
idx, new MacroActionEdit(this, ¯o->Actions()[idx]));
|
||||
SetActionData(*macro);
|
||||
}
|
||||
HighlightAction(idx);
|
||||
ui->actionsList->SetHelpMsgVisible(false);
|
||||
emit(MacroSegmentOrderChanged());
|
||||
|
||||
QTimer::singleShot(0, this, [this]() {
|
||||
ui->actionsList->ensureWidgetVisible(
|
||||
ui->actionsList->WidgetAt(currentActionIdx));
|
||||
});
|
||||
}
|
||||
|
||||
void MacroEdit::AddMacroAction(int idx)
|
||||
|
|
@ -1386,13 +1387,18 @@ void MacroEdit::AddMacroElseAction(Macro *macro, int idx, const std::string &id,
|
|||
RunAndClearPostLoadSteps();
|
||||
macro->UpdateElseActionIndices();
|
||||
ui->elseActionsList->Insert(
|
||||
idx, new MacroActionEdit(
|
||||
this, ¯o->ElseActions()[idx], id));
|
||||
idx,
|
||||
new MacroActionEdit(this, ¯o->ElseActions()[idx]));
|
||||
SetElseActionData(*macro);
|
||||
}
|
||||
HighlightElseAction(idx);
|
||||
ui->elseActionsList->SetHelpMsgVisible(false);
|
||||
emit(MacroSegmentOrderChanged());
|
||||
|
||||
QTimer::singleShot(0, this, [this]() {
|
||||
ui->elseActionsList->ensureWidgetVisible(
|
||||
ui->elseActionsList->WidgetAt(currentElseActionIdx));
|
||||
});
|
||||
}
|
||||
|
||||
void MacroEdit::AddMacroElseAction(int idx)
|
||||
|
|
@ -1589,12 +1595,17 @@ void MacroEdit::AddMacroCondition(Macro *macro, int idx, const std::string &id,
|
|||
ui->conditionsList->Insert(
|
||||
idx,
|
||||
new MacroConditionEdit(this, ¯o->Conditions()[idx],
|
||||
id, idx == 0));
|
||||
idx == 0));
|
||||
SetConditionData(*macro);
|
||||
}
|
||||
HighlightCondition(idx);
|
||||
ui->conditionsList->SetHelpMsgVisible(false);
|
||||
emit(MacroSegmentOrderChanged());
|
||||
|
||||
QTimer::singleShot(0, this, [this]() {
|
||||
ui->conditionsList->ensureWidgetVisible(
|
||||
ui->conditionsList->WidgetAt(currentConditionIdx));
|
||||
});
|
||||
}
|
||||
|
||||
void MacroEdit::on_conditionAdd_clicked()
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ namespace advss {
|
|||
class Macro;
|
||||
class MacroSegment;
|
||||
|
||||
/*******************************************************************************
|
||||
* Advanced Scene Switcher window
|
||||
*******************************************************************************/
|
||||
class MacroEdit : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,33 @@ std::deque<std::shared_ptr<Macro>> GetAllMacros()
|
|||
return macros;
|
||||
}
|
||||
|
||||
Macro *GetMacroByName(const char *name)
|
||||
{
|
||||
for (const auto &m : GetTopLevelMacros()) {
|
||||
if (m->Name() == name) {
|
||||
return m.get();
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Macro *GetMacroByQString(const QString &name)
|
||||
{
|
||||
return GetMacroByName(name.toUtf8().constData());
|
||||
}
|
||||
|
||||
std::weak_ptr<Macro> GetWeakMacroByName(const char *name)
|
||||
{
|
||||
for (const auto &m : GetTopLevelMacros()) {
|
||||
if (m->Name() == name) {
|
||||
return m;
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::optional<std::deque<std::shared_ptr<MacroAction>>>
|
||||
GetMacroActions(Macro *macro)
|
||||
{
|
||||
|
|
@ -90,9 +117,32 @@ GetMacroConditions(Macro *macro)
|
|||
return macro->Conditions();
|
||||
}
|
||||
|
||||
std::string_view GetSceneSwitchActionId()
|
||||
bool IsGroupMacro(Macro *macro)
|
||||
{
|
||||
return MacroAction::GetDefaultID();
|
||||
return macro && macro->IsGroup();
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<Macro>> GetGroupMacroEntries(Macro *macro)
|
||||
{
|
||||
if (!macro || !macro->IsGroup()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<Macro>> entries;
|
||||
entries.reserve(macro->GroupSize());
|
||||
|
||||
const auto ¯os = GetTopLevelMacros();
|
||||
for (auto it = macros.begin(); it < macros.end(); it++) {
|
||||
if ((*it)->Name() != macro->Name()) {
|
||||
continue;
|
||||
}
|
||||
for (uint32_t i = 1; i <= macro->GroupSize(); i++) {
|
||||
entries.emplace_back(*std::next(it, i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return entries;
|
||||
}
|
||||
|
||||
std::condition_variable &GetMacroWaitCV()
|
||||
|
|
@ -192,6 +242,11 @@ bool RunMacroActions(Macro *macro)
|
|||
return macro && macro->PerformActions(true);
|
||||
}
|
||||
|
||||
bool RunMacroElseActions(Macro *macro)
|
||||
{
|
||||
return macro && macro->PerformActions(false);
|
||||
}
|
||||
|
||||
void ResetMacroConditionTimers(Macro *macro)
|
||||
{
|
||||
if (!macro) {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
#pragma once
|
||||
#include "export-symbol-helper.hpp"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
#include <deque>
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
#include <thread>
|
||||
|
||||
struct obs_data;
|
||||
|
|
@ -18,10 +19,16 @@ class Macro;
|
|||
class MacroAction;
|
||||
class MacroCondition;
|
||||
|
||||
static const int macro_func = 10;
|
||||
|
||||
EXPORT std::deque<std::shared_ptr<Macro>> &GetTopLevelMacros();
|
||||
std::deque<std::shared_ptr<Macro>> &GetTemporaryMacros();
|
||||
EXPORT std::deque<std::shared_ptr<Macro>> GetAllMacros();
|
||||
|
||||
Macro *GetMacroByName(const char *name);
|
||||
Macro *GetMacroByQString(const QString &name);
|
||||
std::weak_ptr<Macro> GetWeakMacroByName(const char *name);
|
||||
|
||||
EXPORT std::optional<std::deque<std::shared_ptr<MacroAction>>>
|
||||
GetMacroActions(Macro *);
|
||||
EXPORT std::optional<std::deque<std::shared_ptr<MacroAction>>>
|
||||
|
|
@ -29,9 +36,8 @@ GetMacroElseActions(Macro *);
|
|||
EXPORT std::optional<std::deque<std::shared_ptr<MacroCondition>>>
|
||||
GetMacroConditions(Macro *);
|
||||
|
||||
std::string_view GetSceneSwitchActionId();
|
||||
|
||||
constexpr auto macro_func = 10;
|
||||
EXPORT bool IsGroupMacro(Macro *);
|
||||
EXPORT std::vector<std::shared_ptr<Macro>> GetGroupMacroEntries(Macro *);
|
||||
|
||||
EXPORT std::condition_variable &GetMacroWaitCV();
|
||||
EXPORT std::condition_variable &GetMacroTransitionCV();
|
||||
|
|
@ -62,6 +68,7 @@ EXPORT void AddMacroHelperThread(Macro *, std::thread &&);
|
|||
EXPORT bool CheckMacros();
|
||||
|
||||
EXPORT bool RunMacroActions(Macro *);
|
||||
bool RunMacroElseActions(Macro *);
|
||||
EXPORT bool RunMacros();
|
||||
void StopAllMacros();
|
||||
|
||||
|
|
|
|||
323
lib/macro/macro-search.cpp
Normal file
323
lib/macro/macro-search.cpp
Normal file
|
|
@ -0,0 +1,323 @@
|
|||
#include "macro-search.hpp"
|
||||
#include "layout-helpers.hpp"
|
||||
#include "macro.hpp"
|
||||
#include "macro-action-factory.hpp"
|
||||
#include "macro-condition-factory.hpp"
|
||||
#include "macro-helpers.hpp"
|
||||
#include "macro-signals.hpp"
|
||||
#include "plugin-state-helpers.hpp"
|
||||
#include "ui-helpers.hpp"
|
||||
|
||||
#include <obs.hpp>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
|
||||
namespace advss {
|
||||
|
||||
static bool searchEnabled = false;
|
||||
static bool setup();
|
||||
static bool setupDone = setup();
|
||||
|
||||
static QLayout *searchLayout = nullptr;
|
||||
static QComboBox *searchType = nullptr;
|
||||
static RegexConfigWidget *searchRegex = nullptr;
|
||||
static QPushButton *showSettings = nullptr;
|
||||
static std::function<void()> refreshFilter;
|
||||
|
||||
static void save(obs_data_t *data)
|
||||
{
|
||||
GetMacroSearchSettings().Save(data, "macroSearchSettings");
|
||||
}
|
||||
|
||||
static void load(obs_data_t *data)
|
||||
{
|
||||
GetMacroSearchSettings().Load(data, "macroSearchSettings");
|
||||
}
|
||||
|
||||
static bool setup()
|
||||
{
|
||||
AddSaveStep(save);
|
||||
AddLoadStep(load);
|
||||
return true;
|
||||
}
|
||||
|
||||
void MacroSearchSettings::Save(obs_data_t *data, const char *name)
|
||||
{
|
||||
OBSDataAutoRelease settings = obs_data_create();
|
||||
obs_data_set_bool(settings, "showAlways", showAlways);
|
||||
obs_data_set_int(settings, "searchType", static_cast<int>(searchType));
|
||||
obs_data_set_string(settings, "searchString", searchString.c_str());
|
||||
regex.Save(settings);
|
||||
obs_data_set_obj(data, name, settings);
|
||||
}
|
||||
|
||||
void MacroSearchSettings::Load(obs_data_t *data, const char *name)
|
||||
{
|
||||
OBSDataAutoRelease settings = obs_data_get_obj(data, name);
|
||||
showAlways = obs_data_get_bool(settings, "showAlways");
|
||||
searchType = static_cast<SearchType>(
|
||||
obs_data_get_int(settings, "searchType"));
|
||||
searchString = obs_data_get_string(settings, "searchString");
|
||||
regex.Load(settings);
|
||||
}
|
||||
|
||||
static void showAdvancedSearchSettings(bool show)
|
||||
{
|
||||
assert(searchType);
|
||||
assert(searchRegex);
|
||||
|
||||
searchType->setVisible(show);
|
||||
searchRegex->setVisible(show);
|
||||
}
|
||||
|
||||
static bool shouldShowSearch()
|
||||
{
|
||||
static const int showSearchThreshold = 10;
|
||||
return GetMacroSearchSettings().showAlways ||
|
||||
GetTopLevelMacros().size() >= showSearchThreshold;
|
||||
}
|
||||
|
||||
void CheckMacroSearchVisibility()
|
||||
{
|
||||
assert(searchLayout);
|
||||
assert(searchType);
|
||||
assert(searchRegex);
|
||||
assert(showSettings);
|
||||
|
||||
searchEnabled = shouldShowSearch();
|
||||
SetLayoutVisible(searchLayout, searchEnabled);
|
||||
showAdvancedSearchSettings(false);
|
||||
showSettings->setChecked(false);
|
||||
refreshFilter();
|
||||
}
|
||||
|
||||
void SetupMacroSearchWidgets(QLayout *searchLayoutArg, QLineEdit *searchText,
|
||||
QPushButton *searchClear, QComboBox *searchTypeArg,
|
||||
RegexConfigWidget *searchRegexArg,
|
||||
QPushButton *showSettingsArg,
|
||||
const std::function<void()> &refreshArg)
|
||||
{
|
||||
searchLayout = searchLayoutArg;
|
||||
searchType = searchTypeArg;
|
||||
searchRegex = searchRegexArg;
|
||||
refreshFilter = refreshArg;
|
||||
showSettings = showSettingsArg;
|
||||
|
||||
searchClear->setMaximumWidth(22);
|
||||
SetButtonIcon(searchClear, GetThemeTypeName() == "Light"
|
||||
? "theme:Light/close.svg"
|
||||
: "theme:Dark/close.svg");
|
||||
searchClear->setDisabled(GetMacroSearchSettings().searchString.empty());
|
||||
|
||||
QWidget::connect(searchClear, &QPushButton::clicked, searchClear,
|
||||
[=]() {
|
||||
searchText->setText("");
|
||||
searchClear->setDisabled(true);
|
||||
});
|
||||
|
||||
const auto ph = searchText->placeholderText();
|
||||
const QFontMetrics fm(searchText->font());
|
||||
const int width = fm.horizontalAdvance(ph);
|
||||
// Add a little padding so the text isn't cramped
|
||||
searchText->setMinimumWidth(width + 10);
|
||||
|
||||
searchText->setText(
|
||||
QString::fromStdString(GetMacroSearchSettings().searchString));
|
||||
QWidget::connect(searchText, &QLineEdit::textChanged, searchText,
|
||||
[searchClear](const QString &text) {
|
||||
GetMacroSearchSettings().searchString =
|
||||
text.toStdString();
|
||||
searchClear->setDisabled(text.isEmpty());
|
||||
refreshFilter();
|
||||
});
|
||||
|
||||
searchType->addItem(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.search.name"),
|
||||
static_cast<int>(MacroSearchSettings::SearchType::NAME));
|
||||
searchType->addItem(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.search.allSegments"),
|
||||
static_cast<int>(
|
||||
MacroSearchSettings::SearchType::ALL_SEGMENTS));
|
||||
searchType->addItem(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.search.conditions"),
|
||||
static_cast<int>(MacroSearchSettings::SearchType::CONDITIONS));
|
||||
searchType->addItem(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.search.actions"),
|
||||
static_cast<int>(MacroSearchSettings::SearchType::ACTIONS));
|
||||
searchType->addItem(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.search.label"),
|
||||
static_cast<int>(MacroSearchSettings::SearchType::LABEL));
|
||||
searchType->setCurrentIndex(searchType->findData(
|
||||
static_cast<int>(GetMacroSearchSettings().searchType)));
|
||||
QWidget::connect(
|
||||
searchType, &QComboBox::currentIndexChanged, searchType, []() {
|
||||
GetMacroSearchSettings().searchType =
|
||||
static_cast<MacroSearchSettings::SearchType>(
|
||||
searchType->currentData().toInt());
|
||||
refreshFilter();
|
||||
});
|
||||
|
||||
searchRegex->SetRegexConfig(GetMacroSearchSettings().regex);
|
||||
QWidget::connect(searchRegex, &RegexConfigWidget::RegexConfigChanged,
|
||||
searchRegex, [](const RegexConfig ®ex) {
|
||||
GetMacroSearchSettings().regex = regex;
|
||||
refreshFilter();
|
||||
});
|
||||
|
||||
showSettings->setCheckable(true);
|
||||
showSettings->setMaximumWidth(11);
|
||||
SetButtonIcon(showSettings, GetThemeTypeName() == "Light"
|
||||
? ":/res/images/dots-vert.svg"
|
||||
: "theme:Dark/dots-vert.svg");
|
||||
QWidget::connect(showSettings, &QPushButton::toggled, showSettings,
|
||||
showAdvancedSearchSettings);
|
||||
|
||||
QWidget::connect(MacroSignalManager::Instance(),
|
||||
&MacroSignalManager::Rename, searchText,
|
||||
[]() { refreshFilter(); });
|
||||
|
||||
CheckMacroSearchVisibility();
|
||||
}
|
||||
|
||||
MacroSearchSettings &GetMacroSearchSettings()
|
||||
{
|
||||
static MacroSearchSettings settings;
|
||||
return settings;
|
||||
}
|
||||
|
||||
static bool stringMatches(const std::string &text)
|
||||
{
|
||||
const auto &settings = GetMacroSearchSettings();
|
||||
const auto ®ex = settings.regex;
|
||||
const auto &searchString = settings.searchString;
|
||||
|
||||
if (regex.Enabled()) {
|
||||
return regex.Matches(text, searchString);
|
||||
}
|
||||
|
||||
return QString::fromStdString(text).contains(
|
||||
QString::fromStdString(searchString), Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
static bool segmentTypeMatches(MacroSegment *segment, bool isCondition)
|
||||
{
|
||||
if (!segment) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto getNameFromId =
|
||||
isCondition ? MacroConditionFactory::GetConditionName
|
||||
: MacroActionFactory::GetActionName;
|
||||
const auto name = getNameFromId(segment->GetId());
|
||||
return stringMatches(obs_module_text(name.c_str()));
|
||||
}
|
||||
|
||||
static bool segmentLabelMatches(MacroSegment *segment)
|
||||
{
|
||||
if (!segment) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!segment->GetUseCustomLabel()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto label = segment->GetCustomLabel();
|
||||
return stringMatches(label);
|
||||
}
|
||||
|
||||
bool MacroMatchesSearchFilter(Macro *macro)
|
||||
{
|
||||
assert(macro);
|
||||
|
||||
if (!searchEnabled) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const auto &settings = GetMacroSearchSettings();
|
||||
|
||||
if (settings.searchString.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (macro->IsGroup()) {
|
||||
const auto groupEntries = GetGroupMacroEntries(macro);
|
||||
for (const auto &entry : groupEntries) {
|
||||
if (MacroMatchesSearchFilter(entry.get())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (settings.searchType) {
|
||||
case MacroSearchSettings::SearchType::NAME: {
|
||||
const auto name = macro->Name();
|
||||
return stringMatches(name);
|
||||
}
|
||||
case MacroSearchSettings::SearchType::ALL_SEGMENTS:
|
||||
for (const auto &condition : macro->Conditions()) {
|
||||
if (segmentTypeMatches(condition.get(), true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (const auto &action : macro->Actions()) {
|
||||
if (segmentTypeMatches(action.get(), false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (const auto &action : macro->ElseActions()) {
|
||||
if (segmentTypeMatches(action.get(), false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case MacroSearchSettings::SearchType::CONDITIONS:
|
||||
for (const auto &condition : macro->Conditions()) {
|
||||
if (segmentTypeMatches(condition.get(), true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case MacroSearchSettings::SearchType::ACTIONS:
|
||||
for (const auto &action : macro->Actions()) {
|
||||
if (segmentTypeMatches(action.get(), false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (const auto &action : macro->ElseActions()) {
|
||||
if (segmentTypeMatches(action.get(), false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case MacroSearchSettings::SearchType::LABEL:
|
||||
for (const auto &condition : macro->Conditions()) {
|
||||
if (segmentLabelMatches(condition.get())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (const auto &action : macro->Actions()) {
|
||||
if (segmentLabelMatches(action.get())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (const auto &action : macro->ElseActions()) {
|
||||
if (segmentLabelMatches(action.get())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Unhandled search type
|
||||
assert(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
43
lib/macro/macro-search.hpp
Normal file
43
lib/macro/macro-search.hpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#pragma once
|
||||
#include "regex-config.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
class QComboBox;
|
||||
class QLayout;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
|
||||
namespace advss {
|
||||
|
||||
class Macro;
|
||||
|
||||
struct MacroSearchSettings {
|
||||
void Save(obs_data_t *data, const char *name);
|
||||
void Load(obs_data_t *data, const char *name);
|
||||
|
||||
enum class SearchType {
|
||||
NAME = 0,
|
||||
ALL_SEGMENTS = 10,
|
||||
CONDITIONS = 20,
|
||||
ACTIONS = 30,
|
||||
LABEL = 40,
|
||||
};
|
||||
|
||||
SearchType searchType = SearchType::NAME;
|
||||
std::string searchString;
|
||||
RegexConfig regex;
|
||||
bool showAlways = false;
|
||||
};
|
||||
|
||||
void CheckMacroSearchVisibility();
|
||||
void SetupMacroSearchWidgets(QLayout *searchLayout, QLineEdit *searchText,
|
||||
QPushButton *searchClear, QComboBox *searchType,
|
||||
RegexConfigWidget *searchRegex,
|
||||
QPushButton *showSettings,
|
||||
const std::function<void()> &refresh);
|
||||
MacroSearchSettings &GetMacroSearchSettings();
|
||||
bool MacroMatchesSearchFilter(Macro *macro);
|
||||
|
||||
} // namespace advss
|
||||
|
|
@ -15,9 +15,6 @@ MacroSelection::MacroSelection(QWidget *parent)
|
|||
obs_module_text("AdvSceneSwitcher.selectMacro"))
|
||||
{
|
||||
for (const auto &m : GetTopLevelMacros()) {
|
||||
if (m->IsGroup()) {
|
||||
continue;
|
||||
}
|
||||
addItem(QString::fromStdString(m->Name()));
|
||||
}
|
||||
|
||||
|
|
@ -54,6 +51,7 @@ void MacroSelection::HideSelectedMacro()
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef UNIT_TEST
|
||||
const auto m = ssWindow->ui->macros->GetCurrentMacro();
|
||||
if (!m) {
|
||||
return;
|
||||
|
|
@ -64,6 +62,23 @@ void MacroSelection::HideSelectedMacro()
|
|||
}
|
||||
|
||||
qobject_cast<QListView *>(view())->setRowHidden(idx, true);
|
||||
#endif // !UNIT_TEST
|
||||
}
|
||||
|
||||
void MacroSelection::HideGroups()
|
||||
{
|
||||
for (const auto ¯o : GetTopLevelMacros()) {
|
||||
if (!macro->IsGroup()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int idx = findText(QString::fromStdString(macro->Name()));
|
||||
if (idx == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
qobject_cast<QListView *>(view())->setRowHidden(idx, true);
|
||||
}
|
||||
}
|
||||
|
||||
void MacroSelection::ShowAllMacros()
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ public:
|
|||
MacroSelection(QWidget *parent);
|
||||
void SetCurrentMacro(const MacroRef &);
|
||||
void HideSelectedMacro(); // Macro currently being edited
|
||||
void HideGroups();
|
||||
void ShowAllMacros();
|
||||
|
||||
private slots:
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "macro-condition-edit.hpp"
|
||||
#include "macro-export-import-dialog.hpp"
|
||||
#include "macro-settings.hpp"
|
||||
#include "macro-search.hpp"
|
||||
#include "macro-signals.hpp"
|
||||
#include "macro-tree.hpp"
|
||||
#include "macro.hpp"
|
||||
|
|
@ -24,6 +25,8 @@ namespace advss {
|
|||
|
||||
static QObject *addPulse = nullptr;
|
||||
static QTimer onChangeHighlightTimer;
|
||||
static std::chrono::high_resolution_clock::time_point
|
||||
lastOnChangeHighlightCheckTime{};
|
||||
|
||||
static void disableAddButtonHighlight()
|
||||
{
|
||||
|
|
@ -146,20 +149,7 @@ void AdvSceneSwitcher::on_macroAdd_clicked()
|
|||
static void addGroupSubitems(std::vector<std::shared_ptr<Macro>> ¯os,
|
||||
const std::shared_ptr<Macro> &group)
|
||||
{
|
||||
std::vector<std::shared_ptr<Macro>> subitems;
|
||||
subitems.reserve(group->GroupSize());
|
||||
|
||||
// Find all subitems
|
||||
auto allMacros = GetTopLevelMacros();
|
||||
for (auto it = allMacros.begin(); it < allMacros.end(); it++) {
|
||||
if ((*it)->Name() != group->Name()) {
|
||||
continue;
|
||||
}
|
||||
for (uint32_t i = 1; i <= group->GroupSize(); i++) {
|
||||
subitems.emplace_back(*std::next(it, i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
auto subitems = GetGroupMacroEntries(group.get());
|
||||
|
||||
// Remove subitems which were already selected to avoid duplicates
|
||||
for (const auto &subitem : subitems) {
|
||||
|
|
@ -207,7 +197,7 @@ void AdvSceneSwitcher::RemoveMacro(std::shared_ptr<Macro> ¯o)
|
|||
// Don't cache widgets for about to be deleted macros
|
||||
MacroSegmentList::SetCachingEnabled(false);
|
||||
ui->macros->Remove(macro);
|
||||
MacroSegmentList::SetCachingEnabled(!switcher->disableMacroWidgetCache);
|
||||
MacroSegmentList::SetCachingEnabled(true);
|
||||
|
||||
MacroSignalManager::Instance()->Remove(name);
|
||||
}
|
||||
|
|
@ -484,14 +474,17 @@ void AdvSceneSwitcher::on_runMacroInParallel_stateChanged(int value) const
|
|||
macro->SetRunInParallel(value);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_runMacroOnChange_stateChanged(int value) const
|
||||
void AdvSceneSwitcher::on_actionTriggerMode_currentIndexChanged(int index) const
|
||||
{
|
||||
auto macro = GetSelectedMacro();
|
||||
if (!macro) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
macro->SetMatchOnChange(value);
|
||||
const auto mode = static_cast<Macro::ActionTriggerMode>(
|
||||
ui->actionTriggerMode->itemData(index).toInt());
|
||||
macro->SetActionTriggerMode(mode);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::SetMacroEditAreaDisabled(bool disable) const
|
||||
|
|
@ -499,7 +492,7 @@ void AdvSceneSwitcher::SetMacroEditAreaDisabled(bool disable) const
|
|||
ui->macroName->setDisabled(disable);
|
||||
ui->runMacro->setDisabled(disable);
|
||||
ui->runMacroInParallel->setDisabled(disable);
|
||||
ui->runMacroOnChange->setDisabled(disable);
|
||||
ui->actionTriggerMode->setDisabled(disable);
|
||||
ui->macroEdit->SetControlsDisabled(disable);
|
||||
}
|
||||
|
||||
|
|
@ -529,10 +522,12 @@ void AdvSceneSwitcher::MacroSelectionChanged()
|
|||
{
|
||||
const QSignalBlocker b1(ui->macroName);
|
||||
const QSignalBlocker b2(ui->runMacroInParallel);
|
||||
const QSignalBlocker b3(ui->runMacroOnChange);
|
||||
const QSignalBlocker b3(ui->actionTriggerMode);
|
||||
ui->macroName->setText(macro->Name().c_str());
|
||||
ui->runMacroInParallel->setChecked(macro->RunInParallel());
|
||||
ui->runMacroOnChange->setChecked(macro->MatchOnChange());
|
||||
ui->actionTriggerMode->setCurrentIndex(
|
||||
ui->actionTriggerMode->findData(static_cast<int>(
|
||||
macro->GetActionTriggerMode())));
|
||||
}
|
||||
|
||||
macro->ResetUIHelpers();
|
||||
|
|
@ -562,10 +557,14 @@ void AdvSceneSwitcher::HighlightOnChange() const
|
|||
return;
|
||||
}
|
||||
|
||||
if (macro->OnChangePreventedActionsRecently()) {
|
||||
HighlightWidget(ui->runMacroOnChange, Qt::yellow,
|
||||
if (macro->ActionTriggerModePreventedActionsSince(
|
||||
lastOnChangeHighlightCheckTime)) {
|
||||
HighlightWidget(ui->actionTriggerMode, Qt::yellow,
|
||||
Qt::transparent, true);
|
||||
}
|
||||
|
||||
lastOnChangeHighlightCheckTime =
|
||||
std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_macroSettings_clicked()
|
||||
|
|
@ -615,17 +614,20 @@ setupToolBar(const std::initializer_list<std::initializer_list<QWidget *>>
|
|||
auto toolbar = new QToolBar();
|
||||
toolbar->setIconSize({16, 16});
|
||||
|
||||
QAction *lastSeperator = nullptr;
|
||||
QAction *lastSeparator = nullptr;
|
||||
|
||||
for (const auto &widgetGroup : widgetGroups) {
|
||||
for (const auto &widget : widgetGroup) {
|
||||
if (!widget) {
|
||||
continue;
|
||||
}
|
||||
toolbar->addWidget(widget);
|
||||
}
|
||||
lastSeperator = toolbar->addSeparator();
|
||||
lastSeparator = toolbar->addSeparator();
|
||||
}
|
||||
|
||||
if (lastSeperator) {
|
||||
toolbar->removeAction(lastSeperator);
|
||||
if (lastSeparator) {
|
||||
toolbar->removeAction(lastSeparator);
|
||||
}
|
||||
|
||||
// Prevent "extension" button from showing up
|
||||
|
|
@ -638,7 +640,9 @@ void AdvSceneSwitcher::SetupMacroTab()
|
|||
{
|
||||
ui->macros->installEventFilter(this);
|
||||
|
||||
if (GetTopLevelMacros().size() == 0 && !switcher->disableHints) {
|
||||
auto ¯os = GetTopLevelMacros();
|
||||
|
||||
if (macros.size() == 0 && !switcher->disableHints) {
|
||||
addPulse = HighlightWidget(ui->macroAdd, QColor(Qt::green));
|
||||
}
|
||||
|
||||
|
|
@ -646,8 +650,7 @@ void AdvSceneSwitcher::SetupMacroTab()
|
|||
{ui->macroUp, ui->macroDown}});
|
||||
ui->macroControlLayout->addWidget(macroControls);
|
||||
|
||||
ui->macros->Reset(GetTopLevelMacros(),
|
||||
GetGlobalMacroSettings()._highlightExecuted);
|
||||
ui->macros->Reset(macros, GetGlobalMacroSettings()._highlightExecuted);
|
||||
connect(ui->macros, SIGNAL(MacroSelectionChanged()), this,
|
||||
SLOT(MacroSelectionChanged()));
|
||||
ui->runMacro->SetMacroTree(ui->macros);
|
||||
|
|
@ -660,21 +663,55 @@ void AdvSceneSwitcher::SetupMacroTab()
|
|||
ui->macroPriorityWarning->setVisible(
|
||||
switcher->functionNamesByPriority[0] != macro_func);
|
||||
|
||||
lastOnChangeHighlightCheckTime =
|
||||
std::chrono::high_resolution_clock::now();
|
||||
onChangeHighlightTimer.setInterval(1500);
|
||||
connect(&onChangeHighlightTimer, SIGNAL(timeout()), this,
|
||||
SLOT(HighlightOnChange()));
|
||||
onChangeHighlightTimer.start();
|
||||
|
||||
// Reserve more space for macro edit area than for the macro list
|
||||
ui->macroListMacroEditSplitter->setStretchFactor(0, 1);
|
||||
ui->macroListMacroEditSplitter->setStretchFactor(1, 4);
|
||||
SetupMacroSearchWidgets(ui->macroSearchLayout, ui->macroSearchText,
|
||||
ui->macroSearchClear, ui->macroSearchType,
|
||||
ui->macroSearchRegex,
|
||||
ui->macroSearchShowSettings,
|
||||
[this]() { ui->macros->RefreshFilter(); });
|
||||
|
||||
if (switcher->saveWindowGeo) {
|
||||
if (shouldRestoreSplitter(
|
||||
switcher->macroListMacroEditSplitterPosition)) {
|
||||
static const std::vector<
|
||||
std::pair<Macro::ActionTriggerMode, const char *>>
|
||||
actionTriggerModes = {
|
||||
{Macro::ActionTriggerMode::ALWAYS,
|
||||
"AdvSceneSwitcher.macroTab.actionTriggerMode.always"},
|
||||
{Macro::ActionTriggerMode::MACRO_RESULT_CHANGED,
|
||||
"AdvSceneSwitcher.macroTab.actionTriggerMode.onOverallChange"},
|
||||
{Macro::ActionTriggerMode::ANY_CONDITION_CHANGED,
|
||||
"AdvSceneSwitcher.macroTab.actionTriggerMode.onAnyConditionChange"},
|
||||
{Macro::ActionTriggerMode::ANY_CONDITION_TRIGGERED,
|
||||
"AdvSceneSwitcher.macroTab.actionTriggerMode.onAnyConditionTriggered"},
|
||||
};
|
||||
|
||||
for (const auto &[mode, name] : actionTriggerModes) {
|
||||
ui->actionTriggerMode->addItem(obs_module_text(name),
|
||||
static_cast<int>(mode));
|
||||
}
|
||||
|
||||
ui->macroListBox->setSizePolicy(QSizePolicy::Ignored,
|
||||
QSizePolicy::Preferred);
|
||||
ui->macroListBox->setMinimumWidth(0);
|
||||
ui->macroEditGroup->setSizePolicy(QSizePolicy::Ignored,
|
||||
QSizePolicy::Preferred);
|
||||
ui->macroEditGroup->setMinimumWidth(0);
|
||||
|
||||
if (shouldRestoreSplitter(
|
||||
switcher->macroListMacroEditSplitterPosition)) {
|
||||
ui->macroListMacroEditSplitter->setSizes(
|
||||
switcher->macroListMacroEditSplitterPosition);
|
||||
} else {
|
||||
QTimer::singleShot(0, this, [this]() {
|
||||
const auto totalWidth =
|
||||
ui->macroListMacroEditSplitter->width();
|
||||
ui->macroListMacroEditSplitter->setSizes(
|
||||
switcher->macroListMacroEditSplitterPosition);
|
||||
}
|
||||
{totalWidth / 5, totalWidth * 4 / 5});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
#include "macro-tree.hpp"
|
||||
#include "macro.hpp"
|
||||
#include "macro-search.hpp"
|
||||
#include "macro-signals.hpp"
|
||||
#include "path-helpers.hpp"
|
||||
#include "sync-helpers.hpp"
|
||||
#include "ui-helpers.hpp"
|
||||
#include "utility.hpp"
|
||||
|
||||
#include <obs.h>
|
||||
#include <string>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpacerItem>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMouseEvent>
|
||||
#include <QStylePainter>
|
||||
#include <QToolTip>
|
||||
|
||||
Q_DECLARE_METATYPE(std::shared_ptr<advss::Macro>);
|
||||
|
||||
|
|
@ -61,12 +61,11 @@ MacroTreeItem::MacroTreeItem(MacroTree *tree, std::shared_ptr<Macro> macroItem,
|
|||
|
||||
_boxLayout = new QHBoxLayout();
|
||||
_boxLayout->setContentsMargins(0, 0, 0, 0);
|
||||
_boxLayout->addWidget(_running);
|
||||
if (isGroup) {
|
||||
_boxLayout->addWidget(_iconLabel);
|
||||
_boxLayout->addSpacing(2);
|
||||
_running->hide();
|
||||
}
|
||||
_boxLayout->addWidget(_running);
|
||||
_boxLayout->addWidget(_label);
|
||||
#ifdef __APPLE__
|
||||
/* Hack: Fixes a bug where scrollbars would be above the lock icon */
|
||||
|
|
@ -76,29 +75,138 @@ MacroTreeItem::MacroTreeItem(MacroTree *tree, std::shared_ptr<Macro> macroItem,
|
|||
Update(true);
|
||||
setLayout(_boxLayout);
|
||||
|
||||
auto setRunning = [this](bool val) {
|
||||
_macro->SetPaused(!val);
|
||||
};
|
||||
connect(_running, &QAbstractButton::clicked, setRunning);
|
||||
connect(_running, SIGNAL(clicked(bool)), this,
|
||||
SLOT(RunningClicked(bool)));
|
||||
connect(MacroSignalManager::Instance(), SIGNAL(HighlightChanged(bool)),
|
||||
this, SLOT(EnableHighlight(bool)));
|
||||
connect(MacroSignalManager::Instance(),
|
||||
SIGNAL(Rename(const QString &, const QString &)), this,
|
||||
SLOT(MacroRenamed(const QString &, const QString &)));
|
||||
connect(&_timer, SIGNAL(timeout()), this, SLOT(HighlightIfExecuted()));
|
||||
connect(&_timer, SIGNAL(timeout()), this, SLOT(UpdatePaused()));
|
||||
connect(&_timer, SIGNAL(timeout()), this, SLOT(UpdateRunning()));
|
||||
|
||||
UpdateRunning();
|
||||
_timer.start(1500);
|
||||
}
|
||||
|
||||
bool MacroTreeItem::event(QEvent *event)
|
||||
{
|
||||
if (event->type() != QEvent::ToolTip) {
|
||||
return QFrame::event(event);
|
||||
}
|
||||
|
||||
if (_macro->IsGroup()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
QString text;
|
||||
if (!_macro->WasExecutedSince({})) {
|
||||
text = obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.macroNotYetExecutedTooltip");
|
||||
} else {
|
||||
const QString formatStr = obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.macroLastExecutedTooltip");
|
||||
const auto secondsSinceLastRun =
|
||||
std::chrono::duration_cast<std::chrono::seconds>(
|
||||
std::chrono::high_resolution_clock::now() -
|
||||
_macro->GetLastExecutionTime());
|
||||
text = formatStr.arg(secondsSinceLastRun.count());
|
||||
}
|
||||
|
||||
auto helpEvent = static_cast<QHelpEvent *>(event);
|
||||
QToolTip::showText(helpEvent->globalPos(), text, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
void MacroTreeItem::EnableHighlight(bool enable)
|
||||
{
|
||||
_highlight = enable;
|
||||
}
|
||||
|
||||
void MacroTreeItem::UpdatePaused()
|
||||
void MacroTreeItem::RunningClicked(bool running)
|
||||
{
|
||||
const auto updateWidget = [this](Macro *macro) {
|
||||
if (!macro) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto ¯os = GetTopLevelMacros();
|
||||
|
||||
bool found = false;
|
||||
int idx = 0;
|
||||
for (const auto &m : macros) {
|
||||
if (m.get() == macro) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto widget = _tree->GetItemWidget(idx);
|
||||
if (widget) {
|
||||
widget->UpdateRunning();
|
||||
}
|
||||
};
|
||||
|
||||
if (!_macro->IsGroup()) {
|
||||
_macro->SetPaused(!running);
|
||||
if (!_macro->IsSubitem()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto group = _macro->Parent();
|
||||
updateWidget(group.get());
|
||||
return;
|
||||
}
|
||||
|
||||
const auto macros = GetGroupMacroEntries(_macro.get());
|
||||
for (const auto ¯o : macros) {
|
||||
macro->SetPaused(!running);
|
||||
}
|
||||
|
||||
// Update backend values before updating UI to prevent flickering in
|
||||
// running state of the group
|
||||
for (const auto ¯o : macros) {
|
||||
updateWidget(macro.get());
|
||||
}
|
||||
UpdateRunning();
|
||||
}
|
||||
|
||||
void MacroTreeItem::UpdateRunning()
|
||||
{
|
||||
const QSignalBlocker blocker(_running);
|
||||
_running->setChecked(!_macro->Paused());
|
||||
|
||||
if (!_macro->IsGroup()) {
|
||||
_running->setChecked(!_macro->Paused());
|
||||
return;
|
||||
}
|
||||
|
||||
const auto macros = GetGroupMacroEntries(_macro.get());
|
||||
bool allRunning = true;
|
||||
bool allPaused = true;
|
||||
for (const auto ¯o : macros) {
|
||||
if (macro->Paused()) {
|
||||
allRunning = false;
|
||||
} else {
|
||||
allPaused = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (allRunning) {
|
||||
_running->setCheckState(Qt::Checked);
|
||||
return;
|
||||
}
|
||||
|
||||
if (allPaused) {
|
||||
_running->setCheckState(Qt::Unchecked);
|
||||
return;
|
||||
}
|
||||
|
||||
_running->setCheckState(Qt::PartiallyChecked);
|
||||
}
|
||||
|
||||
void MacroTreeItem::HighlightIfExecuted()
|
||||
|
|
@ -107,10 +215,20 @@ void MacroTreeItem::HighlightIfExecuted()
|
|||
return;
|
||||
}
|
||||
|
||||
bool wasHighlighted = false;
|
||||
if (_lastHighlightCheckTime.time_since_epoch().count() != 0 &&
|
||||
_macro->WasExecutedSince(_lastHighlightCheckTime)) {
|
||||
HighlightWidget(this, Qt::green, QColor(0, 0, 0, 0), true);
|
||||
wasHighlighted = true;
|
||||
}
|
||||
|
||||
if (!wasHighlighted &&
|
||||
_lastHighlightCheckTime.time_since_epoch().count() != 0 &&
|
||||
_macro->ActionTriggerModePreventedActionsSince(
|
||||
_lastHighlightCheckTime)) {
|
||||
HighlightWidget(this, Qt::yellow, QColor(0, 0, 0, 0), true);
|
||||
}
|
||||
|
||||
_lastHighlightCheckTime = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
|
|
@ -187,7 +305,7 @@ void MacroTreeItem::Update(bool force)
|
|||
_expand->blockSignals(true);
|
||||
_expand->setChecked(_macro->IsCollapsed());
|
||||
_expand->blockSignals(false);
|
||||
connect(_expand, &QPushButton::toggled, this,
|
||||
connect(_expand, &QCheckBox::toggled, this,
|
||||
&MacroTreeItem::ExpandClicked);
|
||||
} else {
|
||||
_spacer = new QSpacerItem(3, 1);
|
||||
|
|
@ -213,7 +331,6 @@ void MacroTreeModel::Reset(std::deque<std::shared_ptr<Macro>> &newItems)
|
|||
_macros = newItems;
|
||||
endResetModel();
|
||||
|
||||
UpdateGroupState(false);
|
||||
_mt->ResetWidgets();
|
||||
}
|
||||
|
||||
|
|
@ -458,9 +575,6 @@ void MacroTreeModel::Remove(std::shared_ptr<Macro> item)
|
|||
|
||||
_mt->selectionModel()->clear();
|
||||
|
||||
if (isGroup) {
|
||||
UpdateGroupState(true);
|
||||
}
|
||||
assert(IsInValidState());
|
||||
}
|
||||
|
||||
|
|
@ -549,7 +663,6 @@ MacroTreeModel::MacroTreeModel(MacroTree *st_,
|
|||
_mt(st_),
|
||||
_macros(macros)
|
||||
{
|
||||
UpdateGroupState(false);
|
||||
}
|
||||
|
||||
int MacroTreeModel::rowCount(const QModelIndex &parent) const
|
||||
|
|
@ -703,7 +816,6 @@ void MacroTreeModel::GroupSelectedItems(QModelIndexList &indices)
|
|||
offset++;
|
||||
}
|
||||
|
||||
_hasGroups = true;
|
||||
_mt->selectionModel()->clear();
|
||||
|
||||
Reset(_macros);
|
||||
|
|
@ -761,29 +873,12 @@ void MacroTreeModel::CollapseGroup(std::shared_ptr<Macro> item)
|
|||
assert(IsInValidState());
|
||||
}
|
||||
|
||||
void MacroTreeModel::UpdateGroupState(bool update)
|
||||
{
|
||||
bool nowHasGroups = false;
|
||||
for (auto &item : _macros) {
|
||||
if (item->IsGroup()) {
|
||||
nowHasGroups = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (nowHasGroups != _hasGroups) {
|
||||
_hasGroups = nowHasGroups;
|
||||
if (update) {
|
||||
_mt->UpdateWidgets(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MacroTree::Reset(std::deque<std::shared_ptr<Macro>> ¯os,
|
||||
bool highlight)
|
||||
{
|
||||
_highlight = highlight;
|
||||
MacroTreeModel *mtm = new MacroTreeModel(this, macros);
|
||||
|
||||
auto mtm = new MacroTreeModel(this, macros);
|
||||
setModel(mtm);
|
||||
GetModel()->Reset(macros);
|
||||
connect(selectionModel(),
|
||||
|
|
@ -840,7 +935,6 @@ MacroTree::MacroTree(QWidget *parent_) : QListView(parent_)
|
|||
void MacroTree::ResetWidgets()
|
||||
{
|
||||
MacroTreeModel *mtm = GetModel();
|
||||
mtm->UpdateGroupState(false);
|
||||
int modelIdx = 0;
|
||||
for (int i = 0; i < (int)mtm->_macros.size(); i++) {
|
||||
QModelIndex index = mtm->createIndex(modelIdx, 0, nullptr);
|
||||
|
|
@ -869,7 +963,7 @@ void MacroTree::UpdateWidgets(bool force)
|
|||
|
||||
for (int i = 0; i < (int)mtm->_macros.size(); i++) {
|
||||
std::shared_ptr<Macro> item = mtm->_macros[i];
|
||||
MacroTreeItem *widget = GetItemWidget(i);
|
||||
auto widget = GetItemWidget(i);
|
||||
|
||||
if (!widget) {
|
||||
UpdateWidget(mtm->createIndex(i, 0, nullptr), item);
|
||||
|
|
@ -1204,6 +1298,12 @@ void MacroTree::CollapseGroup(std::shared_ptr<Macro> item) const
|
|||
mtm->CollapseGroup(item);
|
||||
}
|
||||
|
||||
void MacroTree::RefreshFilter()
|
||||
{
|
||||
UpdateWidgets();
|
||||
doItemsLayout();
|
||||
}
|
||||
|
||||
void MacroTree::MoveItemBefore(const std::shared_ptr<Macro> &item,
|
||||
const std::shared_ptr<Macro> &after) const
|
||||
{
|
||||
|
|
@ -1218,7 +1318,7 @@ void MacroTree::MoveItemAfter(const std::shared_ptr<Macro> &item,
|
|||
|
||||
MacroTreeModel *MacroTree::GetModel() const
|
||||
{
|
||||
return reinterpret_cast<MacroTreeModel *>(model());
|
||||
return qobject_cast<MacroTreeModel *>(model());
|
||||
}
|
||||
|
||||
void MacroTree::Remove(std::shared_ptr<Macro> item) const
|
||||
|
|
@ -1333,8 +1433,8 @@ void MacroTree::SelectionChangedHelper(const QItemSelection &,
|
|||
|
||||
inline MacroTreeItem *MacroTree::GetItemWidget(int idx) const
|
||||
{
|
||||
QWidget *widget = indexWidget(GetModel()->createIndex(idx, 0, nullptr));
|
||||
return reinterpret_cast<MacroTreeItem *>(widget);
|
||||
auto widget = indexWidget(GetModel()->createIndex(idx, 0, nullptr));
|
||||
return qobject_cast<MacroTreeItem *>(widget);
|
||||
}
|
||||
|
||||
void MacroTree::paintEvent(QPaintEvent *event)
|
||||
|
|
@ -1361,14 +1461,25 @@ MacroTreeDelegate::MacroTreeDelegate(QObject *parent)
|
|||
QSize MacroTreeDelegate::sizeHint(const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const
|
||||
{
|
||||
MacroTree *tree = qobject_cast<MacroTree *>(parent());
|
||||
QWidget *item = tree->indexWidget(index);
|
||||
auto tree = qobject_cast<MacroTree *>(parent());
|
||||
auto widget = tree->indexWidget(index);
|
||||
|
||||
if (!item) {
|
||||
if (!widget) {
|
||||
return QStyledItemDelegate::sizeHint(option, index);
|
||||
}
|
||||
|
||||
return QSize(item->sizeHint());
|
||||
auto name = index.data(Qt::AccessibleTextRole).toString();
|
||||
auto macro = GetMacroByQString(name);
|
||||
|
||||
if (!macro) {
|
||||
return QStyledItemDelegate::sizeHint(option, index);
|
||||
}
|
||||
|
||||
if (MacroMatchesSearchFilter(macro)) {
|
||||
return QSize(widget->sizeHint());
|
||||
}
|
||||
|
||||
return QSize(0, 0);
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
|
|
@ -34,10 +34,14 @@ public:
|
|||
explicit MacroTreeItem(MacroTree *tree, std::shared_ptr<Macro> macro,
|
||||
bool highlight);
|
||||
|
||||
protected:
|
||||
bool event(QEvent *) override;
|
||||
|
||||
private slots:
|
||||
void ExpandClicked(bool checked);
|
||||
void EnableHighlight(bool enable);
|
||||
void UpdatePaused();
|
||||
void RunningClicked(bool);
|
||||
void UpdateRunning();
|
||||
void HighlightIfExecuted();
|
||||
void MacroRenamed(const QString &, const QString &);
|
||||
|
||||
|
|
@ -106,7 +110,6 @@ private:
|
|||
void UngroupSelectedGroups(QModelIndexList &indices);
|
||||
void ExpandGroup(std::shared_ptr<Macro> item);
|
||||
void CollapseGroup(std::shared_ptr<Macro> item);
|
||||
void UpdateGroupState(bool update);
|
||||
int GetItemMacroIndex(const std::shared_ptr<Macro> &item) const;
|
||||
int GetItemModelIndex(const std::shared_ptr<Macro> &item) const;
|
||||
bool IsLastItem(std::shared_ptr<Macro> item) const;
|
||||
|
|
@ -114,7 +117,6 @@ private:
|
|||
|
||||
MacroTree *_mt;
|
||||
std::deque<std::shared_ptr<Macro>> &_macros;
|
||||
bool _hasGroups = false;
|
||||
|
||||
friend class MacroTree;
|
||||
friend class MacroTreeItem;
|
||||
|
|
@ -142,6 +144,7 @@ public:
|
|||
bool GroupsExist() const;
|
||||
void ExpandGroup(std::shared_ptr<Macro> item) const;
|
||||
void CollapseGroup(std::shared_ptr<Macro> item) const;
|
||||
void RefreshFilter();
|
||||
|
||||
public slots:
|
||||
void GroupSelectedItems();
|
||||
|
|
|
|||
111
lib/macro/macro-websocket-trigger.cpp
Normal file
111
lib/macro/macro-websocket-trigger.cpp
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
#include "websocket-api.hpp"
|
||||
#include "log-helper.hpp"
|
||||
#include "plugin-state-helpers.hpp"
|
||||
#include "variable.hpp"
|
||||
#include "macro-helpers.hpp"
|
||||
|
||||
#include <obs.hpp>
|
||||
|
||||
namespace advss {
|
||||
|
||||
static bool setup();
|
||||
static bool setupDone = setup();
|
||||
static void receiveRunMacroMessage(obs_data_t *data, obs_data_t *);
|
||||
static void receiveSetVariablesMessage(obs_data_t *data, obs_data_t *);
|
||||
|
||||
static const char *runMacroMessage = "AdvancedSceneSwitcherRunMacro";
|
||||
static const char *setVariablesMessage = "AdvancedSceneSwitcherSetVariables";
|
||||
|
||||
static bool setup()
|
||||
{
|
||||
AddPluginInitStep([]() {
|
||||
RegisterWebsocketRequest(runMacroMessage,
|
||||
receiveRunMacroMessage);
|
||||
RegisterWebsocketRequest(setVariablesMessage,
|
||||
receiveSetVariablesMessage);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
static void setVariables(obs_data_t *data)
|
||||
{
|
||||
OBSDataArrayAutoRelease variables =
|
||||
obs_data_get_array(data, "variables");
|
||||
size_t count = obs_data_array_count(variables);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
OBSDataAutoRelease item = obs_data_array_item(variables, i);
|
||||
if (!obs_data_has_user_value(item, "name")) {
|
||||
blog(LOG_INFO,
|
||||
"ignoring invalid variable entry in \"%s\" websocket message (missing \"name\")",
|
||||
runMacroMessage);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!obs_data_has_user_value(item, "value")) {
|
||||
blog(LOG_INFO,
|
||||
"ignoring invalid variable entry in \"%s\" websocket message (missing \"value\")",
|
||||
runMacroMessage);
|
||||
continue;
|
||||
}
|
||||
|
||||
auto varName = obs_data_get_string(item, "name");
|
||||
auto value = obs_data_get_string(item, "value");
|
||||
|
||||
auto weakVar = GetWeakVariableByName(varName);
|
||||
auto var = weakVar.lock();
|
||||
if (!var) {
|
||||
blog(LOG_INFO,
|
||||
"ignoring invalid variable name \"%s\" in \"%s\" websocket message",
|
||||
varName, runMacroMessage);
|
||||
continue;
|
||||
}
|
||||
|
||||
var->SetValue(value);
|
||||
}
|
||||
}
|
||||
|
||||
static void receiveRunMacroMessage(obs_data_t *data, obs_data_t *)
|
||||
{
|
||||
if (!obs_data_has_user_value(data, "name")) {
|
||||
blog(LOG_INFO,
|
||||
"ignoring invalid \"%s\" websocket message (missing \"name\")",
|
||||
runMacroMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
auto name = obs_data_get_string(data, "name");
|
||||
const auto weakMacro =
|
||||
GetWeakMacroByName(obs_data_get_string(data, "name"));
|
||||
const auto macro = weakMacro.lock();
|
||||
if (!macro) {
|
||||
blog(LOG_INFO,
|
||||
"ignoring invalid \"%s\" websocket message (macro \"%s\") not found",
|
||||
runMacroMessage, name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (obs_data_has_user_value(data, "variables")) {
|
||||
setVariables(data);
|
||||
}
|
||||
|
||||
const bool runElse = obs_data_get_bool(data, "runElseActions");
|
||||
if (runElse) {
|
||||
RunMacroElseActions(macro.get());
|
||||
} else {
|
||||
RunMacroActions(macro.get());
|
||||
}
|
||||
}
|
||||
|
||||
static void receiveSetVariablesMessage(obs_data_t *data, obs_data_t *)
|
||||
{
|
||||
if (!obs_data_has_user_value(data, "variables")) {
|
||||
blog(LOG_INFO,
|
||||
"ignoring invalid \"%s\" websocket message (missing \"variables\")",
|
||||
setVariablesMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
setVariables(data);
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
|
@ -111,7 +111,7 @@ static bool checkCondition(const std::shared_ptr<MacroCondition> &condition)
|
|||
const auto startTime = std::chrono::high_resolution_clock::now();
|
||||
bool conditionMatched = false;
|
||||
condition->WithLock([&condition, &conditionMatched]() {
|
||||
conditionMatched = condition->CheckCondition();
|
||||
conditionMatched = condition->EvaluateCondition();
|
||||
});
|
||||
const auto endTime = std::chrono::high_resolution_clock::now();
|
||||
const auto timeSpent = endTime - startTime;
|
||||
|
|
@ -241,9 +241,37 @@ bool Macro::CheckConditions(bool ignorePause)
|
|||
|
||||
vblog(LOG_INFO, "Macro %s returned %d", _name.c_str(), _matched);
|
||||
|
||||
_conditionSateChanged = _lastMatched != _matched;
|
||||
if (!_conditionSateChanged && _performActionsOnChange) {
|
||||
_onPreventedActionExecution = true;
|
||||
_actionModeMatch = false;
|
||||
switch (_actionTriggerMode) {
|
||||
case Macro::ActionTriggerMode::ALWAYS:
|
||||
_actionModeMatch = true;
|
||||
break;
|
||||
case Macro::ActionTriggerMode::MACRO_RESULT_CHANGED:
|
||||
_actionModeMatch = _lastMatched != _matched;
|
||||
break;
|
||||
case Macro::ActionTriggerMode::ANY_CONDITION_CHANGED:
|
||||
for (const auto &condition : _conditions) {
|
||||
if (condition->HasChanged()) {
|
||||
_actionModeMatch = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Macro::ActionTriggerMode::ANY_CONDITION_TRIGGERED:
|
||||
for (const auto &condition : _conditions) {
|
||||
if (condition->IsRisingEdge()) {
|
||||
_actionModeMatch = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
const bool hasActionsToExecute = _matched ? (_actions.size() > 0)
|
||||
: (_elseActions.size() > 0);
|
||||
if (!_actionModeMatch && hasActionsToExecute) {
|
||||
_lastActionRunModePreventTime =
|
||||
std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
_lastMatched = _matched;
|
||||
|
|
@ -302,6 +330,16 @@ bool Macro::WasExecutedSince(const TimePoint &time) const
|
|||
return _lastExecutionTime > time;
|
||||
}
|
||||
|
||||
bool Macro::ActionTriggerModePreventedActionsSince(const TimePoint &time) const
|
||||
{
|
||||
return _lastActionRunModePreventTime > time;
|
||||
}
|
||||
|
||||
Macro::TimePoint Macro::GetLastExecutionTime() const
|
||||
{
|
||||
return _lastExecutionTime;
|
||||
}
|
||||
|
||||
bool Macro::ConditionsShouldBeChecked() const
|
||||
{
|
||||
if (!_useCustomConditionCheckInterval) {
|
||||
|
|
@ -328,10 +366,9 @@ bool Macro::ShouldRunActions() const
|
|||
|
||||
const bool hasActionsToExecute =
|
||||
!_paused && (_matched || _elseActions.size() > 0) &&
|
||||
(!_performActionsOnChange || _conditionSateChanged);
|
||||
_actionModeMatch;
|
||||
|
||||
if (VerboseLoggingEnabled() && _performActionsOnChange &&
|
||||
!_conditionSateChanged) {
|
||||
if (VerboseLoggingEnabled() && !_actionModeMatch) {
|
||||
if (_matched && _actions.size() > 0) {
|
||||
blog(LOG_INFO, "skip actions for Macro %s (on change)",
|
||||
_name.c_str());
|
||||
|
|
@ -362,10 +399,24 @@ void Macro::ResetTimers()
|
|||
_lastExecutionTime = {};
|
||||
}
|
||||
|
||||
void Macro::SetActionTriggerMode(ActionTriggerMode mode)
|
||||
{
|
||||
_actionTriggerMode = mode;
|
||||
}
|
||||
|
||||
Macro::ActionTriggerMode Macro::GetActionTriggerMode() const
|
||||
{
|
||||
return _actionTriggerMode;
|
||||
}
|
||||
|
||||
bool Macro::RunActionsHelper(
|
||||
const std::deque<std::shared_ptr<MacroAction>> &actionsToRun,
|
||||
bool ignorePause)
|
||||
{
|
||||
if (_paused && !ignorePause) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Create copy of action list as elements might be removed, inserted, or
|
||||
// reordered while actions are currently being executed.
|
||||
auto actions = actionsToRun;
|
||||
|
|
@ -415,11 +466,6 @@ bool Macro::WasPausedSince(const TimePoint &time) const
|
|||
return _lastUnpauseTime > time;
|
||||
}
|
||||
|
||||
void Macro::SetMatchOnChange(bool onChange)
|
||||
{
|
||||
_performActionsOnChange = onChange;
|
||||
}
|
||||
|
||||
void Macro::SetStopActionsIfNotDone(bool stopActionsIfNotDone)
|
||||
{
|
||||
_stopActionsIfNotDone = stopActionsIfNotDone;
|
||||
|
|
@ -740,7 +786,8 @@ bool Macro::Save(obs_data_t *obj, bool saveForCopy) const
|
|||
obs_data_set_bool(obj, "pause", _paused);
|
||||
obs_data_set_bool(obj, "parallel", _runInParallel);
|
||||
obs_data_set_bool(obj, "checkConditionsInParallel", _checkInParallel);
|
||||
obs_data_set_bool(obj, "onChange", _performActionsOnChange);
|
||||
obs_data_set_int(obj, "actionTriggerMode",
|
||||
static_cast<int>(_actionTriggerMode));
|
||||
obs_data_set_bool(obj, "skipExecOnStart", _skipExecOnStart);
|
||||
obs_data_set_bool(obj, "stopActionsIfNotDone", _stopActionsIfNotDone);
|
||||
obs_data_set_bool(obj, "useShortCircuitEvaluation",
|
||||
|
|
@ -826,7 +873,15 @@ bool Macro::Load(obs_data_t *obj)
|
|||
}
|
||||
_runInParallel = obs_data_get_bool(obj, "parallel");
|
||||
_checkInParallel = obs_data_get_bool(obj, "checkConditionsInParallel");
|
||||
_performActionsOnChange = obs_data_get_bool(obj, "onChange");
|
||||
if (obs_data_has_user_value(obj, "onChange")) {
|
||||
const bool onChange = obs_data_get_bool(obj, "onChange");
|
||||
_actionTriggerMode =
|
||||
onChange ? ActionTriggerMode::MACRO_RESULT_CHANGED
|
||||
: ActionTriggerMode::ALWAYS;
|
||||
} else {
|
||||
_actionTriggerMode = static_cast<ActionTriggerMode>(
|
||||
obs_data_get_int(obj, "actionTriggerMode"));
|
||||
}
|
||||
_skipExecOnStart = obs_data_get_bool(obj, "skipExecOnStart");
|
||||
_stopActionsIfNotDone = obs_data_get_bool(obj, "stopActionsIfNotDone");
|
||||
_useShortCircuitEvaluation =
|
||||
|
|
@ -948,12 +1003,12 @@ bool Macro::PostLoad()
|
|||
bool Macro::SwitchesScene() const
|
||||
{
|
||||
for (const auto &a : _actions) {
|
||||
if (a->GetId() == GetSceneSwitchActionId()) {
|
||||
if (a->GetId() == MacroAction::GetDefaultID()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (const auto &a : _elseActions) {
|
||||
if (a->GetId() == GetSceneSwitchActionId()) {
|
||||
if (a->GetId() == MacroAction::GetDefaultID()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -986,18 +1041,8 @@ bool Macro::HasValidSplitterPositions() const
|
|||
!_elseActionSplitterPosition.empty();
|
||||
}
|
||||
|
||||
bool Macro::OnChangePreventedActionsRecently()
|
||||
{
|
||||
if (_onPreventedActionExecution) {
|
||||
_onPreventedActionExecution = false;
|
||||
return _matched ? _actions.size() > 0 : _elseActions.size() > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Macro::ResetUIHelpers()
|
||||
{
|
||||
_onPreventedActionExecution = false;
|
||||
for (auto c : _conditions) {
|
||||
c->GetHighlightAndReset();
|
||||
}
|
||||
|
|
@ -1096,9 +1141,11 @@ void Macro::ClearHotkeys() const
|
|||
void setHotkeyDescriptionHelper(const char *formatModuleText,
|
||||
const std::string name, const obs_hotkey_id id)
|
||||
{
|
||||
#ifndef UNIT_TEST
|
||||
QString format{obs_module_text(formatModuleText)};
|
||||
QString hotkeyDesc = format.arg(QString::fromStdString(name));
|
||||
obs_hotkey_set_description(id, hotkeyDesc.toStdString().c_str());
|
||||
#endif // !UNIT_TEST
|
||||
}
|
||||
|
||||
void Macro::SetHotkeysDesc() const
|
||||
|
|
@ -1255,33 +1302,6 @@ void StopAllMacros()
|
|||
}
|
||||
}
|
||||
|
||||
Macro *GetMacroByName(const char *name)
|
||||
{
|
||||
for (const auto &m : GetTopLevelMacros()) {
|
||||
if (m->Name() == name) {
|
||||
return m.get();
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Macro *GetMacroByQString(const QString &name)
|
||||
{
|
||||
return GetMacroByName(name.toUtf8().constData());
|
||||
}
|
||||
|
||||
std::weak_ptr<Macro> GetWeakMacroByName(const char *name)
|
||||
{
|
||||
for (const auto &m : GetTopLevelMacros()) {
|
||||
if (m->Name() == name) {
|
||||
return m;
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void InvalidateMacroTempVarValues()
|
||||
{
|
||||
for (const auto &m : GetTopLevelMacros()) {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
#include "temp-variable.hpp"
|
||||
|
||||
#include <future>
|
||||
#include <QString>
|
||||
#include <QByteArray>
|
||||
#include <string>
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
|
|
@ -28,6 +26,16 @@ class Macro {
|
|||
|
||||
public:
|
||||
enum class PauseStateSaveBehavior { PERSIST, PAUSE, UNPAUSE };
|
||||
enum class ActionTriggerMode {
|
||||
// Trigger always
|
||||
ALWAYS,
|
||||
// Trigger when macro match result flips
|
||||
MACRO_RESULT_CHANGED,
|
||||
// Trigger when any individual condition changes
|
||||
ANY_CONDITION_CHANGED,
|
||||
// Trigger when any individual condition evaluates to true
|
||||
ANY_CONDITION_TRIGGERED,
|
||||
};
|
||||
|
||||
Macro(const std::string &name = "");
|
||||
Macro(const std::string &name, const GlobalMacroSettings &settings);
|
||||
|
|
@ -56,8 +64,8 @@ public:
|
|||
bool GetStop() const { return _stop; }
|
||||
void ResetTimers();
|
||||
|
||||
void SetMatchOnChange(bool onChange);
|
||||
bool MatchOnChange() const { return _performActionsOnChange; }
|
||||
void SetActionTriggerMode(ActionTriggerMode);
|
||||
ActionTriggerMode GetActionTriggerMode() const;
|
||||
|
||||
void SetSkipExecOnStart(bool skip) { _skipExecOnStart = skip; }
|
||||
bool SkipExecOnStart() const { return _skipExecOnStart; }
|
||||
|
|
@ -139,7 +147,8 @@ public:
|
|||
const QList<int> &GetElseActionSplitterPosition() const;
|
||||
bool HasValidSplitterPositions() const;
|
||||
bool WasExecutedSince(const TimePoint &) const;
|
||||
bool OnChangePreventedActionsRecently();
|
||||
bool ActionTriggerModePreventedActionsSince(const TimePoint &) const;
|
||||
TimePoint GetLastExecutionTime() const;
|
||||
void ResetUIHelpers();
|
||||
|
||||
// Hotkeys
|
||||
|
|
@ -170,6 +179,7 @@ private:
|
|||
TimePoint _lastCheckTime{};
|
||||
TimePoint _lastUnpauseTime{};
|
||||
TimePoint _lastExecutionTime{};
|
||||
TimePoint _lastActionRunModePreventTime{};
|
||||
std::vector<std::thread> _helperThreads;
|
||||
|
||||
std::deque<std::shared_ptr<MacroCondition>> _conditions;
|
||||
|
|
@ -184,14 +194,13 @@ private:
|
|||
bool _useShortCircuitEvaluation = false;
|
||||
bool _useCustomConditionCheckInterval = false;
|
||||
Duration _customConditionCheckInterval = 0.3;
|
||||
bool _conditionSateChanged = false;
|
||||
bool _actionModeMatch = false;
|
||||
|
||||
bool _runInParallel = false;
|
||||
bool _checkInParallel = false;
|
||||
bool _matched = false;
|
||||
std::future<void> _conditionCheckFuture;
|
||||
bool _lastMatched = false;
|
||||
bool _performActionsOnChange = true;
|
||||
bool _skipExecOnStart = false;
|
||||
bool _stopActionsIfNotDone = false;
|
||||
bool _paused = false;
|
||||
|
|
@ -201,14 +210,14 @@ private:
|
|||
obs_hotkey_id _unpauseHotkey = OBS_INVALID_HOTKEY_ID;
|
||||
obs_hotkey_id _togglePauseHotkey = OBS_INVALID_HOTKEY_ID;
|
||||
|
||||
ActionTriggerMode _actionTriggerMode =
|
||||
ActionTriggerMode::MACRO_RESULT_CHANGED;
|
||||
|
||||
PauseStateSaveBehavior _pauseSaveBehavior =
|
||||
PauseStateSaveBehavior::PERSIST;
|
||||
|
||||
MacroInputVariables _inputVariables;
|
||||
|
||||
// UI helpers
|
||||
bool _onPreventedActionExecution = false;
|
||||
|
||||
QList<int> _actionConditionSplitterPosition;
|
||||
QList<int> _elseActionSplitterPosition;
|
||||
|
||||
|
|
@ -220,9 +229,6 @@ void SaveMacros(obs_data_t *obj);
|
|||
bool CheckMacros();
|
||||
bool RunMacros();
|
||||
void StopAllMacros();
|
||||
Macro *GetMacroByName(const char *name);
|
||||
Macro *GetMacroByQString(const QString &name);
|
||||
std::weak_ptr<Macro> GetWeakMacroByName(const char *name);
|
||||
void InvalidateMacroTempVarValues();
|
||||
std::shared_ptr<Macro> GetMacroWithInvalidConditionInterval();
|
||||
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ bool IsFullscreen(const std::string &title)
|
|||
return false;
|
||||
}
|
||||
|
||||
std::optional<std::string> GetTextInWindow(const std::string &window)
|
||||
std::optional<std::string> GetTextInWindow(const std::string &)
|
||||
{
|
||||
// Not implemented
|
||||
return {};
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ bool SwitcherData::VersionChanged(obs_data_t *obj, std::string currentVersion)
|
|||
if (!obs_data_has_user_value(obj, "version")) {
|
||||
return false;
|
||||
}
|
||||
switcher->firstBoot = false;
|
||||
|
||||
std::string previousVersion = obs_data_get_string(obj, "version");
|
||||
return previousVersion != currentVersion;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@ public:
|
|||
bool stop = false;
|
||||
std::condition_variable cv;
|
||||
|
||||
bool firstBoot = true;
|
||||
bool transitionActive = false;
|
||||
bool sceneCollectionStop = false;
|
||||
bool obsIsShuttingDown = false;
|
||||
|
|
@ -163,7 +162,6 @@ public:
|
|||
bool warnPluginLoadFailure = true;
|
||||
bool disableHints = false;
|
||||
bool disableFilterComboboxFilter = false;
|
||||
bool disableMacroWidgetCache = false;
|
||||
bool hideLegacyTabs = true;
|
||||
bool saveWindowGeo = false;
|
||||
QPoint windowPos = {};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#include "auto-update-tooltip-label.hpp"
|
||||
|
||||
#include <QToolTip>
|
||||
|
||||
namespace advss {
|
||||
|
||||
AutoUpdateHelpIcon::AutoUpdateHelpIcon(
|
||||
|
|
@ -16,6 +18,7 @@ AutoUpdateHelpIcon::AutoUpdateHelpIcon(
|
|||
|
||||
void AutoUpdateHelpIcon::enterEvent(QEnterEvent *event)
|
||||
{
|
||||
UpdateTooltip();
|
||||
_timer->start(_updateIntervalMs);
|
||||
QLabel::enterEvent(event);
|
||||
}
|
||||
|
|
@ -28,7 +31,12 @@ void AutoUpdateHelpIcon::leaveEvent(QEvent *event)
|
|||
|
||||
void AutoUpdateHelpIcon::UpdateTooltip()
|
||||
{
|
||||
setToolTip(_callback());
|
||||
if (!underMouse()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const QString text = _callback();
|
||||
QToolTip::showText(QCursor::pos(), text, this);
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
|
|
@ -8,13 +8,18 @@
|
|||
|
||||
#include <obs-frontend-api.h>
|
||||
#include <obs-module.h>
|
||||
#include <QFileDialog>
|
||||
#include <QTextStream>
|
||||
#include <util/config-file.h>
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMainWindow>
|
||||
#include <QTextStream>
|
||||
#include <QTimer>
|
||||
|
||||
#include <thread>
|
||||
|
||||
namespace advss {
|
||||
|
||||
void AskForBackup(const QString &json)
|
||||
static void showBackupDialogs(const QString &json)
|
||||
{
|
||||
const bool backupWasConfirmed = DisplayMessage(
|
||||
obs_module_text("AdvSceneSwitcher.askBackup"), true, false);
|
||||
|
|
@ -42,6 +47,27 @@ void AskForBackup(const QString &json)
|
|||
out << json;
|
||||
}
|
||||
|
||||
void AskForBackup(obs_data_t *settings)
|
||||
{
|
||||
// This function is called while the plugin settings are being loaded.
|
||||
// Blocking at this stage can cause issues such as OBS failing to start
|
||||
// or crashing.
|
||||
// Therefore, we ask the user whether they want to back up the settings
|
||||
// asynchronously.
|
||||
|
||||
auto json = obs_data_get_json(settings);
|
||||
static QString jsonQString = json ? json : "";
|
||||
|
||||
static const auto askForBackupWrapper = [](void *) {
|
||||
showBackupDialogs(jsonQString);
|
||||
};
|
||||
|
||||
AddFinishedLoadingStep([]() {
|
||||
obs_queue_task(OBS_TASK_UI, askForBackupWrapper, nullptr,
|
||||
false);
|
||||
});
|
||||
}
|
||||
|
||||
void BackupSettingsOfCurrentVersion()
|
||||
{
|
||||
auto sceneCollectionName = obs_frontend_get_current_scene_collection();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#pragma once
|
||||
#include <QString>
|
||||
#include <obs-data.h>
|
||||
|
||||
namespace advss {
|
||||
|
||||
void AskForBackup(const QString &json);
|
||||
void AskForBackup(obs_data_t *settings);
|
||||
void BackupSettingsOfCurrentVersion();
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ int GetCanvasCount()
|
|||
return 1;
|
||||
#else
|
||||
static const auto enumCanvases = [](void *countPtr,
|
||||
obs_canvas_t *canvas) -> bool {
|
||||
obs_canvas_t *) -> bool {
|
||||
auto count = static_cast<int *>(countPtr);
|
||||
(*count)++;
|
||||
return true;
|
||||
|
|
@ -145,6 +145,15 @@ OBSWeakSource GetActiveCanvasScene(const OBSWeakCanvas &weakCanvas)
|
|||
}
|
||||
#endif
|
||||
|
||||
OBSCanvasAutoRelease mainCanvas = obs_get_main_canvas();
|
||||
|
||||
// The frontend scene order does not necessarily match the order of the
|
||||
// scenes in the canvas.
|
||||
if (canvas == mainCanvas) {
|
||||
OBSSourceAutoRelease scene = obs_frontend_get_current_scene();
|
||||
return OBSGetWeakRef(scene);
|
||||
}
|
||||
|
||||
static const auto enumCanvasScenes = [](void *scenePtr,
|
||||
obs_source_t *source) -> bool {
|
||||
auto scene = static_cast<OBSWeakSource *>(scenePtr);
|
||||
|
|
@ -181,6 +190,25 @@ OBSWeakSource GetSceneAtIndex(const OBSWeakCanvas &weakCanvas, int idx)
|
|||
}
|
||||
#endif
|
||||
|
||||
OBSCanvasAutoRelease mainCanvas = obs_get_main_canvas();
|
||||
|
||||
// The frontend scene order does not necessarily match the order of the
|
||||
// scenes in the canvas.
|
||||
// So, rely on obs_frontend_get_scenes() in case of the main canvas
|
||||
// instead.
|
||||
if (canvas == mainCanvas) {
|
||||
struct obs_frontend_source_list scenes = {0};
|
||||
obs_frontend_get_scenes(&scenes);
|
||||
if (idx >= (int)scenes.sources.num) {
|
||||
obs_frontend_source_list_free(&scenes);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto scene = OBSGetWeakRef(scenes.sources.array[idx]);
|
||||
obs_frontend_source_list_free(&scenes);
|
||||
return scene;
|
||||
}
|
||||
|
||||
struct Data {
|
||||
const int idx;
|
||||
int currentIdx;
|
||||
|
|
@ -223,6 +251,29 @@ int GetIndexOfScene(const OBSWeakCanvas &weakCanvas, const OBSWeakSource &scene)
|
|||
return 0;
|
||||
}
|
||||
#endif
|
||||
OBSCanvasAutoRelease mainCanvas = obs_get_main_canvas();
|
||||
|
||||
// The frontend scene order does not necessarily match the order of the
|
||||
// scenes in the canvas.
|
||||
// So, rely on obs_frontend_get_scenes() in case of the main canvas
|
||||
// instead.
|
||||
if (canvas == mainCanvas) {
|
||||
struct obs_frontend_source_list scenes = {0};
|
||||
obs_frontend_get_scenes(&scenes);
|
||||
|
||||
OBSSourceAutoRelease sceneSource = OBSGetStrongRef(scene);
|
||||
int idx = 0;
|
||||
|
||||
for (size_t i = 0; i < scenes.sources.num; i++) {
|
||||
if (scenes.sources.array[i] == sceneSource) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
obs_frontend_source_list_free(&scenes);
|
||||
return idx;
|
||||
}
|
||||
|
||||
struct Data {
|
||||
int idx;
|
||||
|
|
@ -246,6 +297,12 @@ int GetIndexOfScene(const OBSWeakCanvas &weakCanvas, const OBSWeakSource &scene)
|
|||
return data.idx;
|
||||
}
|
||||
|
||||
OBSWeakCanvas GetMainCanvas()
|
||||
{
|
||||
OBSCanvasAutoRelease mainCanvas = obs_get_main_canvas();
|
||||
return OBSGetWeakRef(mainCanvas);
|
||||
}
|
||||
|
||||
#if LIBOBS_API_VER < MAKE_SEMANTIC_VERSION(31, 1, 0)
|
||||
|
||||
obs_canvas_t *obs_canvas_get_ref(obs_canvas_t *)
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ EXPORT OBSWeakSource GetActiveCanvasScene(const OBSWeakCanvas &canvas);
|
|||
EXPORT OBSWeakSource GetSceneAtIndex(const OBSWeakCanvas &weakCanvas, int idx);
|
||||
EXPORT int GetIndexOfScene(const OBSWeakCanvas &weakCanvas,
|
||||
const OBSWeakSource &scene);
|
||||
EXPORT OBSWeakCanvas GetMainCanvas();
|
||||
|
||||
class CanvasSelection : public FilterComboBox {
|
||||
Q_OBJECT
|
||||
|
|
|
|||
140
lib/utils/crash-handler.cpp
Normal file
140
lib/utils/crash-handler.cpp
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
#include "crash-handler.hpp"
|
||||
#include "log-helper.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
#include "plugin-state-helpers.hpp"
|
||||
#include "ui-helpers.hpp"
|
||||
|
||||
#include <obs-frontend-api.h>
|
||||
#include <obs-module.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QMainWindow>
|
||||
#include <QTimer>
|
||||
|
||||
#include <thread>
|
||||
|
||||
namespace advss {
|
||||
|
||||
static constexpr std::string_view sentinel = ".running";
|
||||
|
||||
#ifndef NDEBUG
|
||||
static constexpr bool handleUncleanShutdown = false;
|
||||
#else
|
||||
static constexpr bool handleUncleanShutdown = true;
|
||||
#endif
|
||||
|
||||
static bool wasCleanShutdown = false;
|
||||
|
||||
static void setup();
|
||||
static bool setupDone = []() {
|
||||
AddPluginInitStep(setup);
|
||||
return true;
|
||||
}();
|
||||
|
||||
static void handleShutdown(enum obs_frontend_event event, void *)
|
||||
{
|
||||
if (event != OBS_FRONTEND_EVENT_EXIT) {
|
||||
return;
|
||||
}
|
||||
|
||||
char *sentinelFile = obs_module_config_path(sentinel.data());
|
||||
if (!sentinelFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
QFile file(sentinelFile);
|
||||
if (!file.exists()) {
|
||||
bfree(sentinelFile);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!file.remove()) {
|
||||
blog(LOG_WARNING, "failed to remove sentinel file");
|
||||
}
|
||||
|
||||
bfree(sentinelFile);
|
||||
}
|
||||
|
||||
static void setup()
|
||||
{
|
||||
char *sentinelFile = obs_module_config_path(sentinel.data());
|
||||
if (!sentinelFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
QString dirPath = QFileInfo(sentinelFile).absolutePath();
|
||||
QDir dir(dirPath);
|
||||
if (!dir.exists()) {
|
||||
if (!dir.mkpath(dirPath)) {
|
||||
blog(LOG_WARNING,
|
||||
"failed to create directory for sentinel file");
|
||||
bfree(sentinelFile);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QFile file(sentinelFile);
|
||||
|
||||
wasCleanShutdown = file.exists();
|
||||
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
blog(LOG_WARNING, "failed to create sentinel file");
|
||||
bfree(sentinelFile);
|
||||
return;
|
||||
}
|
||||
|
||||
file.write("running");
|
||||
file.close();
|
||||
bfree(sentinelFile);
|
||||
|
||||
obs_frontend_add_event_callback(handleShutdown, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
static bool wasUncleanShutdown()
|
||||
{
|
||||
static bool alreadyHandled = false;
|
||||
|
||||
if (!handleUncleanShutdown || !wasCleanShutdown || alreadyHandled) {
|
||||
alreadyHandled = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
alreadyHandled = true;
|
||||
blog(LOG_WARNING, "unclean shutdown detected");
|
||||
return true;
|
||||
}
|
||||
|
||||
static void askForStartupSkip()
|
||||
{
|
||||
bool skipStart = DisplayMessage(
|
||||
obs_module_text("AdvSceneSwitcher.crashDetected"), true, false);
|
||||
if (!skipStart) {
|
||||
StartPlugin();
|
||||
}
|
||||
}
|
||||
|
||||
bool ShouldSkipPluginStartOnUncleanShutdown()
|
||||
{
|
||||
if (!wasUncleanShutdown()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// This function is called while the plugin settings are being loaded.
|
||||
// Blocking at this stage can cause issues such as OBS failing to start
|
||||
// or crashing.
|
||||
// Therefore, we ask the user whether they want to start the plugin
|
||||
// asynchronously.
|
||||
static const auto showDialogWrapper = [](void *) {
|
||||
askForStartupSkip();
|
||||
};
|
||||
|
||||
AddFinishedLoadingStep([]() {
|
||||
obs_queue_task(OBS_TASK_UI, showDialogWrapper, nullptr, false);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
7
lib/utils/crash-handler.hpp
Normal file
7
lib/utils/crash-handler.hpp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
namespace advss {
|
||||
|
||||
bool ShouldSkipPluginStartOnUncleanShutdown();
|
||||
|
||||
} // namespace advss
|
||||
|
|
@ -1,12 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef UNIT_TEST
|
||||
|
||||
#define EXPORT
|
||||
#define ADVSS_EXPORT
|
||||
|
||||
#else
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define EXPORT __declspec(dllexport)
|
||||
#else
|
||||
|
|
@ -19,5 +12,3 @@
|
|||
#else
|
||||
#define ADVSS_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // UNIT_TEST
|
||||
|
|
|
|||
465
lib/utils/first-run-wizard.cpp
Normal file
465
lib/utils/first-run-wizard.cpp
Normal file
|
|
@ -0,0 +1,465 @@
|
|||
#include "first-run-wizard.hpp"
|
||||
|
||||
#include "log-helper.hpp"
|
||||
#include "macro.hpp"
|
||||
#include "macro-action-factory.hpp"
|
||||
#include "macro-condition-factory.hpp"
|
||||
#include "macro-settings.hpp"
|
||||
#include "platform-funcs.hpp"
|
||||
#include "selection-helpers.hpp"
|
||||
|
||||
#include <obs-frontend-api.h>
|
||||
#include <obs-data.h>
|
||||
#include <util/config-file.h>
|
||||
|
||||
#include <QFrame>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMessageBox>
|
||||
#include <QRegularExpression>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace advss {
|
||||
|
||||
static constexpr char kConditionIdWindow[] = "window";
|
||||
static constexpr char kActionIdSceneSwitch[] = "scene_switch";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// OBS global config helpers
|
||||
// ---------------------------------------------------------------------------
|
||||
static constexpr char kConfigSection[] = "AdvancedSceneSwitcher";
|
||||
static constexpr char kFirstRunKey[] = "firstRun";
|
||||
|
||||
bool IsFirstRun()
|
||||
{
|
||||
#if LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(31, 0, 0)
|
||||
config_t *cfg = obs_frontend_get_user_config();
|
||||
#else
|
||||
config_t *cfg = obs_frontend_get_global_config();
|
||||
#endif
|
||||
if (!config_has_user_value(cfg, kConfigSection, kFirstRunKey)) {
|
||||
return true;
|
||||
}
|
||||
return config_get_bool(cfg, kConfigSection, kFirstRunKey);
|
||||
}
|
||||
|
||||
static void WriteFirstRun(bool value)
|
||||
{
|
||||
#if LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(31, 0, 0)
|
||||
config_t *cfg = obs_frontend_get_user_config();
|
||||
#else
|
||||
config_t *cfg = obs_frontend_get_global_config();
|
||||
#endif
|
||||
config_set_bool(cfg, kConfigSection, kFirstRunKey, value);
|
||||
config_save_safe(cfg, "tmp", nullptr);
|
||||
}
|
||||
|
||||
static QString DetectFocusedWindow()
|
||||
{
|
||||
std::string title;
|
||||
GetCurrentWindowTitle(title);
|
||||
return QString::fromStdString(title);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// WelcomePage
|
||||
// ===========================================================================
|
||||
|
||||
WelcomePage::WelcomePage(QWidget *parent) : QWizardPage(parent)
|
||||
{
|
||||
setTitle(obs_module_text("FirstRunWizard.welcome.title"));
|
||||
setSubTitle(obs_module_text("FirstRunWizard.welcome.subtitle"));
|
||||
|
||||
auto body = new QLabel(obs_module_text("FirstRunWizard.welcome.body"),
|
||||
this);
|
||||
body->setWordWrap(true);
|
||||
body->setTextFormat(Qt::RichText);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->addWidget(body);
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// SceneSelectionPage
|
||||
// ===========================================================================
|
||||
|
||||
SceneSelectionPage::SceneSelectionPage(QWidget *parent) : QWizardPage(parent)
|
||||
{
|
||||
setTitle(obs_module_text("FirstRunWizard.scene.title"));
|
||||
setSubTitle(obs_module_text("FirstRunWizard.scene.subtitle"));
|
||||
|
||||
auto label =
|
||||
new QLabel(obs_module_text("FirstRunWizard.scene.label"), this);
|
||||
_sceneCombo = new QComboBox(this);
|
||||
_sceneCombo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
|
||||
// registerField with * suffix means the field is mandatory for Next
|
||||
registerField("targetScene*", _sceneCombo, "currentText",
|
||||
SIGNAL(currentTextChanged(QString)));
|
||||
|
||||
connect(_sceneCombo, &QComboBox::currentTextChanged, this,
|
||||
&QWizardPage::completeChanged);
|
||||
|
||||
auto row = new QHBoxLayout;
|
||||
row->addWidget(label);
|
||||
row->addWidget(_sceneCombo, 1);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->addLayout(row);
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
void SceneSelectionPage::initializePage()
|
||||
{
|
||||
_sceneCombo->clear();
|
||||
for (const QString &name : GetSceneNames())
|
||||
_sceneCombo->addItem(name);
|
||||
}
|
||||
|
||||
bool SceneSelectionPage::isComplete() const
|
||||
{
|
||||
return _sceneCombo->count() > 0 &&
|
||||
!_sceneCombo->currentText().isEmpty();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// WindowConditionPage
|
||||
// ===========================================================================
|
||||
|
||||
WindowConditionPage::WindowConditionPage(QWidget *parent)
|
||||
: QWizardPage(parent),
|
||||
_detectTimer(new QTimer(this))
|
||||
{
|
||||
setTitle(obs_module_text("FirstRunWizard.window.title"));
|
||||
setSubTitle(obs_module_text("FirstRunWizard.window.subtitle"));
|
||||
|
||||
auto label = new QLabel(obs_module_text("FirstRunWizard.window.label"),
|
||||
this);
|
||||
_windowEdit = new QLineEdit(this);
|
||||
_windowEdit->setPlaceholderText(
|
||||
obs_module_text("FirstRunWizard.window.placeholder"));
|
||||
|
||||
_autoDetect = new QPushButton(
|
||||
obs_module_text("FirstRunWizard.window.autoDetect"), this);
|
||||
_autoDetect->setToolTip(
|
||||
obs_module_text("FirstRunWizard.window.autoDetectTooltip"));
|
||||
|
||||
registerField("windowTitle*", _windowEdit);
|
||||
|
||||
connect(_windowEdit, &QLineEdit::textChanged, this,
|
||||
&QWizardPage::completeChanged);
|
||||
connect(_autoDetect, &QPushButton::clicked, this,
|
||||
&WindowConditionPage::onAutoDetectClicked);
|
||||
connect(_detectTimer, &QTimer::timeout, this,
|
||||
&WindowConditionPage::onCountdownTick);
|
||||
|
||||
auto row = new QHBoxLayout;
|
||||
row->addWidget(label);
|
||||
row->addWidget(_windowEdit, 1);
|
||||
|
||||
auto hint =
|
||||
new QLabel(obs_module_text("FirstRunWizard.window.hint"), this);
|
||||
hint->setTextFormat(Qt::RichText);
|
||||
hint->setWordWrap(true);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->addLayout(row);
|
||||
layout->addWidget(_autoDetect, 0, Qt::AlignLeft);
|
||||
layout->addWidget(hint);
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
void WindowConditionPage::initializePage()
|
||||
{
|
||||
if (_windowEdit->text().isEmpty()) {
|
||||
QString detected = DetectFocusedWindow();
|
||||
if (!detected.isEmpty()) {
|
||||
_windowEdit->setText(detected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool WindowConditionPage::isComplete() const
|
||||
{
|
||||
return !_windowEdit->text().trimmed().isEmpty();
|
||||
}
|
||||
|
||||
void WindowConditionPage::onAutoDetectClicked()
|
||||
{
|
||||
_countdown = 3;
|
||||
_autoDetect->setEnabled(false);
|
||||
_autoDetect->setText(
|
||||
QString(obs_module_text(
|
||||
"FirstRunWizard.window.autoDetectCountdown"))
|
||||
.arg(_countdown));
|
||||
_detectTimer->start(1000);
|
||||
}
|
||||
|
||||
void WindowConditionPage::onCountdownTick()
|
||||
{
|
||||
--_countdown;
|
||||
if (_countdown > 0) {
|
||||
_autoDetect->setText(
|
||||
QString(obs_module_text(
|
||||
"FirstRunWizard.window.autoDetectCountdown"))
|
||||
.arg(_countdown));
|
||||
return;
|
||||
}
|
||||
|
||||
_detectTimer->stop();
|
||||
QString title = DetectFocusedWindow();
|
||||
if (!title.isEmpty()) {
|
||||
_windowEdit->setText(title);
|
||||
}
|
||||
|
||||
_autoDetect->setEnabled(true);
|
||||
_autoDetect->setText(
|
||||
obs_module_text("FirstRunWizard.window.autoDetect"));
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// ReviewPage
|
||||
// ===========================================================================
|
||||
|
||||
ReviewPage::ReviewPage(QWidget *parent, std::shared_ptr<Macro> ¯o)
|
||||
: QWizardPage(parent),
|
||||
_macro(macro)
|
||||
{
|
||||
setTitle(obs_module_text("FirstRunWizard.review.title"));
|
||||
setSubTitle(obs_module_text("FirstRunWizard.review.subtitle"));
|
||||
|
||||
_summary = new QLabel(this);
|
||||
_summary->setWordWrap(true);
|
||||
_summary->setTextFormat(Qt::RichText);
|
||||
_summary->setFrameShape(QFrame::StyledPanel);
|
||||
_summary->setContentsMargins(12, 12, 12, 12);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->addWidget(_summary);
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
void ReviewPage::initializePage()
|
||||
{
|
||||
const QString scene = field("targetScene").toString();
|
||||
const QString window = field("windowTitle").toString();
|
||||
|
||||
_summary->setText(
|
||||
QString(obs_module_text("FirstRunWizard.review.summary"))
|
||||
.arg(scene.toHtmlEscaped(), window.toHtmlEscaped()));
|
||||
}
|
||||
|
||||
static QString escapeForRegex(const QString &input)
|
||||
{
|
||||
return QRegularExpression::escape(input);
|
||||
}
|
||||
|
||||
bool ReviewPage::validatePage()
|
||||
{
|
||||
const QString scene = field("targetScene").toString();
|
||||
const QString window = escapeForRegex(field("windowTitle").toString());
|
||||
const std::string name = ("Window -> " + scene).toStdString();
|
||||
|
||||
// Build condition data blob
|
||||
// ---------------------------------------------------------------
|
||||
// Condition blob — mirrors MacroConditionWindow::Save() output:
|
||||
//
|
||||
// {
|
||||
// "segmentSettings": { "enabled": true, "version": 1 },
|
||||
// "id": "window",
|
||||
// "checkTitle": true,
|
||||
// "window": "<user input>",
|
||||
// "windowRegexConfig": {
|
||||
// "enable": true, // use regex-style partial matching
|
||||
// "partial": true, // match anywhere in the title
|
||||
// "options": 3 // case-insensitive (QRegularExpression flags)
|
||||
// },
|
||||
// "focus": true, // only trigger when window is focused
|
||||
// "version": 1
|
||||
// }
|
||||
// ---------------------------------------------------------------
|
||||
OBSDataAutoRelease condSegment = obs_data_create();
|
||||
obs_data_set_bool(condSegment, "enabled", true);
|
||||
obs_data_set_int(condSegment, "version", 1);
|
||||
|
||||
OBSDataAutoRelease condRegex = obs_data_create();
|
||||
obs_data_set_bool(condRegex, "enable", true);
|
||||
obs_data_set_bool(condRegex, "partial", true);
|
||||
obs_data_set_int(condRegex, "options", 3); // CaseInsensitiveOption
|
||||
|
||||
OBSDataAutoRelease condData = obs_data_create();
|
||||
obs_data_set_obj(condData, "segmentSettings", condSegment);
|
||||
obs_data_set_string(condData, "id", "window");
|
||||
obs_data_set_bool(condData, "checkTitle", true);
|
||||
obs_data_set_string(condData, "window", window.toUtf8().constData());
|
||||
obs_data_set_obj(condData, "windowRegexConfig", condRegex);
|
||||
obs_data_set_bool(condData, "focus", true);
|
||||
obs_data_set_int(condData, "version", 1);
|
||||
|
||||
// Build action data blob
|
||||
// ---------------------------------------------------------------
|
||||
// Action blob — mirrors MacroActionSwitchScene::Save() output:
|
||||
//
|
||||
// {
|
||||
// "segmentSettings": { "enabled": true, "version": 1 },
|
||||
// "id": "scene_switch",
|
||||
// "action": 0, // 0 = switch scene
|
||||
// "sceneSelection": {
|
||||
// "type": 0, // 0 = scene by name
|
||||
// "name": "<scene>",
|
||||
// "canvasSelection": "Main"
|
||||
// },
|
||||
// "transitionType": 1, // 1 = use scene's default transition
|
||||
// "blockUntilTransitionDone": false,
|
||||
// "sceneType": 0
|
||||
// }
|
||||
// ---------------------------------------------------------------
|
||||
OBSDataAutoRelease actionSegment = obs_data_create();
|
||||
obs_data_set_bool(actionSegment, "enabled", true);
|
||||
obs_data_set_int(actionSegment, "version", 1);
|
||||
|
||||
OBSDataAutoRelease sceneSelection = obs_data_create();
|
||||
obs_data_set_int(sceneSelection, "type", 0);
|
||||
obs_data_set_string(sceneSelection, "name", scene.toUtf8().constData());
|
||||
obs_data_set_string(sceneSelection, "canvasSelection", "Main");
|
||||
|
||||
OBSDataAutoRelease actionData = obs_data_create();
|
||||
obs_data_set_obj(actionData, "segmentSettings", actionSegment);
|
||||
obs_data_set_string(actionData, "id", "scene_switch");
|
||||
obs_data_set_int(actionData, "action", 0);
|
||||
obs_data_set_obj(actionData, "sceneSelection", sceneSelection);
|
||||
obs_data_set_int(actionData, "transitionType", 1);
|
||||
obs_data_set_bool(actionData, "blockUntilTransitionDone", false);
|
||||
obs_data_set_int(actionData, "sceneType", 0);
|
||||
|
||||
if (!FirstRunWizard::CreateMacro(_macro, name, kConditionIdWindow,
|
||||
condData, kActionIdSceneSwitch,
|
||||
actionData)) {
|
||||
QMessageBox::warning(
|
||||
this,
|
||||
obs_module_text("FirstRunWizard.review.errorTitle"),
|
||||
QString(obs_module_text(
|
||||
"FirstRunWizard.review.errorBody"))
|
||||
.arg(window, scene));
|
||||
_macro.reset();
|
||||
// Still advance so the user is not stuck.
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// DonePage
|
||||
// ===========================================================================
|
||||
|
||||
DonePage::DonePage(QWidget *parent) : QWizardPage(parent)
|
||||
{
|
||||
setTitle(obs_module_text("FirstRunWizard.done.title"));
|
||||
setSubTitle(obs_module_text("FirstRunWizard.done.subtitle"));
|
||||
|
||||
auto body =
|
||||
new QLabel(obs_module_text("FirstRunWizard.done.body"), this);
|
||||
body->setWordWrap(true);
|
||||
body->setTextFormat(Qt::RichText);
|
||||
body->setOpenExternalLinks(true);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->addWidget(body);
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// FirstRunWizard
|
||||
// ===========================================================================
|
||||
|
||||
FirstRunWizard::FirstRunWizard(QWidget *parent) : QWizard(parent)
|
||||
{
|
||||
setWindowTitle(obs_module_text("FirstRunWizard.windowTitle"));
|
||||
setWizardStyle(QWizard::ModernStyle);
|
||||
setMinimumSize(540, 420);
|
||||
|
||||
setPage(PAGE_WELCOME, new WelcomePage(this));
|
||||
setPage(PAGE_SCENE, new SceneSelectionPage(this));
|
||||
setPage(PAGE_WINDOW, new WindowConditionPage(this));
|
||||
setPage(PAGE_REVIEW, new ReviewPage(this, _macro));
|
||||
setPage(PAGE_DONE, new DonePage(this));
|
||||
|
||||
setStartId(PAGE_WELCOME);
|
||||
setOption(QWizard::NoBackButtonOnLastPage, true);
|
||||
setOption(QWizard::NoCancelButtonOnLastPage, true);
|
||||
|
||||
// Mark done on both Accept (Finish) and Reject (Cancel / close)
|
||||
connect(this, &QWizard::accepted, this,
|
||||
&FirstRunWizard::markFirstRunComplete);
|
||||
connect(this, &QWizard::rejected, this,
|
||||
&FirstRunWizard::markFirstRunComplete);
|
||||
}
|
||||
|
||||
void FirstRunWizard::markFirstRunComplete()
|
||||
{
|
||||
WriteFirstRun(false);
|
||||
}
|
||||
|
||||
// static
|
||||
std::shared_ptr<Macro> FirstRunWizard::ShowWizard(QWidget *parent)
|
||||
{
|
||||
auto wizard = new FirstRunWizard(parent);
|
||||
wizard->exec();
|
||||
wizard->deleteLater();
|
||||
return wizard->_macro;
|
||||
}
|
||||
|
||||
// static
|
||||
bool FirstRunWizard::CreateMacro(std::shared_ptr<Macro> ¯o,
|
||||
const std::string ¯oName,
|
||||
const std::string &conditionId,
|
||||
obs_data_t *conditionData,
|
||||
const std::string &actionId,
|
||||
obs_data_t *actionData)
|
||||
{
|
||||
// 1. Create and register the Macro
|
||||
macro = std::make_shared<Macro>(macroName, GetGlobalMacroSettings());
|
||||
if (!macro) {
|
||||
blog(LOG_WARNING, "FirstRunWizard: Macro allocation failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2. Instantiate condition via factory, then hydrate via Load()
|
||||
auto condition =
|
||||
MacroConditionFactory::Create(conditionId, macro.get());
|
||||
if (!condition) {
|
||||
blog(LOG_WARNING,
|
||||
"FirstRunWizard: condition factory returned null "
|
||||
"for id '%s' — is the base plugin loaded?",
|
||||
conditionId.c_str());
|
||||
return false;
|
||||
}
|
||||
if (!condition->Load(conditionData)) {
|
||||
blog(LOG_WARNING,
|
||||
"FirstRunWizard: condition Load() failed for id '%s'",
|
||||
conditionId.c_str());
|
||||
return false;
|
||||
}
|
||||
macro->Conditions().emplace_back(condition);
|
||||
|
||||
// 3. Instantiate action via factory, then hydrate via Load()
|
||||
auto action = MacroActionFactory::Create(actionId, macro.get());
|
||||
if (!action) {
|
||||
blog(LOG_WARNING,
|
||||
"FirstRunWizard: action factory returned null "
|
||||
"for id '%s' — is the base plugin loaded?",
|
||||
actionId.c_str());
|
||||
return false;
|
||||
}
|
||||
if (!action->Load(actionData)) {
|
||||
blog(LOG_WARNING,
|
||||
"FirstRunWizard: action Load() failed for id '%s'",
|
||||
actionId.c_str());
|
||||
return false;
|
||||
}
|
||||
macro->Actions().emplace_back(action);
|
||||
|
||||
blog(LOG_INFO, "FirstRunWizard: created macro '%s'", macroName.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
128
lib/utils/first-run-wizard.hpp
Normal file
128
lib/utils/first-run-wizard.hpp
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
#pragma once
|
||||
|
||||
#include <obs-data.h>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QTimer>
|
||||
#include <QWizard>
|
||||
#include <QWizardPage>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace advss {
|
||||
|
||||
class Macro;
|
||||
|
||||
bool IsFirstRun();
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Page IDs
|
||||
// ---------------------------------------------------------------------------
|
||||
enum WizardPageId {
|
||||
PAGE_WELCOME = 0,
|
||||
PAGE_SCENE,
|
||||
PAGE_WINDOW,
|
||||
PAGE_REVIEW,
|
||||
PAGE_DONE,
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// WelcomePage
|
||||
// ---------------------------------------------------------------------------
|
||||
class WelcomePage : public QWizardPage {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WelcomePage(QWidget *parent = nullptr);
|
||||
int nextId() const override { return PAGE_SCENE; }
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// SceneSelectionPage
|
||||
// Registers wizard field "targetScene" (QString).
|
||||
// ---------------------------------------------------------------------------
|
||||
class SceneSelectionPage : public QWizardPage {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SceneSelectionPage(QWidget *parent = nullptr);
|
||||
void initializePage() override;
|
||||
bool isComplete() const override;
|
||||
int nextId() const override { return PAGE_WINDOW; }
|
||||
|
||||
private:
|
||||
QComboBox *_sceneCombo;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// WindowConditionPage
|
||||
// Registers wizard field "windowTitle" (QString).
|
||||
// Auto-detect button samples the focused window after a countdown.
|
||||
// ---------------------------------------------------------------------------
|
||||
class WindowConditionPage : public QWizardPage {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WindowConditionPage(QWidget *parent = nullptr);
|
||||
void initializePage() override;
|
||||
bool isComplete() const override;
|
||||
int nextId() const override { return PAGE_REVIEW; }
|
||||
|
||||
private slots:
|
||||
void onAutoDetectClicked();
|
||||
void onCountdownTick();
|
||||
|
||||
private:
|
||||
QLineEdit *_windowEdit;
|
||||
QPushButton *_autoDetect;
|
||||
QTimer *_detectTimer;
|
||||
int _countdown = 3;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ReviewPage
|
||||
// Displays a summary and calls FirstRunWizard::CreateMacro() on Finish.
|
||||
// ---------------------------------------------------------------------------
|
||||
class ReviewPage : public QWizardPage {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ReviewPage(QWidget *parent, std::shared_ptr<Macro> ¯o);
|
||||
void initializePage() override;
|
||||
bool validatePage() override;
|
||||
int nextId() const override { return PAGE_DONE; }
|
||||
|
||||
private:
|
||||
QLabel *_summary;
|
||||
std::shared_ptr<Macro> &_macro;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// DonePage
|
||||
// ---------------------------------------------------------------------------
|
||||
class DonePage : public QWizardPage {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DonePage(QWidget *parent = nullptr);
|
||||
int nextId() const override { return -1; }
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// FirstRunWizard
|
||||
// ---------------------------------------------------------------------------
|
||||
class FirstRunWizard : public QWizard {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FirstRunWizard(QWidget *parent = nullptr);
|
||||
static std::shared_ptr<Macro> ShowWizard(QWidget *parent);
|
||||
static bool
|
||||
CreateMacro(std::shared_ptr<Macro> ¯o, const std::string ¯oName,
|
||||
const std::string &conditionId, obs_data_t *conditionData,
|
||||
const std::string &actionId, obs_data_t *actionData);
|
||||
|
||||
private:
|
||||
void markFirstRunComplete();
|
||||
|
||||
std::shared_ptr<Macro> _macro;
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
|
|
@ -4,9 +4,11 @@
|
|||
#include "ui-helpers.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QLayout>
|
||||
#include <QMenu>
|
||||
#include <QTimer>
|
||||
|
||||
Q_DECLARE_METATYPE(advss::Item *);
|
||||
|
||||
|
|
@ -330,6 +332,13 @@ void ItemSettingsDialog::NameChanged(const QString &text)
|
|||
SetNameWarning("");
|
||||
}
|
||||
|
||||
void ItemSettingsDialog::showEvent(QShowEvent *)
|
||||
{
|
||||
if (_showNameEmptyWarning && _name->text().isEmpty()) {
|
||||
_name->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
void ItemSettingsDialog::SetNameWarning(const QString warn)
|
||||
{
|
||||
if (warn.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ private slots:
|
|||
void NameChanged(const QString &);
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent *) override;
|
||||
void SetNameWarning(const QString);
|
||||
|
||||
QLineEdit *_name;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
#ifndef UNIT_TEST
|
||||
#include <util/base.h>
|
||||
#endif
|
||||
|
||||
namespace advss {
|
||||
|
||||
|
|
@ -9,6 +7,7 @@ namespace advss {
|
|||
#define blog(level, msg, ...)
|
||||
#define vblog(level, msg, ...)
|
||||
#define ablog(level, msg, ...)
|
||||
#define mblog(level, msg, ...)
|
||||
#else
|
||||
|
||||
// Print log with "[adv-ss] " prefix
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ std::optional<double> GetDouble(const std::string &str)
|
|||
std::optional<int> GetInt(const std::string &str)
|
||||
{
|
||||
char *end = nullptr;
|
||||
int value = std::strtol(str.c_str(), &end, 10);
|
||||
int value = (int)std::strtol(str.c_str(), &end, 10);
|
||||
|
||||
if (end != str.c_str() && *end == '\0' && value != INT_MAX &&
|
||||
value != INT_MIN) {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
#include "non-modal-dialog.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
#include <obs-frontend-api.h>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
#include <QLayout>
|
||||
#include <QMainWindow>
|
||||
#include <QCoreApplication>
|
||||
|
||||
namespace advss {
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,42 @@
|
|||
#include "macro-signals.hpp"
|
||||
#include "switcher-data.hpp"
|
||||
|
||||
#include "obs-frontend-api.h"
|
||||
|
||||
namespace advss {
|
||||
|
||||
static std::mutex initMutex;
|
||||
static std::mutex postLoadMutex;
|
||||
static std::mutex finishLoadMutex;
|
||||
static std::mutex mutex;
|
||||
|
||||
static bool setup();
|
||||
static bool setupDonw = setup();
|
||||
bool loadingFinished = false;
|
||||
|
||||
static std::vector<std::function<void()>> &getFinishLoadSteps();
|
||||
|
||||
static bool setup()
|
||||
{
|
||||
static auto handleEvent = [](enum obs_frontend_event event, void *) {
|
||||
switch (event) {
|
||||
case OBS_FRONTEND_EVENT_FINISHED_LOADING: {
|
||||
std::lock_guard<std::mutex> lock(finishLoadMutex);
|
||||
for (const auto &step : getFinishLoadSteps()) {
|
||||
step();
|
||||
}
|
||||
getFinishLoadSteps().clear();
|
||||
loadingFinished = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
};
|
||||
};
|
||||
obs_frontend_add_event_callback(handleEvent, nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
static std::vector<std::function<void()>> &getPluginInitSteps()
|
||||
{
|
||||
static std::vector<std::function<void()>> steps;
|
||||
|
|
@ -63,6 +93,12 @@ static std::vector<std::function<void()>> &getPostLoadSteps()
|
|||
return steps;
|
||||
}
|
||||
|
||||
static std::vector<std::function<void()>> &getFinishLoadSteps()
|
||||
{
|
||||
static std::vector<std::function<void()>> steps;
|
||||
return steps;
|
||||
}
|
||||
|
||||
void SavePluginSettings(obs_data_t *obj)
|
||||
{
|
||||
GetSwitcher()->SaveSettings(obj);
|
||||
|
|
@ -136,7 +172,7 @@ void AddPluginInitStep(std::function<void()> step)
|
|||
|
||||
void AddPluginPostLoadStep(std::function<void()> step)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(initMutex);
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
getPluginPostLoadSteps().emplace_back(step);
|
||||
}
|
||||
|
||||
|
|
@ -178,6 +214,16 @@ void RunIntervalResetSteps()
|
|||
}
|
||||
}
|
||||
|
||||
void AddFinishedLoadingStep(std::function<void()> step)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(finishLoadMutex);
|
||||
if (loadingFinished) {
|
||||
return;
|
||||
}
|
||||
|
||||
getFinishLoadSteps().emplace_back(step);
|
||||
}
|
||||
|
||||
void AddStartStep(std::function<void()> step)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ void RunStartSteps();
|
|||
void RunStopSteps();
|
||||
void RunIntervalResetSteps();
|
||||
|
||||
// Steps are executed after OBS_FRONTEND_EVENT_FINISHED_LOADING is fired
|
||||
EXPORT void AddFinishedLoadingStep(std::function<void()>);
|
||||
|
||||
enum class NoMatchBehavior { NO_SWITCH = 0, SWITCH = 1, RANDOM_SWITCH = 2 };
|
||||
EXPORT void SetPluginNoMatchBehavior(NoMatchBehavior);
|
||||
EXPORT NoMatchBehavior GetPluginNoMatchBehavior();
|
||||
|
|
|
|||
|
|
@ -65,13 +65,16 @@ ResourceTable::ResourceTable(QWidget *parent, const QString &help,
|
|||
[openSettings]() { openSettings(); });
|
||||
|
||||
auto settingsShortcut = new QShortcut(QKeySequence("F2"), this);
|
||||
settingsShortcut->setContext(Qt::WidgetWithChildrenShortcut);
|
||||
QWidget::connect(settingsShortcut, &QShortcut::activated, this,
|
||||
openSettings);
|
||||
auto removeShortcut = new QShortcut(QKeySequence("Del"), this);
|
||||
removeShortcut->setContext(Qt::WidgetWithChildrenShortcut);
|
||||
QWidget::connect(removeShortcut, &QShortcut::activated, this,
|
||||
[this]() { Remove(); });
|
||||
|
||||
auto newShortcut = new QShortcut(QKeySequence("Ctrl+N"), this);
|
||||
newShortcut->setContext(Qt::WidgetWithChildrenShortcut);
|
||||
QWidget::connect(newShortcut, &QShortcut::activated, this,
|
||||
[this]() { Add(); });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,10 +103,11 @@ void SceneSelection::Load(obs_data_t *obj, const char *name,
|
|||
OBSDataAutoRelease data =
|
||||
obs_data_get_obj(obj, selectionSaveName.data());
|
||||
|
||||
if (obs_data_has_user_value(data, canvasSaveName.data())) {
|
||||
_canvas = GetWeakCanvasByName(
|
||||
obs_data_get_string(data, canvasSaveName.data()));
|
||||
} else {
|
||||
const char *canvasName =
|
||||
obs_data_get_string(data, canvasSaveName.data());
|
||||
_canvas = GetWeakCanvasByName(
|
||||
obs_data_get_string(data, canvasSaveName.data()));
|
||||
if (strcmp(canvasName, "") == 0) {
|
||||
OBSCanvasAutoRelease mainCanvas = obs_get_main_canvas();
|
||||
_canvas = obs_canvas_get_weak_canvas(mainCanvas);
|
||||
obs_weak_canvas_release(_canvas);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public:
|
|||
|
||||
private:
|
||||
OBSWeakSource _scene;
|
||||
OBSWeakCanvas _canvas;
|
||||
OBSWeakCanvas _canvas = GetMainCanvas();
|
||||
SceneGroup *_group = nullptr;
|
||||
std::weak_ptr<Variable> _variable;
|
||||
Type _type = Type::SCENE;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "source-helpers.hpp"
|
||||
#include "canvas-helpers.hpp"
|
||||
|
||||
#include <obs-frontend-api.h>
|
||||
|
||||
|
|
@ -28,15 +29,43 @@ std::string GetWeakSourceName(obs_weak_source_t *weak_source)
|
|||
|
||||
OBSWeakSource GetWeakSourceByName(const char *name)
|
||||
{
|
||||
OBSWeakSource weak;
|
||||
obs_source_t *source = obs_get_source_by_name(name);
|
||||
OBSSourceAutoRelease source = obs_get_source_by_name(name);
|
||||
if (source) {
|
||||
weak = obs_source_get_weak_source(source);
|
||||
obs_weak_source_release(weak);
|
||||
obs_source_release(source);
|
||||
return OBSGetWeakRef(source);
|
||||
}
|
||||
|
||||
return weak;
|
||||
#if LIBOBS_API_VER > MAKE_SEMANTIC_VERSION(31, 1, 0)
|
||||
struct SearchData {
|
||||
const char *name;
|
||||
OBSWeakSource &scene;
|
||||
};
|
||||
|
||||
static const auto enumCanvasScenes = [](void *dataPtr,
|
||||
obs_source_t *source) -> bool {
|
||||
auto data = static_cast<SearchData *>(dataPtr);
|
||||
if (strcmp(data->name, obs_source_get_name(source)) == 0) {
|
||||
data->scene = OBSGetWeakRef(source);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
static const auto enumCanvases = [](void *dataPtr,
|
||||
obs_canvas_t *canvas) -> bool {
|
||||
obs_canvas_enum_scenes(canvas, enumCanvasScenes, dataPtr);
|
||||
|
||||
auto data = static_cast<SearchData *>(dataPtr);
|
||||
return data->scene == nullptr;
|
||||
};
|
||||
|
||||
OBSWeakSource weakScene;
|
||||
SearchData searchData{name, weakScene};
|
||||
obs_enum_canvases(enumCanvases, &searchData);
|
||||
return weakScene;
|
||||
#else
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
OBSWeakSource GetWeakSourceByQString(const QString &name)
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ void CenterSplitterPosition(QSplitter *splitter)
|
|||
|
||||
void SetSplitterPositionByFraction(QSplitter *splitter, double fraction)
|
||||
{
|
||||
int value1 = (double)QWIDGETSIZE_MAX * fraction;
|
||||
int value2 = (double)QWIDGETSIZE_MAX * (1.0 - fraction);
|
||||
int value1 = (int)((double)QWIDGETSIZE_MAX * fraction);
|
||||
int value2 = (int)((double)QWIDGETSIZE_MAX * (1.0 - fraction));
|
||||
splitter->setSizes(QList<int>() << value1 << value2);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,9 @@ StringListEdit::StringListEdit(
|
|||
_filterCallback(filter),
|
||||
_preprocessCallback(preprocess)
|
||||
{
|
||||
if (_addString.isEmpty()) {
|
||||
_addString = obs_module_text("AdvSceneSwitcher.windowTitle");
|
||||
}
|
||||
}
|
||||
|
||||
void StringListEdit::SetStringList(const StringList &list)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ namespace advss {
|
|||
|
||||
class StringList : public QList<StringVariable> {
|
||||
public:
|
||||
using QList<StringVariable>::QList;
|
||||
|
||||
EXPORT bool Save(obs_data_t *obj, const char *name,
|
||||
const char *elementName = "string") const;
|
||||
EXPORT bool Load(obs_data_t *obj, const char *name,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,22 @@
|
|||
|
||||
namespace advss {
|
||||
|
||||
#ifdef UNIT_TEST
|
||||
std::mutex *GetSwitcherMutex()
|
||||
{
|
||||
static std::mutex m;
|
||||
return &m;
|
||||
}
|
||||
std::unique_lock<std::mutex> *GetSwitcherLoopLock()
|
||||
{
|
||||
static std::mutex m;
|
||||
static std::unique_lock<std::mutex> lock(m);
|
||||
return &lock;
|
||||
}
|
||||
#else
|
||||
std::mutex *GetSwitcherMutex();
|
||||
std::unique_lock<std::mutex> *GetSwitcherLoopLock();
|
||||
#endif
|
||||
|
||||
std::mutex *GetMutex()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#include "export-symbol-helper.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
namespace advss {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "tab-helpers.hpp"
|
||||
#include "log-helper.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
#include "plugin-state-helpers.hpp"
|
||||
|
||||
#include <obs.hpp>
|
||||
#include <QTabBar>
|
||||
|
|
@ -33,6 +34,21 @@ struct TabCallbacks {
|
|||
static std::unordered_map<const char *, TabCallbacks> createTabCallbacks;
|
||||
|
||||
static int lastOpenedTab = -1;
|
||||
static bool alwaysShowTabs = false;
|
||||
|
||||
[[maybe_unused]] static bool _ = []() {
|
||||
AddPluginInitStep([]() {
|
||||
AddSaveStep([](obs_data_t *data) {
|
||||
obs_data_set_bool(data, "alwaysShowTabs",
|
||||
alwaysShowTabs);
|
||||
});
|
||||
AddLoadStep([](obs_data_t *data) {
|
||||
alwaysShowTabs =
|
||||
obs_data_get_bool(data, "alwaysShowTabs");
|
||||
});
|
||||
});
|
||||
return true;
|
||||
}();
|
||||
|
||||
void SetTabVisibleByName(QTabWidget *tabWidget, bool visible,
|
||||
const QString &name)
|
||||
|
|
@ -197,7 +213,41 @@ void SetupOtherTabs(QTabWidget *tabWidget)
|
|||
.c_str());
|
||||
tabWidget->insertTab(0, widget, tabText);
|
||||
callbacks.setupTab(tabWidget);
|
||||
|
||||
if (alwaysShowTabs) {
|
||||
tabWidget->setTabVisible(0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetupShowAllTabsCheckBox(QCheckBox *checkBox, QTabWidget *tabWidget)
|
||||
{
|
||||
const auto stateChanged = [tabWidget](int state) {
|
||||
const bool newState = (state != 0);
|
||||
if (newState == alwaysShowTabs) {
|
||||
return;
|
||||
}
|
||||
|
||||
alwaysShowTabs = newState;
|
||||
|
||||
// Only show currently hidden tabs, but don't hide tabs which
|
||||
// are already visible
|
||||
if (!alwaysShowTabs) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto &[name, _] : createTabCallbacks) {
|
||||
const auto localeKey =
|
||||
std::string("AdvSceneSwitcher.") + name +
|
||||
".title";
|
||||
auto tabText = obs_module_text(localeKey.c_str());
|
||||
SetTabVisibleByName(tabWidget, true, tabText);
|
||||
}
|
||||
};
|
||||
|
||||
checkBox->setChecked(alwaysShowTabs);
|
||||
QWidget::connect(checkBox, &QCheckBox::stateChanged, checkBox,
|
||||
stateChanged);
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
#include "export-symbol-helper.hpp"
|
||||
|
||||
#include <obs-data.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QTabWidget>
|
||||
|
||||
namespace advss {
|
||||
|
|
@ -19,5 +21,6 @@ void SetupOtherTabs(QTabWidget *tabWidget);
|
|||
void SaveTabOrder(obs_data_t *obj);
|
||||
void LoadTabOrder(obs_data_t *obj);
|
||||
bool MacroTabIsInFocus();
|
||||
void SetupShowAllTabsCheckBox(QCheckBox *checkBox, QTabWidget *tabWidget);
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
|
|
@ -81,13 +81,13 @@ void GenericVariableSpinbox::DisableVariableSelection()
|
|||
|
||||
void GenericVariableSpinbox::setMinimum(double value)
|
||||
{
|
||||
_fixedValueInt->setMinimum(value);
|
||||
_fixedValueInt->setMinimum((int)value);
|
||||
_fixedValueDouble->setMinimum(value);
|
||||
}
|
||||
|
||||
void GenericVariableSpinbox::setMaximum(double value)
|
||||
{
|
||||
_fixedValueInt->setMaximum(value);
|
||||
_fixedValueInt->setMaximum((int)value);
|
||||
_fixedValueDouble->setMaximum(value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -467,9 +467,9 @@ static void setupTab(QTabWidget *tab)
|
|||
setTabVisible(tab, false);
|
||||
}
|
||||
|
||||
QWidget::connect(
|
||||
VariableSignalManager::Instance(), &VariableSignalManager::Add,
|
||||
tab, [tab](const QString &name) { setTabVisible(tab, true); });
|
||||
QWidget::connect(VariableSignalManager::Instance(),
|
||||
&VariableSignalManager::Add, tab,
|
||||
[tab](const QString &) { setTabVisible(tab, true); });
|
||||
}
|
||||
|
||||
void VariableTable::Settings::Save(obs_data_t *data, const char *name)
|
||||
|
|
|
|||
|
|
@ -261,6 +261,14 @@ std::optional<std::string> GetTextInWindow(const std::string &window)
|
|||
return {};
|
||||
}
|
||||
|
||||
DWORD pid = 0;
|
||||
DWORD thid = 0;
|
||||
thid = GetWindowThreadProcessId(hwnd, &pid);
|
||||
// Calling CoCreateInstance() on the OBS windows might cause a deadlock
|
||||
if (GetCurrentProcessId() == pid) {
|
||||
return {};
|
||||
}
|
||||
|
||||
IUIAutomation *automation = nullptr;
|
||||
auto hr = CoCreateInstance(__uuidof(CUIAutomation), nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ target_sources(
|
|||
utils/connection-manager.hpp
|
||||
utils/cursor-helpers.cpp
|
||||
utils/cursor-helpers.hpp
|
||||
utils/day-of-week-selector.cpp
|
||||
utils/day-of-week-selector.hpp
|
||||
utils/filter-selection.cpp
|
||||
utils/filter-selection.hpp
|
||||
utils/hotkey-helpers.cpp
|
||||
|
|
@ -166,6 +168,8 @@ target_sources(
|
|||
utils/scene-item-selection.hpp
|
||||
utils/scene-item-transform-helpers.cpp
|
||||
utils/scene-item-transform-helpers.hpp
|
||||
utils/transition-helpers.cpp
|
||||
utils/transition-helpers.hpp
|
||||
utils/source-properties-button.cpp
|
||||
utils/source-properties-button.hpp
|
||||
utils/source-settings-helpers.cpp
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ void MacroActionFileEdit::UpdateEntryData()
|
|||
}
|
||||
|
||||
_actions->setCurrentIndex(static_cast<int>(_entryData->_action));
|
||||
_filePath->SetPath(QString::fromStdString(_entryData->_file));
|
||||
_filePath->SetPath(_entryData->_file);
|
||||
_text->setPlainText(_entryData->_text);
|
||||
|
||||
adjustSize();
|
||||
|
|
|
|||
|
|
@ -47,20 +47,28 @@ getNextMacros(std::vector<MacroRef> ¯os, MacroRef &lastRandomMacroRef,
|
|||
bool MacroActionRandom::PerformAction()
|
||||
{
|
||||
if (_macros.size() == 0) {
|
||||
SetTempVarValue("macro", "");
|
||||
return true;
|
||||
}
|
||||
|
||||
auto macros = getNextMacros(_macros, lastRandomMacro, _allowRepeat);
|
||||
if (macros.size() == 0) {
|
||||
SetTempVarValue("macro", "");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (macros.size() == 1) {
|
||||
lastRandomMacro = macros[0];
|
||||
SetTempVarValue("macro", GetMacroName(macros[0].get()));
|
||||
return RunMacroActions(macros[0].get());
|
||||
}
|
||||
|
||||
srand((unsigned int)time(0));
|
||||
size_t idx = std::rand() % (macros.size());
|
||||
lastRandomMacro = macros[idx];
|
||||
|
||||
SetTempVarValue("macro", GetMacroName(macros[idx].get()));
|
||||
|
||||
return RunMacroActions(macros[idx].get());
|
||||
}
|
||||
|
||||
|
|
@ -85,6 +93,11 @@ bool MacroActionRandom::Load(obs_data_t *obj)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool MacroActionRandom::PostLoad()
|
||||
{
|
||||
return MacroAction::PostLoad() && MultiMacroRefAction::PostLoad();
|
||||
}
|
||||
|
||||
std::shared_ptr<MacroAction> MacroActionRandom::Create(Macro *m)
|
||||
{
|
||||
return std::make_shared<MacroActionRandom>(m);
|
||||
|
|
@ -95,6 +108,16 @@ std::shared_ptr<MacroAction> MacroActionRandom::Copy() const
|
|||
return std::make_shared<MacroActionRandom>(*this);
|
||||
}
|
||||
|
||||
void MacroActionRandom::SetupTempVars()
|
||||
{
|
||||
MacroAction::SetupTempVars();
|
||||
AddTempvar(
|
||||
"macro",
|
||||
obs_module_text("AdvSceneSwitcher.tempVar.random.macro"),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.random.macro.description"));
|
||||
}
|
||||
|
||||
MacroActionRandomEdit::MacroActionRandomEdit(
|
||||
QWidget *parent, std::shared_ptr<MacroActionRandom> entryData)
|
||||
: QWidget(parent),
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ public:
|
|||
void LogAction() const;
|
||||
bool Save(obs_data_t *obj) const;
|
||||
bool Load(obs_data_t *obj);
|
||||
bool PostLoad();
|
||||
std::string GetId() const { return id; };
|
||||
static std::shared_ptr<MacroAction> Create(Macro *m);
|
||||
std::shared_ptr<MacroAction> Copy() const;
|
||||
|
|
@ -22,7 +23,10 @@ public:
|
|||
bool _allowRepeat = false;
|
||||
|
||||
private:
|
||||
void SetupTempVars();
|
||||
|
||||
MacroRef lastRandomMacro;
|
||||
|
||||
static bool _registered;
|
||||
static const std::string id;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "plugin-state-helpers.hpp"
|
||||
#include "scene-switch-helpers.hpp"
|
||||
#include "source-helpers.hpp"
|
||||
#include "transition-helpers.hpp"
|
||||
|
||||
#include <obs-frontend-api.h>
|
||||
|
||||
|
|
@ -68,14 +69,6 @@ static int getTransitionOverrideDuration(OBSWeakSource &scene)
|
|||
return duration;
|
||||
}
|
||||
|
||||
static bool isUsingFixedLengthTransition(const OBSWeakSource &transition)
|
||||
{
|
||||
obs_source_t *source = obs_weak_source_get_source(transition);
|
||||
bool ret = obs_transition_fixed(source);
|
||||
obs_source_release(source);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static OBSWeakSource getOverrideTransition(OBSWeakSource &scene)
|
||||
{
|
||||
OBSWeakSource transition;
|
||||
|
|
@ -101,13 +94,13 @@ static int getExpectedTransitionDuration(OBSWeakSource &scene,
|
|||
auto overrideTransition = getOverrideTransition(scene);
|
||||
if (overrideTransition) {
|
||||
transition = overrideTransition;
|
||||
if (!isUsingFixedLengthTransition(transition)) {
|
||||
if (!IsFixedLengthTransition(transition)) {
|
||||
return getTransitionOverrideDuration(scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isUsingFixedLengthTransition(transition)) {
|
||||
if (IsFixedLengthTransition(transition)) {
|
||||
return -1; // no API is available to access the fixed duration
|
||||
}
|
||||
if (duration != 0) {
|
||||
|
|
@ -137,31 +130,51 @@ bool MacroActionSwitchScene::WaitForTransition(OBSWeakSource &scene,
|
|||
bool MacroActionSwitchScene::PerformAction()
|
||||
{
|
||||
OBSWeakSource sceneToSwitchTo;
|
||||
OBSWeakCanvas canvas;
|
||||
OBSWeakCanvas canvasToSwitchFor;
|
||||
|
||||
OBSCanvasAutoRelease mainCanvas = obs_get_main_canvas();
|
||||
OBSWeakCanvas mainCanvasWeak = OBSGetWeakRef(mainCanvas);
|
||||
|
||||
const auto getActiveSceneHelper = [this](const OBSWeakCanvas &canvas) {
|
||||
OBSWeakSource activeScene;
|
||||
if (IsMainCanvas(canvas) && _sceneType == SceneType::PREVIEW) {
|
||||
OBSSourceAutoRelease previewSource =
|
||||
obs_frontend_get_current_preview_scene();
|
||||
return OBSGetWeakRef(previewSource);
|
||||
} else {
|
||||
return GetActiveCanvasScene(canvas);
|
||||
}
|
||||
};
|
||||
|
||||
switch (_action) {
|
||||
case Action::SCENE_NAME:
|
||||
sceneToSwitchTo = _scene.GetScene();
|
||||
canvas = _scene.GetCanvas();
|
||||
canvasToSwitchFor = _scene.GetCanvas();
|
||||
break;
|
||||
case Action::SCENE_LIST_NEXT: {
|
||||
const auto activeScene = GetActiveCanvasScene(_canvas);
|
||||
const int currentIndex = GetIndexOfScene(_canvas, activeScene);
|
||||
sceneToSwitchTo = GetSceneAtIndex(_canvas, currentIndex + 1);
|
||||
canvas = _canvas;
|
||||
canvasToSwitchFor = _canvas ? _canvas : mainCanvasWeak;
|
||||
const auto activeScene =
|
||||
getActiveSceneHelper(canvasToSwitchFor);
|
||||
const int currentIndex =
|
||||
GetIndexOfScene(canvasToSwitchFor, activeScene);
|
||||
sceneToSwitchTo =
|
||||
GetSceneAtIndex(canvasToSwitchFor, currentIndex + 1);
|
||||
break;
|
||||
}
|
||||
case Action::SCENE_LIST_PREVIOUS: {
|
||||
const auto activeScene = GetActiveCanvasScene(_canvas);
|
||||
const int currentIndex = GetIndexOfScene(_canvas, activeScene);
|
||||
sceneToSwitchTo = GetSceneAtIndex(_canvas, currentIndex - 1);
|
||||
canvas = _canvas;
|
||||
canvasToSwitchFor = _canvas ? _canvas : mainCanvasWeak;
|
||||
const auto activeScene =
|
||||
getActiveSceneHelper(canvasToSwitchFor);
|
||||
const int currentIndex =
|
||||
GetIndexOfScene(canvasToSwitchFor, activeScene);
|
||||
sceneToSwitchTo =
|
||||
GetSceneAtIndex(canvasToSwitchFor, currentIndex - 1);
|
||||
break;
|
||||
}
|
||||
case Action::SCENE_LIST_INDEX: {
|
||||
sceneToSwitchTo =
|
||||
GetSceneAtIndex(_canvas, _index.GetValue() - 1);
|
||||
canvas = _canvas;
|
||||
canvasToSwitchFor = _canvas ? _canvas : mainCanvasWeak;
|
||||
sceneToSwitchTo = GetSceneAtIndex(canvasToSwitchFor,
|
||||
_index.GetValue() - 1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
@ -176,11 +189,12 @@ bool MacroActionSwitchScene::PerformAction()
|
|||
}
|
||||
|
||||
auto transition = _transition.GetTransition();
|
||||
SwitchScene({sceneToSwitchTo, transition,
|
||||
(int)(_duration.Milliseconds())},
|
||||
obs_frontend_preview_program_mode_active(), canvas);
|
||||
SwitchScene(
|
||||
{sceneToSwitchTo, transition, (int)(_duration.Milliseconds())},
|
||||
obs_frontend_preview_program_mode_active(), canvasToSwitchFor);
|
||||
if (_blockUntilTransitionDone && sceneToSwitchTo &&
|
||||
sceneToSwitchTo != GetCurrentScene() && IsMainCanvas(canvas)) {
|
||||
sceneToSwitchTo != GetCurrentScene() &&
|
||||
IsMainCanvas(canvasToSwitchFor)) {
|
||||
return WaitForTransition(sceneToSwitchTo, transition);
|
||||
}
|
||||
return true;
|
||||
|
|
@ -392,6 +406,7 @@ void MacroActionSwitchSceneEdit::SetWidgetData() const
|
|||
_sceneTypes->setCurrentIndex(_sceneTypes->findData(
|
||||
static_cast<int>(_entryData->_sceneType)));
|
||||
_scenes->SetScene(_entryData->_scene);
|
||||
_canvas->SetCanvas(_entryData->_canvas);
|
||||
_transitions->SetTransition(_entryData->_transition);
|
||||
_duration->SetDuration(_entryData->_duration);
|
||||
_blockUntilTransitionDone->setChecked(
|
||||
|
|
@ -431,7 +446,7 @@ void MacroActionSwitchSceneEdit::SceneSelectionCanvasChanged(
|
|||
SetWidgetVisibility();
|
||||
}
|
||||
|
||||
void MacroActionSwitchSceneEdit::ActionChanged(int value)
|
||||
void MacroActionSwitchSceneEdit::ActionChanged(int)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_action = static_cast<MacroActionSwitchScene::Action>(
|
||||
|
|
@ -481,7 +496,7 @@ shouldShowDurationInTransitionLayout(MacroActionSwitchScene::SceneType type,
|
|||
return true;
|
||||
}
|
||||
|
||||
if (isUsingFixedLengthTransition(transition.GetTransition())) {
|
||||
if (IsFixedLengthTransition(transition.GetTransition())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -561,9 +576,17 @@ void MacroActionSwitchSceneEdit::SetWidgetVisibility()
|
|||
{{"{{transitions}}", _transitions},
|
||||
{"{{duration}}", _duration}});
|
||||
|
||||
const auto canvas = action == MacroActionSwitchScene::Action::SCENE_NAME
|
||||
? _entryData->_scene.GetCanvas()
|
||||
: _entryData->_canvas;
|
||||
OBSWeakCanvas canvas;
|
||||
if (action == MacroActionSwitchScene::Action::SCENE_NAME) {
|
||||
canvas = _entryData->_scene.GetCanvas();
|
||||
} else {
|
||||
if (_entryData->_canvas) {
|
||||
canvas = _entryData->_canvas;
|
||||
} else {
|
||||
OBSCanvasAutoRelease mainCanvas = obs_get_main_canvas();
|
||||
canvas = OBSGetWeakRef(mainCanvas);
|
||||
}
|
||||
}
|
||||
const bool isMainCanvas = IsMainCanvas(canvas);
|
||||
SetLayoutVisible(_transitionLayout, isMainCanvas);
|
||||
_blockUntilTransitionDone->setVisible(isMainCanvas);
|
||||
|
|
@ -580,7 +603,7 @@ void MacroActionSwitchSceneEdit::SetWidgetVisibility()
|
|||
_notSupportedWarning->setText(
|
||||
fmt.arg(QString::fromStdString(GetWeakCanvasName(canvas))));
|
||||
_notSupportedWarning->setVisible(
|
||||
!IsMainCanvas(canvas) &&
|
||||
!isMainCanvas &&
|
||||
_entryData->_sceneType ==
|
||||
MacroActionSwitchScene::SceneType::PREVIEW);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
#include "macro-action-scene-visibility.hpp"
|
||||
#include "layout-helpers.hpp"
|
||||
#include "plugin-state-helpers.hpp"
|
||||
#include "transition-helpers.hpp"
|
||||
|
||||
#include <obs-frontend-api.h>
|
||||
|
||||
namespace advss {
|
||||
|
||||
|
|
@ -21,9 +25,168 @@ const static std::map<MacroActionSceneVisibility::Action, std::string>
|
|||
"AdvSceneSwitcher.action.sceneVisibility.type.toggle"},
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
||||
struct TransitionRestoreContext;
|
||||
static std::unordered_map<obs_sceneitem_t *, TransitionRestoreContext *>
|
||||
restoreContexts;
|
||||
static std::mutex restoreMutex;
|
||||
|
||||
struct TransitionRestoreContext {
|
||||
public:
|
||||
obs_sceneitem_t *item;
|
||||
bool wasVisible;
|
||||
|
||||
OBSSource originalTransition = nullptr;
|
||||
uint32_t originalDuration;
|
||||
|
||||
obs_source_t *transition = nullptr;
|
||||
signal_handler_t *sh = nullptr;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
static void handleShutdown(enum obs_frontend_event event, void *private_data)
|
||||
{
|
||||
if (event != OBS_FRONTEND_EVENT_EXIT) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(restoreMutex);
|
||||
for (const auto &[_, ctx] : restoreContexts) {
|
||||
obs_source_release(ctx->transition);
|
||||
}
|
||||
restoreContexts.clear();
|
||||
}
|
||||
|
||||
static bool setup()
|
||||
{
|
||||
obs_frontend_add_event_callback(handleShutdown, nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool setupDone = setup();
|
||||
|
||||
static void handleSourceDestroyed(void *param, calldata_t *)
|
||||
{
|
||||
if (OBSIsShuttingDown()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto ctx = static_cast<TransitionRestoreContext *>(param);
|
||||
ctx->sh = nullptr;
|
||||
ctx->originalTransition = nullptr;
|
||||
delete ctx;
|
||||
}
|
||||
|
||||
static void resetSceneItemTransition(void *param, calldata_t *)
|
||||
{
|
||||
if (OBSIsShuttingDown()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto ctx = static_cast<TransitionRestoreContext *>(param);
|
||||
|
||||
if (!ctx) {
|
||||
return;
|
||||
}
|
||||
|
||||
SetSceneItemTransition(ctx->item, ctx->originalTransition,
|
||||
!ctx->wasVisible);
|
||||
|
||||
obs_sceneitem_set_transition_duration(ctx->item, !ctx->wasVisible,
|
||||
ctx->originalDuration);
|
||||
|
||||
signal_handler_disconnect(ctx->sh, "transition_stop",
|
||||
resetSceneItemTransition, ctx);
|
||||
signal_handler_disconnect(ctx->sh, "destroy", handleSourceDestroyed,
|
||||
ctx);
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(restoreMutex);
|
||||
restoreContexts.erase(ctx->item);
|
||||
}
|
||||
|
||||
obs_source_release(ctx->transition);
|
||||
delete ctx;
|
||||
}
|
||||
|
||||
static void attachRestoreContext(obs_sceneitem_t *item,
|
||||
obs_source_t *transition, bool itemWasVisible,
|
||||
OBSSource originalTransition,
|
||||
uint32_t originalDuration)
|
||||
{
|
||||
signal_handler_t *sh = obs_source_get_signal_handler(transition);
|
||||
if (!sh) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(restoreMutex);
|
||||
|
||||
auto ctx = new TransitionRestoreContext{
|
||||
item,
|
||||
itemWasVisible,
|
||||
originalTransition,
|
||||
originalDuration,
|
||||
obs_source_get_ref(transition),
|
||||
sh,
|
||||
};
|
||||
|
||||
auto it = restoreContexts.find(item);
|
||||
if (it != restoreContexts.end()) {
|
||||
auto *oldCtx = it->second;
|
||||
|
||||
signal_handler_disconnect(oldCtx->sh, "transition_stop",
|
||||
resetSceneItemTransition, oldCtx);
|
||||
|
||||
signal_handler_disconnect(oldCtx->sh, "destroy",
|
||||
handleSourceDestroyed, oldCtx);
|
||||
|
||||
ctx->originalTransition = oldCtx->originalTransition;
|
||||
ctx->originalDuration = oldCtx->originalDuration;
|
||||
|
||||
obs_source_release(oldCtx->transition);
|
||||
delete oldCtx;
|
||||
|
||||
restoreContexts.erase(it);
|
||||
}
|
||||
|
||||
restoreContexts[item] = ctx;
|
||||
|
||||
signal_handler_connect(sh, "transition_stop", resetSceneItemTransition,
|
||||
ctx);
|
||||
signal_handler_connect(sh, "destroy", handleSourceDestroyed, ctx);
|
||||
}
|
||||
|
||||
static void setSceneItemVisibility(obs_sceneitem_t *item,
|
||||
const bool setTransition,
|
||||
const OBSWeakSource &transitionWeak,
|
||||
const bool setDuration,
|
||||
const Duration &duration,
|
||||
MacroActionSceneVisibility::Action action)
|
||||
{
|
||||
const OBSSourceAutoRelease transition = OBSGetStrongRef(transitionWeak);
|
||||
const bool itemIsVisible = obs_sceneitem_visible(item);
|
||||
|
||||
const OBSSource currentTransition =
|
||||
obs_sceneitem_get_transition(item, !itemIsVisible);
|
||||
const uint32_t currentTransitionDuration =
|
||||
obs_sceneitem_get_transition_duration(item, !itemIsVisible);
|
||||
|
||||
OBSSource privateTransitionSource = nullptr;
|
||||
if (setTransition) {
|
||||
privateTransitionSource = SetSceneItemTransition(
|
||||
item, transition, !itemIsVisible);
|
||||
} else {
|
||||
privateTransitionSource =
|
||||
obs_sceneitem_get_transition(item, !itemIsVisible);
|
||||
}
|
||||
|
||||
if (setDuration) {
|
||||
obs_sceneitem_set_transition_duration(item, !itemIsVisible,
|
||||
duration.Milliseconds());
|
||||
}
|
||||
|
||||
switch (action) {
|
||||
case MacroActionSceneVisibility::Action::SHOW:
|
||||
obs_sceneitem_set_visible(item, true);
|
||||
|
|
@ -32,16 +195,43 @@ static void setSceneItemVisibility(obs_sceneitem_t *item,
|
|||
obs_sceneitem_set_visible(item, false);
|
||||
break;
|
||||
case MacroActionSceneVisibility::Action::TOGGLE:
|
||||
obs_sceneitem_set_visible(item, !obs_sceneitem_visible(item));
|
||||
obs_sceneitem_set_visible(item, !itemIsVisible);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!setTransition && !setDuration) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!privateTransitionSource) {
|
||||
if (setTransition) {
|
||||
SetSceneItemTransition(item, currentTransition,
|
||||
!itemIsVisible);
|
||||
}
|
||||
if (setDuration) {
|
||||
obs_sceneitem_set_transition_duration(
|
||||
item, !itemIsVisible,
|
||||
currentTransitionDuration);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
auto sh = obs_source_get_signal_handler(privateTransitionSource);
|
||||
if (!sh) {
|
||||
return;
|
||||
}
|
||||
|
||||
attachRestoreContext(item, privateTransitionSource, itemIsVisible,
|
||||
currentTransition, currentTransitionDuration);
|
||||
}
|
||||
|
||||
bool MacroActionSceneVisibility::PerformAction()
|
||||
{
|
||||
auto items = _source.GetSceneItems(_scene);
|
||||
for (const auto &item : items) {
|
||||
setSceneItemVisibility(item, _action);
|
||||
setSceneItemVisibility(item, _updateTransition,
|
||||
_transition.GetTransition(),
|
||||
_updateDuration, _duration, _action);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -66,6 +256,10 @@ bool MacroActionSceneVisibility::Save(obs_data_t *obj) const
|
|||
MacroAction::Save(obj);
|
||||
_scene.Save(obj);
|
||||
_source.Save(obj);
|
||||
obs_data_set_bool(obj, "updateTransition", _updateTransition);
|
||||
_transition.Save(obj);
|
||||
obs_data_set_bool(obj, "updateDuration", _updateDuration);
|
||||
_duration.Save(obj);
|
||||
obs_data_set_int(obj, "action", static_cast<int>(_action));
|
||||
return true;
|
||||
}
|
||||
|
|
@ -82,6 +276,10 @@ bool MacroActionSceneVisibility::Load(obs_data_t *obj)
|
|||
MacroAction::Load(obj);
|
||||
_scene.Load(obj);
|
||||
_source.Load(obj);
|
||||
_updateTransition = obs_data_get_bool(obj, "updateTransition");
|
||||
_transition.Load(obj);
|
||||
_updateDuration = obs_data_get_bool(obj, "updateDuration");
|
||||
_duration.Load(obj);
|
||||
_action = static_cast<MacroActionSceneVisibility::Action>(
|
||||
obs_data_get_int(obj, "action"));
|
||||
|
||||
|
|
@ -141,10 +339,17 @@ MacroActionSceneVisibilityEdit::MacroActionSceneVisibilityEdit(
|
|||
SceneItemSelection::Type::ALL,
|
||||
},
|
||||
SceneItemSelectionWidget::NameClashMode::ALL)),
|
||||
_updateTransition(new QCheckBox(this)),
|
||||
_transitions(new TransitionSelectionWidget(this, false, false)),
|
||||
_updateDuration(new QCheckBox(this)),
|
||||
_duration(new DurationSelection(this, false)),
|
||||
_durationLayout(new QHBoxLayout),
|
||||
_actions(new QComboBox())
|
||||
{
|
||||
populateActionSelection(_actions);
|
||||
|
||||
_duration->SpinBox()->setSpecialValueText("-");
|
||||
|
||||
QWidget::connect(_actions, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(ActionChanged(int)));
|
||||
QWidget::connect(_scenes, SIGNAL(SceneChanged(const SceneSelection &)),
|
||||
|
|
@ -154,18 +359,49 @@ MacroActionSceneVisibilityEdit::MacroActionSceneVisibilityEdit(
|
|||
QWidget::connect(_sources,
|
||||
SIGNAL(SceneItemChanged(const SceneItemSelection &)),
|
||||
this, SLOT(SourceChanged(const SceneItemSelection &)));
|
||||
QWidget::connect(_updateTransition, SIGNAL(stateChanged(int)), this,
|
||||
SLOT(UpdateTransitionChanged(int)));
|
||||
QWidget::connect(_transitions,
|
||||
SIGNAL(TransitionChanged(const TransitionSelection &)),
|
||||
this,
|
||||
SLOT(TransitionChanged(const TransitionSelection &)));
|
||||
QWidget::connect(_updateDuration, SIGNAL(stateChanged(int)), this,
|
||||
SLOT(UpdateDurationChanged(int)));
|
||||
QWidget::connect(_duration, SIGNAL(DurationChanged(const Duration &)),
|
||||
this, SLOT(DurationChanged(const Duration &)));
|
||||
|
||||
auto layout = new QHBoxLayout;
|
||||
auto sceneItemLayout = new QHBoxLayout;
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.action.sceneVisibility.entry"),
|
||||
layout,
|
||||
"AdvSceneSwitcher.action.sceneVisibility.layout"),
|
||||
sceneItemLayout,
|
||||
{{"{{scenes}}", _scenes},
|
||||
{"{{sources}}", _sources},
|
||||
{"{{actions}}", _actions}});
|
||||
|
||||
auto transitionLayout = new QHBoxLayout;
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.sceneVisibility.layout.transition"),
|
||||
transitionLayout,
|
||||
{{"{{updateTransition}}", _updateTransition},
|
||||
{"{{transitions}}", _transitions}});
|
||||
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.sceneVisibility.layout.duration"),
|
||||
_durationLayout,
|
||||
{{"{{updateDuration}}", _updateDuration},
|
||||
{"{{duration}}", _duration}});
|
||||
|
||||
auto layout = new QVBoxLayout;
|
||||
layout->addLayout(sceneItemLayout);
|
||||
layout->addLayout(transitionLayout);
|
||||
layout->addLayout(_durationLayout);
|
||||
setLayout(layout);
|
||||
|
||||
_entryData = entryData;
|
||||
UpdateEntryData();
|
||||
SetWidgetVisibility();
|
||||
_loading = false;
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +413,11 @@ void MacroActionSceneVisibilityEdit::UpdateEntryData()
|
|||
|
||||
_actions->setCurrentIndex(static_cast<int>(_entryData->_action));
|
||||
_scenes->SetScene(_entryData->_scene);
|
||||
_sources->SetSceneItem((_entryData->_source));
|
||||
_sources->SetSceneItem(_entryData->_source);
|
||||
_updateTransition->setChecked(_entryData->_updateTransition);
|
||||
_transitions->SetTransition(_entryData->_transition);
|
||||
_updateDuration->setChecked(_entryData->_updateDuration);
|
||||
_duration->SetDuration(_entryData->_duration);
|
||||
}
|
||||
|
||||
void MacroActionSceneVisibilityEdit::SceneChanged(const SceneSelection &s)
|
||||
|
|
@ -197,6 +437,34 @@ void MacroActionSceneVisibilityEdit::SourceChanged(
|
|||
updateGeometry();
|
||||
}
|
||||
|
||||
void MacroActionSceneVisibilityEdit::UpdateTransitionChanged(int state)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_updateTransition = state;
|
||||
SetWidgetVisibility();
|
||||
}
|
||||
|
||||
void MacroActionSceneVisibilityEdit::TransitionChanged(
|
||||
const TransitionSelection &t)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_transition = t;
|
||||
SetWidgetVisibility();
|
||||
}
|
||||
|
||||
void MacroActionSceneVisibilityEdit::UpdateDurationChanged(int state)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_updateDuration = state;
|
||||
SetWidgetVisibility();
|
||||
}
|
||||
|
||||
void MacroActionSceneVisibilityEdit::DurationChanged(const Duration &dur)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_duration = dur;
|
||||
}
|
||||
|
||||
void MacroActionSceneVisibilityEdit::ActionChanged(int value)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
|
|
@ -204,4 +472,20 @@ void MacroActionSceneVisibilityEdit::ActionChanged(int value)
|
|||
static_cast<MacroActionSceneVisibility::Action>(value);
|
||||
}
|
||||
|
||||
void MacroActionSceneVisibilityEdit::SetWidgetVisibility()
|
||||
{
|
||||
const bool hideDurationSelection =
|
||||
_entryData->_updateTransition &&
|
||||
IsFixedLengthTransition(
|
||||
_entryData->_transition.GetTransition());
|
||||
|
||||
SetLayoutVisible(_durationLayout, !hideDurationSelection);
|
||||
|
||||
_transitions->setEnabled(_entryData->_updateTransition);
|
||||
_duration->setEnabled(_entryData->_updateDuration);
|
||||
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
#pragma once
|
||||
#include "duration-control.hpp"
|
||||
#include "macro-action-edit.hpp"
|
||||
#include "scene-selection.hpp"
|
||||
#include "scene-item-selection.hpp"
|
||||
#include "transition-selection.hpp"
|
||||
|
||||
namespace advss {
|
||||
|
||||
|
|
@ -20,6 +22,10 @@ public:
|
|||
|
||||
SceneSelection _scene;
|
||||
SceneItemSelection _source;
|
||||
bool _updateTransition = false;
|
||||
TransitionSelection _transition;
|
||||
bool _updateDuration = false;
|
||||
Duration _duration;
|
||||
|
||||
enum class Action {
|
||||
SHOW,
|
||||
|
|
@ -53,17 +59,27 @@ public:
|
|||
private slots:
|
||||
void SceneChanged(const SceneSelection &);
|
||||
void SourceChanged(const SceneItemSelection &);
|
||||
void UpdateTransitionChanged(int);
|
||||
void TransitionChanged(const TransitionSelection &);
|
||||
void UpdateDurationChanged(int);
|
||||
void DurationChanged(const Duration &seconds);
|
||||
void ActionChanged(int value);
|
||||
signals:
|
||||
void HeaderInfoChanged(const QString &);
|
||||
|
||||
protected:
|
||||
private:
|
||||
void SetWidgetVisibility();
|
||||
|
||||
SceneSelectionWidget *_scenes;
|
||||
SceneItemSelectionWidget *_sources;
|
||||
QCheckBox *_updateTransition;
|
||||
TransitionSelectionWidget *_transitions;
|
||||
QCheckBox *_updateDuration;
|
||||
DurationSelection *_duration;
|
||||
QHBoxLayout *_durationLayout;
|
||||
QComboBox *_actions;
|
||||
std::shared_ptr<MacroActionSceneVisibility> _entryData;
|
||||
|
||||
private:
|
||||
std::shared_ptr<MacroActionSceneVisibility> _entryData;
|
||||
bool _loading = true;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -82,13 +82,22 @@ void MacroActionSequence::ResolveVariablesToFixedValues()
|
|||
_resetIndex.ResolveVariables();
|
||||
}
|
||||
|
||||
void MacroActionSequence::SetAction(Action action)
|
||||
{
|
||||
_action = action;
|
||||
SetupTempVars();
|
||||
}
|
||||
|
||||
bool MacroActionSequence::RunSequence()
|
||||
{
|
||||
if (_macros.size() == 0) {
|
||||
SetTempVarValue("macro", "");
|
||||
return true;
|
||||
}
|
||||
|
||||
auto macro = GetNextMacro().GetMacro();
|
||||
SetTempVarValue("macro", GetMacroName(macro.get()));
|
||||
|
||||
if (!macro.get()) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -96,18 +105,21 @@ bool MacroActionSequence::RunSequence()
|
|||
return RunMacroActions(macro.get());
|
||||
}
|
||||
|
||||
bool MacroActionSequence::SetSequenceIndex() const
|
||||
bool MacroActionSequence::SetSequenceIndex()
|
||||
{
|
||||
auto macro = _macro.GetMacro();
|
||||
if (!macro) {
|
||||
SetTempVarValue("nextMacro", "");
|
||||
return true;
|
||||
}
|
||||
|
||||
auto actions = GetMacroActions(macro.get());
|
||||
if (!actions) {
|
||||
SetTempVarValue("nextMacro", "");
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string nextMacroName;
|
||||
for (const auto &action : *actions) {
|
||||
if (action->GetId() != id) {
|
||||
continue;
|
||||
|
|
@ -121,10 +133,34 @@ bool MacroActionSequence::SetSequenceIndex() const
|
|||
// -2 is needed since the _lastIndex starts at -1 and the reset
|
||||
// index starts at 1
|
||||
sequenceAction->_lastIdx = _resetIndex - 2;
|
||||
nextMacroName = GetMacroName(
|
||||
sequenceAction->GetNextMacro(false).GetMacro().get());
|
||||
}
|
||||
SetTempVarValue("nextMacro", nextMacroName);
|
||||
return true;
|
||||
}
|
||||
|
||||
void MacroActionSequence::SetupTempVars()
|
||||
{
|
||||
MacroAction::SetupTempVars();
|
||||
|
||||
if (_action == Action::RUN_SEQUENCE) {
|
||||
AddTempvar(
|
||||
"macro",
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.sequence.macro"),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.sequence.macro.description"));
|
||||
} else if (_action == Action::SET_INDEX) {
|
||||
AddTempvar(
|
||||
"nextMacro",
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.sequence.nextMacro"),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.sequence.nextMacro.description"));
|
||||
}
|
||||
}
|
||||
|
||||
bool MacroActionSequence::PerformAction()
|
||||
{
|
||||
if (_action == Action::RUN_SEQUENCE) {
|
||||
|
|
@ -162,7 +198,7 @@ bool MacroActionSequence::Load(obs_data_t *obj)
|
|||
LoadMacroList(obj, _macros);
|
||||
_restart = obs_data_get_bool(obj, "restart");
|
||||
_macro.Load(obj);
|
||||
_action = static_cast<Action>(obs_data_get_int(obj, "action"));
|
||||
SetAction(static_cast<Action>(obs_data_get_int(obj, "action")));
|
||||
_resetIndex.Load(obj, "resetIndex");
|
||||
return true;
|
||||
}
|
||||
|
|
@ -194,6 +230,7 @@ MacroActionSequenceEdit::MacroActionSequenceEdit(
|
|||
_resetIndex(new VariableSpinBox()),
|
||||
_layout(new QHBoxLayout())
|
||||
{
|
||||
_macros->HideGroups();
|
||||
populateActionSelection(_actions);
|
||||
|
||||
_resetIndex->setMinimum(1);
|
||||
|
|
@ -255,7 +292,7 @@ void MacroActionSequenceEdit::UpdateEntryData()
|
|||
_macroList->SetContent(_entryData->_macros);
|
||||
_restart->setChecked(_entryData->_restart);
|
||||
_resetIndex->SetValue(_entryData->_resetIndex);
|
||||
_actions->setCurrentIndex(static_cast<int>(_entryData->_action));
|
||||
_actions->setCurrentIndex(static_cast<int>(_entryData->GetAction()));
|
||||
_macros->SetCurrentMacro(_entryData->_macro);
|
||||
SetWidgetVisibility();
|
||||
adjustSize();
|
||||
|
|
@ -360,7 +397,7 @@ void MacroActionSequenceEdit::UpdateStatusLine()
|
|||
void MacroActionSequenceEdit::ActionChanged(int value)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_action = static_cast<MacroActionSequence::Action>(value);
|
||||
_entryData->SetAction(static_cast<MacroActionSequence::Action>(value));
|
||||
SetWidgetVisibility();
|
||||
}
|
||||
|
||||
|
|
@ -384,10 +421,10 @@ void MacroActionSequenceEdit::SetWidgetVisibility()
|
|||
|
||||
ClearLayout(_layout);
|
||||
|
||||
const auto action = _entryData->GetAction();
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
_entryData->_action ==
|
||||
MacroActionSequence::Action::RUN_SEQUENCE
|
||||
action == MacroActionSequence::Action::RUN_SEQUENCE
|
||||
? "AdvSceneSwitcher.action.sequence.entry.run"
|
||||
: "AdvSceneSwitcher.action.sequence.entry.setIndex"),
|
||||
_layout,
|
||||
|
|
@ -395,15 +432,14 @@ void MacroActionSequenceEdit::SetWidgetVisibility()
|
|||
{"{{macros}}", _macros},
|
||||
{"{{index}}", _resetIndex}});
|
||||
|
||||
_macroList->setVisible(_entryData->_action ==
|
||||
_macroList->setVisible(action ==
|
||||
MacroActionSequence::Action::RUN_SEQUENCE);
|
||||
_restart->setVisible(_entryData->_action ==
|
||||
_restart->setVisible(action ==
|
||||
MacroActionSequence::Action::RUN_SEQUENCE);
|
||||
_statusLine->setVisible(_entryData->_action ==
|
||||
_statusLine->setVisible(action ==
|
||||
MacroActionSequence::Action::RUN_SEQUENCE);
|
||||
_macros->setVisible(_entryData->_action ==
|
||||
MacroActionSequence::Action::SET_INDEX);
|
||||
_resetIndex->setVisible(_entryData->_action ==
|
||||
_macros->setVisible(action == MacroActionSequence::Action::SET_INDEX);
|
||||
_resetIndex->setVisible(action ==
|
||||
MacroActionSequence::Action::SET_INDEX);
|
||||
|
||||
adjustSize();
|
||||
|
|
|
|||
|
|
@ -34,7 +34,10 @@ public:
|
|||
RUN_SEQUENCE,
|
||||
SET_INDEX,
|
||||
};
|
||||
Action _action = Action::RUN_SEQUENCE;
|
||||
|
||||
Action GetAction() const { return _action; }
|
||||
void SetAction(Action);
|
||||
|
||||
bool _restart = true;
|
||||
IntVariable _resetIndex = 1;
|
||||
|
||||
|
|
@ -43,7 +46,11 @@ public:
|
|||
|
||||
private:
|
||||
bool RunSequence();
|
||||
bool SetSequenceIndex() const;
|
||||
bool SetSequenceIndex();
|
||||
|
||||
void SetupTempVars();
|
||||
|
||||
Action _action = Action::RUN_SEQUENCE;
|
||||
|
||||
static bool _registered;
|
||||
static const std::string id;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,10 @@ const static std::map<MacroActionSource::Action, std::string> actionTypes = {
|
|||
"AdvSceneSwitcher.action.source.type.closeFilterDialog"},
|
||||
{MacroActionSource::Action::CLOSE_PROPERTIES_DIALOG,
|
||||
"AdvSceneSwitcher.action.source.type.closePropertiesDialog"},
|
||||
{MacroActionSource::Action::GET_SETTING,
|
||||
"AdvSceneSwitcher.action.source.type.getSetting"},
|
||||
{MacroActionSource::Action::GET_SETTINGS,
|
||||
"AdvSceneSwitcher.action.source.type.getSettings"},
|
||||
};
|
||||
|
||||
const static std::map<obs_deinterlace_mode, std::string> deinterlaceModes = {
|
||||
|
|
@ -273,6 +277,22 @@ bool MacroActionSource::PerformAction()
|
|||
"OBSBasicProperties");
|
||||
});
|
||||
break;
|
||||
case Action::GET_SETTING: {
|
||||
const auto value =
|
||||
GetSourceSettingValue(_source.GetSource(), _setting);
|
||||
if (value) {
|
||||
SetTempVarValue("setting", *value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Action::GET_SETTINGS: {
|
||||
const auto settings =
|
||||
GetSourceSettings(_source.GetSource(), true);
|
||||
if (settings) {
|
||||
SetTempVarValue("settings", *settings);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -360,6 +380,31 @@ void MacroActionSource::ResolveVariablesToFixedValues()
|
|||
_manualSettingValue.ResolveVariables();
|
||||
}
|
||||
|
||||
void MacroActionSource::SetupTempVars()
|
||||
{
|
||||
MacroAction::SetupTempVars();
|
||||
switch (_action) {
|
||||
case Action::GET_SETTING:
|
||||
AddTempvar("setting",
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.source.setting"));
|
||||
break;
|
||||
case Action::GET_SETTINGS:
|
||||
AddTempvar("settings",
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.source.settings"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MacroActionSource::SetAction(Action action)
|
||||
{
|
||||
_action = action;
|
||||
SetupTempVars();
|
||||
}
|
||||
|
||||
static inline void populateActionSelection(QComboBox *list)
|
||||
{
|
||||
for (auto &[actionType, name] : actionTypes) {
|
||||
|
|
@ -502,7 +547,7 @@ void MacroActionSourceEdit::UpdateEntryData()
|
|||
|
||||
const auto weakSource = _entryData->_source.GetSource();
|
||||
_settingsButtons->SetSelection(weakSource, _entryData->_button);
|
||||
_actions->setCurrentIndex(static_cast<int>(_entryData->_action));
|
||||
_actions->setCurrentIndex(static_cast<int>(_entryData->GetAction()));
|
||||
_sources->SetSource(_entryData->_source);
|
||||
_sourceSettings->SetSelection(weakSource, _entryData->_setting);
|
||||
_settingsString->setPlainText(_entryData->_settingsString);
|
||||
|
|
@ -537,7 +582,7 @@ void MacroActionSourceEdit::SourceChanged(const SourceSelection &source)
|
|||
void MacroActionSourceEdit::ActionChanged(int value)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_action = static_cast<MacroActionSource::Action>(value);
|
||||
_entryData->SetAction(static_cast<MacroActionSource::Action>(value));
|
||||
SetWidgetVisibility();
|
||||
}
|
||||
|
||||
|
|
@ -664,19 +709,29 @@ static QString GetIndividualListEntryName()
|
|||
|
||||
void MacroActionSourceEdit::SetWidgetVisibility()
|
||||
{
|
||||
const auto action = _entryData->GetAction();
|
||||
|
||||
const bool isSetSettings = action ==
|
||||
MacroActionSource::Action::SETTINGS;
|
||||
const bool isGetSetting = action ==
|
||||
MacroActionSource::Action::GET_SETTING;
|
||||
const bool isGetSettings = action ==
|
||||
MacroActionSource::Action::GET_SETTINGS;
|
||||
|
||||
SetLayoutVisible(_settingsLayout,
|
||||
_entryData->_action ==
|
||||
MacroActionSource::Action::SETTINGS);
|
||||
isSetSettings || isGetSetting || isGetSettings);
|
||||
_settingsInputMethods->setVisible(isSetSettings);
|
||||
_sourceSettings->setVisible(
|
||||
_entryData->_action == MacroActionSource::Action::SETTINGS &&
|
||||
_entryData->_settingsInputMethod !=
|
||||
MacroActionSource::SettingsInputMethod::JSON_STRING);
|
||||
(isSetSettings &&
|
||||
_entryData->_settingsInputMethod !=
|
||||
MacroActionSource::SettingsInputMethod::JSON_STRING) ||
|
||||
isGetSetting);
|
||||
_settingsString->setVisible(
|
||||
_entryData->_action == MacroActionSource::Action::SETTINGS &&
|
||||
isSetSettings &&
|
||||
_entryData->_settingsInputMethod ==
|
||||
MacroActionSource::SettingsInputMethod::JSON_STRING);
|
||||
_getSettings->setVisible(
|
||||
_entryData->_action == MacroActionSource::Action::SETTINGS &&
|
||||
isSetSettings &&
|
||||
_entryData->_settingsInputMethod !=
|
||||
MacroActionSource::SettingsInputMethod::
|
||||
INDIVIDUAL_TEMPVAR);
|
||||
|
|
@ -685,13 +740,12 @@ void MacroActionSourceEdit::SetWidgetVisibility()
|
|||
GetIndividualListEntryName(),
|
||||
_entryData->_setting.IsList());
|
||||
|
||||
_tempVars->setVisible(_entryData->_action ==
|
||||
MacroActionSource::Action::SETTINGS &&
|
||||
_tempVars->setVisible(isSetSettings &&
|
||||
_entryData->_settingsInputMethod ==
|
||||
MacroActionSource::SettingsInputMethod::
|
||||
INDIVIDUAL_TEMPVAR);
|
||||
|
||||
if (_entryData->_action == MacroActionSource::Action::SETTINGS &&
|
||||
if (isSetSettings &&
|
||||
(_entryData->_settingsInputMethod ==
|
||||
MacroActionSource::SettingsInputMethod::INDIVIDUAL_MANUAL ||
|
||||
_entryData->_settingsInputMethod ==
|
||||
|
|
@ -704,35 +758,31 @@ void MacroActionSourceEdit::SetWidgetVisibility()
|
|||
_manualSettingValue->hide();
|
||||
}
|
||||
|
||||
const bool showWarning =
|
||||
_entryData->_action == MacroActionSource::Action::ENABLE ||
|
||||
_entryData->_action == MacroActionSource::Action::DISABLE;
|
||||
const bool showWarning = action == MacroActionSource::Action::ENABLE ||
|
||||
action == MacroActionSource::Action::DISABLE;
|
||||
_warning->setVisible(showWarning);
|
||||
_settingsButtons->setVisible(
|
||||
_entryData->_action ==
|
||||
MacroActionSource::Action::SETTINGS_BUTTON);
|
||||
action == MacroActionSource::Action::SETTINGS_BUTTON);
|
||||
_deinterlaceMode->setVisible(
|
||||
_entryData->_action ==
|
||||
MacroActionSource::Action::DEINTERLACE_MODE);
|
||||
action == MacroActionSource::Action::DEINTERLACE_MODE);
|
||||
_deinterlaceOrder->setVisible(
|
||||
_entryData->_action ==
|
||||
MacroActionSource::Action::DEINTERLACE_FIELD_ORDER);
|
||||
action == MacroActionSource::Action::DEINTERLACE_FIELD_ORDER);
|
||||
|
||||
_refreshSettingSelection->setVisible(
|
||||
(_entryData->_settingsInputMethod ==
|
||||
MacroActionSource::SettingsInputMethod::
|
||||
INDIVIDUAL_MANUAL ||
|
||||
_entryData->_settingsInputMethod ==
|
||||
MacroActionSource::SettingsInputMethod::
|
||||
INDIVIDUAL_LIST_ENTRY) &&
|
||||
((isSetSettings &&
|
||||
(_entryData->_settingsInputMethod ==
|
||||
MacroActionSource::SettingsInputMethod::
|
||||
INDIVIDUAL_MANUAL ||
|
||||
_entryData->_settingsInputMethod ==
|
||||
MacroActionSource::SettingsInputMethod::
|
||||
INDIVIDUAL_LIST_ENTRY)) ||
|
||||
isGetSetting) &&
|
||||
_entryData->_source.GetType() ==
|
||||
SourceSelection::Type::VARIABLE);
|
||||
|
||||
_acceptDialog->setVisible(
|
||||
_entryData->_action ==
|
||||
MacroActionSource::Action::CLOSE_FILTER_DIALOG ||
|
||||
_entryData->_action ==
|
||||
MacroActionSource::Action::CLOSE_PROPERTIES_DIALOG);
|
||||
action == MacroActionSource::Action::CLOSE_FILTER_DIALOG ||
|
||||
action == MacroActionSource::Action::CLOSE_PROPERTIES_DIALOG);
|
||||
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
|
|
|
|||
|
|
@ -24,17 +24,7 @@ public:
|
|||
static std::shared_ptr<MacroAction> Create(Macro *m);
|
||||
std::shared_ptr<MacroAction> Copy() const;
|
||||
void ResolveVariablesToFixedValues();
|
||||
|
||||
SourceSelection _source;
|
||||
SourceSettingButton _button;
|
||||
StringVariable _settingsString = "";
|
||||
StringVariable _manualSettingValue = "";
|
||||
obs_deinterlace_mode _deinterlaceMode = OBS_DEINTERLACE_MODE_DISABLE;
|
||||
obs_deinterlace_field_order _deinterlaceOrder =
|
||||
OBS_DEINTERLACE_FIELD_ORDER_TOP;
|
||||
TempVariableRef _tempVar;
|
||||
SourceSetting _setting;
|
||||
bool _acceptDialog = false;
|
||||
void SetupTempVars();
|
||||
|
||||
enum class Action {
|
||||
ENABLE,
|
||||
|
|
@ -50,8 +40,23 @@ public:
|
|||
CLOSE_INTERACTION_DIALOG,
|
||||
CLOSE_FILTER_DIALOG,
|
||||
CLOSE_PROPERTIES_DIALOG,
|
||||
GET_SETTING,
|
||||
GET_SETTINGS,
|
||||
};
|
||||
Action _action = Action::SETTINGS;
|
||||
|
||||
void SetAction(Action);
|
||||
Action GetAction() const { return _action; }
|
||||
|
||||
SourceSelection _source;
|
||||
SourceSettingButton _button;
|
||||
StringVariable _settingsString = "";
|
||||
StringVariable _manualSettingValue = "";
|
||||
obs_deinterlace_mode _deinterlaceMode = OBS_DEINTERLACE_MODE_DISABLE;
|
||||
obs_deinterlace_field_order _deinterlaceOrder =
|
||||
OBS_DEINTERLACE_FIELD_ORDER_TOP;
|
||||
TempVariableRef _tempVar;
|
||||
SourceSetting _setting;
|
||||
bool _acceptDialog = false;
|
||||
|
||||
enum class SettingsInputMethod {
|
||||
INDIVIDUAL_MANUAL,
|
||||
|
|
@ -63,6 +68,8 @@ public:
|
|||
SettingsInputMethod::INDIVIDUAL_MANUAL;
|
||||
|
||||
private:
|
||||
Action _action = Action::SETTINGS;
|
||||
|
||||
static bool _registered;
|
||||
static const std::string id;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,15 +31,16 @@ bool MacroActionTimer::PerformAction()
|
|||
if (!macro) {
|
||||
return true;
|
||||
}
|
||||
auto conditions = *GetMacroConditions(macro.get());
|
||||
for (auto condition : conditions) {
|
||||
|
||||
const auto updateCondition = [this](MacroCondition *condition) {
|
||||
if (condition->GetId() != id) {
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
|
||||
auto timerCondition =
|
||||
dynamic_cast<MacroConditionTimer *>(condition.get());
|
||||
dynamic_cast<MacroConditionTimer *>(condition);
|
||||
if (!timerCondition) {
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (_actionType) {
|
||||
|
|
@ -59,6 +60,23 @@ bool MacroActionTimer::PerformAction()
|
|||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
const auto updateMacro = [&](Macro *macro) {
|
||||
auto conditions = *GetMacroConditions(macro);
|
||||
for (auto condition : conditions) {
|
||||
updateCondition(condition.get());
|
||||
}
|
||||
};
|
||||
|
||||
if (!IsGroupMacro(macro.get())) {
|
||||
updateMacro(macro.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
auto macros = GetGroupMacroEntries(macro.get());
|
||||
for (const auto ¯o : macros) {
|
||||
updateMacro(macro.get());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -131,7 +149,7 @@ void MacroActionTimer::ResolveVariablesToFixedValues()
|
|||
_duration.ResolveVariables();
|
||||
}
|
||||
|
||||
static inline void populateTypeSelection(QComboBox *list)
|
||||
static void populateTypeSelection(QComboBox *list)
|
||||
{
|
||||
for (const auto &[_, name] : timerActions) {
|
||||
list->addItem(obs_module_text(name.c_str()));
|
||||
|
|
@ -140,12 +158,11 @@ static inline void populateTypeSelection(QComboBox *list)
|
|||
|
||||
MacroActionTimerEdit::MacroActionTimerEdit(
|
||||
QWidget *parent, std::shared_ptr<MacroActionTimer> entryData)
|
||||
: QWidget(parent)
|
||||
: QWidget(parent),
|
||||
_macros(new MacroSelection(parent)),
|
||||
_duration(new DurationSelection(this)),
|
||||
_timerAction(new QComboBox(this))
|
||||
{
|
||||
_macros = new MacroSelection(parent);
|
||||
_duration = new DurationSelection();
|
||||
_timerAction = new QComboBox();
|
||||
|
||||
populateTypeSelection(_timerAction);
|
||||
|
||||
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
|
||||
|
|
@ -155,15 +172,13 @@ MacroActionTimerEdit::MacroActionTimerEdit(
|
|||
QWidget::connect(_timerAction, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(ActionTypeChanged(int)));
|
||||
|
||||
_mainLayout = new QHBoxLayout;
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{macros}}", _macros},
|
||||
{"{{duration}}", _duration},
|
||||
{"{{timerAction}}", _timerAction},
|
||||
};
|
||||
auto layout = new QHBoxLayout;
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.timer.entry"),
|
||||
_mainLayout, widgetPlaceholders);
|
||||
setLayout(_mainLayout);
|
||||
layout,
|
||||
{{"{{macros}}", _macros},
|
||||
{"{{duration}}", _duration},
|
||||
{"{{timerAction}}", _timerAction}});
|
||||
setLayout(layout);
|
||||
|
||||
_entryData = entryData;
|
||||
UpdateEntryData();
|
||||
|
|
|
|||
|
|
@ -58,16 +58,14 @@ private slots:
|
|||
signals:
|
||||
void HeaderInfoChanged(const QString &);
|
||||
|
||||
protected:
|
||||
private:
|
||||
void SetWidgetVisibility();
|
||||
|
||||
MacroSelection *_macros;
|
||||
DurationSelection *_duration;
|
||||
QComboBox *_timerAction;
|
||||
std::shared_ptr<MacroActionTimer> _entryData;
|
||||
|
||||
private:
|
||||
QHBoxLayout *_mainLayout;
|
||||
std::shared_ptr<MacroActionTimer> _entryData;
|
||||
bool _loading = true;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "macro-action-transition.hpp"
|
||||
#include "layout-helpers.hpp"
|
||||
#include "transition-helpers.hpp"
|
||||
|
||||
#include <obs-frontend-api.h>
|
||||
|
||||
|
|
@ -75,26 +76,6 @@ static void obs_sceneitem_set_transition_duration(obs_sceneitem_t *item,
|
|||
}
|
||||
#endif
|
||||
|
||||
static void setSceneItemTransition(const OBSSceneItem &item,
|
||||
const OBSSourceAutoRelease &transition,
|
||||
bool show)
|
||||
{
|
||||
OBSDataAutoRelease settings = obs_source_get_settings(transition);
|
||||
if (!transition || !settings) {
|
||||
// Set transition to "None"
|
||||
obs_sceneitem_set_transition(item, show, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
// We cannot share the transition source between
|
||||
// scene items without introducing strange graphical
|
||||
// artifacts so we have to create new ones here
|
||||
OBSSourceAutoRelease transitionSource = obs_source_create_private(
|
||||
obs_source_get_id(transition), obs_source_get_name(transition),
|
||||
settings);
|
||||
obs_sceneitem_set_transition(item, show, transitionSource);
|
||||
}
|
||||
|
||||
void MacroActionTransition::SetSourceTransition(bool show)
|
||||
{
|
||||
#if LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(27, 0, 0)
|
||||
|
|
@ -103,7 +84,7 @@ void MacroActionTransition::SetSourceTransition(bool show)
|
|||
const auto items = _source.GetSceneItems(_scene);
|
||||
for (const auto &item : items) {
|
||||
if (_setTransitionType) {
|
||||
setSceneItemTransition(item, transition, show);
|
||||
SetSceneItemTransition(item, transition, show);
|
||||
}
|
||||
if (_setDuration) {
|
||||
obs_sceneitem_set_transition_duration(
|
||||
|
|
|
|||
|
|
@ -38,32 +38,13 @@ const static std::map<MacroConditionDate::Condition, std::string>
|
|||
"AdvSceneSwitcher.condition.date.state.before"},
|
||||
};
|
||||
|
||||
const static std::map<MacroConditionDate::Day, std::string> dayOfWeekNames = {
|
||||
{MacroConditionDate::Day::ANY,
|
||||
"AdvSceneSwitcher.condition.date.anyDay"},
|
||||
{MacroConditionDate::Day::MONDAY,
|
||||
"AdvSceneSwitcher.condition.date.monday"},
|
||||
{MacroConditionDate::Day::TUESDAY,
|
||||
"AdvSceneSwitcher.condition.date.tuesday"},
|
||||
{MacroConditionDate::Day::WEDNESDAY,
|
||||
"AdvSceneSwitcher.condition.date.wednesday"},
|
||||
{MacroConditionDate::Day::THURSDAY,
|
||||
"AdvSceneSwitcher.condition.date.thursday"},
|
||||
{MacroConditionDate::Day::FRIDAY,
|
||||
"AdvSceneSwitcher.condition.date.friday"},
|
||||
{MacroConditionDate::Day::SATURDAY,
|
||||
"AdvSceneSwitcher.condition.date.saturday"},
|
||||
{MacroConditionDate::Day::SUNDAY,
|
||||
"AdvSceneSwitcher.condition.date.sunday"},
|
||||
};
|
||||
|
||||
bool MacroConditionDate::CheckDayOfWeek(int64_t msSinceLastCheck)
|
||||
{
|
||||
QDateTime cur = QDateTime::currentDateTime();
|
||||
SetVariables(cur);
|
||||
|
||||
if (_dayOfWeek != Day::ANY &&
|
||||
cur.date().dayOfWeek() != static_cast<int>(_dayOfWeek)) {
|
||||
if (!_days.contains(static_cast<DayOfWeekSelector::Day>(
|
||||
cur.date().dayOfWeek()))) {
|
||||
return false;
|
||||
}
|
||||
if (_ignoreTime) {
|
||||
|
|
@ -201,7 +182,7 @@ bool MacroConditionDate::CheckCondition()
|
|||
bool MacroConditionDate::Save(obs_data_t *obj) const
|
||||
{
|
||||
MacroCondition::Save(obj);
|
||||
obs_data_set_int(obj, "dayOfWeek", static_cast<int>(_dayOfWeek));
|
||||
SaveSelectedDays(obj, _days);
|
||||
obs_data_set_int(obj, "condition", static_cast<int>(_condition));
|
||||
const auto &dateToSave = _updateOnRepeat ? _dateTime : _origDateTime;
|
||||
const auto &dateToSave2 = _updateOnRepeat ? _dateTime2 : _origDateTime2;
|
||||
|
|
@ -216,13 +197,14 @@ bool MacroConditionDate::Save(obs_data_t *obj) const
|
|||
_duration.Save(obj);
|
||||
obs_data_set_bool(obj, "dayOfWeekCheck", _dayOfWeekCheck);
|
||||
obs_data_set_string(obj, "pattern", _pattern.c_str());
|
||||
obs_data_set_int(obj, "version", 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MacroConditionDate::Load(obs_data_t *obj)
|
||||
{
|
||||
MacroCondition::Load(obj);
|
||||
_dayOfWeek = static_cast<Day>(obs_data_get_int(obj, "dayOfWeek"));
|
||||
_days = LoadSelectedDays(obj);
|
||||
_condition = static_cast<MacroConditionDate::Condition>(
|
||||
obs_data_get_int(obj, "condition"));
|
||||
_dateTime = QDateTime::fromString(
|
||||
|
|
@ -245,17 +227,64 @@ bool MacroConditionDate::Load(obs_data_t *obj)
|
|||
_condition == MacroConditionDate::Condition::BETWEEN) {
|
||||
_condition = MacroConditionDate::Condition::AT;
|
||||
}
|
||||
|
||||
if (!obs_data_has_user_value(obj, "version")) {
|
||||
enum class Day {
|
||||
ANY = 0,
|
||||
MONDAY,
|
||||
TUESDAY,
|
||||
WEDNESDAY,
|
||||
THURSDAY,
|
||||
FRIDAY,
|
||||
SATURDAY,
|
||||
SUNDAY,
|
||||
};
|
||||
auto oldDay =
|
||||
static_cast<Day>(obs_data_get_int(obj, "dayOfWeek"));
|
||||
switch (oldDay) {
|
||||
case Day::ANY:
|
||||
_days = {DayOfWeekSelector::Monday,
|
||||
DayOfWeekSelector::Tuesday,
|
||||
DayOfWeekSelector::Wednesday,
|
||||
DayOfWeekSelector::Thursday,
|
||||
DayOfWeekSelector::Friday,
|
||||
DayOfWeekSelector::Saturday,
|
||||
DayOfWeekSelector::Sunday};
|
||||
break;
|
||||
case Day::MONDAY:
|
||||
_days = {DayOfWeekSelector::Monday};
|
||||
break;
|
||||
case Day::TUESDAY:
|
||||
_days = {DayOfWeekSelector::Tuesday};
|
||||
break;
|
||||
case Day::WEDNESDAY:
|
||||
_days = {DayOfWeekSelector::Wednesday};
|
||||
break;
|
||||
case Day::THURSDAY:
|
||||
_days = {DayOfWeekSelector::Thursday};
|
||||
break;
|
||||
case Day::FRIDAY:
|
||||
_days = {DayOfWeekSelector::Friday};
|
||||
break;
|
||||
case Day::SATURDAY:
|
||||
_days = {DayOfWeekSelector::Saturday};
|
||||
break;
|
||||
case Day::SUNDAY:
|
||||
_days = {DayOfWeekSelector::Sunday};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string MacroConditionDate::GetShortDesc() const
|
||||
{
|
||||
if (_dayOfWeekCheck) {
|
||||
auto it = dayOfWeekNames.find(_dayOfWeek);
|
||||
if (it == dayOfWeekNames.end()) {
|
||||
return "";
|
||||
}
|
||||
std::string dayName = obs_module_text(it->second.c_str());
|
||||
const auto dayName =
|
||||
DayOfWeekSelector::ToString(_days).toStdString();
|
||||
if (_ignoreTime) {
|
||||
return dayName;
|
||||
}
|
||||
|
|
@ -347,13 +376,6 @@ void MacroConditionDate::SetupTempVars()
|
|||
obs_module_text("AdvSceneSwitcher.tempVar.date.dayOfWeek"));
|
||||
}
|
||||
|
||||
static inline void populateDaySelection(QComboBox *list)
|
||||
{
|
||||
for (auto entry : dayOfWeekNames) {
|
||||
list->addItem(obs_module_text(entry.second.c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
static inline void populateConditionSelection(QComboBox *list)
|
||||
{
|
||||
for (auto entry : dateConditionTypes) {
|
||||
|
|
@ -372,7 +394,7 @@ MacroConditionDateEdit::MacroConditionDateEdit(
|
|||
QWidget *parent, std::shared_ptr<MacroConditionDate> entryData)
|
||||
: QWidget(parent),
|
||||
_weekCondition(new QComboBox()),
|
||||
_dayOfWeek(new QComboBox()),
|
||||
_days(new DayOfWeekSelector(this)),
|
||||
_ignoreWeekTime(new QCheckBox()),
|
||||
_weekTime(new QTimeEdit()),
|
||||
_condition(new QComboBox()),
|
||||
|
|
@ -392,7 +414,7 @@ MacroConditionDateEdit::MacroConditionDateEdit(
|
|||
_currentDate(new QLabel()),
|
||||
_advancedSettingsTooggle(new QPushButton(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.showAdvancedSettings"))),
|
||||
_simpleLayout(new QHBoxLayout()),
|
||||
_simpleLayout(new QVBoxLayout()),
|
||||
_advancedLayout(new QHBoxLayout()),
|
||||
_repeatLayout(new QVBoxLayout()),
|
||||
_repeatUpdateLayout(new QHBoxLayout()),
|
||||
|
|
@ -418,8 +440,8 @@ MacroConditionDateEdit::MacroConditionDateEdit(
|
|||
|
||||
QWidget::connect(_weekCondition, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(ConditionChanged(int)));
|
||||
QWidget::connect(_dayOfWeek, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(DayOfWeekChanged(int)));
|
||||
QWidget::connect(_days, &DayOfWeekSelector::SelectionChanged, this,
|
||||
&MacroConditionDateEdit::DaysChanged);
|
||||
QWidget::connect(_ignoreWeekTime, SIGNAL(stateChanged(int)), this,
|
||||
SLOT(IgnoreTimeChanged(int)));
|
||||
QWidget::connect(_weekTime, SIGNAL(timeChanged(const QTime &)), this,
|
||||
|
|
@ -449,13 +471,12 @@ MacroConditionDateEdit::MacroConditionDateEdit(
|
|||
QWidget::connect(_pattern, SIGNAL(editingFinished()), this,
|
||||
SLOT(PatternChanged()));
|
||||
|
||||
populateDaySelection(_dayOfWeek);
|
||||
populateConditionSelection(_condition);
|
||||
populateWeekConditionSelection(_weekCondition);
|
||||
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{weekCondition}}", _weekCondition},
|
||||
{"{{dayOfWeek}}", _dayOfWeek},
|
||||
{"{{dayOfWeek}}", _days},
|
||||
{"{{ignoreWeekTime}}", _ignoreWeekTime},
|
||||
{"{{weekTime}}", _weekTime},
|
||||
{"{{condition}}", _condition},
|
||||
|
|
@ -472,28 +493,39 @@ MacroConditionDateEdit::MacroConditionDateEdit(
|
|||
{"{{pattern}}", _pattern},
|
||||
{"{{currentDate}}", _currentDate},
|
||||
};
|
||||
|
||||
auto dayLayout = new QHBoxLayout;
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.date.entry.simple"),
|
||||
_simpleLayout, widgetPlaceholders);
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.layout.simple.day"),
|
||||
dayLayout, widgetPlaceholders);
|
||||
auto timeLayout = new QHBoxLayout;
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.layout.simple.time"),
|
||||
timeLayout, widgetPlaceholders);
|
||||
_simpleLayout->addLayout(dayLayout);
|
||||
_simpleLayout->addLayout(timeLayout);
|
||||
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.entry.advanced"),
|
||||
"AdvSceneSwitcher.condition.date.layout.advanced"),
|
||||
_advancedLayout, widgetPlaceholders);
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.entry.updateOnRepeat"),
|
||||
"AdvSceneSwitcher.condition.date.layout.updateOnRepeat"),
|
||||
_repeatUpdateLayout, widgetPlaceholders);
|
||||
auto repeatLayout = new QHBoxLayout;
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.date.entry.repeat"),
|
||||
repeatLayout, widgetPlaceholders);
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.entry.pattern"),
|
||||
"AdvSceneSwitcher.condition.date.layout.repeat"),
|
||||
repeatLayout, widgetPlaceholders);
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.layout.pattern"),
|
||||
_patternLayout, widgetPlaceholders);
|
||||
_repeatLayout->addLayout(repeatLayout);
|
||||
_repeatLayout->addWidget(_nextMatchDate);
|
||||
_repeatLayout->addLayout(_repeatUpdateLayout);
|
||||
|
||||
auto *mainLayout = new QVBoxLayout;
|
||||
auto mainLayout = new QVBoxLayout;
|
||||
mainLayout->addLayout(_simpleLayout);
|
||||
mainLayout->addLayout(_advancedLayout);
|
||||
mainLayout->addLayout(_patternLayout);
|
||||
|
|
@ -515,10 +547,11 @@ MacroConditionDateEdit::MacroConditionDateEdit(
|
|||
_loading = false;
|
||||
}
|
||||
|
||||
void MacroConditionDateEdit::DayOfWeekChanged(int day)
|
||||
void MacroConditionDateEdit::DaysChanged(
|
||||
const QSet<DayOfWeekSelector::Day> &days)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_dayOfWeek = static_cast<MacroConditionDate::Day>(day);
|
||||
_entryData->_days = days;
|
||||
emit HeaderInfoChanged(
|
||||
QString::fromStdString(_entryData->GetShortDesc()));
|
||||
}
|
||||
|
|
@ -632,7 +665,7 @@ void MacroConditionDateEdit::ShowNextMatch()
|
|||
return;
|
||||
}
|
||||
QString format(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.entry.nextMatchDate"));
|
||||
"AdvSceneSwitcher.condition.date.layout.nextMatchDate"));
|
||||
_nextMatchDate->setText(
|
||||
format.arg(_entryData->GetNextMatchDateTime().toString()));
|
||||
}
|
||||
|
|
@ -658,8 +691,7 @@ void MacroConditionDateEdit::UpdateEntryData()
|
|||
}
|
||||
_weekCondition->setCurrentIndex(
|
||||
static_cast<int>(_entryData->_condition));
|
||||
_dayOfWeek->setCurrentIndex(
|
||||
static_cast<int>(static_cast<int>(_entryData->_dayOfWeek)));
|
||||
_days->SetSelectedDays(_entryData->_days);
|
||||
_ignoreWeekTime->setChecked(!_entryData->_ignoreTime);
|
||||
_weekTime->setTime(_entryData->GetDateTime1().time());
|
||||
_condition->setCurrentIndex(static_cast<int>(_entryData->_condition));
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include "macro-condition-edit.hpp"
|
||||
#include "day-of-week-selector.hpp"
|
||||
#include "duration-control.hpp"
|
||||
|
||||
#include <QCheckBox>
|
||||
|
|
@ -30,17 +31,6 @@ public:
|
|||
QDateTime GetDateTime2() const;
|
||||
QDateTime GetNextMatchDateTime() const;
|
||||
|
||||
enum class Day {
|
||||
ANY = 0,
|
||||
MONDAY,
|
||||
TUESDAY,
|
||||
WEDNESDAY,
|
||||
THURSDAY,
|
||||
FRIDAY,
|
||||
SATURDAY,
|
||||
SUNDAY,
|
||||
};
|
||||
|
||||
enum class Condition {
|
||||
AT,
|
||||
AFTER,
|
||||
|
|
@ -49,7 +39,11 @@ public:
|
|||
PATTERN,
|
||||
};
|
||||
|
||||
Day _dayOfWeek = Day::ANY;
|
||||
QSet<DayOfWeekSelector::Day> _days = {
|
||||
DayOfWeekSelector::Day::Monday,
|
||||
DayOfWeekSelector::Day::Tuesday,
|
||||
DayOfWeekSelector::Day::Wednesday,
|
||||
};
|
||||
bool _ignoreDate = false;
|
||||
bool _ignoreTime = false;
|
||||
bool _repeat = false;
|
||||
|
|
@ -94,7 +88,7 @@ public:
|
|||
}
|
||||
|
||||
private slots:
|
||||
void DayOfWeekChanged(int day);
|
||||
void DaysChanged(const QSet<DayOfWeekSelector::Day> &);
|
||||
void ConditionChanged(int cond);
|
||||
void DateChanged(const QDate &date);
|
||||
void TimeChanged(const QTime &time);
|
||||
|
|
@ -114,7 +108,7 @@ signals:
|
|||
|
||||
protected:
|
||||
QComboBox *_weekCondition;
|
||||
QComboBox *_dayOfWeek;
|
||||
DayOfWeekSelector *_days;
|
||||
QCheckBox *_ignoreWeekTime;
|
||||
QTimeEdit *_weekTime;
|
||||
|
||||
|
|
@ -134,7 +128,7 @@ protected:
|
|||
QLabel *_currentDate;
|
||||
|
||||
QPushButton *_advancedSettingsTooggle;
|
||||
QHBoxLayout *_simpleLayout;
|
||||
QVBoxLayout *_simpleLayout;
|
||||
QHBoxLayout *_advancedLayout;
|
||||
QVBoxLayout *_repeatLayout;
|
||||
QHBoxLayout *_repeatUpdateLayout;
|
||||
|
|
|
|||
|
|
@ -55,17 +55,17 @@ void MacroConditionGameCapture::GetCalldataInfo(calldata_t *cd)
|
|||
if (!calldata_get_string(cd, "title", &title)) {
|
||||
blog(LOG_WARNING, "%s failed to get title", __func__);
|
||||
}
|
||||
_title = title;
|
||||
_title = title ? title : "";
|
||||
const char *className = "";
|
||||
if (!calldata_get_string(cd, "class", &className)) {
|
||||
blog(LOG_WARNING, "%s failed to get class", __func__);
|
||||
}
|
||||
_class = className;
|
||||
_class = className ? className : "";
|
||||
const char *executable = "";
|
||||
if (!calldata_get_string(cd, "executable", &executable)) {
|
||||
blog(LOG_WARNING, "%s failed to get executable", __func__);
|
||||
}
|
||||
_executable = executable;
|
||||
_executable = executable ? executable : "";
|
||||
}
|
||||
|
||||
void MacroConditionGameCapture::HookedSignalReceived(void *data, calldata_t *cd)
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ void MacroConditionProcessEdit::ProcessChanged(const QString &text)
|
|||
QString::fromStdString(_entryData->GetShortDesc()));
|
||||
}
|
||||
|
||||
void MacroConditionProcessEdit::showEvent(QShowEvent *event)
|
||||
void MacroConditionProcessEdit::showEvent(QShowEvent *)
|
||||
{
|
||||
const QSignalBlocker b(_processSelection);
|
||||
const auto text = _processSelection->currentText();
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ static int currentRecordingDurationInSeconds = 0;
|
|||
|
||||
bool MacroConditionRecord::CheckCondition()
|
||||
{
|
||||
char *lastSavePath = obs_frontend_get_last_recording();
|
||||
SetTempVarValue("lastSavePath", lastSavePath ? lastSavePath : "");
|
||||
bfree(lastSavePath);
|
||||
|
||||
switch (_condition) {
|
||||
case Condition::STOP:
|
||||
return !obs_frontend_recording_active();
|
||||
|
|
@ -74,6 +78,14 @@ void MacroConditionRecord::SetCondition(Condition condition)
|
|||
void MacroConditionRecord::SetupTempVars()
|
||||
{
|
||||
MacroCondition::SetupTempVars();
|
||||
|
||||
AddTempvar(
|
||||
"lastSavePath",
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.recording.lastSavePath"),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.recording.lastSavePath.description"));
|
||||
|
||||
switch (_condition) {
|
||||
case Condition::DURATION:
|
||||
AddTempvar(
|
||||
|
|
|
|||
|
|
@ -29,6 +29,22 @@ static bool windowContainsText(const std::string &window,
|
|||
return text == matchText;
|
||||
}
|
||||
|
||||
void MacroConditionWindow::SetCheckText(bool value)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
_checkText = value;
|
||||
#else
|
||||
(void)value;
|
||||
_checkText = false;
|
||||
#endif
|
||||
SetupTempVars();
|
||||
}
|
||||
|
||||
bool MacroConditionWindow::GetCheckText()
|
||||
{
|
||||
return _checkText;
|
||||
}
|
||||
|
||||
bool MacroConditionWindow::WindowMatchesRequirements(
|
||||
const std::string &window) const
|
||||
{
|
||||
|
|
@ -94,12 +110,18 @@ void MacroConditionWindow::SetVariableValueBasedOnMatch(
|
|||
#ifdef _WIN32
|
||||
SetTempVarValue("windowClass",
|
||||
GetWindowClassByWindowTitle(matchWindow));
|
||||
if (_checkText) {
|
||||
const auto text = GetTextInWindow(matchWindow);
|
||||
if (text) {
|
||||
SetTempVarValue("windowText", *text);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!IsReferencedInVars()) {
|
||||
return;
|
||||
}
|
||||
if (_checkText) {
|
||||
auto text = GetTextInWindow(matchWindow);
|
||||
const auto text = GetTextInWindow(matchWindow);
|
||||
SetVariableValue(text.value_or(""));
|
||||
} else {
|
||||
SetVariableValue(ForegroundWindowTitle());
|
||||
|
|
@ -186,6 +208,16 @@ void MacroConditionWindow::SetupTempVars()
|
|||
obs_module_text("AdvSceneSwitcher.tempVar.window.windowClass"),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.window.windowClass.description"));
|
||||
|
||||
if (!_checkText) {
|
||||
return;
|
||||
}
|
||||
|
||||
AddTempvar(
|
||||
"windowText",
|
||||
obs_module_text("AdvSceneSwitcher.tempVar.window.windowText"),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.window.windowText.description"));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -349,7 +381,7 @@ void MacroConditionWindowEdit::CheckTitleChanged(int state)
|
|||
void MacroConditionWindowEdit::CheckTextChanged(int state)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_checkText = state;
|
||||
_entryData->SetCheckText(state);
|
||||
SetWidgetVisibility();
|
||||
}
|
||||
|
||||
|
|
@ -409,8 +441,8 @@ void MacroConditionWindowEdit::SetWidgetVisibility()
|
|||
_entryData->_focus || _entryData->_windowFocusChanged);
|
||||
_windowSelection->setVisible(_entryData->_checkTitle);
|
||||
_windowRegex->setVisible(_entryData->_checkTitle);
|
||||
_textRegex->setVisible(_entryData->_checkText);
|
||||
_text->setVisible(_entryData->_checkText);
|
||||
_textRegex->setVisible(_entryData->GetCheckText());
|
||||
_text->setVisible(_entryData->GetCheckText());
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
}
|
||||
|
|
@ -429,7 +461,7 @@ void MacroConditionWindowEdit::UpdateEntryData()
|
|||
_maximized->setChecked(_entryData->_maximized);
|
||||
_focused->setChecked(_entryData->_focus);
|
||||
_windowFocusChanged->setChecked(_entryData->_windowFocusChanged);
|
||||
_checkText->setChecked(_entryData->_checkText);
|
||||
_checkText->setChecked(_entryData->GetCheckText());
|
||||
_text->setPlainText(_entryData->_text);
|
||||
_textRegex->SetRegexConfig(_entryData->_textRegex);
|
||||
SetWidgetVisibility();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ public:
|
|||
return std::make_shared<MacroConditionWindow>(m);
|
||||
}
|
||||
|
||||
void SetCheckText(bool value);
|
||||
bool GetCheckText();
|
||||
|
||||
StringVariable _window;
|
||||
RegexConfig _windowRegex;
|
||||
bool _checkTitle = true;
|
||||
|
|
@ -30,8 +33,6 @@ public:
|
|||
bool _focus = true;
|
||||
bool _windowFocusChanged = false;
|
||||
|
||||
// For now only supported on Windows
|
||||
bool _checkText = false;
|
||||
StringVariable _text;
|
||||
RegexConfig _textRegex = RegexConfig::PartialMatchRegexConfig();
|
||||
|
||||
|
|
@ -42,6 +43,9 @@ private:
|
|||
void SetVariableValueBasedOnMatch(const std::string &matchWindow);
|
||||
void SetupTempVars();
|
||||
|
||||
// For now only supported on Windows
|
||||
bool _checkText = false;
|
||||
|
||||
static bool _registered;
|
||||
static const std::string id;
|
||||
};
|
||||
|
|
|
|||
121
plugins/base/utils/day-of-week-selector.cpp
Normal file
121
plugins/base/utils/day-of-week-selector.cpp
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
#include "day-of-week-selector.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QHBoxLayout>
|
||||
|
||||
namespace advss {
|
||||
|
||||
DayOfWeekSelector::DayOfWeekSelector(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
auto layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(4);
|
||||
|
||||
const QVector<QPair<Day, QString>> days = {
|
||||
{Monday, obs_module_text("AdvSceneSwitcher.day.monday")},
|
||||
{Tuesday, obs_module_text("AdvSceneSwitcher.day.tuesday")},
|
||||
{Wednesday, obs_module_text("AdvSceneSwitcher.day.wednesday")},
|
||||
{Thursday, obs_module_text("AdvSceneSwitcher.day.thursday")},
|
||||
{Friday, obs_module_text("AdvSceneSwitcher.day.friday")},
|
||||
{Saturday, obs_module_text("AdvSceneSwitcher.day.saturday")},
|
||||
{Sunday, obs_module_text("AdvSceneSwitcher.day.sunday")}};
|
||||
|
||||
for (const auto &[day, name] : days) {
|
||||
auto btn = new QPushButton(this);
|
||||
btn->setText(name);
|
||||
btn->setCheckable(true);
|
||||
|
||||
connect(btn, &QPushButton::toggled, this,
|
||||
&DayOfWeekSelector::OnButtonToggled);
|
||||
|
||||
layout->addWidget(btn);
|
||||
m_buttons.insert(day, btn);
|
||||
}
|
||||
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
void DayOfWeekSelector::OnButtonToggled(bool)
|
||||
{
|
||||
emit SelectionChanged(SelectedDays());
|
||||
}
|
||||
|
||||
QSet<DayOfWeekSelector::Day> DayOfWeekSelector::SelectedDays() const
|
||||
{
|
||||
QSet<Day> result;
|
||||
for (auto it = m_buttons.begin(); it != m_buttons.end(); ++it) {
|
||||
if (it.value()->isChecked()) {
|
||||
result.insert(it.key());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void DayOfWeekSelector::SetSelectedDays(const QSet<Day> &days)
|
||||
{
|
||||
for (auto it = m_buttons.begin(); it != m_buttons.end(); ++it) {
|
||||
it.value()->setChecked(days.contains(it.key()));
|
||||
}
|
||||
}
|
||||
|
||||
QString DayOfWeekSelector::ToString(const QSet<Day> &days)
|
||||
{
|
||||
const QVector<QPair<Day, QString>> dayNames = {
|
||||
{Monday, obs_module_text("AdvSceneSwitcher.day.monday")},
|
||||
{Tuesday, obs_module_text("AdvSceneSwitcher.day.tuesday")},
|
||||
{Wednesday, obs_module_text("AdvSceneSwitcher.day.wednesday")},
|
||||
{Thursday, obs_module_text("AdvSceneSwitcher.day.thursday")},
|
||||
{Friday, obs_module_text("AdvSceneSwitcher.day.friday")},
|
||||
{Saturday, obs_module_text("AdvSceneSwitcher.day.saturday")},
|
||||
{Sunday, obs_module_text("AdvSceneSwitcher.day.sunday")}};
|
||||
|
||||
if (days.isEmpty()) {
|
||||
return obs_module_text("AdvSceneSwitcher.day.none");
|
||||
}
|
||||
|
||||
if (days.size() == 7) {
|
||||
return obs_module_text("AdvSceneSwitcher.day.any");
|
||||
}
|
||||
|
||||
QStringList parts;
|
||||
for (const auto &[day, name] : dayNames) {
|
||||
if (days.contains(day)) {
|
||||
parts << name;
|
||||
}
|
||||
}
|
||||
|
||||
return parts.join(", ");
|
||||
}
|
||||
|
||||
void SaveSelectedDays(obs_data_t *settings,
|
||||
const QSet<DayOfWeekSelector::Day> &days)
|
||||
{
|
||||
uint64_t mask = 0;
|
||||
|
||||
for (DayOfWeekSelector::Day day : days) {
|
||||
mask |= (1ULL << static_cast<int>(day));
|
||||
}
|
||||
|
||||
obs_data_set_int(settings, "selectedDays",
|
||||
static_cast<long long>(mask));
|
||||
}
|
||||
|
||||
QSet<DayOfWeekSelector::Day> LoadSelectedDays(obs_data_t *settings)
|
||||
{
|
||||
QSet<DayOfWeekSelector::Day> result;
|
||||
|
||||
uint64_t mask = static_cast<uint64_t>(
|
||||
obs_data_get_int(settings, "selectedDays"));
|
||||
|
||||
for (int i = DayOfWeekSelector::Monday; i <= DayOfWeekSelector::Sunday;
|
||||
++i) {
|
||||
if (mask & (1ULL << i)) {
|
||||
result.insert(static_cast<DayOfWeekSelector::Day>(i));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
45
plugins/base/utils/day-of-week-selector.hpp
Normal file
45
plugins/base/utils/day-of-week-selector.hpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#pragma once
|
||||
#include <QWidget>
|
||||
#include <QSet>
|
||||
|
||||
#include <obs-data.h>
|
||||
|
||||
class QPushButton;
|
||||
|
||||
namespace advss {
|
||||
|
||||
class DayOfWeekSelector : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Day {
|
||||
Monday = 1,
|
||||
Tuesday,
|
||||
Wednesday,
|
||||
Thursday,
|
||||
Friday,
|
||||
Saturday,
|
||||
Sunday
|
||||
};
|
||||
Q_ENUM(Day)
|
||||
|
||||
explicit DayOfWeekSelector(QWidget *parent = nullptr);
|
||||
|
||||
QSet<Day> SelectedDays() const;
|
||||
void SetSelectedDays(const QSet<Day> &days);
|
||||
static QString ToString(const QSet<Day> &days);
|
||||
|
||||
signals:
|
||||
void SelectionChanged(const QSet<Day> &days);
|
||||
|
||||
private:
|
||||
void OnButtonToggled(bool checked);
|
||||
|
||||
QMap<Day, QPushButton *> m_buttons;
|
||||
};
|
||||
|
||||
void SaveSelectedDays(obs_data_t *settings,
|
||||
const QSet<DayOfWeekSelector::Day> &days);
|
||||
QSet<DayOfWeekSelector::Day> LoadSelectedDays(obs_data_t *settings);
|
||||
|
||||
} // namespace advss
|
||||
|
|
@ -10,7 +10,7 @@ namespace advss {
|
|||
enum class HotkeyType;
|
||||
|
||||
bool CanSimulateKeyPresses();
|
||||
void PressKeys(const std::vector<HotkeyType> keys, int duration);
|
||||
void PressKeys(const std::vector<HotkeyType> &keys, int duration);
|
||||
|
||||
class Hotkey {
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ static const std::unordered_map<HotkeyType, long> keyTable = {
|
|||
{HotkeyType::Key_NumpadEnter, XK_KP_Enter},
|
||||
};
|
||||
|
||||
void PressKeys(const std::vector<HotkeyType> keys, int duration)
|
||||
void PressKeys(const std::vector<HotkeyType> &keys, int duration)
|
||||
{
|
||||
if (!canSimulateKeyPresses) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ bool CanSimulateKeyPresses()
|
|||
return canSimulateKeyPresses;
|
||||
}
|
||||
|
||||
void PressKeys(const std::vector<HotkeyType> keys, int duration)
|
||||
void PressKeys(const std::vector<HotkeyType> &, int)
|
||||
{
|
||||
// Not supported on MacOS
|
||||
return;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user