mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-30 05:06:14 -05:00
Compare commits
207 Commits
1.29.2
...
record-pat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a69e774c2 | ||
|
|
2389f37ed6 | ||
|
|
de20c93b14 | ||
|
|
b0d877db8c | ||
|
|
caf9e59475 | ||
|
|
5f6982b5bb | ||
|
|
ce399cc647 | ||
|
|
03f67534c7 | ||
|
|
246667e65e | ||
|
|
68fe7716e7 | ||
|
|
98cc710b4a | ||
|
|
c602c30c54 | ||
|
|
cc1b89fe1d | ||
|
|
1de4ef7ec2 | ||
|
|
e29060fdea | ||
|
|
a0e6e6f528 | ||
|
|
e30d5845fa | ||
|
|
d12911cd02 | ||
|
|
b8ecc40e8c | ||
|
|
8ec4849b1d | ||
|
|
e6e9f3a831 | ||
|
|
555f7c1381 | ||
|
|
f0f8b0fd92 | ||
|
|
661e83162f | ||
|
|
4606f80a9d | ||
|
|
9c109742fb | ||
|
|
b8b0682aaf | ||
|
|
f93175db77 | ||
|
|
8f92ba3ffa | ||
|
|
0d56de11d1 | ||
|
|
e1020a1909 | ||
|
|
8b0bd4193b | ||
|
|
d55bb6bc86 | ||
|
|
0583331bfd | ||
|
|
6932de866d | ||
|
|
00db0cf7c4 | ||
|
|
e9baf27ca2 | ||
|
|
b1a5db0c9c | ||
|
|
8f3b868fd9 | ||
|
|
b3bf89840b | ||
|
|
84f7d0d214 | ||
|
|
e1164c4fa3 | ||
|
|
4534b23bad | ||
|
|
5d6a693f36 | ||
|
|
a82662c8f4 | ||
|
|
602675b3b3 | ||
|
|
9551519cb9 | ||
|
|
badce063eb | ||
|
|
10d45c67d6 | ||
|
|
0b77ef5081 | ||
|
|
8f54e71e61 | ||
|
|
16136b8741 | ||
|
|
02d5051974 | ||
|
|
078d62fa18 | ||
|
|
8aa6a7df2c | ||
|
|
1494b1db6c | ||
|
|
b4b3dc5a2b | ||
|
|
ee41a8d58b | ||
|
|
5f2237ac2a | ||
|
|
6fb76e7e07 | ||
|
|
ba094372a9 | ||
|
|
0c886c8679 | ||
|
|
d9f05d3f7b | ||
|
|
c99b5f1feb | ||
|
|
a3b3cf9818 | ||
|
|
ca3bbf5660 | ||
|
|
18524761a6 | ||
|
|
85222aed33 | ||
|
|
84132f7c37 | ||
|
|
ead664763f | ||
|
|
a2fa16f2d7 | ||
|
|
75edcffac9 | ||
|
|
dd5bcf425a | ||
|
|
de32e1b18e | ||
|
|
1d412a818d | ||
|
|
c8e5b561ef | ||
|
|
a1702dc798 | ||
|
|
ae571583fc | ||
|
|
c4f70657d9 | ||
|
|
7901a988af | ||
|
|
d2b70bbc6b | ||
|
|
4d22a539f0 | ||
|
|
4e561320f7 | ||
|
|
0dfa4fe2c0 | ||
|
|
4cac4584f3 | ||
|
|
d20a975c4f | ||
|
|
756d7bbd3c | ||
|
|
395a18fa4c | ||
|
|
2ea00d94c5 | ||
|
|
058e941a46 | ||
|
|
ea4a951554 | ||
|
|
3c355ac6fe | ||
|
|
37606e274c | ||
|
|
3e8d6e103a | ||
|
|
4cae420ade | ||
|
|
b27a11931a | ||
|
|
92616bed6b | ||
|
|
b3f38851b6 | ||
|
|
bf7fe71ae3 | ||
|
|
12a6b26d9a | ||
|
|
373e74c080 | ||
|
|
f3e7eaf212 | ||
|
|
b036736547 | ||
|
|
817de13e9d | ||
|
|
0b774c171d | ||
|
|
be8f7bd70f | ||
|
|
5f963b5b7d | ||
|
|
c6155c9fea | ||
|
|
be809dbfab | ||
|
|
7478c149b3 | ||
|
|
f4eaa9785d | ||
|
|
49c0de3f1b | ||
|
|
101ef4e973 | ||
|
|
82568b23e8 | ||
|
|
0cd7004f6a | ||
|
|
40c62ba700 | ||
|
|
f2c7b532d9 | ||
|
|
456a9c04c7 | ||
|
|
3e1fdbde45 | ||
|
|
874b9b86e2 | ||
|
|
98d1f83acc | ||
|
|
7e91f81957 | ||
|
|
20488afdd1 | ||
|
|
d9d387ad47 | ||
|
|
0736d673e1 | ||
|
|
34151e4bc6 | ||
|
|
1346c19bec | ||
|
|
be6bc48231 | ||
|
|
79a8ad57af | ||
|
|
daeb9275a3 | ||
|
|
73b542a4db | ||
|
|
e3471066e9 | ||
|
|
ec41c06b4d | ||
|
|
201e45d058 | ||
|
|
b17aa30432 | ||
|
|
93703c80bc | ||
|
|
d7951a7179 | ||
|
|
d42a3b584a | ||
|
|
becd1bd02a | ||
|
|
30422aecf3 | ||
|
|
c567e6ef7f | ||
|
|
1ca61f3ed4 | ||
|
|
1affe9dce3 | ||
|
|
406e3c1855 | ||
|
|
c05dd40c4c | ||
|
|
9a86ecac42 | ||
|
|
721a786e79 | ||
|
|
32d29875ed | ||
|
|
0e5f56b562 | ||
|
|
5490fabf92 | ||
|
|
5e3ab19940 | ||
|
|
1c94a1ab44 | ||
|
|
34baa56134 | ||
|
|
5ce4171773 | ||
|
|
c281c6db83 | ||
|
|
c43439ee64 | ||
|
|
a84731b8fe | ||
|
|
61fbff5821 | ||
|
|
1381654fed | ||
|
|
9805601c07 | ||
|
|
fcf57ee031 | ||
|
|
ba3e87a761 | ||
|
|
3dd3f576c3 | ||
|
|
7403a18e96 | ||
|
|
56494480ba | ||
|
|
cdc5d16e95 | ||
|
|
27aed79305 | ||
|
|
7ec95e33eb | ||
|
|
98260b25a1 | ||
|
|
45b37de9f7 | ||
|
|
027a3e9074 | ||
|
|
cab50e0922 | ||
|
|
88514e209d | ||
|
|
4ed7f13b72 | ||
|
|
0fb11ac274 | ||
|
|
942933290a | ||
|
|
f13beaead2 | ||
|
|
13dba6527d | ||
|
|
b78a6510a9 | ||
|
|
6c22f438b6 | ||
|
|
347abe6c84 | ||
|
|
230863adda | ||
|
|
f59478fac7 | ||
|
|
8adac79cd8 | ||
|
|
ea93c44db7 | ||
|
|
9e20b341d8 | ||
|
|
232cbb06f6 | ||
|
|
e9d57a0f4a | ||
|
|
9633a61a65 | ||
|
|
0643b250e1 | ||
|
|
b52738881f | ||
|
|
470d5ba3d7 | ||
|
|
8326e72047 | ||
|
|
12ab4d8cf9 | ||
|
|
295ec9eb81 | ||
|
|
4c5dbd4b7c | ||
|
|
5568f92ad0 | ||
|
|
7c4c0056ce | ||
|
|
d2b4b1cc07 | ||
|
|
a3ca22d238 | ||
|
|
c73542a3cc | ||
|
|
70bbc7cdac | ||
|
|
d892298995 | ||
|
|
0fe31432be | ||
|
|
aaa0113ccb | ||
|
|
b908954b46 | ||
|
|
b0eede8a85 |
2
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
2
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
@@ -2,7 +2,7 @@
|
|||||||
# https://github.com/obsproject/.github/tree/master/.github/ISSUE_TEMPLATE
|
# https://github.com/obsproject/.github/tree/master/.github/ISSUE_TEMPLATE
|
||||||
|
|
||||||
name: Feature request
|
name: Feature request
|
||||||
description: Suggest an idea for this projectReport a bug or crash
|
description: Suggest an idea for this project
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
id: md_welcome
|
id: md_welcome
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ runs:
|
|||||||
- name: Setup cmake
|
- name: Setup cmake
|
||||||
uses: jwlawson/actions-setup-cmake@v1.13
|
uses: jwlawson/actions-setup-cmake@v1.13
|
||||||
with:
|
with:
|
||||||
cmake-version: '3.24.x'
|
cmake-version: '3.x.x'
|
||||||
|
|
||||||
- name: Restore cached dependencies
|
- name: Restore cached dependencies
|
||||||
id: restore-cache
|
id: restore-cache
|
||||||
|
|||||||
7
.github/scripts/.Aptfile
vendored
7
.github/scripts/.Aptfile
vendored
@@ -10,4 +10,9 @@ package 'libxss-dev'
|
|||||||
package 'libopencv-dev'
|
package 'libopencv-dev'
|
||||||
package 'libtesseract-dev'
|
package 'libtesseract-dev'
|
||||||
package 'libproc2-dev'
|
package 'libproc2-dev'
|
||||||
package 'libusb-1.0-0-dev'
|
package 'libusb-1.0-0-dev'
|
||||||
|
package 'libpaho-mqttpp-dev'
|
||||||
|
package 'libpaho-mqtt-dev'
|
||||||
|
package 'libpaho-mqtt-dev'
|
||||||
|
package 'libasound2-dev'
|
||||||
|
package 'libpipewire-0.3-dev'
|
||||||
|
|||||||
67
.github/scripts/.build-deps.zsh
vendored
67
.github/scripts/.build-deps.zsh
vendored
@@ -394,8 +394,11 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
|
|||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd ${advss_dep_path}
|
|
||||||
log_info "Prepare openssl ..."
|
log_info "Prepare openssl ..."
|
||||||
|
rm -rf ${advss_dep_path}/openssl ${advss_dep_path}/openssl_build
|
||||||
|
mkdir ${advss_dep_path}/openssl_build
|
||||||
|
pushd ${advss_dep_path}/openssl_build
|
||||||
|
|
||||||
rm -rf openssl
|
rm -rf openssl
|
||||||
git clone https://github.com/openssl/openssl.git --branch openssl-3.1.2 --depth 1
|
git clone https://github.com/openssl/openssl.git --branch openssl-3.1.2 --depth 1
|
||||||
mv openssl openssl_x86
|
mv openssl openssl_x86
|
||||||
@@ -403,25 +406,27 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
|
|||||||
|
|
||||||
log_info "Building openssl x86 ..."
|
log_info "Building openssl x86 ..."
|
||||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
export MACOSX_DEPLOYMENT_TARGET=10.9
|
||||||
cd openssl_x86
|
pushd openssl_x86
|
||||||
./Configure darwin64-x86_64-cc shared
|
./Configure darwin64-x86_64-cc no-shared no-module no-zlib --prefix=${advss_dep_path}
|
||||||
make
|
make -j$(nproc)
|
||||||
|
popd
|
||||||
|
|
||||||
log_info "Building openssl arm ..."
|
log_info "Building openssl arm ..."
|
||||||
export MACOSX_DEPLOYMENT_TARGET=10.15
|
export MACOSX_DEPLOYMENT_TARGET=10.15
|
||||||
cd ../openssl_arm
|
pushd openssl_arm
|
||||||
./Configure enable-rc5 zlib darwin64-arm64-cc no-asm
|
./Configure enable-rc5 darwin64-arm64-cc no-shared no-module no-asm no-zlib --prefix=${advss_dep_path}
|
||||||
make
|
make -j$(nproc)
|
||||||
|
|
||||||
|
log_info "Install openssl ..."
|
||||||
|
make install
|
||||||
|
popd
|
||||||
|
|
||||||
log_info "Combine arm and x86 openssl binaries ..."
|
log_info "Combine arm and x86 openssl binaries ..."
|
||||||
cd ..
|
lipo -create openssl_x86/libcrypto.a openssl_arm/libcrypto.a -output ${advss_dep_path}/lib/libcrypto.a
|
||||||
mkdir openssl-combined
|
lipo -create openssl_x86/libssl.a openssl_arm/libssl.a -output ${advss_dep_path}/lib/libssl.a
|
||||||
lipo -create openssl_x86/libcrypto.a openssl_arm/libcrypto.a -output openssl-combined/libcrypto.a
|
|
||||||
lipo -create openssl_x86/libssl.a openssl_arm/libssl.a -output openssl-combined/libssl.a
|
|
||||||
|
|
||||||
log_info "Clean up openssl dir ..."
|
log_info "Clean up openssl dir ..."
|
||||||
mv openssl_x86 openssl
|
rm -rf openssl_x86 openssl_arm
|
||||||
rm -rf openssl_arm
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd ${project_root}/deps/libusb
|
pushd ${project_root}/deps/libusb
|
||||||
@@ -439,14 +444,16 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
|
|||||||
mkdir ${project_root}/deps/libusb/out_x86
|
mkdir ${project_root}/deps/libusb/out_x86
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
./configure --host=x86_64-apple-darwin --prefix=${advss_dep_path}
|
./configure --host=x86_64-apple-darwin --prefix=${advss_dep_path}
|
||||||
make && make install
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
log_info "Configure libusb arm ..."
|
log_info "Configure libusb arm ..."
|
||||||
make clean
|
make clean
|
||||||
rm -r ${project_root}/deps/libusb/out_x86
|
rm -r ${project_root}/deps/libusb/out_x86
|
||||||
mkdir ${project_root}/deps/libusb/out_x86
|
mkdir ${project_root}/deps/libusb/out_x86
|
||||||
./configure --host=aarch64-apple-darwin --prefix=${project_root}/deps/libusb/out_x86
|
./configure --host=aarch64-apple-darwin --prefix=${project_root}/deps/libusb/out_x86
|
||||||
make && make install
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
log_info "Building libusb arm ..."
|
log_info "Building libusb arm ..."
|
||||||
make clean
|
make clean
|
||||||
@@ -459,7 +466,8 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
|
|||||||
export MACOSX_DEPLOYMENT_TARGET=10.15
|
export MACOSX_DEPLOYMENT_TARGET=10.15
|
||||||
mkdir ${project_root}/deps/libusb/out_arm
|
mkdir ${project_root}/deps/libusb/out_arm
|
||||||
./configure --host=aarch64-apple-darwin --prefix=${project_root}/deps/libusb/out_arm
|
./configure --host=aarch64-apple-darwin --prefix=${project_root}/deps/libusb/out_arm
|
||||||
make && make install
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
log_info "Combine arm and x86 libusb binaries ..."
|
log_info "Combine arm and x86 libusb binaries ..."
|
||||||
lipo -create ${project_root}/deps/libusb/out_x86/lib/libusb-1.0.0.dylib \
|
lipo -create ${project_root}/deps/libusb/out_x86/lib/libusb-1.0.0.dylib \
|
||||||
@@ -478,6 +486,33 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
|
|||||||
unset MACOSX_DEPLOYMENT_TARGET
|
unset MACOSX_DEPLOYMENT_TARGET
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
local mqtt_dir="${project_root}/deps/paho.mqtt.cpp"
|
||||||
|
local mqtt_build_dir="${mqtt_dir}/build_${target##*-}"
|
||||||
|
|
||||||
|
local -a mqtt_cmake_args=(
|
||||||
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
|
-DCMAKE_OSX_ARCHITECTURES=${${target##*-}//universal/x86_64;arm64}
|
||||||
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
|
||||||
|
-DCMAKE_PREFIX_PATH="${advss_dep_path};${_plugin_deps}"
|
||||||
|
-DCMAKE_INSTALL_PREFIX="${advss_dep_path}"
|
||||||
|
-DPAHO_BUILD_SHARED=OFF
|
||||||
|
-DPAHO_BUILD_STATIC=ON
|
||||||
|
-DPAHO_WITH_MQTT_C=ON
|
||||||
|
-DPAHO_WITH_SSL=ON
|
||||||
|
-DOPENSSL_USE_STATIC_LIBS=ON
|
||||||
|
)
|
||||||
|
|
||||||
|
pushd ${mqtt_dir}
|
||||||
|
log_info "Configure paho.mqtt.cpp ..."
|
||||||
|
cmake -S . -B ${mqtt_build_dir} ${mqtt_cmake_args}
|
||||||
|
|
||||||
|
log_info "Building paho.mqtt.cpp ..."
|
||||||
|
cmake --build ${mqtt_build_dir} --config Release
|
||||||
|
|
||||||
|
log_info "Installing paho.mqtt.cpp ..."
|
||||||
|
cmake --install ${mqtt_build_dir} --prefix "${advss_dep_path}" --config Release
|
||||||
|
popd
|
||||||
;;
|
;;
|
||||||
linux)
|
linux)
|
||||||
# Nothing to do for now
|
# Nothing to do for now
|
||||||
|
|||||||
6
.github/scripts/.build.zsh
vendored
6
.github/scripts/.build.zsh
vendored
@@ -253,12 +253,8 @@ ${_usage_host:-}"
|
|||||||
macos-*)
|
macos-*)
|
||||||
if (( ${+CI} )) typeset -gx NSUnbufferedIO=YES
|
if (( ${+CI} )) typeset -gx NSUnbufferedIO=YES
|
||||||
|
|
||||||
local openssl_lib_dir="${advss_deps_path}/openssl-combined/"
|
|
||||||
local openssl_include_dir="${advss_deps_path}/openssl/include"
|
|
||||||
|
|
||||||
cmake_args+=(
|
cmake_args+=(
|
||||||
-DOPENSSL_INCLUDE_DIR="${openssl_include_dir}"
|
-DCMAKE_PREFIX_PATH="${advss_deps_path}"
|
||||||
-DOPENSSL_LIBRARIES="${openssl_lib_dir}/libcrypto.a;${openssl_lib_dir}/libssl.a"
|
|
||||||
--preset ${_preset}
|
--preset ${_preset}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
3
.github/scripts/.package.zsh
vendored
3
.github/scripts/.package.zsh
vendored
@@ -258,6 +258,9 @@ ${_usage_host:-}"
|
|||||||
pushd ${project_root}
|
pushd ${project_root}
|
||||||
cmake --build build_${target##*-} --config ${config} -t package ${cmake_args}
|
cmake --build build_${target##*-} --config ${config} -t package ${cmake_args}
|
||||||
|
|
||||||
|
# Mark certain deps as optional
|
||||||
|
build-aux/CI/linux/demote-deps.sh ${project_root}/release/*.deb Recommends '(mqtt)|(opencv)|(tesseract)|(usb)|(x11)'
|
||||||
|
|
||||||
if [ ! -e ${project_root}/release/${output_name}.deb ]; then
|
if [ ! -e ${project_root}/release/${output_name}.deb ]; then
|
||||||
mv ${project_root}/release/*.deb ${project_root}/release/${output_name}.deb
|
mv ${project_root}/release/*.deb ${project_root}/release/${output_name}.deb
|
||||||
mv ${project_root}/release/*.ddeb ${project_root}/release/${output_name}.ddeb
|
mv ${project_root}/release/*.ddeb ${project_root}/release/${output_name}.ddeb
|
||||||
|
|||||||
49
.github/scripts/Build-Deps-Windows.ps1
vendored
49
.github/scripts/Build-Deps-Windows.ps1
vendored
@@ -209,7 +209,9 @@ function Build {
|
|||||||
$msbuildExe = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1
|
$msbuildExe = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1
|
||||||
|
|
||||||
if ($msbuildExe) {
|
if ($msbuildExe) {
|
||||||
|
$env:CL="/wd5287"
|
||||||
Invoke-External $msbuildExe "${LibusbPath}/msvc/libusb.sln" /property:Configuration=Release /property:Platform=x64
|
Invoke-External $msbuildExe "${LibusbPath}/msvc/libusb.sln" /property:Configuration=Release /property:Platform=x64
|
||||||
|
Remove-Item Env:CL
|
||||||
|
|
||||||
$libusbBuildResultDirectory = "${LibusbPath}/build/v143/x64/Release"
|
$libusbBuildResultDirectory = "${LibusbPath}/build/v143/x64/Release"
|
||||||
if (-not (Test-Path -Path $libusbBuildResultDirectory)) {
|
if (-not (Test-Path -Path $libusbBuildResultDirectory)) {
|
||||||
@@ -219,6 +221,53 @@ function Build {
|
|||||||
} else {
|
} else {
|
||||||
Log-Information "Failed to locate msbuild.exe - skipping libusb build"
|
Log-Information "Failed to locate msbuild.exe - skipping libusb build"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Push-Location -Stack BuildMqttTemp
|
||||||
|
Ensure-Location $ProjectRoot
|
||||||
|
|
||||||
|
$MqttPath = "${ProjectRoot}/deps/paho.mqtt.cpp"
|
||||||
|
$MqttBuildPath = "${MqttPath}/build"
|
||||||
|
|
||||||
|
# Explicitly disable PkgConfig and tiff as it will lead build errors
|
||||||
|
$MqttCmakeArgs = @(
|
||||||
|
"-DCMAKE_BUILD_TYPE=${Configuration}"
|
||||||
|
"-DCMAKE_PREFIX_PATH:PATH=${OBSDepPath}"
|
||||||
|
"-DCMAKE_INSTALL_PREFIX:PATH=${ADVSSDepPath}"
|
||||||
|
"-DPAHO_WITH_MQTT_C=ON"
|
||||||
|
"-DPAHO_WITH_SSL=ON"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Try to find OpenSSL installed via winget
|
||||||
|
$pf64 = Join-Path $Env:ProgramFiles "OpenSSL-Win64"
|
||||||
|
$pf = Join-Path $Env:ProgramFiles "OpenSSL"
|
||||||
|
$possibleDirs = @($pf64, $pf)
|
||||||
|
$opensslDir = $possibleDirs | Where-Object { Test-Path (Join-Path $_ "include\openssl\ssl.h") } | Select-Object -First 1
|
||||||
|
|
||||||
|
if ($opensslDir) {
|
||||||
|
Write-Host "Detected OpenSSL at: $opensslDir"
|
||||||
|
$MqttCmakeArgs += "-DOPENSSL_ROOT_DIR=$opensslDir"
|
||||||
|
$MqttCmakeArgs += "-DOPENSSL_CRYPTO_LIBRARY=$opensslDir\lib\VC\x64\MD\libcrypto.lib"
|
||||||
|
$MqttCmakeArgs += "-DOPENSSL_SSL_LIBRARY=$opensslDir\lib\VC\x64\MD\libssl.lib"
|
||||||
|
} else {
|
||||||
|
Write-Warning "OpenSSL not found - maybe cmake will find it ..."
|
||||||
|
}
|
||||||
|
|
||||||
|
Log-Information "Configuring paho.mqtt.cpp..."
|
||||||
|
Invoke-External cmake -S ${MqttPath} -B ${MqttBuildPath} @MqttCmakeArgs
|
||||||
|
|
||||||
|
$MqttCmakeArgs = @(
|
||||||
|
'--config', "${Configuration}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if ( $VerbosePreference -eq 'Continue' ) {
|
||||||
|
$MqttCmakeArgs += ('--verbose')
|
||||||
|
}
|
||||||
|
|
||||||
|
Log-Information "Building paho.mqtt.cpp..."
|
||||||
|
Invoke-External cmake --build "${MqttBuildPath}" @MqttCmakeArgs
|
||||||
|
|
||||||
|
Log-Information "Install paho.mqtt.cpp..."
|
||||||
|
Invoke-External cmake --install "${MqttBuildPath}" --prefix "${ADVSSDepPath}" @MqttCmakeArgs
|
||||||
}
|
}
|
||||||
|
|
||||||
Build
|
Build
|
||||||
|
|||||||
4
.github/scripts/utils.zsh/check_macos
vendored
4
.github/scripts/utils.zsh/check_macos
vendored
@@ -18,5 +18,7 @@ if (( ! ${+commands[brew]} )) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
brew bundle --file ${SCRIPT_HOME}/.Brewfile
|
brew bundle --file ${SCRIPT_HOME}/.Brewfile
|
||||||
rehash
|
# Workaround to make sure locally built openssl is picked up by cmake
|
||||||
|
brew uninstall --ignore-dependencies openssl@3 || true
|
||||||
|
rehash || true
|
||||||
log_group
|
log_group
|
||||||
|
|||||||
1
.github/scripts/utils.zsh/setup_ccache
vendored
1
.github/scripts/utils.zsh/setup_ccache
vendored
@@ -10,7 +10,6 @@ if (( ${+commands[ccache]} )) {
|
|||||||
|
|
||||||
typeset -gx CCACHE_CONFIGPATH="${project_root}/.ccache.conf"
|
typeset -gx CCACHE_CONFIGPATH="${project_root}/.ccache.conf"
|
||||||
|
|
||||||
ccache --set-config=run_second_cpp=true
|
|
||||||
ccache --set-config=direct_mode=true
|
ccache --set-config=direct_mode=true
|
||||||
ccache --set-config=inode_cache=true
|
ccache --set-config=inode_cache=true
|
||||||
ccache --set-config=compiler_check=content
|
ccache --set-config=compiler_check=content
|
||||||
|
|||||||
1
.github/scripts/utils.zsh/setup_linux
vendored
1
.github/scripts/utils.zsh/setup_linux
vendored
@@ -41,6 +41,7 @@ if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) {
|
|||||||
sudo apt-get install ${apt_args} \
|
sudo apt-get install ${apt_args} \
|
||||||
build-essential \
|
build-essential \
|
||||||
libgles2-mesa-dev \
|
libgles2-mesa-dev \
|
||||||
|
libsimde-dev \
|
||||||
obs-studio
|
obs-studio
|
||||||
|
|
||||||
local -a _qt_packages=()
|
local -a _qt_packages=()
|
||||||
|
|||||||
13
.github/workflows/build-project.yaml
vendored
13
.github/workflows/build-project.yaml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
description: "Project name detected by parsing build spec file"
|
description: "Project name detected by parsing build spec file"
|
||||||
value: ${{ jobs.check-event.outputs.pluginName }}
|
value: ${{ jobs.check-event.outputs.pluginName }}
|
||||||
env:
|
env:
|
||||||
DEP_DIR: .deps/advss-build-dependencies
|
DEP_DIR: .deps/advss-build-dependencies-3
|
||||||
jobs:
|
jobs:
|
||||||
check-event:
|
check-event:
|
||||||
name: Check GitHub Event Data 🔎
|
name: Check GitHub Event Data 🔎
|
||||||
@@ -75,7 +75,7 @@ jobs:
|
|||||||
|
|
||||||
macos-build:
|
macos-build:
|
||||||
name: Build for macOS 🍏
|
name: Build for macOS 🍏
|
||||||
runs-on: macos-14
|
runs-on: macos-15
|
||||||
needs: check-event
|
needs: check-event
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@@ -107,8 +107,8 @@ jobs:
|
|||||||
print "pluginName=${product_name}" >> $GITHUB_OUTPUT
|
print "pluginName=${product_name}" >> $GITHUB_OUTPUT
|
||||||
print "pluginVersion=${git_tag}" >> $GITHUB_OUTPUT
|
print "pluginVersion=${git_tag}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
print '::group::Enable Xcode 15.2'
|
print '::group::Enable Xcode 16.1'
|
||||||
sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
|
sudo xcode-select --switch /Applications/Xcode_16.1.0.app/Contents/Developer
|
||||||
print '::endgroup::'
|
print '::endgroup::'
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
@@ -210,6 +210,11 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-ccache-x86_64-
|
${{ runner.os }}-ccache-x86_64-
|
||||||
|
|
||||||
|
- name: Set up CMake 🏗️
|
||||||
|
uses: jwlawson/actions-setup-cmake@v1.13
|
||||||
|
with:
|
||||||
|
cmake-version: '3.x.x'
|
||||||
|
|
||||||
- name: Set up Homebrew 🍺
|
- name: Set up Homebrew 🍺
|
||||||
uses: Homebrew/actions/setup-homebrew@master
|
uses: Homebrew/actions/setup-homebrew@master
|
||||||
|
|
||||||
|
|||||||
9
.gitmodules
vendored
9
.gitmodules
vendored
@@ -28,3 +28,12 @@
|
|||||||
[submodule "deps/libusb"]
|
[submodule "deps/libusb"]
|
||||||
path = deps/libusb
|
path = deps/libusb
|
||||||
url = https://github.com/libusb/libusb.git
|
url = https://github.com/libusb/libusb.git
|
||||||
|
[submodule "deps/date"]
|
||||||
|
path = deps/date
|
||||||
|
url = https://github.com/HowardHinnant/date.git
|
||||||
|
[submodule "deps/jsoncons"]
|
||||||
|
path = deps/jsoncons
|
||||||
|
url = https://github.com/danielaparker/jsoncons.git
|
||||||
|
[submodule "deps/paho.mqtt.cpp"]
|
||||||
|
path = deps/paho.mqtt.cpp
|
||||||
|
url = https://github.com/eclipse-paho/paho.mqtt.cpp.git
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.16...3.26)
|
cmake_minimum_required(VERSION 3.21...3.26)
|
||||||
|
|
||||||
project(advanced-scene-switcher VERSION 1.0.0)
|
project(advanced-scene-switcher VERSION 1.0.0)
|
||||||
|
|
||||||
@@ -34,6 +34,11 @@ include(cmake/common/get_git_revision_description.cmake)
|
|||||||
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
|
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
|
||||||
git_describe(GIT_TAG)
|
git_describe(GIT_TAG)
|
||||||
|
|
||||||
|
# Helper for OpenSSL
|
||||||
|
if(OS_WINDOWS)
|
||||||
|
include(cmake/windows/wingetssl.cmake)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${GIT_TAG} STREQUAL "GIT-NOTFOUND")
|
if(${GIT_TAG} STREQUAL "GIT-NOTFOUND")
|
||||||
set(GIT_TAG ${PROJECT_VERSION})
|
set(GIT_TAG ${PROJECT_VERSION})
|
||||||
endif()
|
endif()
|
||||||
@@ -103,8 +108,6 @@ target_sources(
|
|||||||
lib/macro/macro-action-macro.hpp
|
lib/macro/macro-action-macro.hpp
|
||||||
lib/macro/macro-action-queue.cpp
|
lib/macro/macro-action-queue.cpp
|
||||||
lib/macro/macro-action-queue.hpp
|
lib/macro/macro-action-queue.hpp
|
||||||
lib/macro/macro-action-script.cpp
|
|
||||||
lib/macro/macro-action-script.hpp
|
|
||||||
lib/macro/macro-action-variable.cpp
|
lib/macro/macro-action-variable.cpp
|
||||||
lib/macro/macro-action-variable.hpp
|
lib/macro/macro-action-variable.hpp
|
||||||
lib/macro/macro-action.cpp
|
lib/macro/macro-action.cpp
|
||||||
@@ -117,8 +120,6 @@ target_sources(
|
|||||||
lib/macro/macro-condition-macro.hpp
|
lib/macro/macro-condition-macro.hpp
|
||||||
lib/macro/macro-condition-queue.cpp
|
lib/macro/macro-condition-queue.cpp
|
||||||
lib/macro/macro-condition-queue.hpp
|
lib/macro/macro-condition-queue.hpp
|
||||||
lib/macro/macro-condition-script.cpp
|
|
||||||
lib/macro/macro-condition-script.hpp
|
|
||||||
lib/macro/macro-condition-tempvar.cpp
|
lib/macro/macro-condition-tempvar.cpp
|
||||||
lib/macro/macro-condition-tempvar.hpp
|
lib/macro/macro-condition-tempvar.hpp
|
||||||
lib/macro/macro-condition-variable.cpp
|
lib/macro/macro-condition-variable.cpp
|
||||||
@@ -127,6 +128,12 @@ target_sources(
|
|||||||
lib/macro/macro-condition.hpp
|
lib/macro/macro-condition.hpp
|
||||||
lib/macro/macro-dock.cpp
|
lib/macro/macro-dock.cpp
|
||||||
lib/macro/macro-dock.hpp
|
lib/macro/macro-dock.hpp
|
||||||
|
lib/macro/macro-dock-settings.hpp
|
||||||
|
lib/macro/macro-dock-settings.cpp
|
||||||
|
lib/macro/macro-dock-window.cpp
|
||||||
|
lib/macro/macro-dock-window.hpp
|
||||||
|
lib/macro/macro-edit.cpp
|
||||||
|
lib/macro/macro-edit.hpp
|
||||||
lib/macro/macro-export-import-dialog.cpp
|
lib/macro/macro-export-import-dialog.cpp
|
||||||
lib/macro/macro-export-import-dialog.hpp
|
lib/macro/macro-export-import-dialog.hpp
|
||||||
lib/macro/macro-helpers.cpp
|
lib/macro/macro-helpers.cpp
|
||||||
@@ -139,22 +146,23 @@ target_sources(
|
|||||||
lib/macro/macro-ref.hpp
|
lib/macro/macro-ref.hpp
|
||||||
lib/macro/macro-run-button.cpp
|
lib/macro/macro-run-button.cpp
|
||||||
lib/macro/macro-run-button.hpp
|
lib/macro/macro-run-button.hpp
|
||||||
lib/macro/macro-script-handler.cpp
|
lib/macro/macro-search.cpp
|
||||||
lib/macro/macro-script-handler.hpp
|
lib/macro/macro-search.hpp
|
||||||
lib/macro/macro-segment-copy-paste.cpp
|
lib/macro/macro-segment-copy-paste.cpp
|
||||||
lib/macro/macro-segment-copy-paste.hpp
|
lib/macro/macro-segment-copy-paste.hpp
|
||||||
lib/macro/macro-segment-list.cpp
|
lib/macro/macro-segment-list.cpp
|
||||||
lib/macro/macro-segment-list.hpp
|
lib/macro/macro-segment-list.hpp
|
||||||
lib/macro/macro-segment-script.cpp
|
|
||||||
lib/macro/macro-segment-script.hpp
|
|
||||||
lib/macro/macro-segment-selection.cpp
|
lib/macro/macro-segment-selection.cpp
|
||||||
lib/macro/macro-segment-selection.hpp
|
lib/macro/macro-segment-selection.hpp
|
||||||
|
lib/macro/macro-segment-unknown.hpp
|
||||||
lib/macro/macro-segment.cpp
|
lib/macro/macro-segment.cpp
|
||||||
lib/macro/macro-segment.hpp
|
lib/macro/macro-segment.hpp
|
||||||
lib/macro/macro-selection.cpp
|
lib/macro/macro-selection.cpp
|
||||||
lib/macro/macro-selection.hpp
|
lib/macro/macro-selection.hpp
|
||||||
lib/macro/macro-settings.cpp
|
lib/macro/macro-settings.cpp
|
||||||
lib/macro/macro-settings.hpp
|
lib/macro/macro-settings.hpp
|
||||||
|
lib/macro/macro-signals.cpp
|
||||||
|
lib/macro/macro-signals.hpp
|
||||||
lib/macro/macro-tab.cpp
|
lib/macro/macro-tab.cpp
|
||||||
lib/macro/macro-tree.cpp
|
lib/macro/macro-tree.cpp
|
||||||
lib/macro/macro-tree.hpp
|
lib/macro/macro-tree.hpp
|
||||||
@@ -172,6 +180,8 @@ target_sources(
|
|||||||
lib/utils/auto-update-tooltip-label.hpp
|
lib/utils/auto-update-tooltip-label.hpp
|
||||||
lib/utils/backup.cpp
|
lib/utils/backup.cpp
|
||||||
lib/utils/backup.hpp
|
lib/utils/backup.hpp
|
||||||
|
lib/utils/canvas-helpers.cpp
|
||||||
|
lib/utils/canvas-helpers.hpp
|
||||||
lib/utils/condition-logic.cpp
|
lib/utils/condition-logic.cpp
|
||||||
lib/utils/condition-logic.hpp
|
lib/utils/condition-logic.hpp
|
||||||
lib/utils/curl-helper.cpp
|
lib/utils/curl-helper.cpp
|
||||||
@@ -195,6 +205,8 @@ target_sources(
|
|||||||
lib/utils/help-icon.cpp
|
lib/utils/help-icon.cpp
|
||||||
lib/utils/item-selection-helpers.cpp
|
lib/utils/item-selection-helpers.cpp
|
||||||
lib/utils/item-selection-helpers.hpp
|
lib/utils/item-selection-helpers.hpp
|
||||||
|
lib/utils/json-helpers.cpp
|
||||||
|
lib/utils/json-helpers.hpp
|
||||||
lib/utils/layout-helpers.cpp
|
lib/utils/layout-helpers.cpp
|
||||||
lib/utils/layout-helpers.hpp
|
lib/utils/layout-helpers.hpp
|
||||||
lib/utils/list-controls.cpp
|
lib/utils/list-controls.cpp
|
||||||
@@ -221,17 +233,14 @@ target_sources(
|
|||||||
lib/utils/plugin-state-helpers.hpp
|
lib/utils/plugin-state-helpers.hpp
|
||||||
lib/utils/priority-helper.cpp
|
lib/utils/priority-helper.cpp
|
||||||
lib/utils/priority-helper.hpp
|
lib/utils/priority-helper.hpp
|
||||||
lib/utils/properties-view.cpp
|
|
||||||
lib/utils/properties-view.hpp
|
|
||||||
lib/utils/properties-view.moc.hpp
|
|
||||||
lib/utils/regex-config.cpp
|
lib/utils/regex-config.cpp
|
||||||
lib/utils/regex-config.hpp
|
lib/utils/regex-config.hpp
|
||||||
|
lib/utils/resizable-widget.cpp
|
||||||
|
lib/utils/resizable-widget.hpp
|
||||||
lib/utils/resizing-text-edit.cpp
|
lib/utils/resizing-text-edit.cpp
|
||||||
lib/utils/resizing-text-edit.hpp
|
lib/utils/resizing-text-edit.hpp
|
||||||
lib/utils/resource-table.cpp
|
lib/utils/resource-table.cpp
|
||||||
lib/utils/resource-table.hpp
|
lib/utils/resource-table.hpp
|
||||||
lib/utils/resource-table-hotkey-handler.cpp
|
|
||||||
lib/utils/resource-table-hotkey-handler.hpp
|
|
||||||
lib/utils/scene-selection.cpp
|
lib/utils/scene-selection.cpp
|
||||||
lib/utils/scene-selection.hpp
|
lib/utils/scene-selection.hpp
|
||||||
lib/utils/scene-switch-helpers.cpp
|
lib/utils/scene-switch-helpers.cpp
|
||||||
@@ -358,6 +367,21 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
target_link_libraries(${LIB_NAME} PUBLIC nlohmann_json::nlohmann_json)
|
target_link_libraries(${LIB_NAME} PUBLIC nlohmann_json::nlohmann_json)
|
||||||
|
|
||||||
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/deps/jsoncons/CMakeLists.txt")
|
||||||
|
# Don't build jsoncons unit tests as they are causing compilation issues and
|
||||||
|
# won't be executed either way
|
||||||
|
if(OS_MACOS)
|
||||||
|
cmake_policy(SET CMP0077 NEW)
|
||||||
|
endif()
|
||||||
|
set(JSONCONS_BUILD_TESTS
|
||||||
|
OFF
|
||||||
|
CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
add_subdirectory(deps/jsoncons EXCLUDE_FROM_ALL)
|
||||||
|
target_link_libraries(${LIB_NAME} PRIVATE jsoncons)
|
||||||
|
target_compile_definitions(${LIB_NAME} PRIVATE JSONPATH_SUPPORT=1)
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(CURL QUIET)
|
find_package(CURL QUIET)
|
||||||
find_package(Libcurl QUIET)
|
find_package(Libcurl QUIET)
|
||||||
if(CURL_FOUND)
|
if(CURL_FOUND)
|
||||||
@@ -411,6 +435,7 @@ else()
|
|||||||
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "")
|
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "")
|
||||||
set_target_properties(${LIB_NAME} PROPERTIES SOVERSION 1)
|
set_target_properties(${LIB_NAME} PROPERTIES SOVERSION 1)
|
||||||
|
|
||||||
|
find_package(Qt6 REQUIRED COMPONENTS DBus)
|
||||||
find_package(X11 REQUIRED COMPONENTS Xss)
|
find_package(X11 REQUIRED COMPONENTS Xss)
|
||||||
target_include_directories(${LIB_NAME} PRIVATE "${X11_INCLUDE_DIR}"
|
target_include_directories(${LIB_NAME} PRIVATE "${X11_INCLUDE_DIR}"
|
||||||
"${X11_Xss_INCLUDE_PATH}")
|
"${X11_Xss_INCLUDE_PATH}")
|
||||||
@@ -442,7 +467,8 @@ else()
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
target_include_directories(${LIB_NAME} PRIVATE "${PROC_INCLUDE_DIR}")
|
target_include_directories(${LIB_NAME} PRIVATE "${PROC_INCLUDE_DIR}")
|
||||||
target_sources(${LIB_NAME} PRIVATE lib/linux/advanced-scene-switcher-nix.cpp)
|
target_sources(${LIB_NAME} PRIVATE lib/linux/advanced-scene-switcher-nix.cpp
|
||||||
|
lib/linux/kwin-helpers.cpp)
|
||||||
|
|
||||||
# Don't include irrelevant folders into sources archive
|
# Don't include irrelevant folders into sources archive
|
||||||
list(APPEND CPACK_SOURCE_IGNORE_FILES "\\.deps/.*")
|
list(APPEND CPACK_SOURCE_IGNORE_FILES "\\.deps/.*")
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ The **Snap** package manager offers an OBS Studio installation which is bundled
|
|||||||
sudo snap install obs-studio
|
sudo snap install obs-studio
|
||||||
```
|
```
|
||||||
|
|
||||||
|
More information can be found [here](https://github.com/WarmUpTill/SceneSwitcher/wiki/Installation).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
- If you wish to contribute code to the project, have a look at this [section](BUILDING.md) describing how to compile the plugin.
|
- If you wish to contribute code to the project, have a look at this [section](BUILDING.md) describing how to compile the plugin.
|
||||||
|
|||||||
126
build-aux/CI/linux/demote-deps.sh
Executable file
126
build-aux/CI/linux/demote-deps.sh
Executable file
@@ -0,0 +1,126 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Usage: demote_deps.sh <in.deb> [Recommends|Suggests] [regex]
|
||||||
|
# Example: demote_deps.sh build/advanced-scene-switcher_1.31.0_amd64.deb Recommends 'opencv'
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [[ $# -lt 1 ]]; then
|
||||||
|
echo "Usage: $0 <in.deb> [Recommends|Suggests] [regex]" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
IN_DEB="$1"
|
||||||
|
DEST_FIELD="${2:-Recommends}" # Recommends or Suggests
|
||||||
|
MATCH_REGEX="${3:-opencv}" # regex to match packages to demote
|
||||||
|
|
||||||
|
echo "Demoting dependencies matching '${MATCH_REGEX}' to ${DEST_FIELD}"
|
||||||
|
|
||||||
|
TMPDIR="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$TMPDIR"' EXIT
|
||||||
|
|
||||||
|
dpkg-deb -R "$IN_DEB" "$TMPDIR"
|
||||||
|
CONTROL="$TMPDIR/DEBIAN/control"
|
||||||
|
|
||||||
|
# Read a field (single line value), handling continuation lines starting with a space.
|
||||||
|
get_field() {
|
||||||
|
local key="$1"
|
||||||
|
awk -v key="$key" '
|
||||||
|
BEGIN { val=""; collecting=0 }
|
||||||
|
$0 ~ "^" key ":" {
|
||||||
|
collecting=1
|
||||||
|
sub("^" key ":[[:space:]]*", "", $0)
|
||||||
|
val=$0
|
||||||
|
next
|
||||||
|
}
|
||||||
|
collecting==1 {
|
||||||
|
if ($0 ~ "^[[:space:]]") {
|
||||||
|
sub("^[[:space:]]+", "", $0)
|
||||||
|
val = val " " $0
|
||||||
|
next
|
||||||
|
} else {
|
||||||
|
collecting=0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END { print val }
|
||||||
|
' "$CONTROL"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Split a comma-separated list into lines, trimming whitespace
|
||||||
|
split_csv() {
|
||||||
|
tr ',' '\n' | sed -E 's/^[[:space:]]+//; s/[[:space:]]+$//' | sed '/^$/d'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Join with ", "
|
||||||
|
join_csv() {
|
||||||
|
awk 'BEGIN{first=1}{ if(!first) printf(", "); printf("%s",$0); first=0 } END{print ""}'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Deduplicate while preserving order
|
||||||
|
dedup() {
|
||||||
|
awk '!seen[$0]++'
|
||||||
|
}
|
||||||
|
|
||||||
|
DEPENDS_VAL="$(get_field Depends)"
|
||||||
|
EXIST_DEST_VAL="$(get_field "$DEST_FIELD")"
|
||||||
|
|
||||||
|
# Separate opencv-matching vs the rest (preserve tokens exactly)
|
||||||
|
mapfile -t DEPENDS_ARR < <(printf "%s\n" "$DEPENDS_VAL" | split_csv)
|
||||||
|
declare -a MOVED=()
|
||||||
|
declare -a KEPT=()
|
||||||
|
for item in "${DEPENDS_ARR[@]}"; do
|
||||||
|
# Skip empty just in case
|
||||||
|
[[ -z "$item" ]] && continue
|
||||||
|
if [[ "$item" =~ $MATCH_REGEX ]]; then
|
||||||
|
MOVED+=("$item")
|
||||||
|
else
|
||||||
|
KEPT+=("$item")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Merge with existing dest field
|
||||||
|
if [[ -n "$EXIST_DEST_VAL" ]]; then
|
||||||
|
mapfile -t EXIST_DEST_ARR < <(printf "%s\n" "$EXIST_DEST_VAL" | split_csv)
|
||||||
|
MOVED+=("${EXIST_DEST_ARR[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# De-duplicate
|
||||||
|
mapfile -t MOVED < <(printf "%s\n" "${MOVED[@]:-}" | sed '/^$/d' | dedup)
|
||||||
|
mapfile -t KEPT < <(printf "%s\n" "${KEPT[@]:-}" | sed '/^$/d' | dedup)
|
||||||
|
|
||||||
|
# Rebuild values
|
||||||
|
NEW_DEPENDS="$(printf "%s\n" "${KEPT[@]:-}" | join_csv || true)"
|
||||||
|
NEW_DEST="$(printf "%s\n" "${MOVED[@]:-}" | join_csv || true)"
|
||||||
|
|
||||||
|
# Write a cleaned control (remove existing Depends/Recommends/Suggests incl. continuations)
|
||||||
|
awk '
|
||||||
|
BEGIN { skip=0 }
|
||||||
|
{
|
||||||
|
if ($0 ~ "^(Depends|Recommends|Suggests):") { skip=1; next }
|
||||||
|
if (skip==1) {
|
||||||
|
if ($0 ~ "^[[:space:]]") { next } else { skip=0 }
|
||||||
|
}
|
||||||
|
print
|
||||||
|
}
|
||||||
|
' "$CONTROL" > "$CONTROL.clean"
|
||||||
|
|
||||||
|
# Append the rebuilt fields
|
||||||
|
{
|
||||||
|
cat "$CONTROL.clean"
|
||||||
|
if [[ -n "$NEW_DEPENDS" ]]; then
|
||||||
|
echo "Depends: $NEW_DEPENDS"
|
||||||
|
fi
|
||||||
|
if [[ -n "$NEW_DEST" ]]; then
|
||||||
|
echo "$DEST_FIELD: $NEW_DEST"
|
||||||
|
fi
|
||||||
|
} > "$CONTROL.new"
|
||||||
|
|
||||||
|
# Clean up empty lines
|
||||||
|
sed -i '/^[[:space:]]*$/d' "$CONTROL.new"
|
||||||
|
|
||||||
|
mv "$CONTROL.new" "$CONTROL"
|
||||||
|
rm -f "$CONTROL.clean"
|
||||||
|
|
||||||
|
# Repack
|
||||||
|
rm -f "${IN_DEB}"
|
||||||
|
OUT_DEB="${IN_DEB}"
|
||||||
|
dpkg-deb -b "$TMPDIR" "$OUT_DEB" >/dev/null
|
||||||
|
echo "$OUT_DEB"
|
||||||
@@ -1,33 +1,33 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"obs-studio": {
|
"obs-studio": {
|
||||||
"version": "30.1.2",
|
"version": "31.1.1",
|
||||||
"baseUrl": "https://github.com/obsproject/obs-studio/archive/refs/tags",
|
"baseUrl": "https://github.com/obsproject/obs-studio/archive/refs/tags",
|
||||||
"label": "OBS sources",
|
"label": "OBS sources",
|
||||||
"hashes": {
|
"hashes": {
|
||||||
"macos": "490bae1c392b3b344b0270afd8cb887da4bc50bd92c0c426e96713c1ccb9701a",
|
"macos": "39751f067bacc13d44b116c5138491b5f1391f91516d3d590d874edd21292291",
|
||||||
"windows-x64": "c2dd03fa7fd01fad5beafce8f7156da11f9ed9a588373fd40b44a06f4c03b867"
|
"windows-x64": "2c8427c10b55ac6d68008df2e9a3e82f4647aaad18f105e30d4713c2de678ccf"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"prebuilt": {
|
"prebuilt": {
|
||||||
"version": "2024-03-19",
|
"version": "2025-07-11",
|
||||||
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
|
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
|
||||||
"label": "Pre-Built obs-deps",
|
"label": "Pre-Built obs-deps",
|
||||||
"hashes": {
|
"hashes": {
|
||||||
"macos": "2e9bfb55a5e0e4c1086fa1fda4cf268debfead473089df2aaea80e1c7a3ca7ff",
|
"macos": "495687e63383d1a287684b6e2e9bfe246bb8f156fe265926afb1a325af1edd2a",
|
||||||
"windows-x64": "6e86068371526a967e805f6f9903f9407adb683c21820db5f07da8f30d11e998"
|
"windows-x64": "c8c642c1070dc31ce9a0f1e4cef5bb992f4bff4882255788b5da12129e85caa7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"qt6": {
|
"qt6": {
|
||||||
"version": "2024-03-19",
|
"version": "2025-07-11",
|
||||||
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
|
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
|
||||||
"label": "Pre-Built Qt6",
|
"label": "Pre-Built Qt6",
|
||||||
"hashes": {
|
"hashes": {
|
||||||
"macos": "694f1e639c017e3b1f456f735330dc5afae287cbea85757101af1368de3142c8",
|
"macos": "d3f5f04b6ea486e032530bdf0187cbda9a54e0a49621a4c8ba984c5023998867",
|
||||||
"windows-x64": "72d1df34a0ef7413a681d5fcc88cae81da60adc03dcd23ef17862ab170bcc0dd"
|
"windows-x64": "0e76bf0555dd5382838850b748d3dcfab44a1e1058441309ab54e1a65b156d0a"
|
||||||
},
|
},
|
||||||
"debugSymbols": {
|
"debugSymbols": {
|
||||||
"windows-x64": "fbddd1f659c360f2291911ac5709b67b6f8182e6bca519d24712e4f6fd3cc865"
|
"windows-x64": "11b7be92cf66a273299b8f3515c07a5cfb61614b59a4e67f7fc5ecba5e2bdf21"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -65,17 +65,16 @@ function(_setup_obs_studio)
|
|||||||
|
|
||||||
if(OS_WINDOWS)
|
if(OS_WINDOWS)
|
||||||
set(_cmake_generator "${CMAKE_GENERATOR}")
|
set(_cmake_generator "${CMAKE_GENERATOR}")
|
||||||
set(_cmake_arch "-A ${arch}")
|
set(_cmake_arch
|
||||||
|
"-A ${arch},version=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||||
set(_cmake_extra
|
set(_cmake_extra
|
||||||
"-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} -DCMAKE_ENABLE_SCRIPTING=OFF"
|
"-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} -DCMAKE_ENABLE_SCRIPTING=OFF"
|
||||||
)
|
)
|
||||||
set(_cmake_version "2.0.0")
|
|
||||||
elseif(OS_MACOS)
|
elseif(OS_MACOS)
|
||||||
set(_cmake_generator "Xcode")
|
set(_cmake_generator "Xcode")
|
||||||
set(_cmake_arch "-DCMAKE_OSX_ARCHITECTURES:STRING='arm64;x86_64'")
|
set(_cmake_arch "-DCMAKE_OSX_ARCHITECTURES:STRING='arm64;x86_64'")
|
||||||
set(_cmake_extra
|
set(_cmake_extra
|
||||||
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
set(_cmake_version "3.0.0")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "Configure ${label} (${arch})")
|
message(STATUS "Configure ${label} (${arch})")
|
||||||
@@ -83,32 +82,42 @@ function(_setup_obs_studio)
|
|||||||
COMMAND
|
COMMAND
|
||||||
"${CMAKE_COMMAND}" -S "${dependencies_dir}/${_obs_destination}" -B
|
"${CMAKE_COMMAND}" -S "${dependencies_dir}/${_obs_destination}" -B
|
||||||
"${dependencies_dir}/${_obs_destination}/build_${arch}" -G
|
"${dependencies_dir}/${_obs_destination}/build_${arch}" -G
|
||||||
${_cmake_generator} "${_cmake_arch}"
|
${_cmake_generator} "${_cmake_arch}" -DOBS_CMAKE_VERSION:STRING=3.0.0
|
||||||
-DOBS_CMAKE_VERSION:STRING=${_cmake_version} -DENABLE_PLUGINS:BOOL=OFF
|
-DENABLE_PLUGINS:BOOL=OFF -DENABLE_FRONTEND:BOOL=OFF
|
||||||
-DENABLE_UI:BOOL=OFF -DOBS_VERSION_OVERRIDE:STRING=${_obs_version}
|
-DOBS_VERSION_OVERRIDE:STRING=${_obs_version}
|
||||||
"-DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATH}'" ${_is_fresh} ${_cmake_extra}
|
"-DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATH}'" ${_is_fresh} ${_cmake_extra}
|
||||||
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
|
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
|
||||||
OUTPUT_QUIET)
|
OUTPUT_QUIET)
|
||||||
message(STATUS "Configure ${label} (${arch}) - done")
|
message(STATUS "Configure ${label} (${arch}) - done")
|
||||||
|
|
||||||
message(STATUS "Build ${label} (${arch})")
|
message(STATUS "Build ${label} (Debug - ${arch})")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND "${CMAKE_COMMAND}" --build build_${arch} --target obs-frontend-api
|
COMMAND "${CMAKE_COMMAND}" --build build_${arch} --target obs-frontend-api
|
||||||
--config Debug --parallel
|
--config Debug --parallel
|
||||||
WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
|
WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
|
||||||
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
|
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
|
||||||
OUTPUT_QUIET)
|
OUTPUT_QUIET)
|
||||||
message(STATUS "Build ${label} (${arch}) - done")
|
message(STATUS "Build ${label} (Debug - ${arch}) - done")
|
||||||
|
|
||||||
|
message(STATUS "Build ${label} (Release - ${arch})")
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${CMAKE_COMMAND}" --build build_${arch} --target obs-frontend-api
|
||||||
|
--config Release --parallel
|
||||||
|
WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
|
||||||
|
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
|
||||||
|
OUTPUT_QUIET)
|
||||||
|
message(STATUS "Build ${label} (Reelase - ${arch}) - done")
|
||||||
|
|
||||||
message(STATUS "Install ${label} (${arch})")
|
message(STATUS "Install ${label} (${arch})")
|
||||||
if(OS_WINDOWS)
|
|
||||||
set(_cmake_extra "--component obs_libraries")
|
|
||||||
else()
|
|
||||||
set(_cmake_extra "")
|
|
||||||
endif()
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND "${CMAKE_COMMAND}" --install build_${arch} --component Development
|
COMMAND "${CMAKE_COMMAND}" --install build_${arch} --component Development
|
||||||
--config Debug --prefix "${dependencies_dir}" ${_cmake_extra}
|
--config Debug --prefix "${dependencies_dir}"
|
||||||
|
WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
|
||||||
|
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
|
||||||
|
OUTPUT_QUIET)
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${CMAKE_COMMAND}" --install build_${arch} --component Development
|
||||||
|
--config Release --prefix "${dependencies_dir}"
|
||||||
WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
|
WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
|
||||||
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
|
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
|
||||||
OUTPUT_QUIET)
|
OUTPUT_QUIET)
|
||||||
@@ -171,24 +180,46 @@ function(_check_dependencies)
|
|||||||
set(url ${url}/${version}/${file})
|
set(url ${url}/${version}/${file})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(MAX_DOWNLOAD_RETRIES 3)
|
||||||
|
set(RETRY_DELAY 60) # seconds
|
||||||
|
|
||||||
if(NOT EXISTS "${dependencies_dir}/${file}")
|
if(NOT EXISTS "${dependencies_dir}/${file}")
|
||||||
message(STATUS "Downloading ${url}")
|
message(STATUS "Downloading ${url}")
|
||||||
file(
|
|
||||||
DOWNLOAD "${url}" "${dependencies_dir}/${file}"
|
|
||||||
STATUS download_status
|
|
||||||
EXPECTED_HASH SHA256=${hash})
|
|
||||||
|
|
||||||
list(GET download_status 0 error_code)
|
set(download_success FALSE)
|
||||||
list(GET download_status 1 error_message)
|
|
||||||
if(error_code GREATER 0)
|
foreach(i RANGE 1 ${MAX_DOWNLOAD_RETRIES})
|
||||||
message(STATUS "Downloading ${url} - Failure")
|
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(
|
message(
|
||||||
FATAL_ERROR
|
FATAL_ERROR
|
||||||
"Unable to download ${url}, failed with error: ${error_message}")
|
"Unable to download ${url} after ${MAX_DOWNLOAD_RETRIES} attempts")
|
||||||
file(REMOVE "${dependencies_dir}/${file}")
|
|
||||||
else()
|
|
||||||
message(STATUS "Downloading ${url} - done")
|
|
||||||
endif()
|
endif()
|
||||||
|
message(STATUS "Downloading ${url} - done")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT EXISTS "${dependencies_dir}/${destination}")
|
if(NOT EXISTS "${dependencies_dir}/${destination}")
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ function(set_target_properties_plugin target)
|
|||||||
|
|
||||||
configure_file(cmake/windows/resources/installer-Windows.iss.in
|
configure_file(cmake/windows/resources/installer-Windows.iss.in
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/installer-Windows.generated.iss")
|
"${CMAKE_CURRENT_BINARY_DIR}/installer-Windows.generated.iss")
|
||||||
|
configure_file(data/res/images/logo.ico
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/installer.ico" COPYONLY)
|
||||||
|
|
||||||
configure_file(cmake/windows/resources/resource.rc.in
|
configure_file(cmake/windows/resources/resource.rc.in
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc")
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc")
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ OutputBaseFilename={#MyAppName}-{#MyAppVersion}-Windows-Installer
|
|||||||
Compression=lzma
|
Compression=lzma
|
||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
DirExistsWarning=no
|
DirExistsWarning=no
|
||||||
|
SetupIconFile=installer.ico
|
||||||
|
UninstallDisplayIcon={app}\data\obs-plugins\advanced-scene-switcher\res\images\logo.ico
|
||||||
|
DisableDirPage=no
|
||||||
|
|
||||||
[Languages]
|
[Languages]
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|||||||
78
cmake/windows/wingetssl.cmake
Normal file
78
cmake/windows/wingetssl.cmake
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Detects OpenSSL installed via winget or other common Windows locations,
|
||||||
|
# without requiring the user to manually set OPENSSL_ROOT_DIR.
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if(WIN32 AND (NOT OpenSSL_FOUND))
|
||||||
|
|
||||||
|
set(_openssl_roots
|
||||||
|
"$ENV{ProgramFiles}/OpenSSL-Win64" "$ENV{ProgramFiles}/OpenSSL"
|
||||||
|
"$ENV{ProgramW6432}/OpenSSL-Win64")
|
||||||
|
|
||||||
|
set(_openssl_lib_suffixes "lib/VC/x64/MD" "lib/VC/x64/MDd" "lib/VC/x64/MT"
|
||||||
|
"lib/VC/x64/MTd" "lib")
|
||||||
|
|
||||||
|
# Determine which configuration we're building
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
|
set(_is_debug TRUE)
|
||||||
|
else()
|
||||||
|
set(_is_debug FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Determine which runtime we use Default to /MD (shared CRT)
|
||||||
|
set(_crt_kind "MD")
|
||||||
|
if(MSVC)
|
||||||
|
if(CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "MultiThreaded")
|
||||||
|
if(CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "Debug")
|
||||||
|
set(_crt_kind "MTd")
|
||||||
|
else()
|
||||||
|
set(_crt_kind "MT")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(_is_debug)
|
||||||
|
set(_crt_kind "MDd")
|
||||||
|
else()
|
||||||
|
set(_crt_kind "MD")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Looking for OpenSSL built with CRT variant: ${_crt_kind}")
|
||||||
|
|
||||||
|
# Try to find the root and corresponding lib path
|
||||||
|
foreach(_root ${_openssl_roots})
|
||||||
|
if(EXISTS "${_root}/include/openssl/ssl.h")
|
||||||
|
foreach(_suffix ${_openssl_lib_suffixes})
|
||||||
|
if(_suffix MATCHES "${_crt_kind}$"
|
||||||
|
AND EXISTS "${_root}/${_suffix}/libcrypto.lib")
|
||||||
|
set(OPENSSL_ROOT_DIR
|
||||||
|
"${_root}"
|
||||||
|
CACHE PATH "Path to OpenSSL root")
|
||||||
|
set(OPENSSL_CRYPTO_LIBRARY
|
||||||
|
"${_root}/${_suffix}/libcrypto.lib"
|
||||||
|
CACHE FILEPATH "OpenSSL crypto lib")
|
||||||
|
set(OPENSSL_SSL_LIBRARY
|
||||||
|
"${_root}/${_suffix}/libssl.lib"
|
||||||
|
CACHE FILEPATH "OpenSSL ssl lib")
|
||||||
|
set(OPENSSL_INCLUDE_DIR
|
||||||
|
"${_root}/include"
|
||||||
|
CACHE PATH "OpenSSL include dir")
|
||||||
|
set(OpenSSL_FOUND
|
||||||
|
TRUE
|
||||||
|
CACHE BOOL "Whether OpenSSL was found")
|
||||||
|
message(STATUS "Found OpenSSL at: ${_root}/${_suffix}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
if(OpenSSL_FOUND)
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if(NOT OpenSSL_FOUND)
|
||||||
|
message(WARNING "Could not auto-detect OpenSSL under Program Files. "
|
||||||
|
"Might have to set OPENSSL_ROOT_DIR manually.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endif()
|
||||||
@@ -12,7 +12,7 @@ AdvSceneSwitcher.generalTab.status.onStartup.alwaysStart="Aktiviere den Szenenwe
|
|||||||
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Aktiviere den Szenenwechsler nicht"
|
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Aktiviere den Szenenwechsler nicht"
|
||||||
AdvSceneSwitcher.generalTab.status.start="Start"
|
AdvSceneSwitcher.generalTab.status.start="Start"
|
||||||
AdvSceneSwitcher.generalTab.status.stop="Stop"
|
AdvSceneSwitcher.generalTab.status.stop="Stop"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart="Starte auotmatischen den Szenenwechsler beim:"
|
AdvSceneSwitcher.generalTab.status.autoStart.startup="Starte auotmatischen den Szenenwechsler beim:"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.never="Niemals"
|
AdvSceneSwitcher.generalTab.status.autoStart.never="Niemals"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.recording="Aufnehmen"
|
AdvSceneSwitcher.generalTab.status.autoStart.recording="Aufnehmen"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Streamen"
|
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Streamen"
|
||||||
@@ -26,7 +26,6 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Wechsle zu
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Wechsle zu:"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Wechsle zu:"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="Nach Ausführen von Aktionen überspringe das Ausführen von Aktionen für"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="Nach Ausführen von Aktionen überspringe das Ausführen von Aktionen für"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="In diesem Zeitraum werden potentielle erfüllte Bedingungen ignoriert!"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="In diesem Zeitraum werden potentielle erfüllte Bedingungen ignoriert!"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Ausführliches Logging"
|
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Fensterposition und -größe speichern"
|
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Fensterposition und -größe speichern"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Benachrichtigungen im System-Tray anzeigen"
|
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Benachrichtigungen im System-Tray anzeigen"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Deaktiviere UI Tipps"
|
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Deaktiviere UI Tipps"
|
||||||
@@ -41,7 +40,7 @@ AdvSceneSwitcher.generalTab.saveOrLoadsettings.export="Exportieren"
|
|||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Importieren"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Importieren"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Exportiere Erweiterter Automatischer Szenenwechsler Einstellungen zu Datei ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Exportiere Erweiterter Automatischer Szenenwechsler Einstellungen zu Datei ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Exportiere Erweiterter Automatischer Szenenwechsler Einstellungen von Datei ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Exportiere Erweiterter Automatischer Szenenwechsler Einstellungen von Datei ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Text Dateien (*.txt)"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Text Dateien (*.txt *.json)"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="Importieren der Einstellungen ist fehlgeschlagen"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="Importieren der Einstellungen ist fehlgeschlagen"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Einstellungen wurden erfolgreich importiert"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Einstellungen wurden erfolgreich importiert"
|
||||||
AdvSceneSwitcher.generalTab.priority.fileContent="Datei Inhalt"
|
AdvSceneSwitcher.generalTab.priority.fileContent="Datei Inhalt"
|
||||||
@@ -195,12 +194,12 @@ AdvSceneSwitcher.condition.video.modelLoadFail="Modelldaten konnten nicht gelade
|
|||||||
AdvSceneSwitcher.condition.video.type.main="OBS's Haupt-Ausgabe"
|
AdvSceneSwitcher.condition.video.type.main="OBS's Haupt-Ausgabe"
|
||||||
AdvSceneSwitcher.condition.video.type.source="Quelle"
|
AdvSceneSwitcher.condition.video.type.source="Quelle"
|
||||||
AdvSceneSwitcher.condition.video.type.scene="Szene"
|
AdvSceneSwitcher.condition.video.type.scene="Szene"
|
||||||
AdvSceneSwitcher.condition.video.entry="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
AdvSceneSwitcher.condition.video.layout="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.modelPath="Modelldaten (Haar-Kaskaden-Klassifikator): {{modelDataPath}}"
|
AdvSceneSwitcher.condition.video.layout.modelPath="Modelldaten (Haar-Kaskaden-Klassifikator): {{modelDataPath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.minNeighbor="Minimale Anzahl von Nachbarn: {{minNeighbors}}"
|
AdvSceneSwitcher.condition.video.layout.minNeighbor="Minimale Anzahl von Nachbarn: {{minNeighbors}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.throttle="{{throttleEnable}}Reduzieren Sie die CPU-Belastung, indem Sie die Prüfung nur alle {{throttleCount}} Millisekunden"
|
AdvSceneSwitcher.condition.video.layout.throttle="{{throttleEnable}}Reduzieren Sie die CPU-Belastung, indem Sie die Prüfung nur alle {{throttleCount}} Millisekunden"
|
||||||
AdvSceneSwitcher.condition.video.entry.checkAreaEnable="Kontrolle nur im Bereich durchführen"
|
AdvSceneSwitcher.condition.video.layout.checkAreaEnable="Kontrolle nur im Bereich durchführen"
|
||||||
AdvSceneSwitcher.condition.video.entry.checkArea="{{checkAreaEnable}}{{checkArea}}{{selectArea}}"
|
AdvSceneSwitcher.condition.video.layout.checkArea="{{checkAreaEnable}}{{checkArea}}{{selectArea}}"
|
||||||
AdvSceneSwitcher.condition.video.minSize="Minimale Größe:"
|
AdvSceneSwitcher.condition.video.minSize="Minimale Größe:"
|
||||||
AdvSceneSwitcher.condition.video.maxSize="Maximale Größe:"
|
AdvSceneSwitcher.condition.video.maxSize="Maximale Größe:"
|
||||||
AdvSceneSwitcher.condition.video.selectArea="Bereich auswählen"
|
AdvSceneSwitcher.condition.video.selectArea="Bereich auswählen"
|
||||||
@@ -384,8 +383,6 @@ AdvSceneSwitcher.condition.variable.type.greaterThanVariable="ist größer als d
|
|||||||
|
|
||||||
; Macro Actions
|
; Macro Actions
|
||||||
AdvSceneSwitcher.action.scene="Szene wechseln"
|
AdvSceneSwitcher.action.scene="Szene wechseln"
|
||||||
AdvSceneSwitcher.action.scene.entry="Wechsle{{sceneTypes}}Szene zu{{scenes}}mittels{{transitions}}mit einer Dauer von{{duration}}Sekunden"
|
|
||||||
AdvSceneSwitcher.action.scene.entry.noDuration="Wechsle{{sceneTypes}}Szene zu{{scenes}}mittels{{transitions}}"
|
|
||||||
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Warten, bis der Übergang zur Zielszene abgeschlossen ist"
|
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Warten, bis der Übergang zur Zielszene abgeschlossen ist"
|
||||||
AdvSceneSwitcher.action.wait="Warten"
|
AdvSceneSwitcher.action.wait="Warten"
|
||||||
AdvSceneSwitcher.action.wait.type.fixed="fixe"
|
AdvSceneSwitcher.action.wait.type.fixed="fixe"
|
||||||
@@ -467,7 +464,7 @@ AdvSceneSwitcher.action.pluginState.type.stop="Erweiterten Automatischen Szenenw
|
|||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="Ändern des Nichtübereinstimmungsverhaltens:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="Ändern des Nichtübereinstimmungsverhaltens:"
|
||||||
AdvSceneSwitcher.action.pluginState.type.import="Einstellungen importieren aus"
|
AdvSceneSwitcher.action.pluginState.type.import="Einstellungen importieren aus"
|
||||||
AdvSceneSwitcher.action.pluginState.importWarning="Hinweis: Die Aktion wird ignoriert, solange das Einstellungsfenster geöffnet ist."
|
AdvSceneSwitcher.action.pluginState.importWarning="Hinweis: Die Aktion wird ignoriert, solange das Einstellungsfenster geöffnet ist."
|
||||||
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}{{settingsWarning}}"
|
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}"
|
||||||
AdvSceneSwitcher.action.virtualCamera="Virtuelle Kamera"
|
AdvSceneSwitcher.action.virtualCamera="Virtuelle Kamera"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.stop="Virtuelle Kamera stoppen"
|
AdvSceneSwitcher.action.virtualCamera.type.stop="Virtuelle Kamera stoppen"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.start="Virtuelle Kamera starten"
|
AdvSceneSwitcher.action.virtualCamera.type.start="Virtuelle Kamera starten"
|
||||||
@@ -753,9 +750,9 @@ AdvSceneSwitcher.hotkey.startStopToggleSwitcherHotkey="Starte/Stoppe den Erweite
|
|||||||
AdvSceneSwitcher.hotkey.macro.pause="Pausiere Makro %1"
|
AdvSceneSwitcher.hotkey.macro.pause="Pausiere Makro %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.unpause="Makro %1 nicht mehr pausieren"
|
AdvSceneSwitcher.hotkey.macro.unpause="Makro %1 nicht mehr pausieren"
|
||||||
AdvSceneSwitcher.hotkey.macro.togglePause="Pause von Makro %1 togglen"
|
AdvSceneSwitcher.hotkey.macro.togglePause="Pause von Makro %1 togglen"
|
||||||
AdvSceneSwitcher.hotkey.upMacroSegmentHotkey="Makro-Segmentauswahl nach oben verschieben"
|
AdvSceneSwitcher.hotkey.macro.segment.up="Makro-Segmentauswahl nach oben verschieben"
|
||||||
AdvSceneSwitcher.hotkey.downMacroSegmentHotkey="Makro-Segmentauswahl nach unten verschieben"
|
AdvSceneSwitcher.hotkey.macro.segment.down="Makro-Segmentauswahl nach unten verschieben"
|
||||||
AdvSceneSwitcher.hotkey.removeMacroSegmentHotkey="Ausgewähltes Makro-Segment entfernen"
|
AdvSceneSwitcher.hotkey.macro.segment.remove="Ausgewähltes Makro-Segment entfernen"
|
||||||
|
|
||||||
AdvSceneSwitcher.askBackup="Neue Version des Erweiterten Automatischen Szenenwechslers wurde erkannt.\nSoll ein Backup der alten Einstellungen angelegt werden?"
|
AdvSceneSwitcher.askBackup="Neue Version des Erweiterten Automatischen Szenenwechslers wurde erkannt.\nSoll ein Backup der alten Einstellungen angelegt werden?"
|
||||||
AdvSceneSwitcher.askForMacro="Makro auswählen {{macroSelection}}"
|
AdvSceneSwitcher.askForMacro="Makro auswählen {{macroSelection}}"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ AdvSceneSwitcher.windowTitle="Advanced Scene Switcher"
|
|||||||
# General Tab
|
# General Tab
|
||||||
AdvSceneSwitcher.generalTab.title="General"
|
AdvSceneSwitcher.generalTab.title="General"
|
||||||
AdvSceneSwitcher.generalTab.status="Status"
|
AdvSceneSwitcher.generalTab.status="Status"
|
||||||
AdvSceneSwitcher.generalTab.status.hotkeytips="Hotkeys can be defined in the OBS settings"
|
AdvSceneSwitcher.generalTab.status.hotkeytips="Start/stop hotkeys can be defined in the OBS settings"
|
||||||
AdvSceneSwitcher.generalTab.status.currentStatus="Advanced Scene Switcher is:"
|
AdvSceneSwitcher.generalTab.status.currentStatus="Advanced Scene Switcher is:"
|
||||||
AdvSceneSwitcher.generalTab.status.onStartup="On startup of OBS:"
|
AdvSceneSwitcher.generalTab.status.onStartup="On startup of OBS:"
|
||||||
AdvSceneSwitcher.generalTab.status.onStartup.asLastRun="Start the scene switcher if it was running"
|
AdvSceneSwitcher.generalTab.status.onStartup.asLastRun="Start the scene switcher if it was running"
|
||||||
@@ -12,11 +12,12 @@ AdvSceneSwitcher.generalTab.status.onStartup.alwaysStart="Always start the scene
|
|||||||
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Do not start the scene switcher"
|
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Do not start the scene switcher"
|
||||||
AdvSceneSwitcher.generalTab.status.start="Start"
|
AdvSceneSwitcher.generalTab.status.start="Start"
|
||||||
AdvSceneSwitcher.generalTab.status.stop="Stop"
|
AdvSceneSwitcher.generalTab.status.stop="Stop"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart="Automatically start the scene switcher when:"
|
AdvSceneSwitcher.generalTab.status.autoStart.startup="Automatically start the scene switcher when:"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.never="Never"
|
AdvSceneSwitcher.generalTab.status.autoStart.never="Never"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.recording="Recording"
|
AdvSceneSwitcher.generalTab.status.autoStart.recording="Recording"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Streaming"
|
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Streaming"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.recordingAndStreaming="Recording or Streaming"
|
AdvSceneSwitcher.generalTab.status.autoStart.recordingAndStreaming="Recording or Streaming"
|
||||||
|
AdvSceneSwitcher.generalTab.status.autoStart.scene="Automatically start the scene switcher on scene:"
|
||||||
AdvSceneSwitcher.generalTab.status.checkInterval="Check conditions every"
|
AdvSceneSwitcher.generalTab.status.checkInterval="Check conditions every"
|
||||||
AdvSceneSwitcher.generalTab.status.checkIntervalTooLow="⚠️ Conflict with macro \"%1\"!"
|
AdvSceneSwitcher.generalTab.status.checkIntervalTooLow="⚠️ Conflict with macro \"%1\"!"
|
||||||
AdvSceneSwitcher.generalTab.status.checkIntervalTooLow.tooltip="Macro \"%1\" won't be able to check its condition at the desired interval of %2.\nEither change the condition check value on the General tab or in the settings of macro \"%3\"."
|
AdvSceneSwitcher.generalTab.status.checkIntervalTooLow.tooltip="Macro \"%1\" won't be able to check its condition at the desired interval of %2.\nEither change the condition check value on the General tab or in the settings of macro \"%3\"."
|
||||||
@@ -29,11 +30,11 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Switch to:"
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="After performing actions skip performing actions for"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="After performing actions skip performing actions for"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="During this time potential matches will be ignored!"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="During this time potential matches will be ignored!"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel="Log level:"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel="Log level:"
|
||||||
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.disable="Disable logging"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default="Default"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default="Default"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logMacro="Log executed macros"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logMacro="Log executed macros"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logAction="Log performed actions"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logAction="Log performed actions"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose="Verbose logging"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose="Verbose logging"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Enable verbose logging"
|
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Save window position and size"
|
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Save window position and size"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Show system tray notifications"
|
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Show system tray notifications"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Disable UI hints"
|
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Disable UI hints"
|
||||||
@@ -42,6 +43,7 @@ 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.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.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.hideLegacyTabs="Hide tabs which can be represented via macros"
|
||||||
|
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowMacroSearch="Always show macro search"
|
||||||
AdvSceneSwitcher.generalTab.matchBehavior="Match behavior"
|
AdvSceneSwitcher.generalTab.matchBehavior="Match behavior"
|
||||||
AdvSceneSwitcher.generalTab.priority="Priority"
|
AdvSceneSwitcher.generalTab.priority="Priority"
|
||||||
AdvSceneSwitcher.generalTab.priority.description="Switching methods priority (Highest priority is at the top)"
|
AdvSceneSwitcher.generalTab.priority.description="Switching methods priority (Highest priority is at the top)"
|
||||||
@@ -52,7 +54,7 @@ AdvSceneSwitcher.generalTab.saveOrLoadsettings.export="Export"
|
|||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Import"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Import"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Export Advanced Scene Switcher settings to file ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Export Advanced Scene Switcher settings to file ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Import Advanced Scene Switcher settings from file ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Import Advanced Scene Switcher settings from file ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Text files (*.txt)"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Text files (*.txt);;JSON files (*.json)"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="Advanced Scene Switcher failed to import settings"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="Advanced Scene Switcher failed to import settings"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Advanced Scene Switcher settings imported successfully"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Advanced Scene Switcher settings imported successfully"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportSensitiveDataWarning="Warning:\nThe exported data might contain sensitive information!"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportSensitiveDataWarning="Warning:\nThe exported data might contain sensitive information!"
|
||||||
@@ -72,6 +74,7 @@ AdvSceneSwitcher.generalTab.setTransitionBy="When changing transitions:"
|
|||||||
AdvSceneSwitcher.generalTab.transitionOverride="Set transition overrides"
|
AdvSceneSwitcher.generalTab.transitionOverride="Set transition overrides"
|
||||||
AdvSceneSwitcher.generalTab.adjustActiveTransitionType="Change active transition type"
|
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.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
|
# Variables Tab
|
||||||
AdvSceneSwitcher.variableTab.title="Variables"
|
AdvSceneSwitcher.variableTab.title="Variables"
|
||||||
@@ -89,6 +92,12 @@ AdvSceneSwitcher.variableTab.lastUsed.text.never="Never"
|
|||||||
AdvSceneSwitcher.variableTab.lastChanged.header="Last changed"
|
AdvSceneSwitcher.variableTab.lastChanged.header="Last changed"
|
||||||
AdvSceneSwitcher.variableTab.lastChanged.text.none="No change since launch"
|
AdvSceneSwitcher.variableTab.lastChanged.text.none="No change since launch"
|
||||||
AdvSceneSwitcher.variableTab.lastChanged.tooltip="Times changed: %1\n\nPrevious value: %2"
|
AdvSceneSwitcher.variableTab.lastChanged.tooltip="Times changed: %1\n\nPrevious value: %2"
|
||||||
|
AdvSceneSwitcher.variableTab.search.placeholder="Search ..."
|
||||||
|
AdvSceneSwitcher.variableTab.search.all="All columns"
|
||||||
|
AdvSceneSwitcher.variableTab.search.name="Name column"
|
||||||
|
AdvSceneSwitcher.variableTab.search.value="Value column"
|
||||||
|
AdvSceneSwitcher.variableTab.addDock="Add dock"
|
||||||
|
AdvSceneSwitcher.variableTab.clear="Clear"
|
||||||
|
|
||||||
# Action Queue Tab
|
# Action Queue Tab
|
||||||
AdvSceneSwitcher.actionQueueTab.title="Action Queues"
|
AdvSceneSwitcher.actionQueueTab.title="Action Queues"
|
||||||
@@ -132,14 +141,26 @@ AdvSceneSwitcher.twitchConnectionTab.no="No"
|
|||||||
AdvSceneSwitcher.twitchConnectionTab.removeSingleConnectionPopup.text="Are you sure you want to remove \"%1\"?"
|
AdvSceneSwitcher.twitchConnectionTab.removeSingleConnectionPopup.text="Are you sure you want to remove \"%1\"?"
|
||||||
AdvSceneSwitcher.twitchConnectionTab.removeMultipleConnectionsPopup.text="Are you sure you want to remove %1 Twitch connections?"
|
AdvSceneSwitcher.twitchConnectionTab.removeMultipleConnectionsPopup.text="Are you sure you want to remove %1 Twitch connections?"
|
||||||
|
|
||||||
|
# MQTT Connections Tab
|
||||||
|
AdvSceneSwitcher.mqttConnectionTab.title="MQTT Connections"
|
||||||
|
AdvSceneSwitcher.mqttConnectionTab.help="MQTT connections can be used to communicate with other devices.\n\nClick on the highlighted plus symbol to add a new connection."
|
||||||
|
AdvSceneSwitcher.mqttConnectionTab.mqttonnectionAddButton.tooltip="Add new MQTT connection"
|
||||||
|
AdvSceneSwitcher.mqttConnectionTab.mqttConnectionRemoveButton.tooltip="Remove selected MQTT connections"
|
||||||
|
AdvSceneSwitcher.mqttConnectionTab.name.header="Name"
|
||||||
|
AdvSceneSwitcher.mqttConnectionTab.address.header="Address"
|
||||||
|
AdvSceneSwitcher.mqttConnectionTab.topics.header="Topic subscription count"
|
||||||
|
AdvSceneSwitcher.mqttConnectionTab.status.header="Status"
|
||||||
|
AdvSceneSwitcher.mqttConnectionTab.removeSingleConnectionPopup.text="Are you sure you want to remove \"%1\"?"
|
||||||
|
AdvSceneSwitcher.mqttConnectionTab.removeMultipleConnectionsPopup.text="Are you sure you want to remove %1 connections?"
|
||||||
|
|
||||||
# Macro Tab
|
# Macro Tab
|
||||||
AdvSceneSwitcher.macroTab.title="Macro"
|
AdvSceneSwitcher.macroTab.title="Macro"
|
||||||
AdvSceneSwitcher.macroTab.macros="Macros"
|
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.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.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.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.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.\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.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, which are executed if 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."
|
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."
|
||||||
AdvSceneSwitcher.macroTab.edit="Edit macro"
|
AdvSceneSwitcher.macroTab.edit="Edit macro"
|
||||||
AdvSceneSwitcher.macroTab.edit.logic="Logic type:"
|
AdvSceneSwitcher.macroTab.edit.logic="Logic type:"
|
||||||
AdvSceneSwitcher.macroTab.edit.condition="Condition type:"
|
AdvSceneSwitcher.macroTab.edit.condition="Condition type:"
|
||||||
@@ -164,6 +185,8 @@ AdvSceneSwitcher.macroTab.contextMenuAdd="Add"
|
|||||||
AdvSceneSwitcher.macroTab.copy="Duplicate Macro"
|
AdvSceneSwitcher.macroTab.copy="Duplicate Macro"
|
||||||
AdvSceneSwitcher.macroTab.group="Group Selected Macros"
|
AdvSceneSwitcher.macroTab.group="Group Selected Macros"
|
||||||
AdvSceneSwitcher.macroTab.ungroup="Ungroup Selected Groups"
|
AdvSceneSwitcher.macroTab.ungroup="Ungroup Selected Groups"
|
||||||
|
AdvSceneSwitcher.macroTab.expandAllGroups="Expand all Groups"
|
||||||
|
AdvSceneSwitcher.macroTab.collapseAllGroups="Collapse all Groups"
|
||||||
AdvSceneSwitcher.macroTab.rename="Rename"
|
AdvSceneSwitcher.macroTab.rename="Rename"
|
||||||
AdvSceneSwitcher.macroTab.remove="Remove"
|
AdvSceneSwitcher.macroTab.remove="Remove"
|
||||||
AdvSceneSwitcher.macroTab.export="Export"
|
AdvSceneSwitcher.macroTab.export="Export"
|
||||||
@@ -199,8 +222,11 @@ AdvSceneSwitcher.macroTab.highlightTrueConditions="Highlight conditions of curre
|
|||||||
AdvSceneSwitcher.macroTab.highlightPerformedActions="Highlight recently performed actions of currently selected macro"
|
AdvSceneSwitcher.macroTab.highlightPerformedActions="Highlight recently performed actions of currently selected macro"
|
||||||
AdvSceneSwitcher.macroTab.newMacroRegisterHotkey="Register hotkeys to control the pause state of new macros"
|
AdvSceneSwitcher.macroTab.newMacroRegisterHotkey="Register hotkeys to control the pause state of new macros"
|
||||||
AdvSceneSwitcher.macroTab.newMacroUseShortCircuitEvaluation="Enable short circuit evaluation of macro conditions for new macros"
|
AdvSceneSwitcher.macroTab.newMacroUseShortCircuitEvaluation="Enable short circuit evaluation of macro conditions for new macros"
|
||||||
AdvSceneSwitcher.macroTab.saveSettingsOnMacroChange="Save settings when selecting a new macro"
|
AdvSceneSwitcher.macroTab.newMacroCheckInParallel="Evaluate conditions of new macros in parallel to other macros"
|
||||||
|
AdvSceneSwitcher.macroTab.checkInParallel.tooltip="If this option is not enabled, this macro's conditions will be evaluated after the preceeding macro's condition check has completed.\nSo, if there are three macros - Macro A, Macro B, and Macro C - in the macro list the order the conditions in are evaluated is:\n • Macro A's conditions\n • Macro B's conditions\n • Macro C's conditions\nIf this option is enabled, the order might differ.\nEnabling this option can be useful for scenarios in which you have multiple long running condition checks, which you don't want to result in \"blocking\" other macros."
|
||||||
|
AdvSceneSwitcher.macroTab.saveSettingsOnMacroChange="Save settings when switching between macros"
|
||||||
AdvSceneSwitcher.macroTab.saveSettingsOnMacroChange.tooltip="Saving the settings can be an expensive operation if you are working with a very large scene collection.\nIn this case, it might make sense to disable this option."
|
AdvSceneSwitcher.macroTab.saveSettingsOnMacroChange.tooltip="Saving the settings can be an expensive operation if you are working with a very large scene collection.\nIn this case, it might make sense to disable this option."
|
||||||
|
AdvSceneSwitcher.macroTab.currentCheckInParallel="Evaluate conditions of selected macro in parallel to other macros (Experimental)"
|
||||||
AdvSceneSwitcher.macroTab.currentRegisterHotkeys="Register hotkeys to control the pause state of selected macro"
|
AdvSceneSwitcher.macroTab.currentRegisterHotkeys="Register hotkeys to control the pause state of selected macro"
|
||||||
AdvSceneSwitcher.macroTab.currentUseShortCircuitEvaluation="Enable short circuit evaluation of macro conditions for currently selected macro"
|
AdvSceneSwitcher.macroTab.currentUseShortCircuitEvaluation="Enable short circuit evaluation of macro conditions for currently selected macro"
|
||||||
AdvSceneSwitcher.macroTab.shortCircuit.tooltip="Enabling short circuit evaluation might improve the performance, as some condition checks are skipped, if the overall macro cannot be evaluated to \"true\" anymore.\nHowever, please note that condition checks, which are skipped over, will also not update their duration modifier checks."
|
AdvSceneSwitcher.macroTab.shortCircuit.tooltip="Enabling short circuit evaluation might improve the performance, as some condition checks are skipped, if the overall macro cannot be evaluated to \"true\" anymore.\nHowever, please note that condition checks, which are skipped over, will also not update their duration modifier checks."
|
||||||
@@ -213,6 +239,8 @@ AdvSceneSwitcher.macroTab.pauseStateSaveBehavior.persist="The state the macro wa
|
|||||||
AdvSceneSwitcher.macroTab.pauseStateSaveBehavior.pause="Paused"
|
AdvSceneSwitcher.macroTab.pauseStateSaveBehavior.pause="Paused"
|
||||||
AdvSceneSwitcher.macroTab.pauseStateSaveBehavior.unpause="Unpaused"
|
AdvSceneSwitcher.macroTab.pauseStateSaveBehavior.unpause="Unpaused"
|
||||||
AdvSceneSwitcher.macroTab.currentRegisterDock="Register dock widget to control the pause state of selected macro or run it manually"
|
AdvSceneSwitcher.macroTab.currentRegisterDock="Register dock widget to control the pause state of selected macro or run it manually"
|
||||||
|
AdvSceneSwitcher.macroTab.currentIsStandaloneDock="Is standalone dock"
|
||||||
|
AdvSceneSwitcher.macroTab.currentDockWindowName="Add to macro dock with name:"
|
||||||
AdvSceneSwitcher.macroTab.currentDockAddRunButton="Add button to run the macro"
|
AdvSceneSwitcher.macroTab.currentDockAddRunButton="Add button to run the macro"
|
||||||
AdvSceneSwitcher.macroTab.currentDockAddPauseButton="Add button to pause or unpause the macro"
|
AdvSceneSwitcher.macroTab.currentDockAddPauseButton="Add button to pause or unpause the macro"
|
||||||
AdvSceneSwitcher.macroTab.currentDockAddStatusLabel="Add status label"
|
AdvSceneSwitcher.macroTab.currentDockAddStatusLabel="Add status label"
|
||||||
@@ -249,6 +277,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.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.elseActionBottomButton="Move selected action to the bottom in the else section"
|
||||||
AdvSceneSwitcher.macroTab.tooltip.openMacroSettingsButton="Open macro settings"
|
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.pause="Pause"
|
||||||
AdvSceneSwitcher.macroDock.unpause="Unpause"
|
AdvSceneSwitcher.macroDock.unpause="Unpause"
|
||||||
@@ -305,10 +340,11 @@ AdvSceneSwitcher.condition.scene.type.previousPattern="Previous scene matches"
|
|||||||
AdvSceneSwitcher.condition.scene.type.previewPattern="Preview scene matches"
|
AdvSceneSwitcher.condition.scene.type.previewPattern="Preview scene matches"
|
||||||
AdvSceneSwitcher.condition.scene.currentSceneTransitionBehaviour="During transition check for transition target scene"
|
AdvSceneSwitcher.condition.scene.currentSceneTransitionBehaviour="During transition check for transition target scene"
|
||||||
AdvSceneSwitcher.condition.scene.previousSceneTransitionBehaviour="During transition check for transition source scene"
|
AdvSceneSwitcher.condition.scene.previousSceneTransitionBehaviour="During transition check for transition source scene"
|
||||||
|
AdvSceneSwitcher.condition.scene.canvasNotSupported="This check is not supported for the currently selected canvas \"%1\""
|
||||||
AdvSceneSwitcher.condition.scene.entry.line1="{{sceneType}}{{scenes}}{{pattern}}{{regex}}"
|
AdvSceneSwitcher.condition.scene.entry.line1="{{sceneType}}{{scenes}}{{pattern}}{{regex}}"
|
||||||
AdvSceneSwitcher.condition.scene.entry.line2="{{useTransitionTargetScene}}"
|
AdvSceneSwitcher.condition.scene.entry.line2="{{useTransitionTargetScene}}"
|
||||||
AdvSceneSwitcher.condition.window="Window"
|
AdvSceneSwitcher.condition.window="Window"
|
||||||
AdvSceneSwitcher.condition.window.entry.window="{{checkTitle}}Window title matches{{windowRegex}}{{windows}}"
|
AdvSceneSwitcher.condition.window.entry.window="{{checkTitle}}Window title matches{{windows}}{{windowRegex}}"
|
||||||
AdvSceneSwitcher.condition.window.entry.fullscreen="{{fullscreen}}Window is fullscreen"
|
AdvSceneSwitcher.condition.window.entry.fullscreen="{{fullscreen}}Window is fullscreen"
|
||||||
AdvSceneSwitcher.condition.window.entry.maximized="{{maximized}}Window is maximized"
|
AdvSceneSwitcher.condition.window.entry.maximized="{{maximized}}Window is maximized"
|
||||||
AdvSceneSwitcher.condition.window.entry.focused="{{focused}}Window is focused"
|
AdvSceneSwitcher.condition.window.entry.focused="{{focused}}Window is focused"
|
||||||
@@ -320,6 +356,9 @@ AdvSceneSwitcher.condition.file="File"
|
|||||||
AdvSceneSwitcher.condition.file.type.match="matches"
|
AdvSceneSwitcher.condition.file.type.match="matches"
|
||||||
AdvSceneSwitcher.condition.file.type.contentChange="content changed"
|
AdvSceneSwitcher.condition.file.type.contentChange="content changed"
|
||||||
AdvSceneSwitcher.condition.file.type.dateChange="modification date changed"
|
AdvSceneSwitcher.condition.file.type.dateChange="modification date changed"
|
||||||
|
AdvSceneSwitcher.condition.file.type.exists="exists"
|
||||||
|
AdvSceneSwitcher.condition.file.type.isFile="is a file"
|
||||||
|
AdvSceneSwitcher.condition.file.type.isFolder="is a folder"
|
||||||
AdvSceneSwitcher.condition.file.remote="Remote file"
|
AdvSceneSwitcher.condition.file.remote="Remote file"
|
||||||
AdvSceneSwitcher.condition.file.local="Local file"
|
AdvSceneSwitcher.condition.file.local="Local file"
|
||||||
AdvSceneSwitcher.condition.file.entry.line1="{{fileType}}{{filePath}}{{conditions}}{{useRegex}}"
|
AdvSceneSwitcher.condition.file.entry.line1="{{fileType}}{{filePath}}{{conditions}}{{useRegex}}"
|
||||||
@@ -377,6 +416,13 @@ AdvSceneSwitcher.condition.video.patternMatchSuccessFullImage="Full image matche
|
|||||||
AdvSceneSwitcher.condition.video.objectMatchFail="Object was not found!"
|
AdvSceneSwitcher.condition.video.objectMatchFail="Object was not found!"
|
||||||
AdvSceneSwitcher.condition.video.objectMatchSuccess="Object is highlighted in red"
|
AdvSceneSwitcher.condition.video.objectMatchSuccess="Object is highlighted in red"
|
||||||
AdvSceneSwitcher.condition.video.ocrMatchSuccess="Detected text:\n\n%1"
|
AdvSceneSwitcher.condition.video.ocrMatchSuccess="Detected text:\n\n%1"
|
||||||
|
AdvSceneSwitcher.condition.video.ocrMatchFail="Could not detect any text!"
|
||||||
|
AdvSceneSwitcher.condition.video.ocrUseConfigFile="Use custom tesseract config file"
|
||||||
|
AdvSceneSwitcher.condition.video.ocrOpenConfigFile="Open"
|
||||||
|
AdvSceneSwitcher.condition.video.ocrOpenConfig.createFailed="Could not create the config file!"
|
||||||
|
AdvSceneSwitcher.condition.video.ocrOpenConfig.openFailed="Could not open the config file!"
|
||||||
|
AdvSceneSwitcher.condition.video.ocrConfigReload="Reload configuration file"
|
||||||
|
AdvSceneSwitcher.condition.video.ocrConfigHint="Tesseract config files consist of lines with parameter-value pairs (space separated).\nFor example:\n\ntessedit_char_blacklist\t\t\t\t\"abc\"\nlanguage_model_penalty_non_dict_word\t0"
|
||||||
AdvSceneSwitcher.condition.video.modelLoadFail="Model data could not be loaded!"
|
AdvSceneSwitcher.condition.video.modelLoadFail="Model data could not be loaded!"
|
||||||
AdvSceneSwitcher.condition.video.selectColor="Select Color"
|
AdvSceneSwitcher.condition.video.selectColor="Select Color"
|
||||||
AdvSceneSwitcher.condition.video.ocrMode.singleColumn="Single column of text of variable sizes"
|
AdvSceneSwitcher.condition.video.ocrMode.singleColumn="Single column of text of variable sizes"
|
||||||
@@ -396,16 +442,18 @@ AdvSceneSwitcher.condition.video.colorDeviationThresholdDescription="How similar
|
|||||||
AdvSceneSwitcher.condition.video.type.main="OBS's main output"
|
AdvSceneSwitcher.condition.video.type.main="OBS's main output"
|
||||||
AdvSceneSwitcher.condition.video.type.source="Source"
|
AdvSceneSwitcher.condition.video.type.source="Source"
|
||||||
AdvSceneSwitcher.condition.video.type.scene="Scene"
|
AdvSceneSwitcher.condition.video.type.scene="Scene"
|
||||||
AdvSceneSwitcher.condition.video.entry="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
AdvSceneSwitcher.condition.video.layout="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.modelPath="Model data (haar cascade classifier):{{modelDataPath}}"
|
AdvSceneSwitcher.condition.video.layout.modelPath="Model data (haar cascade classifier):{{modelDataPath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.minNeighbor="Minimum neighbors:{{minNeighbors}}"
|
AdvSceneSwitcher.condition.video.layout.minNeighbor="Minimum neighbors:{{minNeighbors}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.throttle="{{throttleEnable}}Reduce CPU load by performing check only every{{throttleCount}}milliseconds"
|
AdvSceneSwitcher.condition.video.layout.throttle="{{throttleEnable}}Reduce CPU load by performing check only every{{throttleCount}}milliseconds"
|
||||||
AdvSceneSwitcher.condition.video.entry.checkAreaEnable="Perform check only in area"
|
AdvSceneSwitcher.condition.video.layout.checkAreaEnable="Perform check only in area"
|
||||||
AdvSceneSwitcher.condition.video.entry.checkArea="{{checkAreaEnable}}{{checkArea}}{{selectArea}}"
|
AdvSceneSwitcher.condition.video.layout.checkArea="{{checkAreaEnable}}{{checkArea}}{{selectArea}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcColorPick="Check for text color:{{textColor}}{{selectColor}}"
|
AdvSceneSwitcher.condition.video.layout.ocrColorPick="Check for text color:{{textColor}}{{selectColor}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcTextType="Check for text type:{{textType}}"
|
AdvSceneSwitcher.condition.video.layout.ocrTextType="Check for text type:{{textType}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcLanguage="Check for language:{{languageCode}}"
|
AdvSceneSwitcher.condition.video.layout.ocrBaseDir="Tesseract base directory:{{tesseractBaseDir}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.color="Check for color:{{color}}{{selectColor}}"
|
AdvSceneSwitcher.condition.video.layout.ocrLanguage="Check for language:{{languageCode}}"
|
||||||
|
AdvSceneSwitcher.condition.video.layout.ocrConfig="Config file:{{configFile}}{{openConfigFile}}{{reloadConfig}}{{configFileHint}}"
|
||||||
|
AdvSceneSwitcher.condition.video.layout.color="Check for color:{{color}}{{selectColor}}"
|
||||||
AdvSceneSwitcher.condition.video.minSize="Minimum size:"
|
AdvSceneSwitcher.condition.video.minSize="Minimum size:"
|
||||||
AdvSceneSwitcher.condition.video.maxSize="Maximum size:"
|
AdvSceneSwitcher.condition.video.maxSize="Maximum size:"
|
||||||
AdvSceneSwitcher.condition.video.selectArea="Select area"
|
AdvSceneSwitcher.condition.video.selectArea="Select area"
|
||||||
@@ -460,6 +508,7 @@ AdvSceneSwitcher.condition.macro.type.multiState="Multiple macro condition state
|
|||||||
AdvSceneSwitcher.condition.macro.type.actionDisabled="Macro action disabled"
|
AdvSceneSwitcher.condition.macro.type.actionDisabled="Macro action disabled"
|
||||||
AdvSceneSwitcher.condition.macro.type.actionEnabled="Macro action enabled"
|
AdvSceneSwitcher.condition.macro.type.actionEnabled="Macro action enabled"
|
||||||
AdvSceneSwitcher.condition.macro.type.paused="Macro is paused"
|
AdvSceneSwitcher.condition.macro.type.paused="Macro is paused"
|
||||||
|
AdvSceneSwitcher.condition.macro.type.actionsPerformed="Macro actions were executed"
|
||||||
AdvSceneSwitcher.condition.macro.type.selection="{{types}}"
|
AdvSceneSwitcher.condition.macro.type.selection="{{types}}"
|
||||||
AdvSceneSwitcher.condition.macro.count.type.below="Less than"
|
AdvSceneSwitcher.condition.macro.count.type.below="Less than"
|
||||||
AdvSceneSwitcher.condition.macro.count.type.above="More than"
|
AdvSceneSwitcher.condition.macro.count.type.above="More than"
|
||||||
@@ -476,12 +525,14 @@ AdvSceneSwitcher.condition.macro.count.entry.line2="Current count:{{currentCount
|
|||||||
AdvSceneSwitcher.condition.macro.actionState.disabled.entry="Action{{actionIndex}}of{{macros}}is disabled"
|
AdvSceneSwitcher.condition.macro.actionState.disabled.entry="Action{{actionIndex}}of{{macros}}is disabled"
|
||||||
AdvSceneSwitcher.condition.macro.actionState.enabled.entry="Action{{actionIndex}}of{{macros}}is enabled"
|
AdvSceneSwitcher.condition.macro.actionState.enabled.entry="Action{{actionIndex}}of{{macros}}is enabled"
|
||||||
AdvSceneSwitcher.condition.macro.paused.entry="Macro{{macros}}is paused"
|
AdvSceneSwitcher.condition.macro.paused.entry="Macro{{macros}}is paused"
|
||||||
|
AdvSceneSwitcher.condition.macro.actionsPerformed.entry="The actions of macro{{macros}}were performed"
|
||||||
AdvSceneSwitcher.condition.source="Source"
|
AdvSceneSwitcher.condition.source="Source"
|
||||||
AdvSceneSwitcher.condition.source.type.active="Is active"
|
AdvSceneSwitcher.condition.source.type.active="Is active"
|
||||||
AdvSceneSwitcher.condition.source.type.showing="Is showing"
|
AdvSceneSwitcher.condition.source.type.showing="Is showing"
|
||||||
AdvSceneSwitcher.condition.source.type.settingsMatch="Settings match"
|
AdvSceneSwitcher.condition.source.type.settingsMatch="Settings match"
|
||||||
AdvSceneSwitcher.condition.source.type.settingsChanged="Settings changed"
|
AdvSceneSwitcher.condition.source.type.settingsChanged="Settings changed"
|
||||||
AdvSceneSwitcher.condition.source.type.individualSettingMatches="Setting value matches"
|
AdvSceneSwitcher.condition.source.type.individualSettingMatches="Setting value matches"
|
||||||
|
AdvSceneSwitcher.condition.source.type.individualSettingListSelectionMatches="Settings value list selection matches"
|
||||||
AdvSceneSwitcher.condition.source.type.individualSettingChanged="Setting value changed"
|
AdvSceneSwitcher.condition.source.type.individualSettingChanged="Setting value changed"
|
||||||
AdvSceneSwitcher.condition.source.type.width="Width"
|
AdvSceneSwitcher.condition.source.type.width="Width"
|
||||||
AdvSceneSwitcher.condition.source.type.height="Height"
|
AdvSceneSwitcher.condition.source.type.height="Height"
|
||||||
@@ -490,6 +541,7 @@ AdvSceneSwitcher.condition.source.sizeCompare.equal="Equals"
|
|||||||
AdvSceneSwitcher.condition.source.sizeCompare.more="Bigger than"
|
AdvSceneSwitcher.condition.source.sizeCompare.more="Bigger than"
|
||||||
AdvSceneSwitcher.condition.source.refresh="Refresh"
|
AdvSceneSwitcher.condition.source.refresh="Refresh"
|
||||||
AdvSceneSwitcher.condition.source.refresh.tooltip="Repopulate the source settings selection with the settings of the source which's name matches the variable value."
|
AdvSceneSwitcher.condition.source.refresh.tooltip="Repopulate the source settings selection with the settings of the source which's name matches the variable value."
|
||||||
|
AdvSceneSwitcher.condition.source.includeDefaults="Include default settings values"
|
||||||
AdvSceneSwitcher.condition.source.sceneVisibilityHint="Scene specific visibility can be checked using the \"Scene item visibility\" condition"
|
AdvSceneSwitcher.condition.source.sceneVisibilityHint="Scene specific visibility can be checked using the \"Scene item visibility\" condition"
|
||||||
AdvSceneSwitcher.condition.source.getSettings="Get current settings"
|
AdvSceneSwitcher.condition.source.getSettings="Get current settings"
|
||||||
AdvSceneSwitcher.condition.source.entry.line1="{{sources}}{{conditions}}{{settingSelection}}{{refresh}}{{sizeCompareMethods}}{{size}}"
|
AdvSceneSwitcher.condition.source.entry.line1="{{sources}}{{conditions}}{{settingSelection}}{{refresh}}{{sizeCompareMethods}}{{size}}"
|
||||||
@@ -505,9 +557,11 @@ AdvSceneSwitcher.condition.filter.type.showing="Is disabled"
|
|||||||
AdvSceneSwitcher.condition.filter.type.settingsMatch="Settings match"
|
AdvSceneSwitcher.condition.filter.type.settingsMatch="Settings match"
|
||||||
AdvSceneSwitcher.condition.filter.type.settingsChanged="Settings changed"
|
AdvSceneSwitcher.condition.filter.type.settingsChanged="Settings changed"
|
||||||
AdvSceneSwitcher.condition.filter.type.individualSettingMatches="Settings value matches"
|
AdvSceneSwitcher.condition.filter.type.individualSettingMatches="Settings value matches"
|
||||||
|
AdvSceneSwitcher.condition.filter.type.individualSettingListSelectionMatches="Settings value list selection matches"
|
||||||
AdvSceneSwitcher.condition.filter.type.individualSettingChanged="Settings value changed"
|
AdvSceneSwitcher.condition.filter.type.individualSettingChanged="Settings value changed"
|
||||||
AdvSceneSwitcher.condition.filter.refresh="Refresh"
|
AdvSceneSwitcher.condition.filter.refresh="Refresh"
|
||||||
AdvSceneSwitcher.condition.filter.refresh.tooltip="Repopulate the filter settings selection with the settings of the filter which's name matches the variable value."
|
AdvSceneSwitcher.condition.filter.refresh.tooltip="Repopulate the filter settings selection with the settings of the filter which's name matches the variable value."
|
||||||
|
AdvSceneSwitcher.condition.filter.includeDefaults="Include default settings values"
|
||||||
AdvSceneSwitcher.condition.filter.getSettings="Get current settings"
|
AdvSceneSwitcher.condition.filter.getSettings="Get current settings"
|
||||||
AdvSceneSwitcher.condition.filter.entry.line1="On{{sources}}{{filters}}{{conditions}}{{settingSelection}}{{refresh}}"
|
AdvSceneSwitcher.condition.filter.entry.line1="On{{sources}}{{filters}}{{conditions}}{{settingSelection}}{{refresh}}"
|
||||||
AdvSceneSwitcher.condition.filter.entry.line2="{{settings}}"
|
AdvSceneSwitcher.condition.filter.entry.line2="{{settings}}"
|
||||||
@@ -668,6 +722,7 @@ AdvSceneSwitcher.condition.twitch.type.event.channel.raid.outbound="Raided someo
|
|||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.raid.inbound="Raid to your channel occured"
|
AdvSceneSwitcher.condition.twitch.type.event.channel.raid.inbound="Raid to your channel occured"
|
||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.shoutout.outbound="Shoutout to someone's channel given"
|
AdvSceneSwitcher.condition.twitch.type.event.channel.shoutout.outbound="Shoutout to someone's channel given"
|
||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.shoutout.inbound="Shoutout to your channel received"
|
AdvSceneSwitcher.condition.twitch.type.event.channel.shoutout.inbound="Shoutout to your channel received"
|
||||||
|
AdvSceneSwitcher.condition.twitch.type.event.channel.commercial.start="Commercial break started"
|
||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.poll.start="Poll started"
|
AdvSceneSwitcher.condition.twitch.type.event.channel.poll.start="Poll started"
|
||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.poll.progress="Poll votes changed (progress)"
|
AdvSceneSwitcher.condition.twitch.type.event.channel.poll.progress="Poll votes changed (progress)"
|
||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.poll.end="Poll ended"
|
AdvSceneSwitcher.condition.twitch.type.event.channel.poll.end="Poll ended"
|
||||||
@@ -705,6 +760,8 @@ AdvSceneSwitcher.condition.twitch.type.polling.channel.live="Stream is currently
|
|||||||
AdvSceneSwitcher.condition.twitch.type.polling.channel.title="Current title matches"
|
AdvSceneSwitcher.condition.twitch.type.polling.channel.title="Current title matches"
|
||||||
AdvSceneSwitcher.condition.twitch.type.polling.channel.category="Current category is"
|
AdvSceneSwitcher.condition.twitch.type.polling.channel.category="Current category is"
|
||||||
AdvSceneSwitcher.condition.twitch.type.chat.message="Chat message received"
|
AdvSceneSwitcher.condition.twitch.type.chat.message="Chat message received"
|
||||||
|
AdvSceneSwitcher.condition.twitch.type.chat.messageRemoved="Single chat message removed"
|
||||||
|
AdvSceneSwitcher.condition.twitch.type.chat.cleared="All messages of user or channel cleared"
|
||||||
AdvSceneSwitcher.condition.twitch.type.chat.properties="Chat message properties:"
|
AdvSceneSwitcher.condition.twitch.type.chat.properties="Chat message properties:"
|
||||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.select="Select chat message property:"
|
AdvSceneSwitcher.condition.twitch.type.chat.properties.select="Select chat message property:"
|
||||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.firstMessage="Is first message"
|
AdvSceneSwitcher.condition.twitch.type.chat.properties.firstMessage="Is first message"
|
||||||
@@ -771,19 +828,31 @@ AdvSceneSwitcher.condition.streamDeck.stopListen="Stop listening"
|
|||||||
AdvSceneSwitcher.condition.streamDeck.pluginDownload="<html><head/><body><p>The Stream Deck plugin can be found <a href=\"https://github.com/WarmUpTill/advanced-scene-switcher-streamdeck-plugin/releases\"><span style=\" text-decoration: underline; color:#268bd2;\">here on GitHub</span></a>.</p></body></html>"
|
AdvSceneSwitcher.condition.streamDeck.pluginDownload="<html><head/><body><p>The Stream Deck plugin can be found <a href=\"https://github.com/WarmUpTill/advanced-scene-switcher-streamdeck-plugin/releases\"><span style=\" text-decoration: underline; color:#268bd2;\">here on GitHub</span></a>.</p></body></html>"
|
||||||
AdvSceneSwitcher.condition.gameCapture="Game capture"
|
AdvSceneSwitcher.condition.gameCapture="Game capture"
|
||||||
AdvSceneSwitcher.condition.gameCapture.entry="{{sources}}hooked a game."
|
AdvSceneSwitcher.condition.gameCapture.entry="{{sources}}hooked a game."
|
||||||
|
|
||||||
AdvSceneSwitcher.condition.screenshot="Screenshot"
|
AdvSceneSwitcher.condition.screenshot="Screenshot"
|
||||||
AdvSceneSwitcher.condition.screenshot.entry="A screenshot was taken"
|
AdvSceneSwitcher.condition.screenshot.entry="A screenshot was taken"
|
||||||
|
AdvSceneSwitcher.condition.mqtt="MQTT"
|
||||||
|
AdvSceneSwitcher.condition.mqtt.layout.match="Message was received from{{connection}} which matches{{regex}}:"
|
||||||
|
AdvSceneSwitcher.condition.mqtt.layout.listen="Set message selection to incoming message:{{listenButton}}"
|
||||||
|
AdvSceneSwitcher.condition.script="Script"
|
||||||
|
|
||||||
# Macro Actions
|
# Macro Actions
|
||||||
AdvSceneSwitcher.action.unknown="Unknown action"
|
AdvSceneSwitcher.action.unknown="Unknown action"
|
||||||
AdvSceneSwitcher.action.scene="Switch scene"
|
AdvSceneSwitcher.action.scene="Switch scene"
|
||||||
|
AdvSceneSwitcher.action.scene.action.fixed="Scene with name"
|
||||||
|
AdvSceneSwitcher.action.scene.action.sceneListNext="Next scene in scene list"
|
||||||
|
AdvSceneSwitcher.action.scene.action.sceneListPrevious="Previous scene in scene list"
|
||||||
|
AdvSceneSwitcher.action.scene.action.sceneListIndex="Scene in scene list at position"
|
||||||
AdvSceneSwitcher.action.scene.type.program="Program"
|
AdvSceneSwitcher.action.scene.type.program="Program"
|
||||||
AdvSceneSwitcher.action.scene.type.preview="Preview"
|
AdvSceneSwitcher.action.scene.type.preview="Preview"
|
||||||
AdvSceneSwitcher.action.scene.entry="Switch{{sceneTypes}}scene to{{scenes}}using{{transitions}}with a duration of{{duration}}seconds"
|
AdvSceneSwitcher.action.scene.layout.action.fixed="Switch{{sceneTypes}}to{{actions}}{{scenes}}"
|
||||||
AdvSceneSwitcher.action.scene.entry.noDuration="Switch{{sceneTypes}}scene to{{scenes}}using{{transitions}}"
|
AdvSceneSwitcher.action.scene.layout.action.list="Switch{{sceneTypes}}to{{actions}}on{{canvas}}"
|
||||||
AdvSceneSwitcher.action.scene.entry.preview="Switch{{sceneTypes}}scene to{{scenes}}"
|
AdvSceneSwitcher.action.scene.layout.action.list.noCanvasSelection="Switch{{sceneTypes}}to{{actions}}"
|
||||||
|
AdvSceneSwitcher.action.scene.layout.action.listIndex="Switch{{sceneTypes}}to{{actions}}{{index}}on{{canvas}}{{sceneNameAtIndex}}"
|
||||||
|
AdvSceneSwitcher.action.scene.layout.action.listIndex.noCanvasSelection="Switch{{sceneTypes}}to{{actions}}{{index}}{{sceneNameAtIndex}}"
|
||||||
|
AdvSceneSwitcher.action.scene.layout.transition="Use transition{{transitions}}"
|
||||||
|
AdvSceneSwitcher.action.scene.layout.transitionWithDuration="Use transition{{transitions}}with a duration of{{duration}}seconds"
|
||||||
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Wait until transition to target scene is complete"
|
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Wait until transition to target scene is complete"
|
||||||
|
AdvSceneSwitcher.action.scene.canvasNotSupported="Not supported by the currently selected canvas \"%1\""
|
||||||
AdvSceneSwitcher.action.wait="Wait"
|
AdvSceneSwitcher.action.wait="Wait"
|
||||||
AdvSceneSwitcher.action.wait.type.fixed="fixed"
|
AdvSceneSwitcher.action.wait.type.fixed="fixed"
|
||||||
AdvSceneSwitcher.action.wait.type.random="random"
|
AdvSceneSwitcher.action.wait.type.random="random"
|
||||||
@@ -792,6 +861,7 @@ AdvSceneSwitcher.action.wait.entry.random="Wait for{{waitType}}duration from{{du
|
|||||||
AdvSceneSwitcher.action.audio="Audio"
|
AdvSceneSwitcher.action.audio="Audio"
|
||||||
AdvSceneSwitcher.action.audio.type.mute="Mute"
|
AdvSceneSwitcher.action.audio.type.mute="Mute"
|
||||||
AdvSceneSwitcher.action.audio.type.unmute="Unmute"
|
AdvSceneSwitcher.action.audio.type.unmute="Unmute"
|
||||||
|
AdvSceneSwitcher.action.audio.type.toggleMute="Toggle mute"
|
||||||
AdvSceneSwitcher.action.audio.type.sourceVolume="Set source volume"
|
AdvSceneSwitcher.action.audio.type.sourceVolume="Set source volume"
|
||||||
AdvSceneSwitcher.action.audio.type.masterVolume="Set master volume"
|
AdvSceneSwitcher.action.audio.type.masterVolume="Set master volume"
|
||||||
AdvSceneSwitcher.action.audio.type.syncOffset="Set sync offset"
|
AdvSceneSwitcher.action.audio.type.syncOffset="Set sync offset"
|
||||||
@@ -857,6 +927,7 @@ AdvSceneSwitcher.action.filter.entry="On{{sources}}{{actions}}{{filters}}{{refre
|
|||||||
AdvSceneSwitcher.action.filter.entry.settings="{{settings}}{{settingsInputMethod}}{{settingValue}}{{tempVar}}"
|
AdvSceneSwitcher.action.filter.entry.settings="{{settings}}{{settingsInputMethod}}{{settingValue}}{{tempVar}}"
|
||||||
AdvSceneSwitcher.action.filter.getSettings="Get current settings"
|
AdvSceneSwitcher.action.filter.getSettings="Get current settings"
|
||||||
AdvSceneSwitcher.action.filter.inputMethod.individualManual="Set to fixed value"
|
AdvSceneSwitcher.action.filter.inputMethod.individualManual="Set to fixed value"
|
||||||
|
AdvSceneSwitcher.action.filter.inputMethod.individualListEntryManual="Set to list entry"
|
||||||
AdvSceneSwitcher.action.filter.inputMethod.individualTempvar="Set to macro property"
|
AdvSceneSwitcher.action.filter.inputMethod.individualTempvar="Set to macro property"
|
||||||
AdvSceneSwitcher.action.filter.inputMethod.json="Set setting JSON string"
|
AdvSceneSwitcher.action.filter.inputMethod.json="Set setting JSON string"
|
||||||
AdvSceneSwitcher.action.source="Source"
|
AdvSceneSwitcher.action.source="Source"
|
||||||
@@ -871,6 +942,9 @@ AdvSceneSwitcher.action.source.type.deinterlaceOrder="Set deinterlace field orde
|
|||||||
AdvSceneSwitcher.action.source.type.openInteractionDialog="Open interaction dialog"
|
AdvSceneSwitcher.action.source.type.openInteractionDialog="Open interaction dialog"
|
||||||
AdvSceneSwitcher.action.source.type.openFilterDialog="Open filter dialog"
|
AdvSceneSwitcher.action.source.type.openFilterDialog="Open filter dialog"
|
||||||
AdvSceneSwitcher.action.source.type.openPropertiesDialog="Open properties dialog"
|
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.entry="{{actions}}{{sources}}{{settingsButtons}}{{deinterlaceMode}}{{deinterlaceOrder}}{{refresh}}"
|
AdvSceneSwitcher.action.source.entry="{{actions}}{{sources}}{{settingsButtons}}{{deinterlaceMode}}{{deinterlaceOrder}}{{refresh}}"
|
||||||
AdvSceneSwitcher.action.source.entry.settings="{{settings}}{{settingsInputMethod}}{{settingValue}}{{tempVar}}"
|
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\""
|
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\""
|
||||||
@@ -887,10 +961,12 @@ AdvSceneSwitcher.action.source.deinterlaceMode.yadif2x="Yadif 2x"
|
|||||||
AdvSceneSwitcher.action.source.deinterlaceOrder.topFieldFirst="Top Field First"
|
AdvSceneSwitcher.action.source.deinterlaceOrder.topFieldFirst="Top Field First"
|
||||||
AdvSceneSwitcher.action.source.deinterlaceOrder.bottomFieldFirst="Bottom Field First"
|
AdvSceneSwitcher.action.source.deinterlaceOrder.bottomFieldFirst="Bottom Field First"
|
||||||
AdvSceneSwitcher.action.source.inputMethod.individualManual="Set to fixed value"
|
AdvSceneSwitcher.action.source.inputMethod.individualManual="Set to fixed value"
|
||||||
|
AdvSceneSwitcher.action.source.inputMethod.individualListEntryManual="Set to list entry"
|
||||||
AdvSceneSwitcher.action.source.inputMethod.individualTempvar="Set to macro property"
|
AdvSceneSwitcher.action.source.inputMethod.individualTempvar="Set to macro property"
|
||||||
AdvSceneSwitcher.action.source.inputMethod.json="Set setting JSON string"
|
AdvSceneSwitcher.action.source.inputMethod.json="Set setting JSON string"
|
||||||
AdvSceneSwitcher.action.source.refresh="Refresh"
|
AdvSceneSwitcher.action.source.refresh="Refresh"
|
||||||
AdvSceneSwitcher.action.source.refresh.tooltip="Repopulate the source settings selection with the settings of the source which's name matches the variable value."
|
AdvSceneSwitcher.action.source.refresh.tooltip="Repopulate the source settings selection with the settings of the source which's name matches the variable value."
|
||||||
|
AdvSceneSwitcher.action.source.dialog.accept="Accept changes"
|
||||||
AdvSceneSwitcher.action.media="Media"
|
AdvSceneSwitcher.action.media="Media"
|
||||||
AdvSceneSwitcher.action.media.type.play="Play"
|
AdvSceneSwitcher.action.media.type.play="Play"
|
||||||
AdvSceneSwitcher.action.media.type.pause="Pause"
|
AdvSceneSwitcher.action.media.type.pause="Pause"
|
||||||
@@ -908,6 +984,7 @@ AdvSceneSwitcher.action.media.seek.percentage.label="Percentage of total duratio
|
|||||||
AdvSceneSwitcher.action.macro="Macro"
|
AdvSceneSwitcher.action.macro="Macro"
|
||||||
AdvSceneSwitcher.action.macro.type.pause="Pause"
|
AdvSceneSwitcher.action.macro.type.pause="Pause"
|
||||||
AdvSceneSwitcher.action.macro.type.unpause="Unpause"
|
AdvSceneSwitcher.action.macro.type.unpause="Unpause"
|
||||||
|
AdvSceneSwitcher.action.macro.type.togglePause="Toggle pause"
|
||||||
AdvSceneSwitcher.action.macro.type.resetCounter="Reset counter"
|
AdvSceneSwitcher.action.macro.type.resetCounter="Reset counter"
|
||||||
AdvSceneSwitcher.action.macro.type.run="Run macro"
|
AdvSceneSwitcher.action.macro.type.run="Run macro"
|
||||||
AdvSceneSwitcher.action.macro.type.run.conditions.ignore="Do not consider condition state"
|
AdvSceneSwitcher.action.macro.type.run.conditions.ignore="Do not consider condition state"
|
||||||
@@ -924,9 +1001,17 @@ AdvSceneSwitcher.action.macro.type.stop="Stop actions"
|
|||||||
AdvSceneSwitcher.action.macro.type.disableAction="Disable action"
|
AdvSceneSwitcher.action.macro.type.disableAction="Disable action"
|
||||||
AdvSceneSwitcher.action.macro.type.enableAction="Enable action"
|
AdvSceneSwitcher.action.macro.type.enableAction="Enable action"
|
||||||
AdvSceneSwitcher.action.macro.type.toggleAction="Toggle action"
|
AdvSceneSwitcher.action.macro.type.toggleAction="Toggle action"
|
||||||
AdvSceneSwitcher.action.macro.entry.run="{{actions}}{{actionTypes}}of{{macros}}"
|
AdvSceneSwitcher.action.macro.type.nestedMacro="Nested macro"
|
||||||
AdvSceneSwitcher.action.macro.entry.run.condition="{{conditionBehaviors}}of{{conditionMacros}}"
|
AdvSceneSwitcher.action.macro.actionSelectionType.index="at index"
|
||||||
AdvSceneSwitcher.action.macro.entry.other="{{actions}}{{actionIndex}}{{macros}}"
|
AdvSceneSwitcher.action.macro.actionSelectionType.label="with label"
|
||||||
|
AdvSceneSwitcher.action.macro.actionSelectionType.id="of action type"
|
||||||
|
AdvSceneSwitcher.action.macro.type.nestedMacro.conditionHelp="This section allows you to define macro conditions.\n\nClick the plus button below to add a new condition."
|
||||||
|
AdvSceneSwitcher.action.macro.type.nestedMacro.actionHelp="This section allows you to define macro actions.\nThe actions in this section will be performed when the conditions are met.\n\nClick the plus button below to add a new action."
|
||||||
|
AdvSceneSwitcher.action.macro.type.nestedMacro.elseActionHelp="This section allows you to define macro actions.\nThe actions in this section will be performed when the conditions are *not* met.\n\nClick the plus button below to add a new action."
|
||||||
|
AdvSceneSwitcher.action.macro.layout.run="{{actions}}{{actionSections}}of{{macros}}"
|
||||||
|
AdvSceneSwitcher.action.macro.layout.run.condition="{{conditionBehaviors}}of{{conditionMacros}}"
|
||||||
|
AdvSceneSwitcher.action.macro.layout.actionState="{{actions}}{{actionSelectionType}}{{actionIndex}}{{label}}{{regex}}{{actionTypes}}in{{actionSections}}section of{{macros}}"
|
||||||
|
AdvSceneSwitcher.action.macro.layout.other="{{actions}}{{macros}}"
|
||||||
AdvSceneSwitcher.action.pluginState="Plugin state"
|
AdvSceneSwitcher.action.pluginState="Plugin state"
|
||||||
AdvSceneSwitcher.action.pluginState.type.stop="Stop the Advanced Scene Switcher plugin"
|
AdvSceneSwitcher.action.pluginState.type.stop="Stop the Advanced Scene Switcher plugin"
|
||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="Change the no-match behaviour:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="Change the no-match behaviour:"
|
||||||
@@ -934,7 +1019,11 @@ AdvSceneSwitcher.action.pluginState.type.import="Import settings from"
|
|||||||
AdvSceneSwitcher.action.pluginState.importWarning="Note: Action will be ignored while settings window is opened."
|
AdvSceneSwitcher.action.pluginState.importWarning="Note: Action will be ignored while settings window is opened."
|
||||||
AdvSceneSwitcher.action.pluginState.type.terminate="Shut down OBS"
|
AdvSceneSwitcher.action.pluginState.type.terminate="Shut down OBS"
|
||||||
AdvSceneSwitcher.action.pluginState.terminateConfirm="OBS will be shut down automatically in 10 seconds!\nDo you want to continue shutting down OBS?"
|
AdvSceneSwitcher.action.pluginState.terminateConfirm="OBS will be shut down automatically in 10 seconds!\nDo you want to continue shutting down OBS?"
|
||||||
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}{{settingsWarning}}"
|
AdvSceneSwitcher.action.pluginState.type.enableMacroHighlighting="Enable macro highlighting"
|
||||||
|
AdvSceneSwitcher.action.pluginState.type.disableMacroHighlighting="Disable macro highlighting"
|
||||||
|
AdvSceneSwitcher.action.pluginState.type.toggleMacroHighlighting="Toggle macro highlighting"
|
||||||
|
AdvSceneSwitcher.action.pluginState.confirmShutdown="Ask for shutdown confirmation"
|
||||||
|
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}"
|
||||||
AdvSceneSwitcher.action.virtualCamera="Virtual camera"
|
AdvSceneSwitcher.action.virtualCamera="Virtual camera"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.stop="Stop virtual camera"
|
AdvSceneSwitcher.action.virtualCamera.type.stop="Stop virtual camera"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.start="Start virtual camera"
|
AdvSceneSwitcher.action.virtualCamera.type.start="Start virtual camera"
|
||||||
@@ -1045,7 +1134,7 @@ AdvSceneSwitcher.action.websocket.api.genericWebsocket="Generic websocket messag
|
|||||||
AdvSceneSwitcher.action.websocket.type.request="Request"
|
AdvSceneSwitcher.action.websocket.type.request="Request"
|
||||||
AdvSceneSwitcher.action.websocket.type.event="Event"
|
AdvSceneSwitcher.action.websocket.type.event="Event"
|
||||||
AdvSceneSwitcher.action.websocket.settingsConflictGeneric="Possible settings conflict: Generic websocket message selection with connection which follows the OBS protocol!"
|
AdvSceneSwitcher.action.websocket.settingsConflictGeneric="Possible settings conflict: Generic websocket message selection with connection which follows the OBS protocol!"
|
||||||
AdvSceneSwitcher.action.websocket.settingsConflictOBS="Possible settings conflict: Connection selected which only supports generic websockte messages while message type requires OBS protocol!"
|
AdvSceneSwitcher.action.websocket.settingsConflictOBS="Possible settings conflict: Connection selected which only supports generic websocket messages while message type requires OBS protocol!"
|
||||||
AdvSceneSwitcher.action.websocket.entry.sceneSwitcher.request="Send{{api}}of type{{type}}via{{connection}}"
|
AdvSceneSwitcher.action.websocket.entry.sceneSwitcher.request="Send{{api}}of type{{type}}via{{connection}}"
|
||||||
AdvSceneSwitcher.action.websocket.entry.sceneSwitcher.event="Send{{api}}of type{{type}}to connected clients"
|
AdvSceneSwitcher.action.websocket.entry.sceneSwitcher.event="Send{{api}}of type{{type}}to connected clients"
|
||||||
AdvSceneSwitcher.action.websocket.entry.generic="Send{{api}}via{{connection}}"
|
AdvSceneSwitcher.action.websocket.entry.generic="Send{{api}}via{{connection}}"
|
||||||
@@ -1066,7 +1155,7 @@ AdvSceneSwitcher.action.http.type.post="POST"
|
|||||||
AdvSceneSwitcher.action.http.type.put="PUT"
|
AdvSceneSwitcher.action.http.type.put="PUT"
|
||||||
AdvSceneSwitcher.action.http.type.patch="PATCH"
|
AdvSceneSwitcher.action.http.type.patch="PATCH"
|
||||||
AdvSceneSwitcher.action.http.type.delete="DELETE"
|
AdvSceneSwitcher.action.http.type.delete="DELETE"
|
||||||
AdvSceneSwitcher.action.http.layout.method="Send{{method}}to URL{{url}}at path{{path}}"
|
AdvSceneSwitcher.action.http.layout.method="Send{{method}}to URL{{url}}"
|
||||||
AdvSceneSwitcher.action.http.layout.contentType="Content type:{{contentType}}"
|
AdvSceneSwitcher.action.http.layout.contentType="Content type:{{contentType}}"
|
||||||
AdvSceneSwitcher.action.http.layout.timeout="Timeout:{{timeout}}seconds"
|
AdvSceneSwitcher.action.http.layout.timeout="Timeout:{{timeout}}seconds"
|
||||||
AdvSceneSwitcher.action.http.entry.line1="Send{{method}}to{{url}}"
|
AdvSceneSwitcher.action.http.entry.line1="Send{{method}}to{{url}}"
|
||||||
@@ -1074,6 +1163,7 @@ AdvSceneSwitcher.action.http.entry.line2="Timeout:{{timeout}}seconds"
|
|||||||
AdvSceneSwitcher.action.variable="Variable"
|
AdvSceneSwitcher.action.variable="Variable"
|
||||||
AdvSceneSwitcher.action.variable.type.set="Set to value"
|
AdvSceneSwitcher.action.variable.type.set="Set to value"
|
||||||
AdvSceneSwitcher.action.variable.type.append="Append"
|
AdvSceneSwitcher.action.variable.type.append="Append"
|
||||||
|
AdvSceneSwitcher.action.variable.type.copy="Copy variable"
|
||||||
AdvSceneSwitcher.action.variable.type.appendVar="Append variable"
|
AdvSceneSwitcher.action.variable.type.appendVar="Append variable"
|
||||||
AdvSceneSwitcher.action.variable.type.increment="Increment"
|
AdvSceneSwitcher.action.variable.type.increment="Increment"
|
||||||
AdvSceneSwitcher.action.variable.type.decrement="Decrement"
|
AdvSceneSwitcher.action.variable.type.decrement="Decrement"
|
||||||
@@ -1087,7 +1177,10 @@ AdvSceneSwitcher.action.variable.type.askForValue="Get user input"
|
|||||||
AdvSceneSwitcher.action.variable.type.environmentVariable="Set to environment variable value"
|
AdvSceneSwitcher.action.variable.type.environmentVariable="Set to environment variable value"
|
||||||
AdvSceneSwitcher.action.variable.type.sceneItemCount="Set to scene item count of scene"
|
AdvSceneSwitcher.action.variable.type.sceneItemCount="Set to scene item count of scene"
|
||||||
AdvSceneSwitcher.action.variable.type.stringLength="Set to length of string"
|
AdvSceneSwitcher.action.variable.type.stringLength="Set to length of string"
|
||||||
AdvSceneSwitcher.action.variable.type.extractJson="Extract json field with name"
|
AdvSceneSwitcher.action.variable.type.extractJsonField="Extract JSON field with name"
|
||||||
|
AdvSceneSwitcher.action.variable.type.queryJson="Query JSON"
|
||||||
|
AdvSceneSwitcher.action.variable.type.queryJson.info="You can use \"JSONPath\" (RFC 9535) syntax here.\nSo, for example:\n\n • $['books'][0]['category']\n • $.books[0].category\n\nIf the query or the JSON should be invalid, the variable value will not be changed.\nIf the input is valid, the result of the query will always be a JSON array."
|
||||||
|
AdvSceneSwitcher.action.variable.type.accessJsonArray="Access JSON array at index"
|
||||||
AdvSceneSwitcher.action.variable.type.setToTempvar="Set to macro property"
|
AdvSceneSwitcher.action.variable.type.setToTempvar="Set to macro property"
|
||||||
AdvSceneSwitcher.action.variable.type.setToTempvar.help="This action type will allow you to extract values out of segments of the current macro and assign those values to the selected variable.\nFor example, you can get the current scene name from a scene condition and assign this name to a variable."
|
AdvSceneSwitcher.action.variable.type.setToTempvar.help="This action type will allow you to extract values out of segments of the current macro and assign those values to the selected variable.\nFor example, you can get the current scene name from a scene condition and assign this name to a variable."
|
||||||
AdvSceneSwitcher.action.variable.type.sceneItemName="Set to scene item name at index"
|
AdvSceneSwitcher.action.variable.type.sceneItemName="Set to scene item name at index"
|
||||||
@@ -1116,15 +1209,15 @@ AdvSceneSwitcher.action.variable.invalidSelection="Invalid selection!"
|
|||||||
AdvSceneSwitcher.action.variable.actionNoVariableSupport="Getting variable values from %1 actions is not supported!"
|
AdvSceneSwitcher.action.variable.actionNoVariableSupport="Getting variable values from %1 actions is not supported!"
|
||||||
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="Getting variable values from %1 conditions is not supported!"
|
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="Getting variable values from %1 conditions is not supported!"
|
||||||
AdvSceneSwitcher.action.variable.currentSegmentValue="Current value:"
|
AdvSceneSwitcher.action.variable.currentSegmentValue="Current value:"
|
||||||
AdvSceneSwitcher.action.variable.entry.other="{{actions}}{{variables}}{{variables2}}{{strValue}}{{numValue}}{{segmentIndex}}{{mathExpression}}{{envVariableName}}{{scenes}}{{tempVars}}{{tempVarsHelp}}{{sceneItemIndex}}{{direction}}{{stringLength}}{{paddingCharSelection}}{{caseType}}"
|
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.entry.pad="{{actions}}of{{variables}}to length{{stringLength}}by adding{{paddingCharSelection}}to the{{direction}}"
|
AdvSceneSwitcher.action.variable.layout.pad="{{actions}}of{{variables}}to length{{stringLength}}by adding{{paddingCharSelection}}to the{{direction}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.truncate="{{actions}}of{{variables}}to length{{stringLength}}by removing characters from the{{direction}}"
|
AdvSceneSwitcher.action.variable.layout.truncate="{{actions}}of{{variables}}to length{{stringLength}}by removing characters from the{{direction}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.substringIndex="Substring start:{{subStringStart}}Substring size:{{subStringSize}}"
|
AdvSceneSwitcher.action.variable.layout.substringIndex="Substring start:{{subStringStart}}Substring size:{{subStringSize}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.substringRegex="Assign value of{{regexMatchIdx}}match using regular expression:"
|
AdvSceneSwitcher.action.variable.layout.substringRegex="Assign value of{{regexMatchIdx}}match using regular expression:"
|
||||||
AdvSceneSwitcher.action.variable.entry.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
AdvSceneSwitcher.action.variable.layout.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.userInput.customPrompt="{{useCustomPrompt}}Use custom prompt{{inputPrompt}}"
|
AdvSceneSwitcher.action.variable.layout.userInput.customPrompt="{{useCustomPrompt}}Use custom prompt{{inputPrompt}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.userInput.placeholder="{{useInputPlaceholder}}Fill with placeholder{{inputPlaceholder}}"
|
AdvSceneSwitcher.action.variable.layout.userInput.placeholder="{{useInputPlaceholder}}Fill with placeholder{{inputPlaceholder}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.randomNumber="Generate random number in range from{{randomNumberStart}}to{{randomNumberEnd}}"
|
AdvSceneSwitcher.action.variable.layout.randomNumber="Generate random number in range from{{randomNumberStart}}to{{randomNumberEnd}}"
|
||||||
AdvSceneSwitcher.action.projector="Projector"
|
AdvSceneSwitcher.action.projector="Projector"
|
||||||
AdvSceneSwitcher.action.projector.action.open="Open"
|
AdvSceneSwitcher.action.projector.action.open="Open"
|
||||||
AdvSceneSwitcher.action.projector.action.close="Close"
|
AdvSceneSwitcher.action.projector.action.close="Close"
|
||||||
@@ -1151,6 +1244,8 @@ AdvSceneSwitcher.action.sceneLock.entry="On{{scenes}}{{actions}}{{sources}}"
|
|||||||
AdvSceneSwitcher.action.twitch="Twitch"
|
AdvSceneSwitcher.action.twitch="Twitch"
|
||||||
AdvSceneSwitcher.action.twitch.type.channel.info.title.set="Set stream title"
|
AdvSceneSwitcher.action.twitch.type.channel.info.title.set="Set stream title"
|
||||||
AdvSceneSwitcher.action.twitch.type.channel.info.category.set="Set stream category"
|
AdvSceneSwitcher.action.twitch.type.channel.info.category.set="Set stream category"
|
||||||
|
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.start="Start raid"
|
||||||
AdvSceneSwitcher.action.twitch.type.commercial.start="Start commercial"
|
AdvSceneSwitcher.action.twitch.type.commercial.start="Start commercial"
|
||||||
AdvSceneSwitcher.action.twitch.type.marker.create="Create stream marker"
|
AdvSceneSwitcher.action.twitch.type.marker.create="Create stream marker"
|
||||||
@@ -1178,6 +1273,58 @@ AdvSceneSwitcher.action.twitch.announcement.orange="Orange"
|
|||||||
AdvSceneSwitcher.action.twitch.announcement.purple="Purple"
|
AdvSceneSwitcher.action.twitch.announcement.purple="Purple"
|
||||||
AdvSceneSwitcher.action.twitch.user.getInfo.queryType.id="User Id"
|
AdvSceneSwitcher.action.twitch.user.getInfo.queryType.id="User Id"
|
||||||
AdvSceneSwitcher.action.twitch.user.getInfo.queryType.login="User login"
|
AdvSceneSwitcher.action.twitch.user.getInfo.queryType.login="User login"
|
||||||
|
AdvSceneSwitcher.action.twitch.tags.add="Add Channel Tag"
|
||||||
|
AdvSceneSwitcher.action.twitch.tags.getCurrent="Get current channel tags"
|
||||||
|
AdvSceneSwitcher.action.twitch.tags.invalid="Invalid Tag"
|
||||||
|
AdvSceneSwitcher.action.twitch.tags.invalid.info="Tags must be 1–%1 characters long, contain only letters or numbers, and have no spaces or special characters."
|
||||||
|
AdvSceneSwitcher.action.twitch.tags.duplicate="Duplicate Tag"
|
||||||
|
AdvSceneSwitcher.action.twitch.tags.duplicate.info="This tag is already in the list."
|
||||||
|
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.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."
|
||||||
|
AdvSceneSwitcher.action.twitch.contentClassification.violentGraphic="Simulations and/or depictions of realistic violence, gore, extreme injury, or death."
|
||||||
|
AdvSceneSwitcher.action.twitch.contentClassification.gambling="Participating in or promoting online or in-person gambling, poker, or fantasy sports that involve the exchange of real money."
|
||||||
|
AdvSceneSwitcher.action.twitch.contentClassification.profanityVulgarity="Prolonged and repeated use of obscenities, profanities, and vulgarities, especially as a regular part of speech."
|
||||||
|
AdvSceneSwitcher.action.twitch.contentClassification.getCurrent="Get current content classification labels"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.english="English"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.indonesian="Bahasa Indonesia"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.catalan="Català"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.danish="Dansk"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.german="Deutsch"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.spanish="Español"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.french="Français"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.italian="Italiano"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.hungarian="Magyar"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.dutch="Nederlands"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.norwegian="Norsk"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.polish="Polski"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.portuguese="Português"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.romanian="Română"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.slovak="Slovenčina"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.finnish="Suomi"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.swedish="Svenska"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.tagalog="Tagalog"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.vietnamese="Tiếng Việt"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.turkish="Türkçe"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.czech="Čeština"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.greek="Ελληνικά"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.bulgarian="Български"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.russian="Русский"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.ukrainian="Українська"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.arabic="العربية"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.malay="بهاس ملايو"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.hindi="मानक हिन्दी"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.thai="ภาษาไทย"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.chinese="中文"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.japanese="日本語"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.cantonese="粵語"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.korean="한국어"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.asl="American Sign Language"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.other="Other"
|
||||||
|
AdvSceneSwitcher.action.twitch.language.getCurrent="Get current language"
|
||||||
AdvSceneSwitcher.action.clipboard="Clipboard"
|
AdvSceneSwitcher.action.clipboard="Clipboard"
|
||||||
AdvSceneSwitcher.action.clipboard.type.copy.text="Copy text"
|
AdvSceneSwitcher.action.clipboard.type.copy.text="Copy text"
|
||||||
AdvSceneSwitcher.action.clipboard.type.copy.image="Copy image"
|
AdvSceneSwitcher.action.clipboard.type.copy.image="Copy image"
|
||||||
@@ -1202,6 +1349,27 @@ AdvSceneSwitcher.action.window.entry="{{actions}}{{windows}}{{regex}}"
|
|||||||
AdvSceneSwitcher.action.log="Log"
|
AdvSceneSwitcher.action.log="Log"
|
||||||
AdvSceneSwitcher.action.log.placeholder="My log message!"
|
AdvSceneSwitcher.action.log.placeholder="My log message!"
|
||||||
AdvSceneSwitcher.action.log.entry="Write to OBS log:{{logMessage}}"
|
AdvSceneSwitcher.action.log.entry="Write to OBS log:{{logMessage}}"
|
||||||
|
AdvSceneSwitcher.action.mqtt="MQTT"
|
||||||
|
AdvSceneSwitcher.action.mqtt.topic="Topic:"
|
||||||
|
AdvSceneSwitcher.action.mqtt.qos="QoS:"
|
||||||
|
AdvSceneSwitcher.action.mqtt.retain="Retained message:"
|
||||||
|
AdvSceneSwitcher.action.mqtt.layout="Send message to{{connection}}"
|
||||||
|
AdvSceneSwitcher.action.obsSetting="OBS setting"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.setFPSType="Set FPS selection type to"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.setFPSCommonValue="Set FPS common selection to"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.setFPSIntegerValue="Set FPS integer selection to"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.setFPSFractionNumeratorValue="Set fractional FPS numerator selection to"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.setFPSFractionDenominatorValue="Set fractional FPS denominator selection to"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.setBaseCanvasX="Set base resolution X value"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.setBaseCanvasY="Set base resolution Y value"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.setOutputCanvasX="Set output resolution X value"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.setOutputCanvasY="Set output resolution Y value"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.enablePreview="Enable preview"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.disablePreview="Disable preview"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.action.togglePreview="Toggle preview enable"
|
||||||
|
AdvSceneSwitcher.action.obsSetting.getCurrentValue="Get current value"
|
||||||
|
AdvSceneSwitcher.action.obsSettings.layout="{{actions}}{{fpsType}}{{fpsIntValue}}{{fpsStringValue}}{{canvasSizeValue}}{{getCurrentValue}}"
|
||||||
|
AdvSceneSwitcher.action.script="Script"
|
||||||
|
|
||||||
# Hotkey
|
# Hotkey
|
||||||
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Start the Advanced Scene Switcher"
|
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Start the Advanced Scene Switcher"
|
||||||
@@ -1210,9 +1378,10 @@ AdvSceneSwitcher.hotkey.startStopToggleSwitcherHotkey="Toggle Start/Stop for the
|
|||||||
AdvSceneSwitcher.hotkey.macro.pause="Pause macro %1"
|
AdvSceneSwitcher.hotkey.macro.pause="Pause macro %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.unpause="Unpause macro %1"
|
AdvSceneSwitcher.hotkey.macro.unpause="Unpause macro %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.togglePause="Toggle pause of macro %1"
|
AdvSceneSwitcher.hotkey.macro.togglePause="Toggle pause of macro %1"
|
||||||
AdvSceneSwitcher.hotkey.upMacroSegmentHotkey="Move macro segment selection up"
|
AdvSceneSwitcher.hotkey.macro.new="Add new macro"
|
||||||
AdvSceneSwitcher.hotkey.downMacroSegmentHotkey="Move macro segment selection down"
|
AdvSceneSwitcher.hotkey.macro.segment.up="Move macro segment selection up"
|
||||||
AdvSceneSwitcher.hotkey.removeMacroSegmentHotkey="Remove selected macro segment"
|
AdvSceneSwitcher.hotkey.macro.segment.down="Move macro segment selection down"
|
||||||
|
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.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.askForMacro="Select macro{{macroSelection}}"
|
||||||
@@ -1358,6 +1527,42 @@ AdvSceneSwitcher.osc.message.type.false="False"
|
|||||||
AdvSceneSwitcher.osc.message.type.infinity="Infinitum"
|
AdvSceneSwitcher.osc.message.type.infinity="Infinitum"
|
||||||
AdvSceneSwitcher.osc.message.type.null="Nil"
|
AdvSceneSwitcher.osc.message.type.null="Nil"
|
||||||
|
|
||||||
|
AdvSceneSwitcher.mqttConnection.startListen="Start listening"
|
||||||
|
AdvSceneSwitcher.mqttConnection.stopListen="Stop listening"
|
||||||
|
AdvSceneSwitcher.mqttConnection.select="--select connection--"
|
||||||
|
AdvSceneSwitcher.mqttConnection.add="Add new connection"
|
||||||
|
AdvSceneSwitcher.mqttConnection.configure="Configure connection settings"
|
||||||
|
AdvSceneSwitcher.mqttConnection.invalid="Invalid connection selection"
|
||||||
|
AdvSceneSwitcher.mqttConnection.name="Name:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.address="Address:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.username="Username:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.password="Password:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.trustStore="Trust store:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.trustStore.help="The file in PEM format containing the public digital certificates trusted by the client."
|
||||||
|
AdvSceneSwitcher.mqttConnection.keyStore="Key store:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.keyStore.help="The file in PEM format containing the public certificate chain of the client.\nIt may also include the client's private key."
|
||||||
|
AdvSceneSwitcher.mqttConnection.privateKey="Private key:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.privateKey.help="If not included in the key store, this is the file in PEM format containing the client's private key."
|
||||||
|
AdvSceneSwitcher.mqttConnection.verifyServerCert="Verify server certificate"
|
||||||
|
AdvSceneSwitcher.mqttConnection.reconnect="Reconnect automatically:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.reconnectDelay="Automatically reconnect after:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.connectOnStart="Connect on startup:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.test="Test connection"
|
||||||
|
AdvSceneSwitcher.mqttConnection.status.connected="Connected!"
|
||||||
|
AdvSceneSwitcher.mqttConnection.status.connecting="Connecting ..."
|
||||||
|
AdvSceneSwitcher.mqttConnection.status.disconnected="Could not connect!"
|
||||||
|
AdvSceneSwitcher.mqttConnection.topic="Topic"
|
||||||
|
AdvSceneSwitcher.mqttConnection.qos="QoS"
|
||||||
|
AdvSceneSwitcher.mqttConnection.topics="Topic subscriptions:"
|
||||||
|
AdvSceneSwitcher.mqttConnection.inputWarning.emptyTopic="Topic cannot be empty."
|
||||||
|
AdvSceneSwitcher.mqttConnection.inputWarning.emptyTopic.title="Input Error"
|
||||||
|
AdvSceneSwitcher.mqttConnection.inputWarning.duplicateTopic="This topic already exists."
|
||||||
|
AdvSceneSwitcher.mqttConnection.inputWarning.duplicateTopic.title="Duplicate Topic"
|
||||||
|
AdvSceneSwitcher.mqttConnection.inputWarning.qosRange="QoS must be 0, 1, or 2."
|
||||||
|
AdvSceneSwitcher.mqttConnection.inputWarning.qosRange.title="Invalid QoS"
|
||||||
|
AdvSceneSwitcher.mqttConnection.add.layout="Add topic subscription{{topic}}with QoS{{QoS}}"
|
||||||
|
AdvSceneSwitcher.mqttConnection.add.title="Add MQTT Topic Subscription"
|
||||||
|
|
||||||
AdvSceneSwitcher.twitchToken.name="Account name:"
|
AdvSceneSwitcher.twitchToken.name="Account name:"
|
||||||
AdvSceneSwitcher.twitchToken.nameNotAvailable="Account already in use"
|
AdvSceneSwitcher.twitchToken.nameNotAvailable="Account already in use"
|
||||||
AdvSceneSwitcher.twitchToken.select="--select Twitch connection--"
|
AdvSceneSwitcher.twitchToken.select="--select Twitch connection--"
|
||||||
@@ -1384,6 +1589,7 @@ AdvSceneSwitcher.twitchToken.bits.read="Read channel's Bits information."
|
|||||||
AdvSceneSwitcher.twitchToken.channel.raids.manage="Manage channel's raids."
|
AdvSceneSwitcher.twitchToken.channel.raids.manage="Manage channel's raids."
|
||||||
AdvSceneSwitcher.twitchToken.moderator.shoutouts.read="Read channel's shoutouts."
|
AdvSceneSwitcher.twitchToken.moderator.shoutouts.read="Read channel's shoutouts."
|
||||||
AdvSceneSwitcher.twitchToken.moderator.shoutouts.manage="Manage channel's shoutouts."
|
AdvSceneSwitcher.twitchToken.moderator.shoutouts.manage="Manage channel's shoutouts."
|
||||||
|
AdvSceneSwitcher.twitchToken.channel.ads.read="Read the ads schedule and details on your channel."
|
||||||
AdvSceneSwitcher.twitchToken.channel.polls.read="Read channel's polls' state."
|
AdvSceneSwitcher.twitchToken.channel.polls.read="Read channel's polls' state."
|
||||||
AdvSceneSwitcher.twitchToken.channel.polls.manage="Manage channel's polls."
|
AdvSceneSwitcher.twitchToken.channel.polls.manage="Manage channel's polls."
|
||||||
AdvSceneSwitcher.twitchToken.channel.predictions.read="Read channel's predictions' state."
|
AdvSceneSwitcher.twitchToken.channel.predictions.read="Read channel's predictions' state."
|
||||||
@@ -1409,6 +1615,11 @@ AdvSceneSwitcher.twitchToken.moderator.chat.settings.manage="Manage channel's ch
|
|||||||
AdvSceneSwitcher.twitchToken.user.whispers.manage="Manage user's whispers."
|
AdvSceneSwitcher.twitchToken.user.whispers.manage="Manage user's whispers."
|
||||||
AdvSceneSwitcher.twitchToken.chat.read="View live stream chat messages."
|
AdvSceneSwitcher.twitchToken.chat.read="View live stream chat messages."
|
||||||
AdvSceneSwitcher.twitchToken.chat.edit="Send live stream chat messages."
|
AdvSceneSwitcher.twitchToken.chat.edit="Send live stream chat messages."
|
||||||
|
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="Open channel"
|
||||||
AdvSceneSwitcher.twitch.selection.channel.open.tooltip.details="Open channel in external application handling the HTTPS protocol."
|
AdvSceneSwitcher.twitch.selection.channel.open.tooltip.details="Open channel in external application handling the HTTPS protocol."
|
||||||
@@ -1435,6 +1646,20 @@ AdvSceneSwitcher.twitch.selection.points.reward.tooltip.noPermission="Can't sele
|
|||||||
AdvSceneSwitcher.twitch.selection.points.reward.tooltip.noChannel="Can't select points reward without entering a channel first!"
|
AdvSceneSwitcher.twitch.selection.points.reward.tooltip.noChannel="Can't select points reward without entering a channel first!"
|
||||||
AdvSceneSwitcher.twitch.selection.points.reward.tooltip.error="Can't select points reward because Twitch responded with an error! Check OBS logs for more details."
|
AdvSceneSwitcher.twitch.selection.points.reward.tooltip.error="Can't select points reward because Twitch responded with an error! Check OBS logs for more details."
|
||||||
|
|
||||||
|
AdvSceneSwitcher.script.type.inline="Inline"
|
||||||
|
AdvSceneSwitcher.script.type.file="File"
|
||||||
|
AdvSceneSwitcher.script.type.layout="Script type:{{scriptType}}"
|
||||||
|
AdvSceneSwitcher.script.language.python="Python"
|
||||||
|
AdvSceneSwitcher.script.language.lua="LUA"
|
||||||
|
AdvSceneSwitcher.script.language.select="--select language--"
|
||||||
|
AdvSceneSwitcher.script.language.layout="Script language:{{language}}"
|
||||||
|
AdvSceneSwitcher.script.file.open="Open"
|
||||||
|
AdvSceneSwitcher.script.file.open.failed="Could not open script file!"
|
||||||
|
AdvSceneSwitcher.script.file.warning.notFound="Warning: The given file path was not found!"
|
||||||
|
AdvSceneSwitcher.script.file.warning.openFail="Warning: Could not open the script file!"
|
||||||
|
AdvSceneSwitcher.script.file.warning.loadMissing="Warning: The script is missing a 'script_load' function!"
|
||||||
|
AdvSceneSwitcher.script.file.layout="Script file:{{path}}{{open}}"
|
||||||
|
|
||||||
AdvSceneSwitcher.tempVar.select="--select value--"
|
AdvSceneSwitcher.tempVar.select="--select value--"
|
||||||
AdvSceneSwitcher.tempVar.selectionInfo.lastValues="Last values:"
|
AdvSceneSwitcher.tempVar.selectionInfo.lastValues="Last values:"
|
||||||
|
|
||||||
@@ -1828,6 +2053,24 @@ AdvSceneSwitcher.tempVar.twitch.is_turbo.chatReceive.description="'true' if the
|
|||||||
AdvSceneSwitcher.tempVar.twitch.is_vip.chatReceive="Is chatter a VIP"
|
AdvSceneSwitcher.tempVar.twitch.is_vip.chatReceive="Is chatter a VIP"
|
||||||
AdvSceneSwitcher.tempVar.twitch.is_vip.chatReceive.description="'true' if the chatter is a VIP in the channel, 'false' otherwise."
|
AdvSceneSwitcher.tempVar.twitch.is_vip.chatReceive.description="'true' if the chatter is a VIP in the channel, 'false' otherwise."
|
||||||
|
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.login.chatRemove="User login"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.login.chatRemove.description="The name of the user who sent the message."
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.message.chatRemove="Chat message"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.message_id.chatRemove.description="The chat message that was removed."
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.message_id.chatRemove="Chat message ID"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.message_id.chatRemove.description="The ID of the message in UUID format."
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.timestamp.chatRemove="Chat message timestamp"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.timestamp.chatRemove.description="The UNIX timestamp."
|
||||||
|
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.login.chatClear="User login"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.login.chatClear.description="The login name of the user whose messages were removed from the chat room because they were banned or put in a timeout."
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.user_id.chatClear="User ID"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.user_id.chatClear.description="Optional.\nThe User ID of the user that was banned or put in a timeout.\nEmpty in case the complete chat was cleared."
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.ban_duration.chatClear="Ban duration"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.ban_duration.chatClear.description="Set to zero if the complete chat was cleared or a user was banned indefinitely.\nIs set to non-zero value, if a user was put in a timeout.\nWill contain the duration of the timeout in seconds."
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.timestamp.chatClear="Timestamp"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.timestamp.chatClear.description="The UNIX timestamp."
|
||||||
|
|
||||||
AdvSceneSwitcher.tempVar.twitch.user_login.chatJoin="User login"
|
AdvSceneSwitcher.tempVar.twitch.user_login.chatJoin="User login"
|
||||||
AdvSceneSwitcher.tempVar.twitch.user_login.chatJoin.description="The user login of the person who joined the chat room."
|
AdvSceneSwitcher.tempVar.twitch.user_login.chatJoin.description="The user login of the person who joined the chat room."
|
||||||
|
|
||||||
@@ -1866,6 +2109,18 @@ AdvSceneSwitcher.tempVar.twitch.offline_image_url.user.getInfo="Offline image UR
|
|||||||
AdvSceneSwitcher.tempVar.twitch.created_at.user.getInfo="Account creation date"
|
AdvSceneSwitcher.tempVar.twitch.created_at.user.getInfo="Account creation date"
|
||||||
AdvSceneSwitcher.tempVar.twitch.created_at.user.getInfo.description="The UTC date and time that the user's account was created. The timestamp is in RFC3339 format."
|
AdvSceneSwitcher.tempVar.twitch.created_at.user.getInfo.description="The UTC date and time that the user's account was created. The timestamp is in RFC3339 format."
|
||||||
|
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.duration_seconds.commercial="Duration"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.duration_seconds.commercial.description="Length in seconds of the mid-roll ad break requested."
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.started_at.commercial="Started at"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.started_at.commercial.description="The UTC timestamp of when the ad break began, in RFC3339 format. Note that there is potential delay between this event, when the streamer requested the ad break, and when the viewers will see ads."
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.is_automatic.commercial="Was automatic"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.is_automatic.commercial.description="Indicates if the ad was automatically scheduled via Ads Manager"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.requester_user_id.commercial="Requester user ID"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.requester_user_id.commercial.description="The ID of the user that requested the ad. For automatic ads, this will be the ID of the broadcaster."
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.requester_user_login.commercial="Requester user login"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.requester_user_login.commercial.description="The login of the user that requested the ad."
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.requester_user_name.commercial="Requester user name"
|
||||||
|
AdvSceneSwitcher.tempVar.twitch.requester_user_name.commercial.description="The display name of the user that requested the ad."
|
||||||
|
|
||||||
AdvSceneSwitcher.tempVar.audio.output_volume="Output volume"
|
AdvSceneSwitcher.tempVar.audio.output_volume="Output volume"
|
||||||
AdvSceneSwitcher.tempVar.audio.output_volume.description="The volume the audio source is outputting."
|
AdvSceneSwitcher.tempVar.audio.output_volume.description="The volume the audio source is outputting."
|
||||||
@@ -1884,6 +2139,7 @@ AdvSceneSwitcher.tempVar.clipboard.mimeType.all.description="All MIME types of t
|
|||||||
AdvSceneSwitcher.tempVar.scene.current="Current scene"
|
AdvSceneSwitcher.tempVar.scene.current="Current scene"
|
||||||
AdvSceneSwitcher.tempVar.scene.previous="Previous scene"
|
AdvSceneSwitcher.tempVar.scene.previous="Previous scene"
|
||||||
AdvSceneSwitcher.tempVar.scene.preview="Preview scene"
|
AdvSceneSwitcher.tempVar.scene.preview="Preview scene"
|
||||||
|
AdvSceneSwitcher.tempVar.scene.position="Position in scenes list"
|
||||||
|
|
||||||
AdvSceneSwitcher.tempVar.window.window="Window title"
|
AdvSceneSwitcher.tempVar.window.window="Window title"
|
||||||
AdvSceneSwitcher.tempVar.window.window.description="The window title of the matching window."
|
AdvSceneSwitcher.tempVar.window.window.description="The window title of the matching window."
|
||||||
@@ -1930,6 +2186,8 @@ AdvSceneSwitcher.tempVar.run.process.none.description="When not waiting for the
|
|||||||
|
|
||||||
AdvSceneSwitcher.tempVar.recording.durationSeconds="Recording duration"
|
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.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.patternCount="Pattern count"
|
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.patternCount.description="The number of times the given pattern has been found in a given video input frame."
|
||||||
@@ -1967,6 +2225,19 @@ AdvSceneSwitcher.tempVar.clipboard.text.description="The text contained in the c
|
|||||||
|
|
||||||
AdvSceneSwitcher.tempVar.file.content="File content"
|
AdvSceneSwitcher.tempVar.file.content="File content"
|
||||||
AdvSceneSwitcher.tempVar.file.date="File modification date"
|
AdvSceneSwitcher.tempVar.file.date="File modification date"
|
||||||
|
AdvSceneSwitcher.tempVar.file.basename="File basename"
|
||||||
|
AdvSceneSwitcher.tempVar.file.basename.description="Returns the base name of the file without the path.\nThe base name consists of all characters in the file up to (but not including) the first '.' character."
|
||||||
|
AdvSceneSwitcher.tempVar.file.basenameComplete="File basename (complete)"
|
||||||
|
AdvSceneSwitcher.tempVar.file.basenameComplete.description="Returns the complete base name of the file without the path.\nThe complete base name consists of all characters in the file up to (but not including) the last '.' character."
|
||||||
|
AdvSceneSwitcher.tempVar.file.suffix="File suffix"
|
||||||
|
AdvSceneSwitcher.tempVar.file.suffix.description="Returns the suffix (extension) of the file.\nThe suffix consists of all characters in the file after (but not including) the last '.'."
|
||||||
|
AdvSceneSwitcher.tempVar.file.suffixComplete="File suffix (complete)"
|
||||||
|
AdvSceneSwitcher.tempVar.file.suffixComplete.description="Returns the complete suffix (extension) of the file.\nThe complete suffix consists of all characters in the file after (but not including) the first '.'."
|
||||||
|
AdvSceneSwitcher.tempVar.file.filename="File name"
|
||||||
|
AdvSceneSwitcher.tempVar.file.absoluteFilePath="Absolute file path"
|
||||||
|
AdvSceneSwitcher.tempVar.file.absolutePath="Absolute path"
|
||||||
|
AdvSceneSwitcher.tempVar.file.isAbsolutePath="Path is absolute"
|
||||||
|
|
||||||
|
|
||||||
AdvSceneSwitcher.tempVar.folder.newFiles="New files"
|
AdvSceneSwitcher.tempVar.folder.newFiles="New files"
|
||||||
AdvSceneSwitcher.tempVar.folder.changedFiles="Changed files"
|
AdvSceneSwitcher.tempVar.folder.changedFiles="Changed files"
|
||||||
@@ -2000,6 +2271,8 @@ AdvSceneSwitcher.tempVar.usb.serialNumber="Serial Number"
|
|||||||
AdvSceneSwitcher.tempVar.transform.setting="Setting value"
|
AdvSceneSwitcher.tempVar.transform.setting="Setting value"
|
||||||
AdvSceneSwitcher.tempVar.transform.settings="Settings string"
|
AdvSceneSwitcher.tempVar.transform.settings="Settings string"
|
||||||
|
|
||||||
|
AdvSceneSwitcher.tempVar.media.source="Source"
|
||||||
|
AdvSceneSwitcher.tempVar.media.source.description="The name of the source which matched.\nIf multiple sources matched the last one is returned."
|
||||||
AdvSceneSwitcher.tempVar.media.state="State"
|
AdvSceneSwitcher.tempVar.media.state="State"
|
||||||
AdvSceneSwitcher.tempVar.media.state.description="The current media state represented as an integer value:\n0 being 'None'\n1 being 'Playing'\n2 being 'Opening'\n3 being 'Buffering'\n4 being 'Paused'\n5 being 'Stopped'\n6 being 'Ended'\n7 being 'Error'"
|
AdvSceneSwitcher.tempVar.media.state.description="The current media state represented as an integer value:\n0 being 'None'\n1 being 'Playing'\n2 being 'Opening'\n3 being 'Buffering'\n4 being 'Paused'\n5 being 'Stopped'\n6 being 'Ended'\n7 being 'Error'"
|
||||||
AdvSceneSwitcher.tempVar.media.time="Current time"
|
AdvSceneSwitcher.tempVar.media.time="Current time"
|
||||||
@@ -2059,7 +2332,16 @@ AdvSceneSwitcher.tempVar.http.body="Message body"
|
|||||||
AdvSceneSwitcher.tempVar.http.error="Error"
|
AdvSceneSwitcher.tempVar.http.error="Error"
|
||||||
AdvSceneSwitcher.tempVar.http.error.description="Empty when no error occurred.\nOther possible values:\n\n * Could not establish connection\n * Failed to bind IP address\n * Failed to read connection\n * Failed to write connection\n * Maximum redirect count exceeded\n * Connection handling canceled\n * SSL connection failed\n * SSL certificate loading failed\n * SSL server verification failed\n * Unsupported HTTP multipart boundary characters\n * Compression failed\n * Connection timed out\n * Proxy connection failed\n * Unknown"
|
AdvSceneSwitcher.tempVar.http.error.description="Empty when no error occurred.\nOther possible values:\n\n * Could not establish connection\n * Failed to bind IP address\n * Failed to read connection\n * Failed to write connection\n * Maximum redirect count exceeded\n * Connection handling canceled\n * SSL connection failed\n * SSL certificate loading failed\n * SSL server verification failed\n * Unsupported HTTP multipart boundary characters\n * Compression failed\n * Connection timed out\n * Proxy connection failed\n * Unknown"
|
||||||
|
|
||||||
|
AdvSceneSwitcher.tempVar.mqtt.message="Message"
|
||||||
|
|
||||||
|
AdvSceneSwitcher.tempVar.cursor.x="Cursor position (X)"
|
||||||
|
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.selectScene="--select scene--"
|
AdvSceneSwitcher.selectScene="--select scene--"
|
||||||
|
AdvSceneSwitcher.selectCanvas="--select canvas--"
|
||||||
AdvSceneSwitcher.selectPreviousScene="Previous Scene"
|
AdvSceneSwitcher.selectPreviousScene="Previous Scene"
|
||||||
AdvSceneSwitcher.selectCurrentScene="Current Scene"
|
AdvSceneSwitcher.selectCurrentScene="Current Scene"
|
||||||
AdvSceneSwitcher.selectPreviewScene="Preview Scene"
|
AdvSceneSwitcher.selectPreviewScene="Preview Scene"
|
||||||
@@ -2120,21 +2402,23 @@ AdvSceneSwitcher.setting.transform.width="Width"
|
|||||||
|
|
||||||
AdvSceneSwitcher.sceneItemSelection.configure="Configure scene item selection type"
|
AdvSceneSwitcher.sceneItemSelection.configure="Configure scene item selection type"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceName="Source name"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceName="Source name"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceName.entry="{{nameConflictIndex}}{{sourceName}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceName.layout="{{nameConflictIndex}}{{sourceName}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable="Variable name"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable="Variable name"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable.entry="{{nameConflictIndex}}{{variable}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable.layout="{{nameConflictIndex}}{{variable}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern="Source name matches pattern"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern="Source name matches pattern"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern.entry="{{nameConflictIndex}}matching{{pattern}}{{regex}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern.layout="{{nameConflictIndex}}matching{{pattern}}{{regex}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup="Sources in source group"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup="Sources in source group"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup.entry="Sources in{{sourceGroups}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup.layout="{{nameConflictIndex}}Sources in{{sourceGroups}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType="Sources of type"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceType="Sources of type"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType.entry="Source type{{nameConflictIndex}}{{sourceTypes}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceType.layout="Source type{{nameConflictIndex}}{{sourceTypes}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.index="Source with index"
|
AdvSceneSwitcher.sceneItemSelection.type.index="Source with index"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.index.entry="{{index}}source"
|
AdvSceneSwitcher.sceneItemSelection.type.index.layout="{{index}}source"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.indexRange="Sources in index range"
|
AdvSceneSwitcher.sceneItemSelection.type.indexRange="Sources in index range"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.indexRange.entry="Sources from{{index}}to{{indexEnd}}"
|
AdvSceneSwitcher.sceneItemSelection.type.indexRange.layout="Sources from{{index}}to{{indexEnd}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.all="All sources"
|
AdvSceneSwitcher.sceneItemSelection.type.all="All sources"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.all.entry="All sources"
|
AdvSceneSwitcher.sceneItemSelection.type.all.layout="All sources"
|
||||||
|
AdvSceneSwitcher.sceneItemSelection.type.any="Any source"
|
||||||
|
AdvSceneSwitcher.sceneItemSelection.type.any.layout="Any source"
|
||||||
AdvSceneSwitcher.sceneItemSelection.all="All"
|
AdvSceneSwitcher.sceneItemSelection.all="All"
|
||||||
AdvSceneSwitcher.sceneItemSelection.any="Any"
|
AdvSceneSwitcher.sceneItemSelection.any="Any"
|
||||||
|
|
||||||
@@ -2178,13 +2462,12 @@ AdvSceneSwitcher.script.timeout="Script timeout:{{timeout}}"
|
|||||||
|
|
||||||
# This secion is copied from the OBS locale files
|
# This secion is copied from the OBS locale files
|
||||||
|
|
||||||
# commonly shared locale
|
# OBS commonly shared locale
|
||||||
Browse="Browse"
|
Browse="Browse"
|
||||||
Show="Show"
|
Show="Show"
|
||||||
Hide="Hide"
|
Hide="Hide"
|
||||||
|
|
||||||
|
# OBS properties window
|
||||||
# properties window
|
|
||||||
Basic.PropertiesWindow="Properties for '%1'"
|
Basic.PropertiesWindow="Properties for '%1'"
|
||||||
Basic.PropertiesWindow.AutoSelectFormat="%1 (autoselect: %2)"
|
Basic.PropertiesWindow.AutoSelectFormat="%1 (autoselect: %2)"
|
||||||
Basic.PropertiesWindow.SelectColor="Select color"
|
Basic.PropertiesWindow.SelectColor="Select color"
|
||||||
@@ -2201,7 +2484,7 @@ Basic.PropertiesWindow.AddEditableListFiles="Add files to '%1'"
|
|||||||
Basic.PropertiesWindow.AddEditableListEntry="Add entry to '%1'"
|
Basic.PropertiesWindow.AddEditableListEntry="Add entry to '%1'"
|
||||||
Basic.PropertiesWindow.EditEditableListEntry="Edit entry from '%1'"
|
Basic.PropertiesWindow.EditEditableListEntry="Edit entry from '%1'"
|
||||||
|
|
||||||
# properties view
|
# OBS properties view
|
||||||
Basic.PropertiesView.FPS.Simple="Simple FPS Values"
|
Basic.PropertiesView.FPS.Simple="Simple FPS Values"
|
||||||
Basic.PropertiesView.FPS.Rational="Rational FPS Values"
|
Basic.PropertiesView.FPS.Rational="Rational FPS Values"
|
||||||
Basic.PropertiesView.FPS.ValidFPSRanges="Valid FPS Ranges:"
|
Basic.PropertiesView.FPS.ValidFPSRanges="Valid FPS Ranges:"
|
||||||
@@ -2209,6 +2492,11 @@ Basic.PropertiesView.UrlButton.Text="Open this link in your default web browser?
|
|||||||
Basic.PropertiesView.UrlButton.Text.Url="URL: %1"
|
Basic.PropertiesView.UrlButton.Text.Url="URL: %1"
|
||||||
Basic.PropertiesView.UrlButton.OpenUrl="Open URL"
|
Basic.PropertiesView.UrlButton.OpenUrl="Open URL"
|
||||||
|
|
||||||
|
# OBS settings
|
||||||
|
Basic.Settings.Video.FPSCommon="Common FPS Values"
|
||||||
|
Basic.Settings.Video.FPSInteger="Integer FPS Value"
|
||||||
|
Basic.Settings.Video.FPSFraction="Fractional FPS Value"
|
||||||
|
|
||||||
# Legacy tabs below - please don't waste your time adding translations for these :)
|
# Legacy tabs below - please don't waste your time adding translations for these :)
|
||||||
# Transition Tab
|
# Transition Tab
|
||||||
AdvSceneSwitcher.transitionTab.title="Transition"
|
AdvSceneSwitcher.transitionTab.title="Transition"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ AdvSceneSwitcher.generalTab.status.onStartup.alwaysStart="Siempre iniciar el sel
|
|||||||
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="No iniciar el selector de escenas"
|
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="No iniciar el selector de escenas"
|
||||||
AdvSceneSwitcher.generalTab.status.start="Iniciar"
|
AdvSceneSwitcher.generalTab.status.start="Iniciar"
|
||||||
AdvSceneSwitcher.generalTab.status.stop="Detener"
|
AdvSceneSwitcher.generalTab.status.stop="Detener"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart="Iniciar automáticamente el selector de escenas cuando:"
|
AdvSceneSwitcher.generalTab.status.autoStart.startup="Iniciar automáticamente el selector de escenas cuando:"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.never="Nunca"
|
AdvSceneSwitcher.generalTab.status.autoStart.never="Nunca"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.recording="Grabando"
|
AdvSceneSwitcher.generalTab.status.autoStart.recording="Grabando"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Emitiendo"
|
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Emitiendo"
|
||||||
@@ -25,7 +25,6 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch="No cambiar"
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Cambiar a una escena aleatoria"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Cambiar a una escena aleatoria"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Cambiar a:"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Cambiar a:"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="¡Durante este tiempo, se ignorarán las posibles coincidencias!"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="¡Durante este tiempo, se ignorarán las posibles coincidencias!"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Habilitar el registro detallado"
|
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Guardar la posición y el tamaño de la ventana"
|
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Guardar la posición y el tamaño de la ventana"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Mostrar notificaciones del sistema"
|
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Mostrar notificaciones del sistema"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Deshabilitar sugerencias de interfaz de usuario"
|
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Deshabilitar sugerencias de interfaz de usuario"
|
||||||
@@ -39,7 +38,7 @@ AdvSceneSwitcher.generalTab.saveOrLoadsettings.export="Exportar"
|
|||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Importar"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Importar"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Exportar los ajustes para Advanced Scene Switcher ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Exportar los ajustes para Advanced Scene Switcher ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Importar los ajustes para Advanced Scene Switcher ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Importar los ajustes para Advanced Scene Switcher ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Archivos de texto (*.txt)"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Archivos de texto (*.txt *.json)"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="La importacion la configuracion de escenas fallo"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="La importacion la configuracion de escenas fallo"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Configuración de escenas importada correctamente"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Configuración de escenas importada correctamente"
|
||||||
AdvSceneSwitcher.generalTab.priority.fileContent="Contenido del archivo"
|
AdvSceneSwitcher.generalTab.priority.fileContent="Contenido del archivo"
|
||||||
@@ -155,12 +154,12 @@ AdvSceneSwitcher.condition.video.patternMatchSuccess="El patrón está resaltado
|
|||||||
AdvSceneSwitcher.condition.video.objectMatchFail="¡No se encontró el objeto!"
|
AdvSceneSwitcher.condition.video.objectMatchFail="¡No se encontró el objeto!"
|
||||||
AdvSceneSwitcher.condition.video.objectMatchSuccess="El objeto está resaltado en rojo"
|
AdvSceneSwitcher.condition.video.objectMatchSuccess="El objeto está resaltado en rojo"
|
||||||
AdvSceneSwitcher.condition.video.modelLoadFail="¡No se pudieron cargar los datos del modelo!"
|
AdvSceneSwitcher.condition.video.modelLoadFail="¡No se pudieron cargar los datos del modelo!"
|
||||||
AdvSceneSwitcher.condition.video.entry="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
AdvSceneSwitcher.condition.video.layout="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.modelPath="Datos del modelo (haar cascade classifier): {{modelDataPath}}"
|
AdvSceneSwitcher.condition.video.layout.modelPath="Datos del modelo (haar cascade classifier): {{modelDataPath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.minNeighbor="Mínimo de vecinos: {{minNeighbors}}"
|
AdvSceneSwitcher.condition.video.layout.minNeighbor="Mínimo de vecinos: {{minNeighbors}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.throttle="{{throttleEnable}}Reduzca la carga de la CPU realizando una comprobación solo cada {{throttleCount}} milisegundos"
|
AdvSceneSwitcher.condition.video.layout.throttle="{{throttleEnable}}Reduzca la carga de la CPU realizando una comprobación solo cada {{throttleCount}} milisegundos"
|
||||||
AdvSceneSwitcher.condition.video.entry.checkAreaEnable="Realizar comprobación solo en el área"
|
AdvSceneSwitcher.condition.video.layout.checkAreaEnable="Realizar comprobación solo en el área"
|
||||||
AdvSceneSwitcher.condition.video.entry.checkArea="{{checkAreaEnable}}Realizar comprobación solo en el área {{checkArea}} {{selectArea}}"
|
AdvSceneSwitcher.condition.video.layout.checkArea="{{checkAreaEnable}}Realizar comprobación solo en el área {{checkArea}} {{selectArea}}"
|
||||||
AdvSceneSwitcher.condition.video.minSize="Tamaño mínimo:"
|
AdvSceneSwitcher.condition.video.minSize="Tamaño mínimo:"
|
||||||
AdvSceneSwitcher.condition.video.maxSize="Tamaño máximo:"
|
AdvSceneSwitcher.condition.video.maxSize="Tamaño máximo:"
|
||||||
AdvSceneSwitcher.condition.video.selectArea="Seleccionar área"
|
AdvSceneSwitcher.condition.video.selectArea="Seleccionar área"
|
||||||
@@ -312,7 +311,6 @@ AdvSceneSwitcher.condition.stats.entry="{{stats}} esta {{condition}} {{value}}"
|
|||||||
|
|
||||||
; Macro Actions
|
; Macro Actions
|
||||||
AdvSceneSwitcher.action.scene="Cambiar escena"
|
AdvSceneSwitcher.action.scene="Cambiar escena"
|
||||||
AdvSceneSwitcher.action.scene.entry="Cambiar a la{{sceneTypes}}escena{{scenes}}usando{{transitions}}con una duración de{{duration}} segundos"
|
|
||||||
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Espere hasta que se complete la transición a la escena de destino"
|
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Espere hasta que se complete la transición a la escena de destino"
|
||||||
AdvSceneSwitcher.action.wait="Esperar"
|
AdvSceneSwitcher.action.wait="Esperar"
|
||||||
AdvSceneSwitcher.action.wait.type.fixed="fijo"
|
AdvSceneSwitcher.action.wait.type.fixed="fijo"
|
||||||
@@ -384,7 +382,7 @@ AdvSceneSwitcher.action.pluginState.type.stop="Detener el complemento Advanced S
|
|||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="Cambiar el comportamiento de no coincidencia:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="Cambiar el comportamiento de no coincidencia:"
|
||||||
AdvSceneSwitcher.action.pluginState.type.import="Importar configuración desde"
|
AdvSceneSwitcher.action.pluginState.type.import="Importar configuración desde"
|
||||||
AdvSceneSwitcher.action.pluginState.importWarning="Nota: la acción se ignorará mientras se abra la ventana de configuración."
|
AdvSceneSwitcher.action.pluginState.importWarning="Nota: la acción se ignorará mientras se abra la ventana de configuración."
|
||||||
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}{{settingsWarning}}"
|
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}"
|
||||||
AdvSceneSwitcher.action.virtualCamera="Cámara virtual"
|
AdvSceneSwitcher.action.virtualCamera="Cámara virtual"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.stop="Detener cámara virtual"
|
AdvSceneSwitcher.action.virtualCamera.type.stop="Detener cámara virtual"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.start="Iniciar cámara virtual"
|
AdvSceneSwitcher.action.virtualCamera.type.start="Iniciar cámara virtual"
|
||||||
@@ -641,9 +639,9 @@ AdvSceneSwitcher.hotkey.startStopToggleSwitcherHotkey="Alternar inicio / detenci
|
|||||||
AdvSceneSwitcher.hotkey.macro.pause="Pausar macro %1"
|
AdvSceneSwitcher.hotkey.macro.pause="Pausar macro %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.unpause="Despausar macro %1"
|
AdvSceneSwitcher.hotkey.macro.unpause="Despausar macro %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.togglePause="Alternar pausa de macro %1"
|
AdvSceneSwitcher.hotkey.macro.togglePause="Alternar pausa de macro %1"
|
||||||
AdvSceneSwitcher.hotkey.upMacroSegmentHotkey="Mover selección de segmento de macro hacia arriba"
|
AdvSceneSwitcher.hotkey.macro.segment.up="Mover selección de segmento de macro hacia arriba"
|
||||||
AdvSceneSwitcher.hotkey.downMacroSegmentHotkey="Mover selección de segmento de macro hacia abajo"
|
AdvSceneSwitcher.hotkey.macro.segment.down="Mover selección de segmento de macro hacia abajo"
|
||||||
AdvSceneSwitcher.hotkey.removeMacroSegmentHotkey="Eliminar segmento de macro seleccionado"
|
AdvSceneSwitcher.hotkey.macro.segment.remove="Eliminar segmento de macro seleccionado"
|
||||||
|
|
||||||
AdvSceneSwitcher.askBackup="Se detectó una nueva versión de Advanced Scene Switcher.\n¿Crear una copia de seguridad de la configuración anterior?"
|
AdvSceneSwitcher.askBackup="Se detectó una nueva versión de Advanced Scene Switcher.\n¿Crear una copia de seguridad de la configuración anterior?"
|
||||||
AdvSceneSwitcher.askForMacro="Select macro {{macroSelection}}"
|
AdvSceneSwitcher.askForMacro="Select macro {{macroSelection}}"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ AdvSceneSwitcher.generalTab.status.onStartup.alwaysStart="Toujours démarrer le
|
|||||||
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Ne pas démarrer le sélecteur de scène"
|
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Ne pas démarrer le sélecteur de scène"
|
||||||
AdvSceneSwitcher.generalTab.status.start="Démarrer"
|
AdvSceneSwitcher.generalTab.status.start="Démarrer"
|
||||||
AdvSceneSwitcher.generalTab.status.stop="Arrêter"
|
AdvSceneSwitcher.generalTab.status.stop="Arrêter"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart="Démarrer automatiquement le sélecteur de scène lorsque :"
|
AdvSceneSwitcher.generalTab.status.autoStart.startup="Démarrer automatiquement le sélecteur de scène lorsque :"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.never="Jamais"
|
AdvSceneSwitcher.generalTab.status.autoStart.never="Jamais"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.recording="Enregistrement"
|
AdvSceneSwitcher.generalTab.status.autoStart.recording="Enregistrement"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Diffusion en continu"
|
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Diffusion en continu"
|
||||||
@@ -26,7 +26,6 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Basculer v
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Basculer vers :"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Basculer vers :"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="Après avoir effectué des actions, sauter l'exécution d'actions pendant"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="Après avoir effectué des actions, sauter l'exécution d'actions pendant"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="Pendant cette période, les correspondances potentielles seront ignorées !"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="Pendant cette période, les correspondances potentielles seront ignorées !"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Activer les journaux détaillés"
|
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Enregistrer la position et la taille de la fenêtre"
|
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Enregistrer la position et la taille de la fenêtre"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Afficher les notifications dans la zone de notification système"
|
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Afficher les notifications dans la zone de notification système"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Désactiver les indications de l'interface utilisateur"
|
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Désactiver les indications de l'interface utilisateur"
|
||||||
@@ -44,7 +43,7 @@ AdvSceneSwitcher.generalTab.saveOrLoadsettings.export="Exporter"
|
|||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Importer"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Importer"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Exporter les paramètres d'Advanced Scene Switcher vers un fichier ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Exporter les paramètres d'Advanced Scene Switcher vers un fichier ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Importer les paramètres d'Advanced Scene Switcher depuis un fichier ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Importer les paramètres d'Advanced Scene Switcher depuis un fichier ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Fichiers texte (*.txt)"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Fichiers texte (*.txt *.json)"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="L'importation des paramètres d'Advanced Scene Switcher a échoué"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="L'importation des paramètres d'Advanced Scene Switcher a échoué"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Les paramètres d'Advanced Scene Switcher ont été importés avec succès"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Les paramètres d'Advanced Scene Switcher ont été importés avec succès"
|
||||||
AdvSceneSwitcher.generalTab.priority.fileContent="Contenu du fichier"
|
AdvSceneSwitcher.generalTab.priority.fileContent="Contenu du fichier"
|
||||||
@@ -258,14 +257,14 @@ AdvSceneSwitcher.condition.video.colorDeviationThresholdDescription="À quel poi
|
|||||||
AdvSceneSwitcher.condition.video.type.main="Sortie principale d'OBS"
|
AdvSceneSwitcher.condition.video.type.main="Sortie principale d'OBS"
|
||||||
AdvSceneSwitcher.condition.video.type.source="Source"
|
AdvSceneSwitcher.condition.video.type.source="Source"
|
||||||
AdvSceneSwitcher.condition.video.type.scene="Scène"
|
AdvSceneSwitcher.condition.video.type.scene="Scène"
|
||||||
AdvSceneSwitcher.condition.video.entry.modelPath="Données du modèle (classificateur de cascade de Haar) :{{modelDataPath}}"
|
AdvSceneSwitcher.condition.video.layout.modelPath="Données du modèle (classificateur de cascade de Haar) :{{modelDataPath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.minNeighbor="Nombre minimum de voisins :{{minNeighbors}}"
|
AdvSceneSwitcher.condition.video.layout.minNeighbor="Nombre minimum de voisins :{{minNeighbors}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.throttle="{{throttleEnable}}Réduire la charge CPU en effectuant la vérification uniquement toutes les{{throttleCount}}millisecondes"
|
AdvSceneSwitcher.condition.video.layout.throttle="{{throttleEnable}}Réduire la charge CPU en effectuant la vérification uniquement toutes les{{throttleCount}}millisecondes"
|
||||||
AdvSceneSwitcher.condition.video.entry.checkAreaEnable="Effectuer la vérification uniquement dans la zone"
|
AdvSceneSwitcher.condition.video.layout.checkAreaEnable="Effectuer la vérification uniquement dans la zone"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcColorPick="Vérifier la couleur du texte :{{textColor}}{{selectColor}}"
|
AdvSceneSwitcher.condition.video.layout.ocrColorPick="Vérifier la couleur du texte :{{textColor}}{{selectColor}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcTextType="Vérifier le type de texte :{{textType}}"
|
AdvSceneSwitcher.condition.video.layout.ocrTextType="Vérifier le type de texte :{{textType}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcLanguage="Vérifier la langue :{{languageCode}}"
|
AdvSceneSwitcher.condition.video.layout.ocrLanguage="Vérifier la langue :{{languageCode}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.color="Vérifier la couleur :{{color}}{{selectColor}}"
|
AdvSceneSwitcher.condition.video.layout.color="Vérifier la couleur :{{color}}{{selectColor}}"
|
||||||
AdvSceneSwitcher.condition.video.minSize="Taille minimale :"
|
AdvSceneSwitcher.condition.video.minSize="Taille minimale :"
|
||||||
AdvSceneSwitcher.condition.video.maxSize="Taille maximale :"
|
AdvSceneSwitcher.condition.video.maxSize="Taille maximale :"
|
||||||
AdvSceneSwitcher.condition.video.selectArea="Sélectionner la zone"
|
AdvSceneSwitcher.condition.video.selectArea="Sélectionner la zone"
|
||||||
@@ -460,8 +459,6 @@ AdvSceneSwitcher.condition.slideshow.updateInterval.tooltip="Les informations su
|
|||||||
AdvSceneSwitcher.action.scene="Changer de scène"
|
AdvSceneSwitcher.action.scene="Changer de scène"
|
||||||
AdvSceneSwitcher.action.scene.type.program="Programme"
|
AdvSceneSwitcher.action.scene.type.program="Programme"
|
||||||
AdvSceneSwitcher.action.scene.type.preview="Aperçu"
|
AdvSceneSwitcher.action.scene.type.preview="Aperçu"
|
||||||
AdvSceneSwitcher.action.scene.entry="Changer la scène{{sceneTypes}}{{scenes}}en utilisant{{transitions}}avec une durée de{{duration}}secondes"
|
|
||||||
AdvSceneSwitcher.action.scene.entry.noDuration="Changer la scène{{sceneTypes}}{{scenes}}en utilisant{{transitions}}"
|
|
||||||
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Attendre que la transition vers la scène cible soit terminée"
|
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Attendre que la transition vers la scène cible soit terminée"
|
||||||
AdvSceneSwitcher.action.wait="Attendre"
|
AdvSceneSwitcher.action.wait="Attendre"
|
||||||
AdvSceneSwitcher.action.wait.type.fixed="fixe"
|
AdvSceneSwitcher.action.wait.type.fixed="fixe"
|
||||||
@@ -704,10 +701,10 @@ 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.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.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.currentSegmentValue="Valeur actuelle :"
|
||||||
AdvSceneSwitcher.action.variable.entry.substringIndex="Début de la sous-chaîne :{{subStringStart}}Taille de la sous-chaîne :{{subStringSize}}"
|
AdvSceneSwitcher.action.variable.layout.substringIndex="Début de la sous-chaîne :{{subStringStart}}Taille de la sous-chaîne :{{subStringSize}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.substringRegex="Attribuer la valeur du match{{regexMatchIdx}}en utilisant une expression régulière :"
|
AdvSceneSwitcher.action.variable.layout.substringRegex="Attribuer la valeur du match{{regexMatchIdx}}en utilisant une expression régulière :"
|
||||||
AdvSceneSwitcher.action.variable.entry.userInput.customPrompt="{{useCustomPrompt}}Utiliser un message personnalisé{{inputPrompt}}"
|
AdvSceneSwitcher.action.variable.layout.userInput.customPrompt="{{useCustomPrompt}}Utiliser un message personnalisé{{inputPrompt}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.userInput.placeholder="{{useInputPlaceholder}}Remplir avec un indicateur de position{{inputPlaceholder}}"
|
AdvSceneSwitcher.action.variable.layout.userInput.placeholder="{{useInputPlaceholder}}Remplir avec un indicateur de position{{inputPlaceholder}}"
|
||||||
AdvSceneSwitcher.action.projector="Projecteur"
|
AdvSceneSwitcher.action.projector="Projecteur"
|
||||||
AdvSceneSwitcher.action.projector.type.source="Source"
|
AdvSceneSwitcher.action.projector.type.source="Source"
|
||||||
AdvSceneSwitcher.action.projector.type.scene="Scène"
|
AdvSceneSwitcher.action.projector.type.scene="Scène"
|
||||||
@@ -921,9 +918,9 @@ AdvSceneSwitcher.hotkey.startStopToggleSwitcherHotkey="Basculer le démarrage/ar
|
|||||||
AdvSceneSwitcher.hotkey.macro.pause="Mettre en pause la macro %1"
|
AdvSceneSwitcher.hotkey.macro.pause="Mettre en pause la macro %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.unpause="Reprendre la macro %1"
|
AdvSceneSwitcher.hotkey.macro.unpause="Reprendre la macro %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.togglePause="Basculer la pause de la macro %1"
|
AdvSceneSwitcher.hotkey.macro.togglePause="Basculer la pause de la macro %1"
|
||||||
AdvSceneSwitcher.hotkey.upMacroSegmentHotkey="Déplacer la sélection du segment de macro vers le haut"
|
AdvSceneSwitcher.hotkey.macro.segment.up="Déplacer la sélection du segment de macro vers le haut"
|
||||||
AdvSceneSwitcher.hotkey.downMacroSegmentHotkey="Déplacer la sélection du segment de macro vers le bas"
|
AdvSceneSwitcher.hotkey.macro.segment.down="Déplacer la sélection du segment de macro vers le bas"
|
||||||
AdvSceneSwitcher.hotkey.removeMacroSegmentHotkey="Supprimer le segment de macro sélectionné"
|
AdvSceneSwitcher.hotkey.macro.segment.remove="Supprimer le segment de macro sélectionné"
|
||||||
|
|
||||||
AdvSceneSwitcher.askBackup="Une nouvelle version du commutateur de scènes avancé a été détectée.\nSouhaitez-vous créer une sauvegarde des anciens paramètres ?"
|
AdvSceneSwitcher.askBackup="Une nouvelle version du commutateur de scènes avancé a été détectée.\nSouhaitez-vous créer une sauvegarde des anciens paramètres ?"
|
||||||
AdvSceneSwitcher.askForMacro="Sélectionnez la macro{{macroSelection}}"
|
AdvSceneSwitcher.askForMacro="Sélectionnez la macro{{macroSelection}}"
|
||||||
@@ -1108,15 +1105,15 @@ AdvSceneSwitcher.sceneItemSelection.configure="Configurer le type de sélection
|
|||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceName="Nom de la source"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceName="Nom de la source"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable="Nom de la variable"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable="Nom de la variable"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern="Le nom de la source correspond au motif"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern="Le nom de la source correspond au motif"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern.entry="{{nameConflictIndex}}correspondant à{{pattern}}{{regex}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern.layout="{{nameConflictIndex}}correspondant à{{pattern}}{{regex}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType="Sources de type"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceType="Sources de type"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType.entry="{{nameConflictIndex}}Type de source{{sourceTypes}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceType.layout="{{nameConflictIndex}}Type de source{{sourceTypes}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.index="Source avec index"
|
AdvSceneSwitcher.sceneItemSelection.type.index="Source avec index"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.index.entry="{{index}}source"
|
AdvSceneSwitcher.sceneItemSelection.type.index.layout="{{index}}source"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.indexRange="Sources dans la plage d'index"
|
AdvSceneSwitcher.sceneItemSelection.type.indexRange="Sources dans la plage d'index"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.indexRange.entry="Sources de{{index}}à{{indexEnd}}"
|
AdvSceneSwitcher.sceneItemSelection.type.indexRange.layout="Sources de{{index}}à{{indexEnd}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.all="Toutes les sources"
|
AdvSceneSwitcher.sceneItemSelection.type.all="Toutes les sources"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.all.entry="Toutes les sources"
|
AdvSceneSwitcher.sceneItemSelection.type.all.layout="Toutes les sources"
|
||||||
AdvSceneSwitcher.sceneItemSelection.all="Tout"
|
AdvSceneSwitcher.sceneItemSelection.all="Tout"
|
||||||
AdvSceneSwitcher.sceneItemSelection.any="N'importe lequel"
|
AdvSceneSwitcher.sceneItemSelection.any="N'importe lequel"
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@ AdvSceneSwitcher.generalTab.status.onStartup.alwaysStart="Sempre iniciar o switc
|
|||||||
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Não iniciar o switcher de cenas"
|
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Não iniciar o switcher de cenas"
|
||||||
AdvSceneSwitcher.generalTab.status.start="Iniciar"
|
AdvSceneSwitcher.generalTab.status.start="Iniciar"
|
||||||
AdvSceneSwitcher.generalTab.status.stop="Parar"
|
AdvSceneSwitcher.generalTab.status.stop="Parar"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart="Iniciar automaticamente o switcher de cenas quando:"
|
AdvSceneSwitcher.generalTab.status.autoStart.startup="Iniciar automaticamente o switcher de cenas quando:"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.never="Nunca"
|
AdvSceneSwitcher.generalTab.status.autoStart.never="Nunca"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.recording="Gravando"
|
AdvSceneSwitcher.generalTab.status.autoStart.recording="Gravando"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Transmitindo"
|
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Transmitindo"
|
||||||
@@ -30,7 +30,6 @@ AdvSceneSwitcher.generalTab.generalBehavior.logLevel="Nível de log:"
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default="Padrão"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default="Padrão"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logAction="Registrar ações executadas"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logAction="Registrar ações executadas"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose="Registro detalhado"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose="Registro detalhado"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Ativar registro detalhado"
|
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Salvar posição e tamanho da janela"
|
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Salvar posição e tamanho da janela"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Mostrar notificações na área de notificação"
|
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Mostrar notificações na área de notificação"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Desativar dicas de interface"
|
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Desativar dicas de interface"
|
||||||
@@ -49,7 +48,7 @@ AdvSceneSwitcher.generalTab.saveOrLoadsettings.export="Exportar"
|
|||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Importar"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Importar"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Exportar configurações do Advanced Scene Switcher para arquivo ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Exportar configurações do Advanced Scene Switcher para arquivo ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Importar configurações do Advanced Scene Switcher de arquivo ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Importar configurações do Advanced Scene Switcher de arquivo ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Arquivos de texto (*.txt)"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Arquivos de texto (*.txt *.json)"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="O Advanced Scene Switcher falhou ao importar configurações"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="O Advanced Scene Switcher falhou ao importar configurações"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Configurações do Advanced Scene Switcher importadas com sucesso"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Configurações do Advanced Scene Switcher importadas com sucesso"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportSensitiveDataWarning="Aviso:\nOs dados exportados podem conter informações sensíveis!"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportSensitiveDataWarning="Aviso:\nOs dados exportados podem conter informações sensíveis!"
|
||||||
@@ -373,16 +372,16 @@ AdvSceneSwitcher.condition.video.colorDeviationThresholdDescription="Quão semel
|
|||||||
AdvSceneSwitcher.condition.video.type.main="Saída principal do OBS"
|
AdvSceneSwitcher.condition.video.type.main="Saída principal do OBS"
|
||||||
AdvSceneSwitcher.condition.video.type.source="Fonte"
|
AdvSceneSwitcher.condition.video.type.source="Fonte"
|
||||||
AdvSceneSwitcher.condition.video.type.scene="Cena"
|
AdvSceneSwitcher.condition.video.type.scene="Cena"
|
||||||
AdvSceneSwitcher.condition.video.entry="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
AdvSceneSwitcher.condition.video.layout="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.modelPath="Dados do modelo (classificador em cascata haar):{{modelDataPath}}"
|
AdvSceneSwitcher.condition.video.layout.modelPath="Dados do modelo (classificador em cascata haar):{{modelDataPath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.minNeighbor="Vizinhos mínimos:{{minNeighbors}}"
|
AdvSceneSwitcher.condition.video.layout.minNeighbor="Vizinhos mínimos:{{minNeighbors}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.throttle="{{throttleEnable}}Reduzir carga de CPU realizando a verificação apenas a cada {{throttleCount}} milissegundos"
|
AdvSceneSwitcher.condition.video.layout.throttle="{{throttleEnable}}Reduzir carga de CPU realizando a verificação apenas a cada {{throttleCount}} milissegundos"
|
||||||
AdvSceneSwitcher.condition.video.entry.checkAreaEnable="Realizar verificação apenas na área"
|
AdvSceneSwitcher.condition.video.layout.checkAreaEnable="Realizar verificação apenas na área"
|
||||||
AdvSceneSwitcher.condition.video.entry.checkArea="{{checkAreaEnable}}{{checkArea}}{{selectArea}}"
|
AdvSceneSwitcher.condition.video.layout.checkArea="{{checkAreaEnable}}{{checkArea}}{{selectArea}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcColorPick="Verificar cor do texto:{{textColor}}{{selectColor}}"
|
AdvSceneSwitcher.condition.video.layout.ocrColorPick="Verificar cor do texto:{{textColor}}{{selectColor}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcTextType="Verificar tipo de texto:{{textType}}"
|
AdvSceneSwitcher.condition.video.layout.ocrTextType="Verificar tipo de texto:{{textType}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcLanguage="Verificar idioma:{{languageCode}}"
|
AdvSceneSwitcher.condition.video.layout.ocrLanguage="Verificar idioma:{{languageCode}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.color="Verificar cor:{{color}}{{selectColor}}"
|
AdvSceneSwitcher.condition.video.layout.color="Verificar cor:{{color}}{{selectColor}}"
|
||||||
AdvSceneSwitcher.condition.video.minSize="Tamanho mínimo:"
|
AdvSceneSwitcher.condition.video.minSize="Tamanho mínimo:"
|
||||||
AdvSceneSwitcher.condition.video.maxSize="Tamanho máximo:"
|
AdvSceneSwitcher.condition.video.maxSize="Tamanho máximo:"
|
||||||
AdvSceneSwitcher.condition.video.selectArea="Selecionar área"
|
AdvSceneSwitcher.condition.video.selectArea="Selecionar área"
|
||||||
@@ -721,9 +720,6 @@ AdvSceneSwitcher.condition.noDevicesFoundWarning="Nenhum dispositivo USB detecta
|
|||||||
AdvSceneSwitcher.action.scene="Trocar cena"
|
AdvSceneSwitcher.action.scene="Trocar cena"
|
||||||
AdvSceneSwitcher.action.scene.type.program="Programa"
|
AdvSceneSwitcher.action.scene.type.program="Programa"
|
||||||
AdvSceneSwitcher.action.scene.type.preview="Pré-visualização"
|
AdvSceneSwitcher.action.scene.type.preview="Pré-visualização"
|
||||||
AdvSceneSwitcher.action.scene.entry="Trocar{{sceneTypes}}cena para{{scenes}}usando{{transitions}}com duração de{{duration}}segundos"
|
|
||||||
AdvSceneSwitcher.action.scene.entry.noDuration="Trocar{{sceneTypes}}cena para{{scenes}}usando{{transitions}}"
|
|
||||||
AdvSceneSwitcher.action.scene.entry.preview="Trocar{{sceneTypes}}cena para{{scenes}}"
|
|
||||||
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Aguardar até que a transição para a cena de destino seja concluída"
|
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Aguardar até que a transição para a cena de destino seja concluída"
|
||||||
AdvSceneSwitcher.action.wait="Aguardar"
|
AdvSceneSwitcher.action.wait="Aguardar"
|
||||||
AdvSceneSwitcher.action.wait.type.fixed="fixo"
|
AdvSceneSwitcher.action.wait.type.fixed="fixo"
|
||||||
@@ -865,9 +861,9 @@ AdvSceneSwitcher.action.macro.type.stop="Parar ações"
|
|||||||
AdvSceneSwitcher.action.macro.type.disableAction="Desabilitar ação"
|
AdvSceneSwitcher.action.macro.type.disableAction="Desabilitar ação"
|
||||||
AdvSceneSwitcher.action.macro.type.enableAction="Habilitar ação"
|
AdvSceneSwitcher.action.macro.type.enableAction="Habilitar ação"
|
||||||
AdvSceneSwitcher.action.macro.type.toggleAction="Alternar ação"
|
AdvSceneSwitcher.action.macro.type.toggleAction="Alternar ação"
|
||||||
AdvSceneSwitcher.action.macro.entry.run="{{actions}}{{actionTypes}}de{{macros}}"
|
AdvSceneSwitcher.action.macro.layout.run="{{actions}}{{actionSections}}de{{macros}}"
|
||||||
AdvSceneSwitcher.action.macro.entry.run.condition="{{conditionBehaviors}}de{{conditionMacros}}"
|
AdvSceneSwitcher.action.macro.layout.run.condition="{{conditionBehaviors}}de{{conditionMacros}}"
|
||||||
AdvSceneSwitcher.action.macro.entry.other="{{actions}}{{actionIndex}}{{macros}}"
|
AdvSceneSwitcher.action.macro.layout.other="{{actions}}{{macros}}"
|
||||||
AdvSceneSwitcher.action.pluginState="Estado do plugin"
|
AdvSceneSwitcher.action.pluginState="Estado do plugin"
|
||||||
AdvSceneSwitcher.action.pluginState.type.stop="Parar o plugin Advanced Scene Switcher"
|
AdvSceneSwitcher.action.pluginState.type.stop="Parar o plugin Advanced Scene Switcher"
|
||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="Alterar o comportamento em caso de não correspondência:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="Alterar o comportamento em caso de não correspondência:"
|
||||||
@@ -875,7 +871,7 @@ AdvSceneSwitcher.action.pluginState.type.import="Importar configurações de"
|
|||||||
AdvSceneSwitcher.action.pluginState.importWarning="Nota: Ação será ignorada enquanto a janela de configurações estiver aberta."
|
AdvSceneSwitcher.action.pluginState.importWarning="Nota: Ação será ignorada enquanto a janela de configurações estiver aberta."
|
||||||
AdvSceneSwitcher.action.pluginState.type.terminate="Desligar OBS"
|
AdvSceneSwitcher.action.pluginState.type.terminate="Desligar OBS"
|
||||||
AdvSceneSwitcher.action.pluginState.terminateConfirm="O OBS será desligado automaticamente em 10 segundos!\nDeseja continuar com o desligamento do OBS?"
|
AdvSceneSwitcher.action.pluginState.terminateConfirm="O OBS será desligado automaticamente em 10 segundos!\nDeseja continuar com o desligamento do OBS?"
|
||||||
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}{{settingsWarning}}"
|
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}"
|
||||||
AdvSceneSwitcher.action.virtualCamera="Câmera virtual"
|
AdvSceneSwitcher.action.virtualCamera="Câmera virtual"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.stop="Parar câmera virtual"
|
AdvSceneSwitcher.action.virtualCamera.type.stop="Parar câmera virtual"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.start="Iniciar câmera virtual"
|
AdvSceneSwitcher.action.virtualCamera.type.start="Iniciar câmera virtual"
|
||||||
@@ -1012,7 +1008,7 @@ AdvSceneSwitcher.action.variable.type.askForValue="Obter entrada do usuário"
|
|||||||
AdvSceneSwitcher.action.variable.type.environmentVariable="Definir valor da variável de ambiente"
|
AdvSceneSwitcher.action.variable.type.environmentVariable="Definir valor da variável de ambiente"
|
||||||
AdvSceneSwitcher.action.variable.type.sceneItemCount="Definir para contagem de itens de cena"
|
AdvSceneSwitcher.action.variable.type.sceneItemCount="Definir para contagem de itens de cena"
|
||||||
AdvSceneSwitcher.action.variable.type.stringLength="Definir comprimento da string"
|
AdvSceneSwitcher.action.variable.type.stringLength="Definir comprimento da string"
|
||||||
AdvSceneSwitcher.action.variable.type.extractJson="Extrair campo json com nome"
|
AdvSceneSwitcher.action.variable.type.extractJsonField="Extrair campo json com nome"
|
||||||
AdvSceneSwitcher.action.variable.type.setToTempvar="Definir para propriedade da macro"
|
AdvSceneSwitcher.action.variable.type.setToTempvar="Definir para propriedade da macro"
|
||||||
AdvSceneSwitcher.action.variable.type.setToTempvar.help="Este tipo de ação permite extrair valores de segmentos da macro atual e atribuir esses valores à variável selecionada.\nPor exemplo, você pode obter o nome da cena atual de uma condição de cena e atribuir esse nome a uma variável."
|
AdvSceneSwitcher.action.variable.type.setToTempvar.help="Este tipo de ação permite extrair valores de segmentos da macro atual e atribuir esses valores à variável selecionada.\nPor exemplo, você pode obter o nome da cena atual de uma condição de cena e atribuir esse nome a uma variável."
|
||||||
AdvSceneSwitcher.action.variable.type.sceneItemName="Definir para nome do item de cena no índice"
|
AdvSceneSwitcher.action.variable.type.sceneItemName="Definir para nome do item de cena no índice"
|
||||||
@@ -1032,13 +1028,13 @@ AdvSceneSwitcher.action.variable.invalidSelection="Seleção inválida!"
|
|||||||
AdvSceneSwitcher.action.variable.actionNoVariableSupport="Obter valores de variáveis das ações %1 não é suportado!"
|
AdvSceneSwitcher.action.variable.actionNoVariableSupport="Obter valores de variáveis das ações %1 não é suportado!"
|
||||||
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="Obter valores de variáveis das condições %1 não é suportado!"
|
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="Obter valores de variáveis das condições %1 não é suportado!"
|
||||||
AdvSceneSwitcher.action.variable.currentSegmentValue="Valor atual:"
|
AdvSceneSwitcher.action.variable.currentSegmentValue="Valor atual:"
|
||||||
AdvSceneSwitcher.action.variable.entry.pad="{{actions}}de{{variables}}para comprimento{{stringLength}}adicionando{{paddingCharSelection}}ao{{direction}}"
|
AdvSceneSwitcher.action.variable.layout.pad="{{actions}}de{{variables}}para comprimento{{stringLength}}adicionando{{paddingCharSelection}}ao{{direction}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.truncate="{{actions}}de{{variables}}para comprimento{{stringLength}}removendo caracteres da{{direction}}"
|
AdvSceneSwitcher.action.variable.layout.truncate="{{actions}}de{{variables}}para comprimento{{stringLength}}removendo caracteres da{{direction}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.substringIndex="Início da substring:{{subStringStart}}Tamanho da substring:{{subStringSize}}"
|
AdvSceneSwitcher.action.variable.layout.substringIndex="Início da substring:{{subStringStart}}Tamanho da substring:{{subStringSize}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.substringRegex="Atribuir valor do{{regexMatchIdx}}correspondência usando expressão regular:"
|
AdvSceneSwitcher.action.variable.layout.substringRegex="Atribuir valor do{{regexMatchIdx}}correspondência usando expressão regular:"
|
||||||
AdvSceneSwitcher.action.variable.entry.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
AdvSceneSwitcher.action.variable.layout.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.userInput.customPrompt="{{useCustomPrompt}}Usar prompt personalizado{{inputPrompt}}"
|
AdvSceneSwitcher.action.variable.layout.userInput.customPrompt="{{useCustomPrompt}}Usar prompt personalizado{{inputPrompt}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.userInput.placeholder="{{useInputPlaceholder}}Preencher com placeholder{{inputPlaceholder}}"
|
AdvSceneSwitcher.action.variable.layout.userInput.placeholder="{{useInputPlaceholder}}Preencher com placeholder{{inputPlaceholder}}"
|
||||||
AdvSceneSwitcher.action.projector="Projetor"
|
AdvSceneSwitcher.action.projector="Projetor"
|
||||||
AdvSceneSwitcher.action.projector.type.source="Fonte"
|
AdvSceneSwitcher.action.projector.type.source="Fonte"
|
||||||
AdvSceneSwitcher.action.projector.type.scene="Cena"
|
AdvSceneSwitcher.action.projector.type.scene="Cena"
|
||||||
@@ -1112,9 +1108,9 @@ AdvSceneSwitcher.hotkey.startStopToggleSwitcherHotkey="Alternar Iniciar/Parar pa
|
|||||||
AdvSceneSwitcher.hotkey.macro.pause="Pausar macro %1"
|
AdvSceneSwitcher.hotkey.macro.pause="Pausar macro %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.unpause="Retomar macro %1"
|
AdvSceneSwitcher.hotkey.macro.unpause="Retomar macro %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.togglePause="Alternar pausa da macro %1"
|
AdvSceneSwitcher.hotkey.macro.togglePause="Alternar pausa da macro %1"
|
||||||
AdvSceneSwitcher.hotkey.upMacroSegmentHotkey="Mover seleção de segmento de macro para cima"
|
AdvSceneSwitcher.hotkey.macro.segment.up="Mover seleção de segmento de macro para cima"
|
||||||
AdvSceneSwitcher.hotkey.downMacroSegmentHotkey="Mover seleção de segmento de macro para baixo"
|
AdvSceneSwitcher.hotkey.macro.segment.down="Mover seleção de segmento de macro para baixo"
|
||||||
AdvSceneSwitcher.hotkey.removeMacroSegmentHotkey="Remover segmento de macro selecionado"
|
AdvSceneSwitcher.hotkey.macro.segment.remove="Remover segmento de macro selecionado"
|
||||||
|
|
||||||
AdvSceneSwitcher.askBackup="Detectada uma nova versão do Advanced Scene Switcher.\nDeve ser criado um backup das configurações antigas?"
|
AdvSceneSwitcher.askBackup="Detectada uma nova versão do Advanced Scene Switcher.\nDeve ser criado um backup das configurações antigas?"
|
||||||
AdvSceneSwitcher.askForMacro="Selecionar macro{{macroSelection}}"
|
AdvSceneSwitcher.askForMacro="Selecionar macro{{macroSelection}}"
|
||||||
@@ -1852,19 +1848,19 @@ AdvSceneSwitcher.setting.transform.width="Largura"
|
|||||||
|
|
||||||
AdvSceneSwitcher.sceneItemSelection.configure="Configurar tipo de seleção de item de cena"
|
AdvSceneSwitcher.sceneItemSelection.configure="Configurar tipo de seleção de item de cena"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceName="Nome da fonte"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceName="Nome da fonte"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceName.entry="{{nameConflictIndex}}{{sourceName}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceName.layout="{{nameConflictIndex}}{{sourceName}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable="Nome da variável"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable="Nome da variável"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable.entry="{{nameConflictIndex}}{{variable}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable.layout="{{nameConflictIndex}}{{variable}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern="Nome da fonte corresponde ao padrão"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern="Nome da fonte corresponde ao padrão"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern.entry="{{nameConflictIndex}}correspondendo{{pattern}}{{regex}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern.layout="{{nameConflictIndex}}correspondendo{{pattern}}{{regex}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType="Fontes do tipo"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceType="Fontes do tipo"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType.entry="Tipo de fonte{{nameConflictIndex}}{{sourceTypes}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceType.layout="Tipo de fonte{{nameConflictIndex}}{{sourceTypes}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.index="Fonte com índice"
|
AdvSceneSwitcher.sceneItemSelection.type.index="Fonte com índice"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.index.entry="{{index}}fonte"
|
AdvSceneSwitcher.sceneItemSelection.type.index.layout="{{index}}fonte"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.indexRange="Fontes no intervalo de índices"
|
AdvSceneSwitcher.sceneItemSelection.type.indexRange="Fontes no intervalo de índices"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.indexRange.entry="Fontes de{{index}}para{{indexEnd}}"
|
AdvSceneSwitcher.sceneItemSelection.type.indexRange.layout="Fontes de{{index}}para{{indexEnd}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.all="Todas as fontes"
|
AdvSceneSwitcher.sceneItemSelection.type.all="Todas as fontes"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.all.entry="Todas as fontes"
|
AdvSceneSwitcher.sceneItemSelection.type.all.layout="Todas as fontes"
|
||||||
AdvSceneSwitcher.sceneItemSelection.all="Todas"
|
AdvSceneSwitcher.sceneItemSelection.all="Todas"
|
||||||
AdvSceneSwitcher.sceneItemSelection.any="Qualquer"
|
AdvSceneSwitcher.sceneItemSelection.any="Qualquer"
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ AdvSceneSwitcher.generalTab.status.onStartup.alwaysStart="Всегда запу
|
|||||||
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Не запускать переключатель сцен"
|
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Не запускать переключатель сцен"
|
||||||
AdvSceneSwitcher.generalTab.status.start="Старт"
|
AdvSceneSwitcher.generalTab.status.start="Старт"
|
||||||
AdvSceneSwitcher.generalTab.status.stop="Стоп"
|
AdvSceneSwitcher.generalTab.status.stop="Стоп"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart="Автоматически запускать переключатель сцен, когда:"
|
AdvSceneSwitcher.generalTab.status.autoStart.startup="Автоматически запускать переключатель сцен, когда:"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.never="Никогда"
|
AdvSceneSwitcher.generalTab.status.autoStart.never="Никогда"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.recording="Запись"
|
AdvSceneSwitcher.generalTab.status.autoStart.recording="Запись"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Вещание"
|
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Вещание"
|
||||||
@@ -25,7 +25,6 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch="Не пере
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Переключиться на любую сцену на вкладке Random"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Переключиться на любую сцену на вкладке Random"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Переключиться на:"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Переключиться на:"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="В течение этого времени потенциальные совпадения будут игнорироваться!"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="В течение этого времени потенциальные совпадения будут игнорироваться!"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Включить ведение подробного журнала"
|
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Сохранять положение и размер окна"
|
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Сохранять положение и размер окна"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Отключить подсказки пользовательского интерфейса"
|
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Отключить подсказки пользовательского интерфейса"
|
||||||
AdvSceneSwitcher.generalTab.priority="Приоритет"
|
AdvSceneSwitcher.generalTab.priority="Приоритет"
|
||||||
@@ -37,7 +36,7 @@ AdvSceneSwitcher.generalTab.saveOrLoadsettings.export="Экспорт"
|
|||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Импорт"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="Импорт"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Экспортировать настройки расширенного переключателя сцен в файл ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Экспортировать настройки расширенного переключателя сцен в файл ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Импортировать настройки Advanced Scene Switcher из файла ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Импортировать настройки Advanced Scene Switcher из файла ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Текстовые файлы (*.txt)"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Текстовые файлы (*.txt *.json)"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="Advanced Scene Switcher не удалось импортировать настройки"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="Advanced Scene Switcher не удалось импортировать настройки"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Настройки Advanced Scene Switcher импортированы успешно"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Настройки Advanced Scene Switcher импортированы успешно"
|
||||||
AdvSceneSwitcher.generalTab.priority.fileContent="Содержание файла"
|
AdvSceneSwitcher.generalTab.priority.fileContent="Содержание файла"
|
||||||
@@ -115,7 +114,6 @@ AdvSceneSwitcher.condition.pluginState.entry="{{condition}}"
|
|||||||
|
|
||||||
; Macro Actions
|
; Macro Actions
|
||||||
AdvSceneSwitcher.action.scene="Переключить сцену"
|
AdvSceneSwitcher.action.scene="Переключить сцену"
|
||||||
AdvSceneSwitcher.action.scene.entry="Перейти к сцене{{sceneTypes}}{{scenes}}используя{{transitions}}с продолжительностью{{duration}}секунд"
|
|
||||||
AdvSceneSwitcher.action.wait="Подождать"
|
AdvSceneSwitcher.action.wait="Подождать"
|
||||||
AdvSceneSwitcher.action.wait.type.fixed="фиксированный"
|
AdvSceneSwitcher.action.wait.type.fixed="фиксированный"
|
||||||
AdvSceneSwitcher.action.wait.type.random="случайный"
|
AdvSceneSwitcher.action.wait.type.random="случайный"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ AdvSceneSwitcher.generalTab.status.onStartup.alwaysStart="Her zaman sahne deği
|
|||||||
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Sahne değiştiriciyi başlatma"
|
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="Sahne değiştiriciyi başlatma"
|
||||||
AdvSceneSwitcher.generalTab.status.start="Başlat"
|
AdvSceneSwitcher.generalTab.status.start="Başlat"
|
||||||
AdvSceneSwitcher.generalTab.status.stop="Durdur"
|
AdvSceneSwitcher.generalTab.status.stop="Durdur"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart="Aşağıdaki durumlarda sahne değiştiriciyi otomatik olarak başlatın:"
|
AdvSceneSwitcher.generalTab.status.autoStart.startup="Aşağıdaki durumlarda sahne değiştiriciyi otomatik olarak başlatın:"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.never="Asla"
|
AdvSceneSwitcher.generalTab.status.autoStart.never="Asla"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.recording="Kayıt"
|
AdvSceneSwitcher.generalTab.status.autoStart.recording="Kayıt"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Yayın"
|
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Yayın"
|
||||||
@@ -26,7 +26,6 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Rastgele s
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Değiştirmek:"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Değiştirmek:"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="Bir eşleşmeden sonra aşağıdakiler için işlem yapmayın:"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="Bir eşleşmeden sonra aşağıdakiler için işlem yapmayın:"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="Bu süre zarfında olası eşleşmeler göz ardı edilecektir!"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="Bu süre zarfında olası eşleşmeler göz ardı edilecektir!"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Ayrıntılı günlük kaydını etkinleştir"
|
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Pencere konumunu ve boyutunu kaydet"
|
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Pencere konumunu ve boyutunu kaydet"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Sistem tepsisi bildirimlerini göster"
|
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Sistem tepsisi bildirimlerini göster"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="UI ipuçlarını devre dışı bırak"
|
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="UI ipuçlarını devre dışı bırak"
|
||||||
@@ -39,7 +38,7 @@ AdvSceneSwitcher.generalTab.saveOrLoadsettings.export="Dışa Aktar"
|
|||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="İçe Aktar"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="İçe Aktar"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Gelişmiş Sahne Değiştirici ayarlarını dosyaya aktar ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="Gelişmiş Sahne Değiştirici ayarlarını dosyaya aktar ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Gelişmiş Sahne Değiştirici ayarlarını dosyadan içe aktar ..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="Gelişmiş Sahne Değiştirici ayarlarını dosyadan içe aktar ..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Text dosyası (*.txt)"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="Text dosyası (*.txt *.json)"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="Gelişmiş Sahne Değiştirici ayarları dosyadan içe aktarmakta başarısız oldu"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="Gelişmiş Sahne Değiştirici ayarları dosyadan içe aktarmakta başarısız oldu"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Gelişmiş Sahne Değiştirici ayarları başarılı bir şekilde dosyadan içe aktarıldı"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="Gelişmiş Sahne Değiştirici ayarları başarılı bir şekilde dosyadan içe aktarıldı"
|
||||||
AdvSceneSwitcher.generalTab.priority.fileContent="Dosya İçeriği"
|
AdvSceneSwitcher.generalTab.priority.fileContent="Dosya İçeriği"
|
||||||
@@ -140,10 +139,10 @@ AdvSceneSwitcher.condition.video.screenshotFail="Kaynağın ekran görüntüsü
|
|||||||
AdvSceneSwitcher.condition.video.patternMatchFail="Desen bulunamadı!"
|
AdvSceneSwitcher.condition.video.patternMatchFail="Desen bulunamadı!"
|
||||||
AdvSceneSwitcher.condition.video.objectMatchFail="Nesne bulunamadı!"
|
AdvSceneSwitcher.condition.video.objectMatchFail="Nesne bulunamadı!"
|
||||||
AdvSceneSwitcher.condition.video.modelLoadFail="Model verileri yüklenemedi!"
|
AdvSceneSwitcher.condition.video.modelLoadFail="Model verileri yüklenemedi!"
|
||||||
AdvSceneSwitcher.condition.video.entry="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
AdvSceneSwitcher.condition.video.layout="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.modelPath="Model verileri (haar kademeli sınıflandırıcı):{{modelDataPath}}"
|
AdvSceneSwitcher.condition.video.layout.modelPath="Model verileri (haar kademeli sınıflandırıcı):{{modelDataPath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.minNeighbor="Minimum komşular: {{minNeighbors}}"
|
AdvSceneSwitcher.condition.video.layout.minNeighbor="Minimum komşular: {{minNeighbors}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.throttle="{{throttleEnable}} Yalnızca her seferinde kontrol gerçekleştirerek CPU yükünü azaltın {{throttleCount}} millisaniyeler"
|
AdvSceneSwitcher.condition.video.layout.throttle="{{throttleEnable}} Yalnızca her seferinde kontrol gerçekleştirerek CPU yükünü azaltın {{throttleCount}} millisaniyeler"
|
||||||
AdvSceneSwitcher.condition.stream="Yayınlama"
|
AdvSceneSwitcher.condition.stream="Yayınlama"
|
||||||
AdvSceneSwitcher.condition.stream.state.start="Yayın çalışıyor"
|
AdvSceneSwitcher.condition.stream.state.start="Yayın çalışıyor"
|
||||||
AdvSceneSwitcher.condition.stream.state.stop="Yayın durdu"
|
AdvSceneSwitcher.condition.stream.state.stop="Yayın durdu"
|
||||||
@@ -250,7 +249,6 @@ AdvSceneSwitcher.condition.openvr.entry.line3="HMD mevcut {{xPos}} x {{yPos}} x
|
|||||||
|
|
||||||
; Macro Actions
|
; Macro Actions
|
||||||
AdvSceneSwitcher.action.scene="Sahne Degistirici"
|
AdvSceneSwitcher.action.scene="Sahne Degistirici"
|
||||||
AdvSceneSwitcher.action.scene.entry="Sahneyi{{sceneTypes}}{{scenes}}kullanarak{{transitions}}süresi olan{{duration}}saniye"
|
|
||||||
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Hedef sahneye geçiş tamamlanana kadar bekleyin"
|
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="Hedef sahneye geçiş tamamlanana kadar bekleyin"
|
||||||
AdvSceneSwitcher.action.wait="Bekle"
|
AdvSceneSwitcher.action.wait="Bekle"
|
||||||
AdvSceneSwitcher.action.wait.type.fixed="sabit"
|
AdvSceneSwitcher.action.wait.type.fixed="sabit"
|
||||||
@@ -313,7 +311,7 @@ AdvSceneSwitcher.action.pluginState.type.stop="Advanced Scene Switcher eklentisi
|
|||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="Eşleşmeme davranışını değiştirin:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="Eşleşmeme davranışını değiştirin:"
|
||||||
AdvSceneSwitcher.action.pluginState.type.import="Ayarları şuradan içe aktar:"
|
AdvSceneSwitcher.action.pluginState.type.import="Ayarları şuradan içe aktar:"
|
||||||
AdvSceneSwitcher.action.pluginState.importWarning="Not: Ayarlar penceresi açılırken eylem göz ardı edilecektir."
|
AdvSceneSwitcher.action.pluginState.importWarning="Not: Ayarlar penceresi açılırken eylem göz ardı edilecektir."
|
||||||
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}{{settingsWarning}}"
|
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}"
|
||||||
AdvSceneSwitcher.action.virtualCamera="Sanal Kamera"
|
AdvSceneSwitcher.action.virtualCamera="Sanal Kamera"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.stop="Sanal Kamerayı Durdur"
|
AdvSceneSwitcher.action.virtualCamera.type.stop="Sanal Kamerayı Durdur"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.start="Sanal Kamerayı Başlat"
|
AdvSceneSwitcher.action.virtualCamera.type.start="Sanal Kamerayı Başlat"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ AdvSceneSwitcher.generalTab.status.onStartup.alwaysStart="总是自动启动"
|
|||||||
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="不要启动"
|
AdvSceneSwitcher.generalTab.status.onStartup.doNotStart="不要启动"
|
||||||
AdvSceneSwitcher.generalTab.status.start="启动"
|
AdvSceneSwitcher.generalTab.status.start="启动"
|
||||||
AdvSceneSwitcher.generalTab.status.stop="停止"
|
AdvSceneSwitcher.generalTab.status.stop="停止"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart="在以下情况下自动启动场景切换器:"
|
AdvSceneSwitcher.generalTab.status.autoStart.startup="在以下情况下自动启动场景切换器:"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.never="从不"
|
AdvSceneSwitcher.generalTab.status.autoStart.never="从不"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.recording="录制"
|
AdvSceneSwitcher.generalTab.status.autoStart.recording="录制"
|
||||||
AdvSceneSwitcher.generalTab.status.autoStart.streaming="直播"
|
AdvSceneSwitcher.generalTab.status.autoStart.streaming="直播"
|
||||||
@@ -33,7 +33,6 @@ AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default="默认"
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logMacro="记录已执行的宏"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logMacro="记录已执行的宏"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logAction="记录已执行的操作"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logAction="记录已执行的操作"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose="记录所有信息"
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose="记录所有信息"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="详细日志输出"
|
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="保存窗口位置和大小"
|
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="保存窗口位置和大小"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="显示系统托盘通知"
|
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="显示系统托盘通知"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="禁用UI提示"
|
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="禁用UI提示"
|
||||||
@@ -52,7 +51,7 @@ AdvSceneSwitcher.generalTab.saveOrLoadsettings.export="导出设置"
|
|||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="导入设置"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.import="导入设置"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="导出高级场景切换器到文件..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle="导出高级场景切换器到文件..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="导入高级场景切换器到文件..."
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.importWindowTitle="导入高级场景切换器到文件..."
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="文本文件 (*.txt)"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType="文本文件 (*.txt *.json)"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="高级场景切换器导入设置失败"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail="高级场景切换器导入设置失败"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="高级场景切换器导入设置成功"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess="高级场景切换器导入设置成功"
|
||||||
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportSensitiveDataWarning="警告:\n导出的数据可能包含敏感信息!"
|
AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportSensitiveDataWarning="警告:\n导出的数据可能包含敏感信息!"
|
||||||
@@ -396,16 +395,16 @@ AdvSceneSwitcher.condition.video.colorDeviationThresholdDescription="颜色与
|
|||||||
AdvSceneSwitcher.condition.video.type.main="OBS的主输出"
|
AdvSceneSwitcher.condition.video.type.main="OBS的主输出"
|
||||||
AdvSceneSwitcher.condition.video.type.source="源"
|
AdvSceneSwitcher.condition.video.type.source="源"
|
||||||
AdvSceneSwitcher.condition.video.type.scene="场景"
|
AdvSceneSwitcher.condition.video.type.scene="场景"
|
||||||
AdvSceneSwitcher.condition.video.entry="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
AdvSceneSwitcher.condition.video.layout="{{videoInputTypes}}{{sources}}{{scenes}}{{condition}}{{imagePath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.modelPath="模型数据 (haar级联分类器): {{modelDataPath}}"
|
AdvSceneSwitcher.condition.video.layout.modelPath="模型数据 (haar级联分类器): {{modelDataPath}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.minNeighbor="最小区域: {{minNeighbors}}"
|
AdvSceneSwitcher.condition.video.layout.minNeighbor="最小区域: {{minNeighbors}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.throttle="{{throttleEnable}}每隔{{throttleCount}} 毫秒,才执行一次检查,从而减少 CPU 负载."
|
AdvSceneSwitcher.condition.video.layout.throttle="{{throttleEnable}}每隔{{throttleCount}} 毫秒,才执行一次检查,从而减少 CPU 负载."
|
||||||
AdvSceneSwitcher.condition.video.entry.checkAreaEnable="仅在区域内执行检查"
|
AdvSceneSwitcher.condition.video.layout.checkAreaEnable="仅在区域内执行检查"
|
||||||
AdvSceneSwitcher.condition.video.entry.checkArea="{{checkAreaEnable}}{{checkArea}}{{selectArea}}"
|
AdvSceneSwitcher.condition.video.layout.checkArea="{{checkAreaEnable}}{{checkArea}}{{selectArea}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcColorPick="文本检查颜色:{{textColor}}{{selectColor}}"
|
AdvSceneSwitcher.condition.video.layout.ocrColorPick="文本检查颜色:{{textColor}}{{selectColor}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcTextType="文本检查类型:{{textType}}"
|
AdvSceneSwitcher.condition.video.layout.ocrTextType="文本检查类型:{{textType}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.orcLanguage="语言检查:{{languageCode}}"
|
AdvSceneSwitcher.condition.video.layout.ocrLanguage="语言检查:{{languageCode}}"
|
||||||
AdvSceneSwitcher.condition.video.entry.color="颜色检查:{{color}}{{selectColor}}"
|
AdvSceneSwitcher.condition.video.layout.color="颜色检查:{{color}}{{selectColor}}"
|
||||||
AdvSceneSwitcher.condition.video.minSize="最小尺寸:"
|
AdvSceneSwitcher.condition.video.minSize="最小尺寸:"
|
||||||
AdvSceneSwitcher.condition.video.maxSize="最大尺寸:"
|
AdvSceneSwitcher.condition.video.maxSize="最大尺寸:"
|
||||||
AdvSceneSwitcher.condition.video.selectArea="选择区域"
|
AdvSceneSwitcher.condition.video.selectArea="选择区域"
|
||||||
@@ -699,7 +698,7 @@ AdvSceneSwitcher.condition.twitch.type.event.channel.user.moderator.deletion="
|
|||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online.live="开始直播"
|
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online.live="开始直播"
|
||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online.playlist="开始播放列表"
|
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online.playlist="开始播放列表"
|
||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online.watchParty="开始观看派对"
|
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online.watchParty="开始观看派对"
|
||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online.premiere="开始首播
|
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online.premiere="开始首播"
|
||||||
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online.rerun="开始重播"
|
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online.rerun="开始重播"
|
||||||
AdvSceneSwitcher.condition.twitch.type.polling.channel.live="当前正在直播"
|
AdvSceneSwitcher.condition.twitch.type.polling.channel.live="当前正在直播"
|
||||||
AdvSceneSwitcher.condition.twitch.type.polling.channel.title="当前为头衔赛"
|
AdvSceneSwitcher.condition.twitch.type.polling.channel.title="当前为头衔赛"
|
||||||
@@ -780,9 +779,6 @@ AdvSceneSwitcher.action.unknown="未知操作"
|
|||||||
AdvSceneSwitcher.action.scene="切换场景"
|
AdvSceneSwitcher.action.scene="切换场景"
|
||||||
AdvSceneSwitcher.action.scene.type.program="程序"
|
AdvSceneSwitcher.action.scene.type.program="程序"
|
||||||
AdvSceneSwitcher.action.scene.type.preview="预览"
|
AdvSceneSwitcher.action.scene.type.preview="预览"
|
||||||
AdvSceneSwitcher.action.scene.entry="切换到场景{{sceneTypes}}{{scenes}}使用{{transitions}}时长{{duration}}秒"
|
|
||||||
AdvSceneSwitcher.action.scene.entry.noDuration="切换到场景{{sceneTypes}}{{scenes}}使用{{transitions}}"
|
|
||||||
AdvSceneSwitcher.action.scene.entry.preview="将{{sceneTypes}}场景切换到{{scenes}}"
|
|
||||||
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="等待转场到目标场景的动画完成"
|
AdvSceneSwitcher.action.scene.blockUntilTransitionDone="等待转场到目标场景的动画完成"
|
||||||
AdvSceneSwitcher.action.wait="等待"
|
AdvSceneSwitcher.action.wait="等待"
|
||||||
AdvSceneSwitcher.action.wait.type.fixed="固定"
|
AdvSceneSwitcher.action.wait.type.fixed="固定"
|
||||||
@@ -924,9 +920,9 @@ AdvSceneSwitcher.action.macro.type.stop="停止操作"
|
|||||||
AdvSceneSwitcher.action.macro.type.disableAction="停用操作"
|
AdvSceneSwitcher.action.macro.type.disableAction="停用操作"
|
||||||
AdvSceneSwitcher.action.macro.type.enableAction="启用操作"
|
AdvSceneSwitcher.action.macro.type.enableAction="启用操作"
|
||||||
AdvSceneSwitcher.action.macro.type.toggleAction="切换操作开关"
|
AdvSceneSwitcher.action.macro.type.toggleAction="切换操作开关"
|
||||||
AdvSceneSwitcher.action.macro.entry.run="{{actions}}{{actionTypes}}{{macros}}"
|
AdvSceneSwitcher.action.macro.layout.run="{{actions}}{{actionSections}}{{macros}}"
|
||||||
AdvSceneSwitcher.action.macro.entry.run.condition="{{conditionBehaviors}}{{conditionMacros}}"
|
AdvSceneSwitcher.action.macro.layout.run.condition="{{conditionBehaviors}}{{conditionMacros}}"
|
||||||
AdvSceneSwitcher.action.macro.entry.other="{{actions}}{{actionIndex}}{{macros}}"
|
AdvSceneSwitcher.action.macro.layout.other="{{actions}}{{macros}}"
|
||||||
AdvSceneSwitcher.action.pluginState="插件状态"
|
AdvSceneSwitcher.action.pluginState="插件状态"
|
||||||
AdvSceneSwitcher.action.pluginState.type.stop="停止高级场景切换插件"
|
AdvSceneSwitcher.action.pluginState.type.stop="停止高级场景切换插件"
|
||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="没有匹配项时:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="没有匹配项时:"
|
||||||
@@ -934,7 +930,7 @@ AdvSceneSwitcher.action.pluginState.type.import="导入设置"
|
|||||||
AdvSceneSwitcher.action.pluginState.importWarning="注意:当设置窗口打开时,操作将被忽略."
|
AdvSceneSwitcher.action.pluginState.importWarning="注意:当设置窗口打开时,操作将被忽略."
|
||||||
AdvSceneSwitcher.action.pluginState.type.terminate="关闭OBS"
|
AdvSceneSwitcher.action.pluginState.type.terminate="关闭OBS"
|
||||||
AdvSceneSwitcher.action.pluginState.terminateConfirm="OBS将在10秒后自动关闭!\n你想继续关闭OBS吗?"
|
AdvSceneSwitcher.action.pluginState.terminateConfirm="OBS将在10秒后自动关闭!\n你想继续关闭OBS吗?"
|
||||||
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}{{settingsWarning}}"
|
AdvSceneSwitcher.action.pluginState.entry="{{actions}}{{values}}{{scenes}}{{settings}}"
|
||||||
AdvSceneSwitcher.action.virtualCamera="虚拟摄像机"
|
AdvSceneSwitcher.action.virtualCamera="虚拟摄像机"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.stop="停止虚拟摄像机"
|
AdvSceneSwitcher.action.virtualCamera.type.stop="停止虚拟摄像机"
|
||||||
AdvSceneSwitcher.action.virtualCamera.type.start="启动虚拟摄像机"
|
AdvSceneSwitcher.action.virtualCamera.type.start="启动虚拟摄像机"
|
||||||
@@ -1073,7 +1069,7 @@ AdvSceneSwitcher.action.variable.type.askForValue="获取用户输入内容"
|
|||||||
AdvSceneSwitcher.action.variable.type.environmentVariable="设置为环境变量值"
|
AdvSceneSwitcher.action.variable.type.environmentVariable="设置为环境变量值"
|
||||||
AdvSceneSwitcher.action.variable.type.sceneItemCount="设置为场景内的场景项目计数"
|
AdvSceneSwitcher.action.variable.type.sceneItemCount="设置为场景内的场景项目计数"
|
||||||
AdvSceneSwitcher.action.variable.type.stringLength="设置为字符串长度"
|
AdvSceneSwitcher.action.variable.type.stringLength="设置为字符串长度"
|
||||||
AdvSceneSwitcher.action.variable.type.extractJson="取JSON内字段的值"
|
AdvSceneSwitcher.action.variable.type.extractJsonField="取JSON内字段的值"
|
||||||
AdvSceneSwitcher.action.variable.type.setToTempvar="设置为宏属性"
|
AdvSceneSwitcher.action.variable.type.setToTempvar="设置为宏属性"
|
||||||
AdvSceneSwitcher.action.variable.type.setToTempvar.help="此操作类型将允许您从当前宏的部分中提取值,并将这些值分配给所选变量.\n例如,可以从场景条件中获取当前场景名称,并将该名称分配给变量."
|
AdvSceneSwitcher.action.variable.type.setToTempvar.help="此操作类型将允许您从当前宏的部分中提取值,并将这些值分配给所选变量.\n例如,可以从场景条件中获取当前场景名称,并将该名称分配给变量."
|
||||||
AdvSceneSwitcher.action.variable.type.sceneItemName="设置为场景项目索引的名称"
|
AdvSceneSwitcher.action.variable.type.sceneItemName="设置为场景项目索引的名称"
|
||||||
@@ -1102,15 +1098,14 @@ AdvSceneSwitcher.action.variable.invalidSelection="无效选择!"
|
|||||||
AdvSceneSwitcher.action.variable.actionNoVariableSupport="不支持从 %1 操作中获取变量值!"
|
AdvSceneSwitcher.action.variable.actionNoVariableSupport="不支持从 %1 操作中获取变量值!"
|
||||||
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="不支持从 %1 条件中获取变量值!"
|
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="不支持从 %1 条件中获取变量值!"
|
||||||
AdvSceneSwitcher.action.variable.currentSegmentValue="当前值:"
|
AdvSceneSwitcher.action.variable.currentSegmentValue="当前值:"
|
||||||
AdvSceneSwitcher.action.variable.entry.other="{{actions}}{{variables}}{{variables2}}{{strValue}}{{numValue}}{{segmentIndex}}{{mathExpression}}{{envVariableName}}{{scenes}}{{tempVars}}{{tempVarsHelp}}{{sceneItemIndex}}{{direction}}{{stringLength}}{{paddingCharSelection}}{{caseType}}"
|
AdvSceneSwitcher.action.variable.layout.pad="{{actions}}于{{variables}}的{{direction}}起,内容为{{paddingCharSelection}}将其变量值长度增加至{{stringLength}}."
|
||||||
AdvSceneSwitcher.action.variable.entry.pad="{{actions}}于{{variables}}的{{direction}}起,内容为{{paddingCharSelection}}将其变量值长度增加至{{stringLength}}."
|
AdvSceneSwitcher.action.variable.layout.truncate="{{actions}}于{{variables}}的{{direction}}起,将变量长度缩减至{{stringLength}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.truncate="{{actions}}于{{variables}}的{{direction}}起,将变量长度缩减至{{stringLength}}"
|
AdvSceneSwitcher.action.variable.layout.substringIndex="截取字符串开始位置:{{subStringStart}} 截取字符串长度:{{subStringSize}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.substringIndex="截取字符串开始位置:{{subStringStart}} 截取字符串长度:{{subStringSize}}"
|
AdvSceneSwitcher.action.variable.layout.substringRegex="使用正则表达式为 {{regexMatchIdx}} 匹配的值:"
|
||||||
AdvSceneSwitcher.action.variable.entry.substringRegex="使用正则表达式为 {{regexMatchIdx}} 匹配的值:"
|
AdvSceneSwitcher.action.variable.layout.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
AdvSceneSwitcher.action.variable.layout.userInput.customPrompt="{{useCustomPrompt}}使用自定义提示{{inputPrompt}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.userInput.customPrompt="{{useCustomPrompt}}使用自定义提示{{inputPrompt}}"
|
AdvSceneSwitcher.action.variable.layout.userInput.placeholder="{{useInputPlaceholder}}用占位符填充{{inputPlaceholder}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.userInput.placeholder="{{useInputPlaceholder}}用占位符填充{{inputPlaceholder}}"
|
AdvSceneSwitcher.action.variable.layout.randomNumber="在以下范围内生成随机数{{randomNumberStart}}到{{randomNumberEnd}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.randomNumber="在以下范围内生成随机数{{randomNumberStart}}到{{randomNumberEnd}}"
|
|
||||||
AdvSceneSwitcher.action.projector="投影仪"
|
AdvSceneSwitcher.action.projector="投影仪"
|
||||||
AdvSceneSwitcher.action.projector.type.source="源"
|
AdvSceneSwitcher.action.projector.type.source="源"
|
||||||
AdvSceneSwitcher.action.projector.type.scene="场景"
|
AdvSceneSwitcher.action.projector.type.scene="场景"
|
||||||
@@ -1191,9 +1186,9 @@ AdvSceneSwitcher.hotkey.startStopToggleSwitcherHotkey="切换(启动/停止)高
|
|||||||
AdvSceneSwitcher.hotkey.macro.pause="停用宏 %1"
|
AdvSceneSwitcher.hotkey.macro.pause="停用宏 %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.unpause="启用宏 %1"
|
AdvSceneSwitcher.hotkey.macro.unpause="启用宏 %1"
|
||||||
AdvSceneSwitcher.hotkey.macro.togglePause="切换(停用/启用)宏 %1"
|
AdvSceneSwitcher.hotkey.macro.togglePause="切换(停用/启用)宏 %1"
|
||||||
AdvSceneSwitcher.hotkey.upMacroSegmentHotkey="上移选择宏"
|
AdvSceneSwitcher.hotkey.macro.segment.up="上移选择宏"
|
||||||
AdvSceneSwitcher.hotkey.downMacroSegmentHotkey="下移选择宏"
|
AdvSceneSwitcher.hotkey.macro.segment.down="下移选择宏"
|
||||||
AdvSceneSwitcher.hotkey.removeMacroSegmentHotkey="删除选定的宏"
|
AdvSceneSwitcher.hotkey.macro.segment.remove="删除选定的宏"
|
||||||
|
|
||||||
AdvSceneSwitcher.askBackup="检测到新版本的高级场景切换器。\n是否要创建旧版本的设置备份?"
|
AdvSceneSwitcher.askBackup="检测到新版本的高级场景切换器。\n是否要创建旧版本的设置备份?"
|
||||||
AdvSceneSwitcher.askForMacro="选择宏 {{macroSelection}}"
|
AdvSceneSwitcher.askForMacro="选择宏 {{macroSelection}}"
|
||||||
@@ -2097,21 +2092,19 @@ AdvSceneSwitcher.setting.transform.width="宽度"
|
|||||||
|
|
||||||
AdvSceneSwitcher.sceneItemSelection.configure="配置场景项目选择类型"
|
AdvSceneSwitcher.sceneItemSelection.configure="配置场景项目选择类型"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceName="源名称"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceName="源名称"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceName.entry="{{nameConflictIndex}}{{sourceName}}"
|
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable="变量名称"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable="变量名称"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable.entry="{{nameConflictIndex}}{{variable}}"
|
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern="源名称与匹配相符"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern="源名称与匹配相符"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern.entry="{{nameConflictIndex}}匹配{{pattern}}{{regex}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern.layout="{{nameConflictIndex}}匹配{{pattern}}{{regex}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup="源分组中的来源"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup="源分组中的来源"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup.entry="{{sourceGroups}}中的源"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup.layout="{{nameConflictIndex}}{{sourceGroups}}中的源"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType="源类型"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceType="源类型"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType.entry="源类型{{nameConflictIndex}}{{sourceTypes}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceType.layout="源类型{{nameConflictIndex}}{{sourceTypes}}"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.index="附有索引的源"
|
AdvSceneSwitcher.sceneItemSelection.type.index="附有索引的源"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.index.entry="{{index}}源"
|
AdvSceneSwitcher.sceneItemSelection.type.index.layout="{{index}}源"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.indexRange="索引范围内的源"
|
AdvSceneSwitcher.sceneItemSelection.type.indexRange="索引范围内的源"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.indexRange.entry="从{{index}}到{{indexEnd}}的源"
|
AdvSceneSwitcher.sceneItemSelection.type.indexRange.layout="从{{index}}到{{indexEnd}}的源"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.all="所有源"
|
AdvSceneSwitcher.sceneItemSelection.type.all="所有源"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.all.entry="所有源"
|
AdvSceneSwitcher.sceneItemSelection.type.all.layout="所有源"
|
||||||
AdvSceneSwitcher.sceneItemSelection.all="全部"
|
AdvSceneSwitcher.sceneItemSelection.all="全部"
|
||||||
AdvSceneSwitcher.sceneItemSelection.any="任何"
|
AdvSceneSwitcher.sceneItemSelection.any="任何"
|
||||||
|
|
||||||
@@ -2135,9 +2128,9 @@ AdvSceneSwitcher.unit.weeks="周"
|
|||||||
AdvSceneSwitcher.unit.months="月"
|
AdvSceneSwitcher.unit.months="月"
|
||||||
AdvSceneSwitcher.unit.years="年"
|
AdvSceneSwitcher.unit.years="年"
|
||||||
AdvSceneSwitcher.duration.condition.none="没有时间限制"
|
AdvSceneSwitcher.duration.condition.none="没有时间限制"
|
||||||
AdvSceneSwitcher.duration.condition.more="时间少于"
|
AdvSceneSwitcher.duration.condition.more="时间大于"
|
||||||
AdvSceneSwitcher.duration.condition.equal="时间等于"
|
AdvSceneSwitcher.duration.condition.equal="时间等于"
|
||||||
AdvSceneSwitcher.duration.condition.less="时间大于"
|
AdvSceneSwitcher.duration.condition.less="时间少于"
|
||||||
AdvSceneSwitcher.duration.condition.within="最后"
|
AdvSceneSwitcher.duration.condition.within="最后"
|
||||||
|
|
||||||
AdvSceneSwitcher.time.relative="%1 %2 之前"
|
AdvSceneSwitcher.time.relative="%1 %2 之前"
|
||||||
|
|||||||
BIN
data/res/images/logo.ico
Normal file
BIN
data/res/images/logo.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
1
deps/date
vendored
Submodule
1
deps/date
vendored
Submodule
Submodule deps/date added at 5bdb7e6f31
2
deps/json
vendored
2
deps/json
vendored
Submodule deps/json updated: bc889afb4c...55f93686c0
1
deps/jsoncons
vendored
Submodule
1
deps/jsoncons
vendored
Submodule
Submodule deps/jsoncons added at 64b9da1e9f
2
deps/libusb
vendored
2
deps/libusb
vendored
Submodule deps/libusb updated: d52e355daa...15a7ebb4d4
1
deps/paho.mqtt.cpp
vendored
Submodule
1
deps/paho.mqtt.cpp
vendored
Submodule
Submodule deps/paho.mqtt.cpp added at 165476b1dc
File diff suppressed because it is too large
Load Diff
388
forms/macro-edit.ui
Normal file
388
forms/macro-edit.ui
Normal file
@@ -0,0 +1,388 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MacroEdit</class>
|
||||||
|
<widget class="QWidget" name="MacroEdit">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QSplitter" name="macroActionConditionSplitter">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="macroConditions" native="true">
|
||||||
|
<layout class="QVBoxLayout" name="macroConditionsLayout">
|
||||||
|
<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="advss::MacroSegmentList" name="conditionsList">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="conditionControlsLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="conditionAdd">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.conditionAddButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">addIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-plus</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="conditionRemove">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.conditionRemoveButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">removeIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-trash</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="conditionTop">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.conditionTopButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="conditionUp">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.conditionUpButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">upArrowIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-up</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="conditionDown">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.conditionDownButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">downArrowIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-down</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="conditionBottom">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.conditionBottomButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QSplitter" name="macroElseActionSplitter">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="macroActions" native="true">
|
||||||
|
<layout class="QVBoxLayout" name="macroActionsLayout">
|
||||||
|
<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="advss::MacroSegmentList" name="actionsList">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="actionControlsLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="actionAdd">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.actionAddButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">addIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-plus</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="actionRemove">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.actionRemoveButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">removeIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-trash</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="actionTop">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.actionTopButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="actionUp">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.actionUpButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">upArrowIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-up</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="actionDown">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.actionDownButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">downArrowIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-down</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="actionBottom">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.actionBottomButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_14">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="toggleElseActions">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.toggleShowElseSection</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="macroElseActions" native="true">
|
||||||
|
<layout class="QVBoxLayout" name="macroElseActionsLayout">
|
||||||
|
<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="advss::MacroSegmentList" name="elseActionsList">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="elseActionControlsLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="elseActionAdd">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.elseActionAddButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">addIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-plus</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="elseActionRemove">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.elseActionRemoveButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">removeIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-trash</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="elseActionTop">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.elseActionTopButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="elseActionUp">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.elseActionUpButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">upArrowIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-up</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="elseActionDown">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.elseActionDownButton</string>
|
||||||
|
</property>
|
||||||
|
<property name="themeID" stdset="0">
|
||||||
|
<string notr="true">downArrowIconSmall</string>
|
||||||
|
</property>
|
||||||
|
<property name="class" stdset="0">
|
||||||
|
<string notr="true">icon-down</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="elseActionBottom">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.tooltip.elseActionBottomButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>advss::MacroSegmentList</class>
|
||||||
|
<extends>QScrollArea</extends>
|
||||||
|
<header>macro-segment-list.hpp</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>conditionsList</tabstop>
|
||||||
|
<tabstop>conditionAdd</tabstop>
|
||||||
|
<tabstop>conditionRemove</tabstop>
|
||||||
|
<tabstop>conditionTop</tabstop>
|
||||||
|
<tabstop>conditionUp</tabstop>
|
||||||
|
<tabstop>conditionDown</tabstop>
|
||||||
|
<tabstop>conditionBottom</tabstop>
|
||||||
|
<tabstop>actionsList</tabstop>
|
||||||
|
<tabstop>actionAdd</tabstop>
|
||||||
|
<tabstop>actionRemove</tabstop>
|
||||||
|
<tabstop>actionTop</tabstop>
|
||||||
|
<tabstop>actionUp</tabstop>
|
||||||
|
<tabstop>actionDown</tabstop>
|
||||||
|
<tabstop>actionBottom</tabstop>
|
||||||
|
<tabstop>toggleElseActions</tabstop>
|
||||||
|
<tabstop>elseActionsList</tabstop>
|
||||||
|
<tabstop>elseActionAdd</tabstop>
|
||||||
|
<tabstop>elseActionRemove</tabstop>
|
||||||
|
<tabstop>elseActionTop</tabstop>
|
||||||
|
<tabstop>elseActionUp</tabstop>
|
||||||
|
<tabstop>elseActionDown</tabstop>
|
||||||
|
<tabstop>elseActionBottom</tabstop>
|
||||||
|
</tabstops>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -146,16 +146,7 @@ void AdvSceneSwitcher::LoadUI()
|
|||||||
bool AdvSceneSwitcher::eventFilter(QObject *obj, QEvent *event)
|
bool AdvSceneSwitcher::eventFilter(QObject *obj, QEvent *event)
|
||||||
{
|
{
|
||||||
auto eventType = event->type();
|
auto eventType = event->type();
|
||||||
if (obj == ui->macroElseActions && eventType == QEvent::Resize) {
|
if (eventType == QEvent::KeyPress) {
|
||||||
QResizeEvent *resizeEvent = static_cast<QResizeEvent *>(event);
|
|
||||||
|
|
||||||
if (resizeEvent->size().height() == 0) {
|
|
||||||
SetElseActionsStateToHidden();
|
|
||||||
return QDialog::eventFilter(obj, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
SetElseActionsStateToVisible();
|
|
||||||
} else if (eventType == QEvent::KeyPress) {
|
|
||||||
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
|
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
|
||||||
auto pressedKey = keyEvent->key();
|
auto pressedKey = keyEvent->key();
|
||||||
|
|
||||||
@@ -430,7 +421,7 @@ bool SwitcherData::CheckForMatch(OBSWeakSource &scene,
|
|||||||
|
|
||||||
static void ResetMacros()
|
static void ResetMacros()
|
||||||
{
|
{
|
||||||
for (auto &m : GetMacros()) {
|
for (auto &m : GetTopLevelMacros()) {
|
||||||
ResetMacroRunCount(m.get());
|
ResetMacroRunCount(m.get());
|
||||||
ResetMacroConditionTimers(m.get());
|
ResetMacroConditionTimers(m.get());
|
||||||
}
|
}
|
||||||
@@ -547,6 +538,7 @@ static void handleSceneChange()
|
|||||||
}
|
}
|
||||||
|
|
||||||
switcher->checkDefaultSceneTransitions();
|
switcher->checkDefaultSceneTransitions();
|
||||||
|
switcher->CheckAutoStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setLiveTime()
|
static void setLiveTime()
|
||||||
@@ -561,18 +553,28 @@ static void resetLiveTime()
|
|||||||
|
|
||||||
static void checkAutoStartRecording()
|
static void checkAutoStartRecording()
|
||||||
{
|
{
|
||||||
|
if (switcher->obsIsShuttingDown) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (switcher->autoStartEvent == SwitcherData::AutoStart::RECORDING ||
|
if (switcher->autoStartEvent == SwitcherData::AutoStart::RECORDING ||
|
||||||
switcher->autoStartEvent ==
|
switcher->autoStartEvent ==
|
||||||
SwitcherData::AutoStart::RECORINDG_OR_STREAMING)
|
SwitcherData::AutoStart::RECORINDG_OR_STREAMING) {
|
||||||
switcher->Start();
|
switcher->Start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void checkAutoStartStreaming()
|
static void checkAutoStartStreaming()
|
||||||
{
|
{
|
||||||
|
if (switcher->obsIsShuttingDown) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (switcher->autoStartEvent == SwitcherData::AutoStart::STREAMING ||
|
if (switcher->autoStartEvent == SwitcherData::AutoStart::STREAMING ||
|
||||||
switcher->autoStartEvent ==
|
switcher->autoStartEvent ==
|
||||||
SwitcherData::AutoStart::RECORINDG_OR_STREAMING)
|
SwitcherData::AutoStart::RECORINDG_OR_STREAMING) {
|
||||||
switcher->Start();
|
switcher->Start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handleTransitionEnd()
|
static void handleTransitionEnd()
|
||||||
@@ -608,7 +610,7 @@ static void handleSceneCollectionChanging()
|
|||||||
AdvSceneSwitcher::window->close();
|
AdvSceneSwitcher::window->close();
|
||||||
}
|
}
|
||||||
if (!switcher->stop) {
|
if (!switcher->stop) {
|
||||||
switcher->sceneColletionStop = true;
|
switcher->sceneCollectionStop = true;
|
||||||
switcher->Stop();
|
switcher->Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -744,6 +746,21 @@ void AdvSceneSwitcher::HighlightMacroSettingsButton(bool enable)
|
|||||||
highlight = HighlightWidget(ui->macroSettings, Qt::green);
|
highlight = HighlightWidget(ui->macroSettings, Qt::green);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::HighlightAction(int idx, QColor color) const
|
||||||
|
{
|
||||||
|
ui->macroEdit->HighlightAction(idx, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::HighlightElseAction(int idx, QColor color) const
|
||||||
|
{
|
||||||
|
ui->macroEdit->HighlightElseAction(idx, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::HighlightCondition(int idx, QColor color) const
|
||||||
|
{
|
||||||
|
ui->macroEdit->HighlightCondition(idx, color);
|
||||||
|
}
|
||||||
|
|
||||||
void HighlightMacroSettingsButton(bool enable)
|
void HighlightMacroSettingsButton(bool enable)
|
||||||
{
|
{
|
||||||
auto window = GetSettingsWindow();
|
auto window = GetSettingsWindow();
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ namespace advss {
|
|||||||
|
|
||||||
class MacroActionEdit;
|
class MacroActionEdit;
|
||||||
class MacroConditionEdit;
|
class MacroConditionEdit;
|
||||||
|
class MacroSegment;
|
||||||
class Duration;
|
class Duration;
|
||||||
class SequenceWidget;
|
class SequenceWidget;
|
||||||
struct SceneGroup;
|
struct SceneGroup;
|
||||||
@@ -44,7 +45,6 @@ protected:
|
|||||||
/* --- Begin of general tab section --- */
|
/* --- Begin of general tab section --- */
|
||||||
public:
|
public:
|
||||||
void SetupGeneralTab();
|
void SetupGeneralTab();
|
||||||
void UpdateNonMatchingScene(const QString &name);
|
|
||||||
void SetDeprecationWarnings();
|
void SetDeprecationWarnings();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@@ -57,7 +57,6 @@ public slots:
|
|||||||
void on_startupBehavior_currentIndexChanged(int index);
|
void on_startupBehavior_currentIndexChanged(int index);
|
||||||
void on_logLevel_currentIndexChanged(int index);
|
void on_logLevel_currentIndexChanged(int index);
|
||||||
void on_autoStartEvent_currentIndexChanged(int index);
|
void on_autoStartEvent_currentIndexChanged(int index);
|
||||||
void on_noMatchSwitchScene_currentTextChanged(const QString &text);
|
|
||||||
void on_checkInterval_valueChanged(int value);
|
void on_checkInterval_valueChanged(int value);
|
||||||
void on_tabWidget_currentChanged(int index);
|
void on_tabWidget_currentChanged(int index);
|
||||||
void on_exportSettings_clicked();
|
void on_exportSettings_clicked();
|
||||||
@@ -77,24 +76,26 @@ public slots:
|
|||||||
/* --- Begin of macro tab section --- */
|
/* --- Begin of macro tab section --- */
|
||||||
public:
|
public:
|
||||||
void SetupMacroTab();
|
void SetupMacroTab();
|
||||||
|
bool MacroTabIsInFocus();
|
||||||
bool AddNewMacro(std::shared_ptr<Macro> &res, std::string &name,
|
bool AddNewMacro(std::shared_ptr<Macro> &res, std::string &name,
|
||||||
std::string format = "");
|
std::string format = "");
|
||||||
void RemoveMacro(std::shared_ptr<Macro> &);
|
void RemoveMacro(std::shared_ptr<Macro> &);
|
||||||
void RemoveSelectedMacros();
|
void RemoveSelectedMacros();
|
||||||
void RenameMacro(std::shared_ptr<Macro> &, const QString &name);
|
void RenameMacro(std::shared_ptr<Macro> &, const QString &name);
|
||||||
std::shared_ptr<Macro> GetSelectedMacro();
|
std::shared_ptr<Macro> GetSelectedMacro() const;
|
||||||
std::vector<std::shared_ptr<Macro>> GetSelectedMacros();
|
std::vector<std::shared_ptr<Macro>> GetSelectedMacros() const;
|
||||||
void SetEditMacro(Macro &m);
|
void SetMacroEditAreaDisabled(bool) const;
|
||||||
void SetMacroEditAreaDisabled(bool);
|
void HighlightAction(int idx, QColor color = QColor(Qt::green)) const;
|
||||||
void HighlightAction(int idx, QColor color = QColor(Qt::green));
|
void HighlightElseAction(int idx,
|
||||||
void HighlightElseAction(int idx, QColor color = QColor(Qt::green));
|
QColor color = QColor(Qt::green)) const;
|
||||||
void HighlightCondition(int idx, QColor color = QColor(Qt::green));
|
void HighlightCondition(int idx,
|
||||||
|
QColor color = QColor(Qt::green)) const;
|
||||||
void PopulateMacroActions(Macro &m, uint32_t afterIdx = 0);
|
void PopulateMacroActions(Macro &m, uint32_t afterIdx = 0);
|
||||||
void PopulateMacroElseActions(Macro &m, uint32_t afterIdx = 0);
|
void PopulateMacroElseActions(Macro &m, uint32_t afterIdx = 0);
|
||||||
void PopulateMacroConditions(Macro &m, uint32_t afterIdx = 0);
|
void PopulateMacroConditions(Macro &m, uint32_t afterIdx = 0);
|
||||||
void SetActionData(Macro &m);
|
void SetActionData(Macro &m) const;
|
||||||
void SetElseActionData(Macro &m);
|
void SetElseActionData(Macro &m) const;
|
||||||
void SetConditionData(Macro &m);
|
void SetConditionData(Macro &m) const;
|
||||||
void SwapActions(Macro *m, int pos1, int pos2);
|
void SwapActions(Macro *m, int pos1, int pos2);
|
||||||
void SwapConditions(Macro *m, int pos1, int pos2);
|
void SwapConditions(Macro *m, int pos1, int pos2);
|
||||||
void HighlightMacroSettingsButton(bool enable = true);
|
void HighlightMacroSettingsButton(bool enable = true);
|
||||||
@@ -102,111 +103,22 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void on_macroAdd_clicked();
|
void on_macroAdd_clicked();
|
||||||
void on_macroRemove_clicked();
|
void on_macroRemove_clicked();
|
||||||
void on_macroUp_clicked();
|
void on_macroUp_clicked() const;
|
||||||
void on_macroDown_clicked();
|
void on_macroDown_clicked() const;
|
||||||
void on_macroName_editingFinished();
|
void on_macroName_editingFinished();
|
||||||
void on_runMacroInParallel_stateChanged(int value);
|
void on_runMacroInParallel_stateChanged(int value) const;
|
||||||
void on_runMacroOnChange_stateChanged(int value);
|
void on_runMacroOnChange_stateChanged(int value) const;
|
||||||
void on_conditionAdd_clicked();
|
|
||||||
void on_conditionRemove_clicked();
|
|
||||||
void on_conditionTop_clicked();
|
|
||||||
void on_conditionUp_clicked();
|
|
||||||
void on_conditionDown_clicked();
|
|
||||||
void on_conditionBottom_clicked();
|
|
||||||
void on_actionAdd_clicked();
|
|
||||||
void on_actionRemove_clicked();
|
|
||||||
void on_actionTop_clicked();
|
|
||||||
void on_actionUp_clicked();
|
|
||||||
void on_actionDown_clicked();
|
|
||||||
void on_actionBottom_clicked();
|
|
||||||
void on_toggleElseActions_clicked();
|
|
||||||
void on_elseActionAdd_clicked();
|
|
||||||
void on_elseActionRemove_clicked();
|
|
||||||
void on_elseActionTop_clicked();
|
|
||||||
void on_elseActionUp_clicked();
|
|
||||||
void on_elseActionDown_clicked();
|
|
||||||
void on_elseActionBottom_clicked();
|
|
||||||
void MacroSelectionAboutToChange();
|
|
||||||
void MacroSelectionChanged();
|
void MacroSelectionChanged();
|
||||||
void UpMacroSegementHotkey();
|
|
||||||
void DownMacroSegementHotkey();
|
|
||||||
void DeleteMacroSegementHotkey();
|
|
||||||
void ShowMacroContextMenu(const QPoint &);
|
void ShowMacroContextMenu(const QPoint &);
|
||||||
void ShowMacroActionsContextMenu(const QPoint &);
|
|
||||||
void ShowMacroElseActionsContextMenu(const QPoint &);
|
|
||||||
void ShowMacroConditionsContextMenu(const QPoint &);
|
|
||||||
void CopyMacro();
|
void CopyMacro();
|
||||||
void RenameSelectedMacro();
|
void RenameSelectedMacro();
|
||||||
void ExportMacros();
|
void ExportMacros() const;
|
||||||
void ImportMacros();
|
void ImportMacros();
|
||||||
void ExpandAllActions();
|
void HighlightOnChange() const;
|
||||||
void ExpandAllElseActions();
|
|
||||||
void ExpandAllConditions();
|
|
||||||
void CollapseAllActions();
|
|
||||||
void CollapseAllElseActions();
|
|
||||||
void CollapseAllConditions();
|
|
||||||
void MinimizeActions();
|
|
||||||
void MaximizeActions();
|
|
||||||
void MinimizeElseActions();
|
|
||||||
void MaximizeElseActions();
|
|
||||||
void MinimizeConditions();
|
|
||||||
void MaximizeConditions();
|
|
||||||
void SetElseActionsStateToHidden();
|
|
||||||
void SetElseActionsStateToVisible();
|
|
||||||
void MacroActionSelectionChanged(int idx);
|
|
||||||
void MacroActionReorder(int to, int target);
|
|
||||||
void AddMacroAction(Macro *macro, int idx, const std::string &id,
|
|
||||||
obs_data_t *data);
|
|
||||||
void AddMacroAction(int idx);
|
|
||||||
void RemoveMacroAction(int idx);
|
|
||||||
void MoveMacroActionUp(int idx);
|
|
||||||
void MoveMacroActionDown(int idx);
|
|
||||||
void MacroElseActionSelectionChanged(int idx);
|
|
||||||
void MacroElseActionReorder(int to, int target);
|
|
||||||
void AddMacroElseAction(Macro *macro, int idx, const std::string &id,
|
|
||||||
obs_data_t *data);
|
|
||||||
void AddMacroElseAction(int idx);
|
|
||||||
void RemoveMacroElseAction(int idx);
|
|
||||||
void SwapElseActions(Macro *m, int pos1, int pos2);
|
|
||||||
void MoveMacroElseActionUp(int idx);
|
|
||||||
void MoveMacroElseActionDown(int idx);
|
|
||||||
void MacroConditionSelectionChanged(int idx);
|
|
||||||
void MacroConditionReorder(int to, int target);
|
|
||||||
void AddMacroCondition(int idx);
|
|
||||||
void AddMacroCondition(Macro *macro, int idx, const std::string &id,
|
|
||||||
obs_data_t *data, Logic::Type logic);
|
|
||||||
void RemoveMacroCondition(int idx);
|
|
||||||
void MoveMacroConditionUp(int idx);
|
|
||||||
void MoveMacroConditionDown(int idx);
|
|
||||||
void HighlightControls();
|
|
||||||
void HighlightOnChange();
|
|
||||||
void on_macroSettings_clicked();
|
void on_macroSettings_clicked();
|
||||||
void CopyMacroSegment();
|
|
||||||
void PasteMacroSegment();
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void MacroAdded(const QString &name);
|
|
||||||
void MacroRemoved(const QString &name);
|
|
||||||
void MacroRenamed(const QString &oldName, const QString &newName);
|
|
||||||
void MacroSegmentOrderChanged();
|
|
||||||
void SegmentTempVarsChanged();
|
|
||||||
void HighlightMacrosChanged(bool value);
|
|
||||||
|
|
||||||
void ConnectionAdded(const QString &);
|
|
||||||
void ConnectionRenamed(const QString &oldName, const QString &newName);
|
|
||||||
void ConnectionRemoved(const QString &);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class MacroSection { CONDITIONS, ACTIONS, ELSE_ACTIONS };
|
|
||||||
|
|
||||||
void SetupMacroSegmentSelection(MacroSection type, int idx);
|
|
||||||
bool ResolveMacroImportNameConflict(std::shared_ptr<Macro> &);
|
bool ResolveMacroImportNameConflict(std::shared_ptr<Macro> &);
|
||||||
bool MacroTabIsInFocus();
|
|
||||||
|
|
||||||
MacroSection lastInteracted = MacroSection::CONDITIONS;
|
|
||||||
int currentConditionIdx = -1;
|
|
||||||
int currentActionIdx = -1;
|
|
||||||
int currentElseActionIdx = -1;
|
|
||||||
|
|
||||||
/* --- End of macro tab section --- */
|
/* --- End of macro tab section --- */
|
||||||
|
|
||||||
|
|||||||
242
lib/general.cpp
242
lib/general.cpp
@@ -3,6 +3,8 @@
|
|||||||
#include "filter-combo-box.hpp"
|
#include "filter-combo-box.hpp"
|
||||||
#include "layout-helpers.hpp"
|
#include "layout-helpers.hpp"
|
||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
|
#include "macro-search.hpp"
|
||||||
|
#include "macro-settings.hpp"
|
||||||
#include "path-helpers.hpp"
|
#include "path-helpers.hpp"
|
||||||
#include "selection-helpers.hpp"
|
#include "selection-helpers.hpp"
|
||||||
#include "source-helpers.hpp"
|
#include "source-helpers.hpp"
|
||||||
@@ -25,15 +27,6 @@ void AdvSceneSwitcher::reject()
|
|||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::UpdateNonMatchingScene(const QString &name)
|
|
||||||
{
|
|
||||||
OBSSourceAutoRelease scene =
|
|
||||||
obs_get_source_by_name(name.toUtf8().constData());
|
|
||||||
OBSWeakSourceAutoRelease ws = obs_source_get_weak_source(scene);
|
|
||||||
|
|
||||||
switcher->nonMatchingScene = ws;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_noMatchDontSwitch_clicked()
|
void AdvSceneSwitcher::on_noMatchDontSwitch_clicked()
|
||||||
{
|
{
|
||||||
if (loading) {
|
if (loading) {
|
||||||
@@ -55,7 +48,6 @@ void AdvSceneSwitcher::on_noMatchSwitch_clicked()
|
|||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
switcher->switchIfNotMatching = NoMatchBehavior::SWITCH;
|
switcher->switchIfNotMatching = NoMatchBehavior::SWITCH;
|
||||||
ui->noMatchSwitchScene->setEnabled(true);
|
ui->noMatchSwitchScene->setEnabled(true);
|
||||||
UpdateNonMatchingScene(ui->noMatchSwitchScene->currentText());
|
|
||||||
ui->randomDisabledWarning->setVisible(true);
|
ui->randomDisabledWarning->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,12 +105,12 @@ void AdvSceneSwitcher::on_startupBehavior_currentIndexChanged(int index)
|
|||||||
static_cast<SwitcherData::StartupBehavior>(index);
|
static_cast<SwitcherData::StartupBehavior>(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_logLevel_currentIndexChanged(int value)
|
void AdvSceneSwitcher::on_logLevel_currentIndexChanged(int idx)
|
||||||
{
|
{
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switcher->logLevel = static_cast<SwitcherData::LogLevel>(value);
|
SetLogLevel(static_cast<LogLevel>(ui->logLevel->itemData(idx).toInt()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_autoStartEvent_currentIndexChanged(int index)
|
void AdvSceneSwitcher::on_autoStartEvent_currentIndexChanged(int index)
|
||||||
@@ -131,17 +123,6 @@ void AdvSceneSwitcher::on_autoStartEvent_currentIndexChanged(int index)
|
|||||||
switcher->autoStartEvent = static_cast<SwitcherData::AutoStart>(index);
|
switcher->autoStartEvent = static_cast<SwitcherData::AutoStart>(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_noMatchSwitchScene_currentTextChanged(
|
|
||||||
const QString &text)
|
|
||||||
{
|
|
||||||
if (loading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
|
||||||
UpdateNonMatchingScene(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_checkInterval_valueChanged(int value)
|
void AdvSceneSwitcher::on_checkInterval_valueChanged(int value)
|
||||||
{
|
{
|
||||||
if (loading) {
|
if (loading) {
|
||||||
@@ -163,7 +144,7 @@ void AdvSceneSwitcher::closeEvent(QCloseEvent *)
|
|||||||
switcher->windowSize = this->size();
|
switcher->windowSize = this->size();
|
||||||
switcher->macroListMacroEditSplitterPosition =
|
switcher->macroListMacroEditSplitterPosition =
|
||||||
ui->macroListMacroEditSplitter->sizes();
|
ui->macroListMacroEditSplitter->sizes();
|
||||||
MacroSelectionAboutToChange(); // Trigger saving of splitter states
|
ui->macroEdit->SetMacro(nullptr); // Trigger saving of splitter states
|
||||||
|
|
||||||
obs_frontend_save();
|
obs_frontend_save();
|
||||||
}
|
}
|
||||||
@@ -275,12 +256,15 @@ static bool containsSensitiveData(obs_data_t *data)
|
|||||||
obs_data_get_array(data, "twitchConnections");
|
obs_data_get_array(data, "twitchConnections");
|
||||||
OBSDataArrayAutoRelease websocketConnections =
|
OBSDataArrayAutoRelease websocketConnections =
|
||||||
obs_data_get_array(data, "websocketConnections");
|
obs_data_get_array(data, "websocketConnections");
|
||||||
|
OBSDataArrayAutoRelease mqttConnections =
|
||||||
|
obs_data_get_array(data, "mqttConnections");
|
||||||
|
|
||||||
auto isNotEmpty = [](obs_data_array *array) {
|
auto isNotEmpty = [](obs_data_array *array) {
|
||||||
return obs_data_array_count(array) > 0;
|
return obs_data_array_count(array) > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
return isNotEmpty(twitchTokens) || isNotEmpty(websocketConnections);
|
return isNotEmpty(twitchTokens) || isNotEmpty(websocketConnections) ||
|
||||||
|
isNotEmpty(mqttConnections);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_exportSettings_clicked()
|
void AdvSceneSwitcher::on_exportSettings_clicked()
|
||||||
@@ -383,6 +367,7 @@ void AdvSceneSwitcher::CheckFirstTimeSetup()
|
|||||||
switcher->firstBoot = false;
|
switcher->firstBoot = false;
|
||||||
DisplayMessage(
|
DisplayMessage(
|
||||||
obs_module_text("AdvSceneSwitcher.firstBootMessage"));
|
obs_module_text("AdvSceneSwitcher.firstBootMessage"));
|
||||||
|
switcher->Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,16 +422,14 @@ void SwitcherData::LoadSettings(obs_data_t *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// New post load steps to be declared during load
|
// New post load steps to be declared during load
|
||||||
postLoadSteps.clear();
|
ClearPostLoadSteps();
|
||||||
|
|
||||||
// Needs to be loaded before any entries which might rely on scene group
|
// Needs to be loaded before any entries which might rely on scene group
|
||||||
// selections to be available.
|
// selections to be available.
|
||||||
loadSceneGroups(obj);
|
loadSceneGroups(obj);
|
||||||
LoadVariables(obj);
|
LoadVariables(obj);
|
||||||
|
|
||||||
for (const auto &func : loadSteps) {
|
RunLoadSteps(obj);
|
||||||
func(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
LoadMacros(obj);
|
LoadMacros(obj);
|
||||||
LoadGlobalMacroSettings(obj);
|
LoadGlobalMacroSettings(obj);
|
||||||
@@ -467,7 +450,7 @@ void SwitcherData::LoadSettings(obs_data_t *obj)
|
|||||||
LoadHotkeys(obj);
|
LoadHotkeys(obj);
|
||||||
LoadUISettings(obj);
|
LoadUISettings(obj);
|
||||||
|
|
||||||
RunPostLoadSteps();
|
RunAndClearPostLoadSteps();
|
||||||
|
|
||||||
// Reset on startup and scene collection change
|
// Reset on startup and scene collection change
|
||||||
ResetLastOpenedTab();
|
ResetLastOpenedTab();
|
||||||
@@ -502,18 +485,16 @@ void SwitcherData::SaveSettings(obs_data_t *obj)
|
|||||||
SaveUISettings(obj);
|
SaveUISettings(obj);
|
||||||
SaveVersion(obj, g_GIT_SHA1);
|
SaveVersion(obj, g_GIT_SHA1);
|
||||||
|
|
||||||
for (const auto &func : saveSteps) {
|
RunSaveSteps(obj);
|
||||||
func(obj);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitcherData::SaveGeneralSettings(obs_data_t *obj)
|
void SwitcherData::SaveGeneralSettings(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
obs_data_set_int(obj, "interval", interval);
|
obs_data_set_int(obj, "interval", interval);
|
||||||
|
|
||||||
std::string nonMatchingSceneName = GetWeakSourceName(nonMatchingScene);
|
OBSDataAutoRelease noMatchScene = obs_data_create();
|
||||||
obs_data_set_string(obj, "non_matching_scene",
|
nonMatchingScene.Save(noMatchScene);
|
||||||
nonMatchingSceneName.c_str());
|
obs_data_set_obj(obj, "noMatchScene", noMatchScene);
|
||||||
obs_data_set_int(obj, "switch_if_not_matching",
|
obs_data_set_int(obj, "switch_if_not_matching",
|
||||||
static_cast<int>(switchIfNotMatching));
|
static_cast<int>(switchIfNotMatching));
|
||||||
noMatchDelay.Save(obj, "noMatchDelay");
|
noMatchDelay.Save(obj, "noMatchDelay");
|
||||||
@@ -521,16 +502,21 @@ void SwitcherData::SaveGeneralSettings(obs_data_t *obj)
|
|||||||
cooldown.Save(obj, "cooldown");
|
cooldown.Save(obj, "cooldown");
|
||||||
obs_data_set_bool(obj, "enableCooldown", enableCooldown);
|
obs_data_set_bool(obj, "enableCooldown", enableCooldown);
|
||||||
|
|
||||||
obs_data_set_bool(obj, "active", sceneColletionStop ? true : !stop);
|
obs_data_set_bool(obj, "active", sceneCollectionStop ? true : !stop);
|
||||||
sceneColletionStop = false;
|
sceneCollectionStop = false;
|
||||||
obs_data_set_int(obj, "startup_behavior",
|
obs_data_set_int(obj, "startup_behavior",
|
||||||
static_cast<int>(startupBehavior));
|
static_cast<int>(startupBehavior));
|
||||||
|
|
||||||
obs_data_set_int(obj, "autoStartEvent",
|
OBSDataAutoRelease autoStart = obs_data_create();
|
||||||
static_cast<int>(autoStartEvent));
|
obs_data_set_int(autoStart, "event", static_cast<int>(autoStartEvent));
|
||||||
|
obs_data_set_bool(autoStart, "useAutoStartScene", useAutoStartScene);
|
||||||
|
autoStartScene.Save(autoStart);
|
||||||
|
autoStartSceneName.Save(autoStart, "name");
|
||||||
|
autoStartSceneRegex.Save(autoStart);
|
||||||
|
obs_data_set_obj(obj, "autoStart", autoStart);
|
||||||
|
|
||||||
|
SaveLogLevel(obj);
|
||||||
|
|
||||||
obs_data_set_int(obj, "logLevel", static_cast<int>(logLevel));
|
|
||||||
obs_data_set_int(obj, "logLevelVersion", 1);
|
|
||||||
obs_data_set_bool(obj, "showSystemTrayNotifications",
|
obs_data_set_bool(obj, "showSystemTrayNotifications",
|
||||||
showSystemTrayNotifications);
|
showSystemTrayNotifications);
|
||||||
obs_data_set_bool(obj, "disableHints", disableHints);
|
obs_data_set_bool(obj, "disableHints", disableHints);
|
||||||
@@ -560,9 +546,14 @@ void SwitcherData::LoadGeneralSettings(obs_data_t *obj)
|
|||||||
static_cast<int>(NoMatchBehavior::NO_SWITCH));
|
static_cast<int>(NoMatchBehavior::NO_SWITCH));
|
||||||
switchIfNotMatching = static_cast<NoMatchBehavior>(
|
switchIfNotMatching = static_cast<NoMatchBehavior>(
|
||||||
obs_data_get_int(obj, "switch_if_not_matching"));
|
obs_data_get_int(obj, "switch_if_not_matching"));
|
||||||
std::string nonMatchingSceneName =
|
|
||||||
obs_data_get_string(obj, "non_matching_scene");
|
if (obs_data_has_user_value(obj, "noMatchScene")) {
|
||||||
nonMatchingScene = GetWeakSourceByName(nonMatchingSceneName.c_str());
|
OBSDataAutoRelease noMatchScene =
|
||||||
|
obs_data_get_obj(obj, "noMatchScene");
|
||||||
|
nonMatchingScene.Load(noMatchScene);
|
||||||
|
} else {
|
||||||
|
nonMatchingScene.Load(obj, "non_matching_scene");
|
||||||
|
}
|
||||||
noMatchDelay.Load(obj, "noMatchDelay");
|
noMatchDelay.Load(obj, "noMatchDelay");
|
||||||
|
|
||||||
cooldown.Load(obj, "cooldown");
|
cooldown.Load(obj, "cooldown");
|
||||||
@@ -583,28 +574,17 @@ void SwitcherData::LoadGeneralSettings(obs_data_t *obj)
|
|||||||
stop = true;
|
stop = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
autoStartEvent =
|
OBSDataAutoRelease autoStart = obs_data_get_obj(obj, "autoStart");
|
||||||
static_cast<AutoStart>(obs_data_get_int(obj, "autoStartEvent"));
|
autoStartEvent = static_cast<AutoStart>(
|
||||||
|
obs_data_has_user_value(obj, "autoStart")
|
||||||
|
? obs_data_get_int(autoStart, "event")
|
||||||
|
: obs_data_get_int(obj, "autoStartEvent"));
|
||||||
|
useAutoStartScene = obs_data_get_bool(autoStart, "useAutoStartScene");
|
||||||
|
autoStartScene.Load(autoStart);
|
||||||
|
autoStartSceneName.Load(autoStart, "name");
|
||||||
|
autoStartSceneRegex.Load(autoStart);
|
||||||
|
|
||||||
logLevel = static_cast<LogLevel>(obs_data_get_int(obj, "logLevel"));
|
LoadLogLevel(obj);
|
||||||
if (obs_data_get_int(obj, "logLevelVersion") < 1) {
|
|
||||||
enum OldLogLevel { DEFAULT, LOG_ACTION, VERBOSE };
|
|
||||||
OldLogLevel oldLogLevel = static_cast<OldLogLevel>(
|
|
||||||
obs_data_get_int(obj, "logLevel"));
|
|
||||||
switch (oldLogLevel) {
|
|
||||||
case DEFAULT:
|
|
||||||
logLevel = LogLevel::DEFAULT;
|
|
||||||
break;
|
|
||||||
case LOG_ACTION:
|
|
||||||
logLevel = LogLevel::LOG_ACTION;
|
|
||||||
break;
|
|
||||||
case VERBOSE:
|
|
||||||
logLevel = LogLevel::VERBOSE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
showSystemTrayNotifications =
|
showSystemTrayNotifications =
|
||||||
obs_data_get_bool(obj, "showSystemTrayNotifications");
|
obs_data_get_bool(obj, "showSystemTrayNotifications");
|
||||||
@@ -680,10 +660,10 @@ void SwitcherData::CheckNoMatchSwitch(bool &match, OBSWeakSource &scene,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switchIfNotMatching == NoMatchBehavior::SWITCH &&
|
auto noMatchScene = nonMatchingScene.GetScene(false);
|
||||||
nonMatchingScene) {
|
if (switchIfNotMatching == NoMatchBehavior::SWITCH && noMatchScene) {
|
||||||
match = true;
|
match = true;
|
||||||
scene = nonMatchingScene;
|
scene = noMatchScene;
|
||||||
transition = nullptr;
|
transition = nullptr;
|
||||||
}
|
}
|
||||||
if (switchIfNotMatching == NoMatchBehavior::RANDOM_SWITCH) {
|
if (switchIfNotMatching == NoMatchBehavior::RANDOM_SWITCH) {
|
||||||
@@ -691,6 +671,27 @@ void SwitcherData::CheckNoMatchSwitch(bool &match, OBSWeakSource &scene,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SwitcherData::CheckAutoStart()
|
||||||
|
{
|
||||||
|
if (!useAutoStartScene) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool shouldStartPlugin = false;
|
||||||
|
if (autoStartSceneRegex.Enabled()) {
|
||||||
|
const auto currentSceneName = GetWeakSourceName(currentScene);
|
||||||
|
shouldStartPlugin = autoStartSceneRegex.Matches(
|
||||||
|
currentSceneName, autoStartSceneName);
|
||||||
|
} else {
|
||||||
|
shouldStartPlugin = autoStartScene.GetScene(false) ==
|
||||||
|
currentScene;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldStartPlugin) {
|
||||||
|
Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SwitcherData::checkSwitchCooldown(bool &match)
|
void SwitcherData::checkSwitchCooldown(bool &match)
|
||||||
{
|
{
|
||||||
if (!match || !enableCooldown) {
|
if (!match || !enableCooldown) {
|
||||||
@@ -833,7 +834,7 @@ static void setupGeneralTabInactiveWarning(QTabWidget *tabs)
|
|||||||
inactiveTimer->start();
|
inactiveTimer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void advss::AdvSceneSwitcher::SetCheckIntervalTooLowVisibility() const
|
void AdvSceneSwitcher::SetCheckIntervalTooLowVisibility() const
|
||||||
{
|
{
|
||||||
auto macro = GetMacroWithInvalidConditionInterval();
|
auto macro = GetMacroWithInvalidConditionInterval();
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
@@ -857,8 +858,6 @@ void advss::AdvSceneSwitcher::SetCheckIntervalTooLowVisibility() const
|
|||||||
|
|
||||||
void AdvSceneSwitcher::SetupGeneralTab()
|
void AdvSceneSwitcher::SetupGeneralTab()
|
||||||
{
|
{
|
||||||
PopulateSceneSelection(ui->noMatchSwitchScene, false);
|
|
||||||
|
|
||||||
if (switcher->switchIfNotMatching == NoMatchBehavior::SWITCH) {
|
if (switcher->switchIfNotMatching == NoMatchBehavior::SWITCH) {
|
||||||
ui->noMatchSwitch->setChecked(true);
|
ui->noMatchSwitch->setChecked(true);
|
||||||
ui->noMatchSwitchScene->setEnabled(true);
|
ui->noMatchSwitchScene->setEnabled(true);
|
||||||
@@ -870,8 +869,17 @@ void AdvSceneSwitcher::SetupGeneralTab()
|
|||||||
ui->noMatchRandomSwitch->setChecked(true);
|
ui->noMatchRandomSwitch->setChecked(true);
|
||||||
ui->noMatchSwitchScene->setEnabled(false);
|
ui->noMatchSwitchScene->setEnabled(false);
|
||||||
}
|
}
|
||||||
ui->noMatchSwitchScene->setCurrentText(
|
ui->noMatchSwitchScene->SetScene(switcher->nonMatchingScene);
|
||||||
GetWeakSourceName(switcher->nonMatchingScene).c_str());
|
ui->noMatchSwitchScene->LockToMainCanvas();
|
||||||
|
|
||||||
|
connect(ui->noMatchSwitchScene, &SceneSelectionWidget::SceneChanged,
|
||||||
|
this, [this](const SceneSelection &scene) {
|
||||||
|
if (loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
switcher->nonMatchingScene = scene;
|
||||||
|
});
|
||||||
|
|
||||||
DurationSelection *noMatchDelay = new DurationSelection();
|
DurationSelection *noMatchDelay = new DurationSelection();
|
||||||
noMatchDelay->SetDuration(switcher->noMatchDelay);
|
noMatchDelay->SetDuration(switcher->noMatchDelay);
|
||||||
@@ -894,7 +902,9 @@ void AdvSceneSwitcher::SetupGeneralTab()
|
|||||||
SIGNAL(DurationChanged(const Duration &)), this,
|
SIGNAL(DurationChanged(const Duration &)), this,
|
||||||
SLOT(CooldownDurationChanged(const Duration &)));
|
SLOT(CooldownDurationChanged(const Duration &)));
|
||||||
|
|
||||||
ui->logLevel->setCurrentIndex(static_cast<int>(switcher->logLevel));
|
PopulateLogLevelSelection(ui->logLevel);
|
||||||
|
ui->logLevel->setCurrentIndex(
|
||||||
|
ui->logLevel->findData(static_cast<int>(GetLogLevel())));
|
||||||
|
|
||||||
ui->saveWindowGeo->setChecked(switcher->saveWindowGeo);
|
ui->saveWindowGeo->setChecked(switcher->saveWindowGeo);
|
||||||
ui->showTrayNotifications->setChecked(
|
ui->showTrayNotifications->setChecked(
|
||||||
@@ -917,6 +927,88 @@ void AdvSceneSwitcher::SetupGeneralTab()
|
|||||||
populateAutoStartEventSelection(ui->autoStartEvent);
|
populateAutoStartEventSelection(ui->autoStartEvent);
|
||||||
ui->autoStartEvent->setCurrentIndex(
|
ui->autoStartEvent->setCurrentIndex(
|
||||||
static_cast<int>(switcher->autoStartEvent));
|
static_cast<int>(switcher->autoStartEvent));
|
||||||
|
ui->autoStartSceneEnable->setChecked(switcher->useAutoStartScene);
|
||||||
|
ui->autoStartScene->SetScene(switcher->autoStartScene);
|
||||||
|
ui->autoStartScene->LockToMainCanvas();
|
||||||
|
ui->autoStartSceneName->setText(switcher->autoStartSceneName);
|
||||||
|
ui->autoStartSceneNameRegex->SetRegexConfig(
|
||||||
|
switcher->autoStartSceneRegex);
|
||||||
|
|
||||||
|
const auto setupAutoStartSceneLayoutVisibility = [this](bool useRegex) {
|
||||||
|
ui->autoStartSceneName->setVisible(useRegex);
|
||||||
|
ui->autoStartScene->setVisible(!useRegex);
|
||||||
|
if (useRegex) {
|
||||||
|
RemoveStretchIfPresent(ui->autoStartSceneLayout);
|
||||||
|
} else {
|
||||||
|
AddStretchIfNecessary(ui->autoStartSceneLayout);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
setupAutoStartSceneLayoutVisibility(
|
||||||
|
switcher->autoStartSceneRegex.Enabled());
|
||||||
|
|
||||||
|
const auto setupAutoStartSceneWidgetState =
|
||||||
|
[this](bool useAutoStartScene) {
|
||||||
|
ui->autoStartScene->setEnabled(useAutoStartScene);
|
||||||
|
ui->autoStartSceneName->setEnabled(useAutoStartScene);
|
||||||
|
ui->autoStartSceneNameRegex->setEnabled(
|
||||||
|
useAutoStartScene);
|
||||||
|
};
|
||||||
|
setupAutoStartSceneWidgetState(switcher->useAutoStartScene);
|
||||||
|
|
||||||
|
connect(ui->autoStartSceneEnable, &QCheckBox::stateChanged, this,
|
||||||
|
[this, setupAutoStartSceneWidgetState](int enabled) {
|
||||||
|
if (loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
switcher->useAutoStartScene = enabled;
|
||||||
|
setupAutoStartSceneWidgetState(enabled);
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->autoStartScene, &SceneSelectionWidget::SceneChanged, this,
|
||||||
|
[this](const SceneSelection &scene) {
|
||||||
|
if (loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
switcher->autoStartScene = scene;
|
||||||
|
switcher->CheckAutoStart();
|
||||||
|
});
|
||||||
|
connect(ui->autoStartSceneName, &VariableLineEdit::editingFinished,
|
||||||
|
this, [this]() {
|
||||||
|
if (loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
switcher->autoStartSceneName =
|
||||||
|
ui->autoStartSceneName->text().toStdString();
|
||||||
|
switcher->CheckAutoStart();
|
||||||
|
});
|
||||||
|
connect(ui->autoStartSceneNameRegex,
|
||||||
|
&RegexConfigWidget::RegexConfigChanged, this,
|
||||||
|
[this, setupAutoStartSceneLayoutVisibility](
|
||||||
|
const RegexConfig ®ex) {
|
||||||
|
if (loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
switcher->autoStartSceneRegex = regex;
|
||||||
|
setupAutoStartSceneLayoutVisibility(regex.Enabled());
|
||||||
|
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
|
// Set up status control
|
||||||
auto statusControl = new StatusControl(this, true);
|
auto statusControl = new StatusControl(this, true);
|
||||||
|
|||||||
@@ -259,7 +259,8 @@ void AudioSwitch::setVolumeLevel(void *data, const float *,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
obs_volmeter_t *AddVolmeterToSource(AudioSwitch *entry, obs_weak_source *source)
|
static obs_volmeter_t *addVolmeterToSource(AudioSwitch *entry,
|
||||||
|
obs_weak_source *source)
|
||||||
{
|
{
|
||||||
obs_volmeter_t *volmeter = obs_volmeter_create(OBS_FADER_LOG);
|
obs_volmeter_t *volmeter = obs_volmeter_create(OBS_FADER_LOG);
|
||||||
obs_volmeter_add_callback(volmeter, AudioSwitch::setVolumeLevel, entry);
|
obs_volmeter_add_callback(volmeter, AudioSwitch::setVolumeLevel, entry);
|
||||||
@@ -279,7 +280,7 @@ void AudioSwitch::resetVolmeter()
|
|||||||
obs_volmeter_remove_callback(volmeter, setVolumeLevel, this);
|
obs_volmeter_remove_callback(volmeter, setVolumeLevel, this);
|
||||||
obs_volmeter_destroy(volmeter);
|
obs_volmeter_destroy(volmeter);
|
||||||
|
|
||||||
volmeter = AddVolmeterToSource(this, audioSource);
|
volmeter = addVolmeterToSource(this, audioSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioSwitch::initialized()
|
bool AudioSwitch::initialized()
|
||||||
@@ -318,7 +319,7 @@ void AudioSwitch::load(obs_data_t *obj)
|
|||||||
duration.Load(obj, "duration");
|
duration.Load(obj, "duration");
|
||||||
ignoreInactiveSource = obs_data_get_bool(obj, "ignoreInactiveSource");
|
ignoreInactiveSource = obs_data_get_bool(obj, "ignoreInactiveSource");
|
||||||
|
|
||||||
volmeter = AddVolmeterToSource(this, audioSource);
|
volmeter = addVolmeterToSource(this, audioSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioSwitchFallback::save(obs_data_t *obj)
|
void AudioSwitchFallback::save(obs_data_t *obj)
|
||||||
@@ -349,7 +350,7 @@ AudioSwitch::AudioSwitch(const AudioSwitch &other)
|
|||||||
condition(other.condition),
|
condition(other.condition),
|
||||||
duration(other.duration)
|
duration(other.duration)
|
||||||
{
|
{
|
||||||
volmeter = AddVolmeterToSource(this, other.audioSource);
|
volmeter = addVolmeterToSource(this, other.audioSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioSwitch::AudioSwitch(AudioSwitch &&other) noexcept
|
AudioSwitch::AudioSwitch(AudioSwitch &&other) noexcept
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include "kwin-helpers.h"
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
@@ -44,6 +45,10 @@ static XScreenSaverAllocInfoFunc allocSSFunc = nullptr;
|
|||||||
static XScreenSaverQueryInfoFunc querySSFunc = nullptr;
|
static XScreenSaverQueryInfoFunc querySSFunc = nullptr;
|
||||||
bool canGetIdleTime = false;
|
bool canGetIdleTime = false;
|
||||||
|
|
||||||
|
static bool KWin = false;
|
||||||
|
static FocusNotifier notifier;
|
||||||
|
static QString KWinScriptObjectPath;
|
||||||
|
|
||||||
static QLibrary *libprocps = nullptr;
|
static QLibrary *libprocps = nullptr;
|
||||||
#ifdef PROCPS_AVAILABLE
|
#ifdef PROCPS_AVAILABLE
|
||||||
typedef PROCTAB *(*openproc_func)(int flags);
|
typedef PROCTAB *(*openproc_func)(int flags);
|
||||||
@@ -275,6 +280,11 @@ int getActiveWindow(Window *&window)
|
|||||||
|
|
||||||
void GetCurrentWindowTitle(std::string &title)
|
void GetCurrentWindowTitle(std::string &title)
|
||||||
{
|
{
|
||||||
|
if (KWin) {
|
||||||
|
title = FocusNotifier::getActiveWindowTitle();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Window *data = 0;
|
Window *data = 0;
|
||||||
if (getActiveWindow(data) != Success || !data) {
|
if (getActiveWindow(data) != Success || !data) {
|
||||||
return;
|
return;
|
||||||
@@ -286,6 +296,7 @@ void GetCurrentWindowTitle(std::string &title)
|
|||||||
|
|
||||||
auto name = getWindowName(data[0]);
|
auto name = getWindowName(data[0]);
|
||||||
XFree(data);
|
XFree(data);
|
||||||
|
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -412,6 +423,10 @@ void GetProcessList(QStringList &processes)
|
|||||||
|
|
||||||
long getForegroundProcessPid()
|
long getForegroundProcessPid()
|
||||||
{
|
{
|
||||||
|
if (KWin) {
|
||||||
|
return FocusNotifier::getActiveWindowPID();
|
||||||
|
}
|
||||||
|
|
||||||
Window *window;
|
Window *window;
|
||||||
if (getActiveWindow(window) != Success || !window || !*window) {
|
if (getActiveWindow(window) != Success || !window || !*window) {
|
||||||
return -1;
|
return -1;
|
||||||
@@ -437,6 +452,7 @@ long getForegroundProcessPid()
|
|||||||
|
|
||||||
pid = *((long *)prop);
|
pid = *((long *)prop);
|
||||||
XFree(prop);
|
XFree(prop);
|
||||||
|
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,6 +566,11 @@ static void initProc2()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ignoreXerror(Display *d, XErrorEvent *e)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void PlatformInit()
|
void PlatformInit()
|
||||||
{
|
{
|
||||||
auto display = disp();
|
auto display = disp();
|
||||||
@@ -557,9 +578,21 @@ void PlatformInit()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KWin = isKWinAvailable();
|
||||||
|
if (!(KWin && startKWinScript(KWinScriptObjectPath) &&
|
||||||
|
registerKWinDBusListener(¬ifier))) {
|
||||||
|
// something bad happened while trying to initialize
|
||||||
|
// the KWin script/dbus so disable it
|
||||||
|
KWin = false;
|
||||||
|
blog(LOG_INFO, "not using KWin compat");
|
||||||
|
} else {
|
||||||
|
blog(LOG_INFO, "using KWin compat");
|
||||||
|
}
|
||||||
|
|
||||||
initXss();
|
initXss();
|
||||||
initProcps();
|
initProcps();
|
||||||
initProc2();
|
initProc2();
|
||||||
|
XSetErrorHandler(ignoreXerror);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cleanupHelper(QLibrary *lib)
|
static void cleanupHelper(QLibrary *lib)
|
||||||
@@ -576,6 +609,9 @@ void PlatformCleanup()
|
|||||||
cleanupHelper(libprocps);
|
cleanupHelper(libprocps);
|
||||||
cleanupHelper(libproc2);
|
cleanupHelper(libproc2);
|
||||||
cleanupDisplay();
|
cleanupDisplay();
|
||||||
|
XSetErrorHandler(NULL);
|
||||||
|
if (KWin && !KWinScriptObjectPath.isEmpty())
|
||||||
|
stopKWinScript(KWinScriptObjectPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
166
lib/linux/kwin-helpers.cpp
Normal file
166
lib/linux/kwin-helpers.cpp
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
#include "kwin-helpers.h"
|
||||||
|
|
||||||
|
#include "log-helper.hpp"
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QFileDevice>
|
||||||
|
#include <QTextStream>
|
||||||
|
#include <QtDBus/QDBusConnectionInterface>
|
||||||
|
#include <QtDBus/QDBusInterface>
|
||||||
|
#include <QtDBus/QDBusReply>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
int FocusNotifier::activePID = -1;
|
||||||
|
std::string FocusNotifier::activeTitle = {};
|
||||||
|
|
||||||
|
int FocusNotifier::getActiveWindowPID()
|
||||||
|
{
|
||||||
|
return activePID;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string FocusNotifier::getActiveWindowTitle()
|
||||||
|
{
|
||||||
|
return activeTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FocusNotifier::focusChanged(const int pid)
|
||||||
|
{
|
||||||
|
activePID = pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FocusNotifier::focusTitle(const QString &title)
|
||||||
|
{
|
||||||
|
activeTitle = title.toStdString();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isKWinAvailable()
|
||||||
|
{
|
||||||
|
const QDBusConnectionInterface *interface =
|
||||||
|
QDBusConnection::sessionBus().interface();
|
||||||
|
if (!interface)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const QStringList services =
|
||||||
|
interface->registeredServiceNames().value();
|
||||||
|
return services.contains("org.kde.KWin");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool startKWinScript(QString &scriptObjectPath)
|
||||||
|
{
|
||||||
|
const QString scriptPath =
|
||||||
|
"/tmp/AdvancedSceneSwitcher/KWinFocusNotifier.js";
|
||||||
|
|
||||||
|
const QString script =
|
||||||
|
R"(workspace.windowActivated.connect(function(client) {
|
||||||
|
if (!client) return;
|
||||||
|
if (!client.pid) return;
|
||||||
|
if (!client.caption) return;
|
||||||
|
|
||||||
|
callDBus(
|
||||||
|
"com.github.AdvancedSceneSwitcher",
|
||||||
|
"/com/github/AdvancedSceneSwitcher",
|
||||||
|
"com.github.AdvancedSceneSwitcher",
|
||||||
|
"focusChanged",
|
||||||
|
client.pid
|
||||||
|
);
|
||||||
|
callDBus(
|
||||||
|
"com.github.AdvancedSceneSwitcher",
|
||||||
|
"/com/github/AdvancedSceneSwitcher",
|
||||||
|
"com.github.AdvancedSceneSwitcher",
|
||||||
|
"focusTitle",
|
||||||
|
client.caption
|
||||||
|
);
|
||||||
|
}))";
|
||||||
|
|
||||||
|
if (const QDir dir; !dir.mkpath(QFileInfo(scriptPath).absolutePath())) {
|
||||||
|
blog(LOG_ERROR, "error creating /tmp/AdvancedSceneSwitcher");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QFile scriptFile(scriptPath);
|
||||||
|
if (!scriptFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
|
blog(LOG_ERROR,
|
||||||
|
"error opening KWinFocusNotifier.js for writing");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
scriptFile.setPermissions(QFileDevice::ReadOwner |
|
||||||
|
QFileDevice::WriteOwner);
|
||||||
|
QTextStream outputStream(&scriptFile);
|
||||||
|
outputStream << script;
|
||||||
|
scriptFile.close();
|
||||||
|
|
||||||
|
const QDBusConnection bus = QDBusConnection::sessionBus();
|
||||||
|
|
||||||
|
QDBusInterface scriptingIface("org.kde.KWin", "/Scripting",
|
||||||
|
"org.kde.kwin.Scripting", bus);
|
||||||
|
if (!scriptingIface.isValid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusReply<bool> scriptRunningReply =
|
||||||
|
scriptingIface.call("isScriptLoaded", scriptPath);
|
||||||
|
if (scriptRunningReply.isValid() && scriptRunningReply.value()) {
|
||||||
|
// script already registered and running, don't do it again
|
||||||
|
// this will leave the script running since we do not have
|
||||||
|
// a valid script id anymore, but at the very least this prevents
|
||||||
|
// it from running multiple times
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusReply<int> scriptIdReply =
|
||||||
|
scriptingIface.call("loadScript", scriptPath);
|
||||||
|
if (!scriptIdReply.isValid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const int scriptId = scriptIdReply.value();
|
||||||
|
scriptObjectPath =
|
||||||
|
QString("/Scripting/Script%1").arg(QString::number(scriptId));
|
||||||
|
|
||||||
|
QDBusInterface scriptRunner("org.kde.KWin", scriptObjectPath,
|
||||||
|
"org.kde.kwin.Script", bus);
|
||||||
|
if (!scriptRunner.isValid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QDBusReply<void> runReply = scriptRunner.call("run");
|
||||||
|
return runReply.isValid();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool stopKWinScript(const QString &scriptObjectPath)
|
||||||
|
{
|
||||||
|
QDBusInterface scriptRunner("org.kde.KWin", scriptObjectPath,
|
||||||
|
"org.kde.kwin.Script",
|
||||||
|
QDBusConnection::sessionBus());
|
||||||
|
if (!scriptRunner.isValid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const QDBusReply<void> stopReply = scriptRunner.call("stop");
|
||||||
|
return stopReply.isValid();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool registerKWinDBusListener(FocusNotifier *notifier)
|
||||||
|
{
|
||||||
|
static const QString serviceName = "com.github.AdvancedSceneSwitcher";
|
||||||
|
static const QString objectPath = "/com/github/AdvancedSceneSwitcher";
|
||||||
|
auto bus = QDBusConnection::sessionBus();
|
||||||
|
|
||||||
|
if (bus.objectRegisteredAt(objectPath)) {
|
||||||
|
// already registered?
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bus.registerService(serviceName)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bus.registerObject(objectPath, notifier,
|
||||||
|
QDBusConnection::ExportAllSlots)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} // namespace advss
|
||||||
33
lib/linux/kwin-helpers.h
Normal file
33
lib/linux/kwin-helpers.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QString>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
class FocusNotifier final : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
Q_CLASSINFO("D-Bus Interface", "com.github.AdvancedSceneSwitcher")
|
||||||
|
|
||||||
|
static int activePID;
|
||||||
|
static std::string activeTitle;
|
||||||
|
|
||||||
|
public:
|
||||||
|
using QObject::QObject;
|
||||||
|
|
||||||
|
static int getActiveWindowPID();
|
||||||
|
static std::string getActiveWindowTitle();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void focusChanged(const int pid);
|
||||||
|
void focusTitle(const QString &title);
|
||||||
|
};
|
||||||
|
|
||||||
|
bool isKWinAvailable();
|
||||||
|
bool startKWinScript(QString &scriptObjectPath);
|
||||||
|
bool stopKWinScript(const QString &scriptObjectPath);
|
||||||
|
bool registerKWinDBusListener(FocusNotifier *notifier);
|
||||||
|
void printDBusError();
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
@@ -7,8 +7,6 @@
|
|||||||
#include "section.hpp"
|
#include "section.hpp"
|
||||||
#include "switch-button.hpp"
|
#include "switch-button.hpp"
|
||||||
|
|
||||||
#include <QGraphicsOpacityEffect>
|
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
static inline void populateActionSelection(QComboBox *list)
|
static inline void populateActionSelection(QComboBox *list)
|
||||||
@@ -30,19 +28,20 @@ static inline void populateActionSelection(QComboBox *list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MacroActionEdit::MacroActionEdit(QWidget *parent,
|
MacroActionEdit::MacroActionEdit(QWidget *parent,
|
||||||
std::shared_ptr<MacroAction> *entryData,
|
std::shared_ptr<MacroAction> *entryData)
|
||||||
const std::string &id)
|
|
||||||
: MacroSegmentEdit(parent),
|
: MacroSegmentEdit(parent),
|
||||||
_actionSelection(new FilterComboBox()),
|
_actionSelection(new FilterComboBox()),
|
||||||
_enable(new SwitchButton()),
|
_enable(new SwitchButton()),
|
||||||
_entryData(entryData)
|
_entryData(entryData)
|
||||||
{
|
{
|
||||||
|
auto actionStateTimer = new QTimer(this);
|
||||||
|
|
||||||
QWidget::connect(_actionSelection,
|
QWidget::connect(_actionSelection,
|
||||||
SIGNAL(currentTextChanged(const QString &)), this,
|
SIGNAL(currentTextChanged(const QString &)), this,
|
||||||
SLOT(ActionSelectionChanged(const QString &)));
|
SLOT(ActionSelectionChanged(const QString &)));
|
||||||
QWidget::connect(_enable, SIGNAL(checked(bool)), this,
|
QWidget::connect(_enable, SIGNAL(checked(bool)), this,
|
||||||
SLOT(ActionEnableChanged(bool)));
|
SLOT(ActionEnableChanged(bool)));
|
||||||
QWidget::connect(&_actionStateTimer, SIGNAL(timeout()), this,
|
QWidget::connect(actionStateTimer, SIGNAL(timeout()), this,
|
||||||
SLOT(UpdateActionState()));
|
SLOT(UpdateActionState()));
|
||||||
|
|
||||||
populateActionSelection(_actionSelection);
|
populateActionSelection(_actionSelection);
|
||||||
@@ -63,12 +62,40 @@ MacroActionEdit::MacroActionEdit(QWidget *parent,
|
|||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
_entryData = entryData;
|
_entryData = entryData;
|
||||||
UpdateEntryData(id);
|
SetupWidgets(true);
|
||||||
|
|
||||||
_actionStateTimer.start(300);
|
actionStateTimer->start(300);
|
||||||
_loading = false;
|
_loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroActionEdit::SetupWidgets(bool basicSetup)
|
||||||
|
{
|
||||||
|
if (_allWidgetsAreSetup) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto id = (*_entryData)->GetId();
|
||||||
|
_actionSelection->setCurrentText(
|
||||||
|
obs_module_text(MacroActionFactory::GetActionName(id).c_str()));
|
||||||
|
const bool enabled = (*_entryData)->Enabled();
|
||||||
|
_enable->setChecked(enabled);
|
||||||
|
SetDisableEffect(!enabled);
|
||||||
|
HeaderInfoChanged(
|
||||||
|
QString::fromStdString((*_entryData)->GetShortDesc()));
|
||||||
|
|
||||||
|
if (basicSetup) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto widget = MacroActionFactory::CreateWidget(id, this, *_entryData);
|
||||||
|
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
||||||
|
this, SLOT(HeaderInfoChanged(const QString &)));
|
||||||
|
_section->SetContent(widget, (*_entryData)->GetCollapsed());
|
||||||
|
SetFocusPolicyOfWidgets();
|
||||||
|
|
||||||
|
_allWidgetsAreSetup = true;
|
||||||
|
}
|
||||||
|
|
||||||
void MacroActionEdit::ActionSelectionChanged(const QString &text)
|
void MacroActionEdit::ActionSelectionChanged(const QString &text)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
if (_loading || !_entryData) {
|
||||||
@@ -89,7 +116,7 @@ void MacroActionEdit::ActionSelectionChanged(const QString &text)
|
|||||||
*_entryData = MacroActionFactory::Create(id, macro);
|
*_entryData = MacroActionFactory::Create(id, macro);
|
||||||
(*_entryData)->SetIndex(idx);
|
(*_entryData)->SetIndex(idx);
|
||||||
(*_entryData)->PostLoad();
|
(*_entryData)->PostLoad();
|
||||||
RunPostLoadSteps();
|
RunAndClearPostLoadSteps();
|
||||||
}
|
}
|
||||||
auto widget = MacroActionFactory::CreateWidget(id, this, *_entryData);
|
auto widget = MacroActionFactory::CreateWidget(id, this, *_entryData);
|
||||||
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
||||||
@@ -98,38 +125,11 @@ void MacroActionEdit::ActionSelectionChanged(const QString &text)
|
|||||||
SetFocusPolicyOfWidgets();
|
SetFocusPolicyOfWidgets();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionEdit::UpdateEntryData(const std::string &id)
|
|
||||||
{
|
|
||||||
_actionSelection->setCurrentText(
|
|
||||||
obs_module_text(MacroActionFactory::GetActionName(id).c_str()));
|
|
||||||
const bool enabled = (*_entryData)->Enabled();
|
|
||||||
_enable->setChecked(enabled);
|
|
||||||
SetDisableEffect(!enabled);
|
|
||||||
auto widget = MacroActionFactory::CreateWidget(id, this, *_entryData);
|
|
||||||
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
|
||||||
this, SLOT(HeaderInfoChanged(const QString &)));
|
|
||||||
HeaderInfoChanged(
|
|
||||||
QString::fromStdString((*_entryData)->GetShortDesc()));
|
|
||||||
_section->SetContent(widget, (*_entryData)->GetCollapsed());
|
|
||||||
SetFocusPolicyOfWidgets();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MacroActionEdit::SetEntryData(std::shared_ptr<MacroAction> *data)
|
void MacroActionEdit::SetEntryData(std::shared_ptr<MacroAction> *data)
|
||||||
{
|
{
|
||||||
_entryData = data;
|
_entryData = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionEdit::SetDisableEffect(bool value)
|
|
||||||
{
|
|
||||||
if (value) {
|
|
||||||
auto effect = new QGraphicsOpacityEffect(this);
|
|
||||||
effect->setOpacity(0.5);
|
|
||||||
_section->setGraphicsEffect(effect);
|
|
||||||
} else {
|
|
||||||
_section->setGraphicsEffect(nullptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MacroActionEdit::ActionEnableChanged(bool value)
|
void MacroActionEdit::ActionEnableChanged(bool value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
if (_loading || !_entryData) {
|
||||||
@@ -147,13 +147,9 @@ void MacroActionEdit::UpdateActionState()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetEnableAppearance((*_entryData)->Enabled());
|
const bool enabled = (*_entryData)->Enabled();
|
||||||
}
|
SetEnableAppearance(enabled);
|
||||||
|
_enable->setChecked(enabled);
|
||||||
void MacroActionEdit::SetEnableAppearance(bool value)
|
|
||||||
{
|
|
||||||
_enable->setChecked(value);
|
|
||||||
SetDisableEffect(!value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<MacroSegment> MacroActionEdit::Data() const
|
std::shared_ptr<MacroSegment> MacroActionEdit::Data() const
|
||||||
@@ -161,473 +157,4 @@ std::shared_ptr<MacroSegment> MacroActionEdit::Data() const
|
|||||||
return *_entryData;
|
return *_entryData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::AddMacroAction(Macro *macro, int idx,
|
|
||||||
const std::string &id, obs_data_t *data)
|
|
||||||
{
|
|
||||||
if (idx < 0 || idx > (int)macro->Actions().size()) {
|
|
||||||
assert(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
|
||||||
macro->Actions().emplace(macro->Actions().begin() + idx,
|
|
||||||
MacroActionFactory::Create(id, macro));
|
|
||||||
if (data) {
|
|
||||||
macro->Actions().at(idx)->Load(data);
|
|
||||||
}
|
|
||||||
macro->Actions().at(idx)->PostLoad();
|
|
||||||
RunPostLoadSteps();
|
|
||||||
macro->UpdateActionIndices();
|
|
||||||
ui->actionsList->Insert(
|
|
||||||
idx,
|
|
||||||
new MacroActionEdit(this, ¯o->Actions()[idx], id));
|
|
||||||
SetActionData(*macro);
|
|
||||||
}
|
|
||||||
HighlightAction(idx);
|
|
||||||
ui->actionsList->SetHelpMsgVisible(false);
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::AddMacroAction(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 0 || idx > (int)macro->Actions().size()) {
|
|
||||||
assert(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string id;
|
|
||||||
if (idx - 1 >= 0) {
|
|
||||||
id = macro->Actions().at(idx - 1)->GetId();
|
|
||||||
} else {
|
|
||||||
id = MacroAction::GetDefaultID();
|
|
||||||
}
|
|
||||||
|
|
||||||
OBSDataAutoRelease data;
|
|
||||||
if (idx - 1 >= 0) {
|
|
||||||
data = obs_data_create();
|
|
||||||
macro->Actions().at(idx - 1)->Save(data);
|
|
||||||
}
|
|
||||||
AddMacroAction(macro.get(), idx, id, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_actionAdd_clicked()
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentActionIdx == -1) {
|
|
||||||
AddMacroAction((int)macro->Actions().size());
|
|
||||||
} else {
|
|
||||||
AddMacroAction(currentActionIdx + 1);
|
|
||||||
}
|
|
||||||
if (currentActionIdx != -1) {
|
|
||||||
MacroActionSelectionChanged(currentActionIdx + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::RemoveMacroAction(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 0 || idx >= (int)macro->Actions().size()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
|
||||||
ui->actionsList->Remove(idx);
|
|
||||||
macro->Actions().erase(macro->Actions().begin() + idx);
|
|
||||||
SetMacroAbortWait(true);
|
|
||||||
GetMacroWaitCV().notify_all();
|
|
||||||
macro->UpdateActionIndices();
|
|
||||||
SetActionData(*macro);
|
|
||||||
}
|
|
||||||
MacroActionSelectionChanged(-1);
|
|
||||||
lastInteracted = MacroSection::ACTIONS;
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_actionRemove_clicked()
|
|
||||||
{
|
|
||||||
if (currentActionIdx == -1) {
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RemoveMacroAction((int)macro->Actions().size() - 1);
|
|
||||||
} else {
|
|
||||||
RemoveMacroAction(currentActionIdx);
|
|
||||||
}
|
|
||||||
MacroActionSelectionChanged(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_actionTop_clicked()
|
|
||||||
{
|
|
||||||
if (currentActionIdx == -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MacroActionReorder(0, currentActionIdx);
|
|
||||||
MacroActionSelectionChanged(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_actionUp_clicked()
|
|
||||||
{
|
|
||||||
if (currentActionIdx == -1 || currentActionIdx == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveMacroActionUp(currentActionIdx);
|
|
||||||
MacroActionSelectionChanged(currentActionIdx - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_actionDown_clicked()
|
|
||||||
{
|
|
||||||
if (currentActionIdx == -1 ||
|
|
||||||
currentActionIdx == ui->actionsList->ContentLayout()->count() - 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveMacroActionDown(currentActionIdx);
|
|
||||||
MacroActionSelectionChanged(currentActionIdx + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_actionBottom_clicked()
|
|
||||||
{
|
|
||||||
if (currentActionIdx == -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const int newIdx = ui->actionsList->ContentLayout()->count() - 1;
|
|
||||||
MacroActionReorder(newIdx, currentActionIdx);
|
|
||||||
MacroActionSelectionChanged(newIdx);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_elseActionAdd_clicked()
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentElseActionIdx == -1) {
|
|
||||||
AddMacroElseAction((int)macro->ElseActions().size());
|
|
||||||
} else {
|
|
||||||
AddMacroElseAction(currentElseActionIdx + 1);
|
|
||||||
}
|
|
||||||
if (currentElseActionIdx != -1) {
|
|
||||||
MacroElseActionSelectionChanged(currentElseActionIdx + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_elseActionRemove_clicked()
|
|
||||||
{
|
|
||||||
if (currentElseActionIdx == -1) {
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RemoveMacroElseAction((int)macro->ElseActions().size() - 1);
|
|
||||||
} else {
|
|
||||||
RemoveMacroElseAction(currentElseActionIdx);
|
|
||||||
}
|
|
||||||
MacroElseActionSelectionChanged(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_elseActionTop_clicked()
|
|
||||||
{
|
|
||||||
if (currentElseActionIdx == -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MacroElseActionReorder(0, currentElseActionIdx);
|
|
||||||
MacroElseActionSelectionChanged(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_elseActionUp_clicked()
|
|
||||||
{
|
|
||||||
if (currentElseActionIdx == -1 || currentElseActionIdx == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveMacroElseActionUp(currentElseActionIdx);
|
|
||||||
MacroElseActionSelectionChanged(currentElseActionIdx - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_elseActionDown_clicked()
|
|
||||||
{
|
|
||||||
if (currentElseActionIdx == -1 ||
|
|
||||||
currentElseActionIdx ==
|
|
||||||
ui->elseActionsList->ContentLayout()->count() - 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveMacroElseActionDown(currentElseActionIdx);
|
|
||||||
MacroElseActionSelectionChanged(currentElseActionIdx + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_elseActionBottom_clicked()
|
|
||||||
{
|
|
||||||
if (currentElseActionIdx == -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const int newIdx = ui->elseActionsList->ContentLayout()->count() - 1;
|
|
||||||
MacroElseActionReorder(newIdx, currentElseActionIdx);
|
|
||||||
MacroElseActionSelectionChanged(newIdx);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::SwapActions(Macro *m, int pos1, int pos2)
|
|
||||||
{
|
|
||||||
if (pos1 == pos2) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (pos1 > pos2) {
|
|
||||||
std::swap(pos1, pos2);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
iter_swap(m->Actions().begin() + pos1, m->Actions().begin() + pos2);
|
|
||||||
m->UpdateActionIndices();
|
|
||||||
auto widget1 = static_cast<MacroActionEdit *>(
|
|
||||||
ui->actionsList->ContentLayout()->takeAt(pos1)->widget());
|
|
||||||
auto widget2 = static_cast<MacroActionEdit *>(
|
|
||||||
ui->actionsList->ContentLayout()->takeAt(pos2 - 1)->widget());
|
|
||||||
ui->actionsList->Insert(pos1, widget2);
|
|
||||||
ui->actionsList->Insert(pos2, widget1);
|
|
||||||
SetActionData(*m);
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MoveMacroActionUp(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 1 || idx >= (int)macro->Actions().size()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SwapActions(macro.get(), idx, idx - 1);
|
|
||||||
HighlightAction(idx - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MoveMacroActionDown(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 0 || idx >= (int)macro->Actions().size() - 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SwapActions(macro.get(), idx, idx + 1);
|
|
||||||
HighlightAction(idx + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MacroElseActionSelectionChanged(int idx)
|
|
||||||
{
|
|
||||||
SetupMacroSegmentSelection(MacroSection::ELSE_ACTIONS, idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MacroElseActionReorder(int to, int from)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (to == from || from < 0 || from > (int)macro->ElseActions().size() ||
|
|
||||||
to < 0 || to > (int)macro->ElseActions().size()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
|
||||||
auto action = macro->ElseActions().at(from);
|
|
||||||
macro->ElseActions().erase(macro->ElseActions().begin() + from);
|
|
||||||
macro->ElseActions().insert(macro->ElseActions().begin() + to,
|
|
||||||
action);
|
|
||||||
macro->UpdateElseActionIndices();
|
|
||||||
ui->elseActionsList->ContentLayout()->insertItem(
|
|
||||||
to, ui->elseActionsList->ContentLayout()->takeAt(from));
|
|
||||||
SetElseActionData(*macro);
|
|
||||||
}
|
|
||||||
HighlightElseAction(to);
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::AddMacroElseAction(Macro *macro, int idx,
|
|
||||||
const std::string &id,
|
|
||||||
obs_data_t *data)
|
|
||||||
{
|
|
||||||
if (idx < 0 || idx > (int)macro->ElseActions().size()) {
|
|
||||||
assert(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
|
||||||
macro->ElseActions().emplace(macro->ElseActions().begin() + idx,
|
|
||||||
MacroActionFactory::Create(id,
|
|
||||||
macro));
|
|
||||||
if (data) {
|
|
||||||
macro->ElseActions().at(idx)->Load(data);
|
|
||||||
}
|
|
||||||
macro->ElseActions().at(idx)->PostLoad();
|
|
||||||
RunPostLoadSteps();
|
|
||||||
macro->UpdateElseActionIndices();
|
|
||||||
ui->elseActionsList->Insert(
|
|
||||||
idx, new MacroActionEdit(
|
|
||||||
this, ¯o->ElseActions()[idx], id));
|
|
||||||
SetElseActionData(*macro);
|
|
||||||
}
|
|
||||||
HighlightElseAction(idx);
|
|
||||||
ui->elseActionsList->SetHelpMsgVisible(false);
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::AddMacroElseAction(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 0 || idx > (int)macro->ElseActions().size()) {
|
|
||||||
assert(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string id;
|
|
||||||
if (idx - 1 >= 0) {
|
|
||||||
id = macro->ElseActions().at(idx - 1)->GetId();
|
|
||||||
} else {
|
|
||||||
id = MacroAction::GetDefaultID();
|
|
||||||
}
|
|
||||||
|
|
||||||
OBSDataAutoRelease data;
|
|
||||||
if (idx - 1 >= 0) {
|
|
||||||
data = obs_data_create();
|
|
||||||
macro->ElseActions().at(idx - 1)->Save(data);
|
|
||||||
}
|
|
||||||
AddMacroElseAction(macro.get(), idx, id, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::RemoveMacroElseAction(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 0 || idx >= (int)macro->ElseActions().size()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
|
||||||
ui->elseActionsList->Remove(idx);
|
|
||||||
macro->ElseActions().erase(macro->ElseActions().begin() + idx);
|
|
||||||
SetMacroAbortWait(true);
|
|
||||||
GetMacroWaitCV().notify_all();
|
|
||||||
macro->UpdateElseActionIndices();
|
|
||||||
SetElseActionData(*macro);
|
|
||||||
}
|
|
||||||
MacroElseActionSelectionChanged(-1);
|
|
||||||
lastInteracted = MacroSection::ELSE_ACTIONS;
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::SwapElseActions(Macro *m, int pos1, int pos2)
|
|
||||||
{
|
|
||||||
if (pos1 == pos2) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (pos1 > pos2) {
|
|
||||||
std::swap(pos1, pos2);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
iter_swap(m->ElseActions().begin() + pos1,
|
|
||||||
m->ElseActions().begin() + pos2);
|
|
||||||
m->UpdateElseActionIndices();
|
|
||||||
auto widget1 = static_cast<MacroActionEdit *>(
|
|
||||||
ui->elseActionsList->ContentLayout()->takeAt(pos1)->widget());
|
|
||||||
auto widget2 = static_cast<MacroActionEdit *>(
|
|
||||||
ui->elseActionsList->ContentLayout()
|
|
||||||
->takeAt(pos2 - 1)
|
|
||||||
->widget());
|
|
||||||
ui->elseActionsList->Insert(pos1, widget2);
|
|
||||||
ui->elseActionsList->Insert(pos2, widget1);
|
|
||||||
SetElseActionData(*m);
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MoveMacroElseActionUp(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 1 || idx >= (int)macro->ElseActions().size()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SwapElseActions(macro.get(), idx, idx - 1);
|
|
||||||
HighlightElseAction(idx - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MoveMacroElseActionDown(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 0 || idx >= (int)macro->ElseActions().size() - 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SwapElseActions(macro.get(), idx, idx + 1);
|
|
||||||
HighlightElseAction(idx + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MacroActionSelectionChanged(int idx)
|
|
||||||
{
|
|
||||||
SetupMacroSegmentSelection(MacroSection::ACTIONS, idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MacroActionReorder(int to, int from)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (to == from || from < 0 || from > (int)macro->Actions().size() ||
|
|
||||||
to < 0 || to > (int)macro->Actions().size()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
|
||||||
auto action = macro->Actions().at(from);
|
|
||||||
macro->Actions().erase(macro->Actions().begin() + from);
|
|
||||||
macro->Actions().insert(macro->Actions().begin() + to, action);
|
|
||||||
macro->UpdateActionIndices();
|
|
||||||
ui->actionsList->ContentLayout()->insertItem(
|
|
||||||
to, ui->actionsList->ContentLayout()->takeAt(from));
|
|
||||||
SetActionData(*macro);
|
|
||||||
}
|
|
||||||
HighlightAction(to);
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -13,11 +13,9 @@ class MacroActionEdit : public MacroSegmentEdit {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MacroActionEdit(
|
MacroActionEdit(QWidget *parent = nullptr,
|
||||||
QWidget *parent = nullptr,
|
std::shared_ptr<MacroAction> * = nullptr);
|
||||||
std::shared_ptr<MacroAction> * = nullptr,
|
void SetupWidgets(bool basicSetup = false);
|
||||||
const std::string &id = MacroAction::GetDefaultID().data());
|
|
||||||
void UpdateEntryData(const std::string &id);
|
|
||||||
void SetEntryData(std::shared_ptr<MacroAction> *);
|
void SetEntryData(std::shared_ptr<MacroAction> *);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@@ -27,14 +25,11 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<MacroSegment> Data() const;
|
std::shared_ptr<MacroSegment> Data() const;
|
||||||
void SetDisableEffect(bool);
|
|
||||||
void SetEnableAppearance(bool);
|
|
||||||
|
|
||||||
FilterComboBox *_actionSelection;
|
FilterComboBox *_actionSelection;
|
||||||
SwitchButton *_enable;
|
SwitchButton *_enable;
|
||||||
|
|
||||||
std::shared_ptr<MacroAction> *_entryData;
|
std::shared_ptr<MacroAction> *_entryData;
|
||||||
QTimer _actionStateTimer;
|
|
||||||
bool _loading = true;
|
bool _loading = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,11 @@
|
|||||||
#include "macro-action-factory.hpp"
|
#include "macro-action-factory.hpp"
|
||||||
|
#include "macro-segment-unknown.hpp"
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
namespace {
|
using MacroActionUnknown = MacroSegmentUnknown<MacroAction>;
|
||||||
|
|
||||||
class MacroActionUnknown : public MacroAction {
|
|
||||||
public:
|
|
||||||
MacroActionUnknown(Macro *m) : MacroAction(m) {}
|
|
||||||
std::shared_ptr<MacroAction> Copy() const
|
|
||||||
{
|
|
||||||
return std::make_shared<MacroActionUnknown>(GetMacro());
|
|
||||||
}
|
|
||||||
bool PerformAction() { return true; };
|
|
||||||
bool Save(obs_data_t *obj) const { return MacroAction::Save(obj); };
|
|
||||||
bool Load(obs_data_t *obj) { return MacroAction::Load(obj); };
|
|
||||||
std::string GetId() const { return "unknown"; }
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
static std::recursive_mutex mutex;
|
static std::recursive_mutex mutex;
|
||||||
|
|
||||||
@@ -49,9 +35,10 @@ bool MacroActionFactory::Deregister(const std::string &id)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::shared_ptr<MacroAction> createUnknownAction(Macro *m)
|
static std::shared_ptr<MacroAction> createUnknownAction(Macro *m,
|
||||||
|
const std::string &id)
|
||||||
{
|
{
|
||||||
return std::make_shared<MacroActionUnknown>(m);
|
return std::make_shared<MacroActionUnknown>(m, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<MacroAction> MacroActionFactory::Create(const std::string &id,
|
std::shared_ptr<MacroAction> MacroActionFactory::Create(const std::string &id,
|
||||||
@@ -62,12 +49,7 @@ std::shared_ptr<MacroAction> MacroActionFactory::Create(const std::string &id,
|
|||||||
return it->second._create(m);
|
return it->second._create(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
return createUnknownAction(m);
|
return createUnknownAction(m, id);
|
||||||
}
|
|
||||||
|
|
||||||
static QWidget *createUnknownActionWidget()
|
|
||||||
{
|
|
||||||
return new QLabel(obs_module_text("AdvSceneSwitcher.action.unknown"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *MacroActionFactory::CreateWidget(const std::string &id,
|
QWidget *MacroActionFactory::CreateWidget(const std::string &id,
|
||||||
@@ -79,7 +61,7 @@ QWidget *MacroActionFactory::CreateWidget(const std::string &id,
|
|||||||
return it->second._createWidget(parent, action);
|
return it->second._createWidget(parent, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
return createUnknownActionWidget();
|
return CreateUnknownSegmentWidget(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string MacroActionFactory::GetActionName(const std::string &id)
|
std::string MacroActionFactory::GetActionName(const std::string &id)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public:
|
|||||||
MacroActionFactory() = delete;
|
MacroActionFactory() = delete;
|
||||||
|
|
||||||
EXPORT static bool Register(const std::string &id, MacroActionInfo);
|
EXPORT static bool Register(const std::string &id, MacroActionInfo);
|
||||||
static bool Deregister(const std::string &id);
|
EXPORT static bool Deregister(const std::string &id);
|
||||||
static std::shared_ptr<MacroAction> Create(const std::string &id,
|
static std::shared_ptr<MacroAction> Create(const std::string &id,
|
||||||
Macro *m);
|
Macro *m);
|
||||||
static QWidget *CreateWidget(const std::string &id, QWidget *parent,
|
static QWidget *CreateWidget(const std::string &id, QWidget *parent,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include "help-icon.hpp"
|
#include "help-icon.hpp"
|
||||||
#include "layout-helpers.hpp"
|
#include "layout-helpers.hpp"
|
||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
|
#include "macro-action-factory.hpp"
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
@@ -12,27 +13,81 @@ bool MacroActionMacro::_registered = MacroActionFactory::Register(
|
|||||||
{MacroActionMacro::Create, MacroActionMacroEdit::Create,
|
{MacroActionMacro::Create, MacroActionMacroEdit::Create,
|
||||||
"AdvSceneSwitcher.action.macro"});
|
"AdvSceneSwitcher.action.macro"});
|
||||||
|
|
||||||
const static std::map<MacroActionMacro::Action, std::string> actionTypes = {
|
void MacroActionMacro::AdjustActionState(Macro *macro) const
|
||||||
{MacroActionMacro::Action::PAUSE,
|
{
|
||||||
"AdvSceneSwitcher.action.macro.type.pause"},
|
const auto ¯oActions = _useElseSection ? macro->ElseActions()
|
||||||
{MacroActionMacro::Action::UNPAUSE,
|
: macro->Actions();
|
||||||
"AdvSceneSwitcher.action.macro.type.unpause"},
|
|
||||||
{MacroActionMacro::Action::RESET_COUNTER,
|
std::vector<std::shared_ptr<MacroAction>> actionsToModify;
|
||||||
"AdvSceneSwitcher.action.macro.type.resetCounter"},
|
switch (_actionSelectionType) {
|
||||||
{MacroActionMacro::Action::RUN,
|
case SelectionType::INDEX: {
|
||||||
"AdvSceneSwitcher.action.macro.type.run"},
|
const bool isValidAction =
|
||||||
{MacroActionMacro::Action::STOP,
|
(_useElseSection &&
|
||||||
"AdvSceneSwitcher.action.macro.type.stop"},
|
IsValidElseActionIndex(macro, _actionIndex - 1)) ||
|
||||||
{MacroActionMacro::Action::DISABLE_ACTION,
|
(!_useElseSection &&
|
||||||
"AdvSceneSwitcher.action.macro.type.disableAction"},
|
IsValidActionIndex(macro, _actionIndex - 1));
|
||||||
{MacroActionMacro::Action::ENABLE_ACTION,
|
|
||||||
"AdvSceneSwitcher.action.macro.type.enableAction"},
|
if (isValidAction) {
|
||||||
{MacroActionMacro::Action::TOGGLE_ACTION,
|
actionsToModify.emplace_back(
|
||||||
"AdvSceneSwitcher.action.macro.type.toggleAction"},
|
macroActions.at(_actionIndex - 1));
|
||||||
};
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SelectionType::LABEL:
|
||||||
|
for (const auto &action : macroActions) {
|
||||||
|
if (!action->GetUseCustomLabel()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto label = action->GetCustomLabel();
|
||||||
|
|
||||||
|
if (_regex.Enabled()) {
|
||||||
|
if (_regex.Matches(label, _label)) {
|
||||||
|
actionsToModify.emplace_back(action);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (label == std::string(_label)) {
|
||||||
|
actionsToModify.emplace_back(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SelectionType::ID:
|
||||||
|
for (const auto &action : macroActions) {
|
||||||
|
if (action->GetId() == _actionId) {
|
||||||
|
actionsToModify.emplace_back(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto &action : actionsToModify) {
|
||||||
|
switch (_action) {
|
||||||
|
case Action::DISABLE_ACTION:
|
||||||
|
action->SetEnabled(false);
|
||||||
|
break;
|
||||||
|
case Action::ENABLE_ACTION:
|
||||||
|
action->SetEnabled(true);
|
||||||
|
break;
|
||||||
|
case Action::TOGGLE_ACTION:
|
||||||
|
action->SetEnabled(!action->Enabled());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool MacroActionMacro::PerformAction()
|
bool MacroActionMacro::PerformAction()
|
||||||
{
|
{
|
||||||
|
if (_action == Action::NESTED_MACRO) {
|
||||||
|
const bool conditionsMatched = _nestedMacro->CheckConditions();
|
||||||
|
return _nestedMacro->PerformActions(conditionsMatched);
|
||||||
|
}
|
||||||
|
|
||||||
auto macro = _macro.GetMacro();
|
auto macro = _macro.GetMacro();
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
return true;
|
return true;
|
||||||
@@ -45,33 +100,22 @@ bool MacroActionMacro::PerformAction()
|
|||||||
case Action::UNPAUSE:
|
case Action::UNPAUSE:
|
||||||
macro->SetPaused(false);
|
macro->SetPaused(false);
|
||||||
break;
|
break;
|
||||||
|
case Action::TOGGLE_PAUSE:
|
||||||
|
macro->SetPaused(!macro->Paused());
|
||||||
|
break;
|
||||||
case Action::RESET_COUNTER:
|
case Action::RESET_COUNTER:
|
||||||
macro->ResetRunCount();
|
macro->ResetRunCount();
|
||||||
break;
|
break;
|
||||||
case Action::RUN:
|
case Action::RUN_ACTIONS:
|
||||||
RunActions(macro.get());
|
RunActions(macro.get());
|
||||||
break;
|
break;
|
||||||
case Action::STOP:
|
case Action::STOP:
|
||||||
macro->Stop();
|
macro->Stop();
|
||||||
break;
|
break;
|
||||||
case Action::DISABLE_ACTION:
|
case Action::DISABLE_ACTION:
|
||||||
if (IsValidMacroSegmentIndex(macro.get(), _actionIndex - 1,
|
|
||||||
false)) {
|
|
||||||
macro->Actions().at(_actionIndex - 1)->SetEnabled(false);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Action::ENABLE_ACTION:
|
case Action::ENABLE_ACTION:
|
||||||
if (IsValidMacroSegmentIndex(macro.get(), _actionIndex - 1,
|
|
||||||
false)) {
|
|
||||||
macro->Actions().at(_actionIndex - 1)->SetEnabled(true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Action::TOGGLE_ACTION:
|
case Action::TOGGLE_ACTION:
|
||||||
if (IsValidMacroSegmentIndex(macro.get(), _actionIndex - 1,
|
AdjustActionState(macro.get());
|
||||||
false)) {
|
|
||||||
auto action = macro->Actions().at(_actionIndex - 1);
|
|
||||||
action->SetEnabled(!action->Enabled());
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -96,7 +140,7 @@ void MacroActionMacro::LogAction() const
|
|||||||
ablog(LOG_INFO, "reset counter for \"%s\"",
|
ablog(LOG_INFO, "reset counter for \"%s\"",
|
||||||
macro->Name().c_str());
|
macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
case Action::RUN:
|
case Action::RUN_ACTIONS:
|
||||||
ablog(LOG_INFO, "run nested macro \"%s\"",
|
ablog(LOG_INFO, "run nested macro \"%s\"",
|
||||||
macro->Name().c_str());
|
macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
@@ -115,6 +159,9 @@ void MacroActionMacro::LogAction() const
|
|||||||
ablog(LOG_INFO, "toggled action %d of macro \"%s\"",
|
ablog(LOG_INFO, "toggled action %d of macro \"%s\"",
|
||||||
_actionIndex.GetValue(), macro->Name().c_str());
|
_actionIndex.GetValue(), macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
|
case Action::NESTED_MACRO:
|
||||||
|
ablog(LOG_INFO, "run nested macro");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -123,21 +170,44 @@ void MacroActionMacro::LogAction() const
|
|||||||
bool MacroActionMacro::Save(obs_data_t *obj) const
|
bool MacroActionMacro::Save(obs_data_t *obj) const
|
||||||
{
|
{
|
||||||
MacroAction::Save(obj);
|
MacroAction::Save(obj);
|
||||||
_macro.Save(obj);
|
|
||||||
_actionIndex.Save(obj, "actionIndex");
|
|
||||||
obs_data_set_int(obj, "action", static_cast<int>(_action));
|
obs_data_set_int(obj, "action", static_cast<int>(_action));
|
||||||
|
_macro.Save(obj);
|
||||||
|
obs_data_set_int(obj, "actionSelectionType",
|
||||||
|
static_cast<int>(_actionSelectionType));
|
||||||
|
_actionIndex.Save(obj, "actionIndex");
|
||||||
|
_label.Save(obj, "label");
|
||||||
|
obs_data_set_string(obj, "actionId", _actionId.c_str());
|
||||||
|
_regex.Save(obj);
|
||||||
_runOptions.Save(obj);
|
_runOptions.Save(obj);
|
||||||
|
OBSDataAutoRelease nestedMacroData = obs_data_create();
|
||||||
|
_nestedMacro->Save(nestedMacroData);
|
||||||
|
obs_data_set_obj(obj, "nestedMacro", nestedMacroData);
|
||||||
|
obs_data_set_int(obj, "customWidgetHeight", _customWidgetHeight);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroActionMacro::Load(obs_data_t *obj)
|
bool MacroActionMacro::Load(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
MacroAction::Load(obj);
|
MacroAction::Load(obj);
|
||||||
_macro.Load(obj);
|
|
||||||
_actionIndex.Load(obj, "actionIndex");
|
|
||||||
_action = static_cast<MacroActionMacro::Action>(
|
_action = static_cast<MacroActionMacro::Action>(
|
||||||
obs_data_get_int(obj, "action"));
|
obs_data_get_int(obj, "action"));
|
||||||
|
_macro.Load(obj);
|
||||||
|
_actionSelectionType = static_cast<SelectionType>(
|
||||||
|
obs_data_get_int(obj, "actionSelectionType"));
|
||||||
|
_actionIndex.Load(obj, "actionIndex");
|
||||||
|
_label.Load(obj, "label");
|
||||||
|
_actionId = obs_data_get_string(obj, "actionId");
|
||||||
|
_regex.Load(obj);
|
||||||
_runOptions.Load(obj);
|
_runOptions.Load(obj);
|
||||||
|
|
||||||
|
if (obs_data_has_user_value(obj, "nestedMacro")) {
|
||||||
|
OBSDataAutoRelease nestedMacroData =
|
||||||
|
obs_data_get_obj(obj, "nestedMacro");
|
||||||
|
_nestedMacro->Load(nestedMacroData);
|
||||||
|
}
|
||||||
|
|
||||||
|
_customWidgetHeight = obs_data_get_int(obj, "customWidgetHeight");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,6 +216,7 @@ bool MacroActionMacro::PostLoad()
|
|||||||
MacroRefAction::PostLoad();
|
MacroRefAction::PostLoad();
|
||||||
MacroAction::PostLoad();
|
MacroAction::PostLoad();
|
||||||
_runOptions.macro.PostLoad();
|
_runOptions.macro.PostLoad();
|
||||||
|
_nestedMacro->PostLoad();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,12 +232,23 @@ std::shared_ptr<MacroAction> MacroActionMacro::Create(Macro *m)
|
|||||||
|
|
||||||
std::shared_ptr<MacroAction> MacroActionMacro::Copy() const
|
std::shared_ptr<MacroAction> MacroActionMacro::Copy() const
|
||||||
{
|
{
|
||||||
return std::make_shared<MacroActionMacro>(*this);
|
auto copy = std::make_shared<MacroActionMacro>(*this);
|
||||||
|
|
||||||
|
// Create a new nested macro
|
||||||
|
OBSDataAutoRelease data = obs_data_create();
|
||||||
|
_nestedMacro->Save(data);
|
||||||
|
|
||||||
|
copy->_nestedMacro = std::make_shared<Macro>();
|
||||||
|
copy->_nestedMacro->Load(data);
|
||||||
|
copy->_nestedMacro->PostLoad();
|
||||||
|
|
||||||
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionMacro::ResolveVariablesToFixedValues()
|
void MacroActionMacro::ResolveVariablesToFixedValues()
|
||||||
{
|
{
|
||||||
_actionIndex.ResolveVariables();
|
_actionIndex.ResolveVariables();
|
||||||
|
_label.ResolveVariables();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void runActionsHelper(Macro *macro, bool runElseActions, bool setInputs,
|
static void runActionsHelper(Macro *macro, bool runElseActions, bool setInputs,
|
||||||
@@ -210,8 +292,33 @@ void MacroActionMacro::RunActions(Macro *actionMacro) const
|
|||||||
|
|
||||||
static void populateActionSelection(QComboBox *list)
|
static void populateActionSelection(QComboBox *list)
|
||||||
{
|
{
|
||||||
for (const auto &[_, name] : actionTypes) {
|
static const std::vector<std::pair<MacroActionMacro::Action, std::string>>
|
||||||
list->addItem(obs_module_text(name.c_str()));
|
actions = {
|
||||||
|
{MacroActionMacro::Action::PAUSE,
|
||||||
|
"AdvSceneSwitcher.action.macro.type.pause"},
|
||||||
|
{MacroActionMacro::Action::UNPAUSE,
|
||||||
|
"AdvSceneSwitcher.action.macro.type.unpause"},
|
||||||
|
{MacroActionMacro::Action::TOGGLE_PAUSE,
|
||||||
|
"AdvSceneSwitcher.action.macro.type.togglePause"},
|
||||||
|
{MacroActionMacro::Action::RESET_COUNTER,
|
||||||
|
"AdvSceneSwitcher.action.macro.type.resetCounter"},
|
||||||
|
{MacroActionMacro::Action::NESTED_MACRO,
|
||||||
|
"AdvSceneSwitcher.action.macro.type.nestedMacro"},
|
||||||
|
{MacroActionMacro::Action::RUN_ACTIONS,
|
||||||
|
"AdvSceneSwitcher.action.macro.type.run"},
|
||||||
|
{MacroActionMacro::Action::STOP,
|
||||||
|
"AdvSceneSwitcher.action.macro.type.stop"},
|
||||||
|
{MacroActionMacro::Action::DISABLE_ACTION,
|
||||||
|
"AdvSceneSwitcher.action.macro.type.disableAction"},
|
||||||
|
{MacroActionMacro::Action::ENABLE_ACTION,
|
||||||
|
"AdvSceneSwitcher.action.macro.type.enableAction"},
|
||||||
|
{MacroActionMacro::Action::TOGGLE_ACTION,
|
||||||
|
"AdvSceneSwitcher.action.macro.type.toggleAction"},
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const auto &[value, name] : actions) {
|
||||||
|
list->addItem(obs_module_text(name.c_str()),
|
||||||
|
static_cast<int>(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +332,7 @@ static void populateConditionBehaviorSelection(QComboBox *list)
|
|||||||
"AdvSceneSwitcher.action.macro.type.run.conditions.false"));
|
"AdvSceneSwitcher.action.macro.type.run.conditions.false"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void populateActionTypeSelection(QComboBox *list)
|
static void populateActionSectionSelection(QComboBox *list)
|
||||||
{
|
{
|
||||||
list->addItem(obs_module_text(
|
list->addItem(obs_module_text(
|
||||||
"AdvSceneSwitcher.action.macro.type.run.actionType.regular"));
|
"AdvSceneSwitcher.action.macro.type.run.actionType.regular"));
|
||||||
@@ -233,19 +340,47 @@ static void populateActionTypeSelection(QComboBox *list)
|
|||||||
"AdvSceneSwitcher.action.macro.type.run.actionType.else"));
|
"AdvSceneSwitcher.action.macro.type.run.actionType.else"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void populateActionTypes(QComboBox *list)
|
||||||
|
{
|
||||||
|
for (const auto &[id, info] : MacroActionFactory::GetActionTypes()) {
|
||||||
|
list->addItem(obs_module_text(info._name.c_str()),
|
||||||
|
QString::fromStdString(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void populateActionSelectionTypes(QComboBox *list)
|
||||||
|
{
|
||||||
|
list->addItem(
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.macro.actionSelectionType.index"),
|
||||||
|
static_cast<int>(MacroActionMacro::SelectionType::INDEX));
|
||||||
|
list->addItem(
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.macro.actionSelectionType.label"),
|
||||||
|
static_cast<int>(MacroActionMacro::SelectionType::LABEL));
|
||||||
|
list->addItem(
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.macro.actionSelectionType.id"),
|
||||||
|
static_cast<int>(MacroActionMacro::SelectionType::ID));
|
||||||
|
}
|
||||||
|
|
||||||
MacroActionMacroEdit::MacroActionMacroEdit(
|
MacroActionMacroEdit::MacroActionMacroEdit(
|
||||||
QWidget *parent, std::shared_ptr<MacroActionMacro> entryData)
|
QWidget *parent, std::shared_ptr<MacroActionMacro> entryData)
|
||||||
: QWidget(parent),
|
: ResizableWidget(parent),
|
||||||
|
_actions(new QComboBox()),
|
||||||
_macros(new MacroSelection(parent)),
|
_macros(new MacroSelection(parent)),
|
||||||
|
_actionSelectionType(new QComboBox(this)),
|
||||||
_actionIndex(new MacroSegmentSelection(
|
_actionIndex(new MacroSegmentSelection(
|
||||||
this, MacroSegmentSelection::Type::ACTION)),
|
this, MacroSegmentSelection::Type::ACTION)),
|
||||||
_actions(new QComboBox()),
|
_label(new VariableLineEdit(this)),
|
||||||
|
_actionTypes(new FilterComboBox(this)),
|
||||||
|
_regex(new RegexConfigWidget(this)),
|
||||||
_conditionMacros(new MacroSelection(parent)),
|
_conditionMacros(new MacroSelection(parent)),
|
||||||
_conditionBehaviors(new QComboBox()),
|
_conditionBehaviors(new QComboBox()),
|
||||||
_reevaluateConditionState(new QCheckBox(
|
_reevaluateConditionState(new QCheckBox(
|
||||||
obs_module_text("AdvSceneSwitcher.action.macro.type.run."
|
obs_module_text("AdvSceneSwitcher.action.macro.type.run."
|
||||||
"updateConditionMatchState"))),
|
"updateConditionMatchState"))),
|
||||||
_actionTypes(new QComboBox()),
|
_actionSections(new QComboBox(this)),
|
||||||
_skipWhenPaused(new QCheckBox(obs_module_text(
|
_skipWhenPaused(new QCheckBox(obs_module_text(
|
||||||
"AdvSceneSwitcher.action.macro.type.run.skipWhenPaused"))),
|
"AdvSceneSwitcher.action.macro.type.run.skipWhenPaused"))),
|
||||||
_setInputs(new QCheckBox(obs_module_text(
|
_setInputs(new QCheckBox(obs_module_text(
|
||||||
@@ -254,11 +389,19 @@ MacroActionMacroEdit::MacroActionMacroEdit(
|
|||||||
_entryLayout(new QHBoxLayout()),
|
_entryLayout(new QHBoxLayout()),
|
||||||
_conditionLayout(new QHBoxLayout()),
|
_conditionLayout(new QHBoxLayout()),
|
||||||
_reevaluateConditionStateLayout(new QHBoxLayout()),
|
_reevaluateConditionStateLayout(new QHBoxLayout()),
|
||||||
_setInputsLayout(new QHBoxLayout())
|
_setInputsLayout(new QHBoxLayout()),
|
||||||
|
_nestedMacro(new MacroEdit(
|
||||||
|
this,
|
||||||
|
QStringList()
|
||||||
|
<< "AdvSceneSwitcher.action.macro.type.nestedMacro.conditionHelp"
|
||||||
|
<< "AdvSceneSwitcher.action.macro.type.nestedMacro.actionHelp"
|
||||||
|
<< "AdvSceneSwitcher.action.macro.type.nestedMacro.elseActionHelp"))
|
||||||
{
|
{
|
||||||
populateActionSelection(_actions);
|
populateActionSelection(_actions);
|
||||||
populateConditionBehaviorSelection(_conditionBehaviors);
|
populateConditionBehaviorSelection(_conditionBehaviors);
|
||||||
populateActionTypeSelection(_actionTypes);
|
populateActionSectionSelection(_actionSections);
|
||||||
|
populateActionSelectionTypes(_actionSelectionType);
|
||||||
|
populateActionTypes(_actionTypes);
|
||||||
|
|
||||||
_conditionMacros->HideSelectedMacro();
|
_conditionMacros->HideSelectedMacro();
|
||||||
|
|
||||||
@@ -266,16 +409,25 @@ MacroActionMacroEdit::MacroActionMacroEdit(
|
|||||||
this, SLOT(MacroChanged(const QString &)));
|
this, SLOT(MacroChanged(const QString &)));
|
||||||
QWidget::connect(_actions, SIGNAL(currentIndexChanged(int)), this,
|
QWidget::connect(_actions, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(ActionChanged(int)));
|
SLOT(ActionChanged(int)));
|
||||||
|
QWidget::connect(_actionSelectionType, SIGNAL(currentIndexChanged(int)),
|
||||||
|
this, SLOT(ActionSelectionTypeChanged(int)));
|
||||||
QWidget::connect(_actionIndex,
|
QWidget::connect(_actionIndex,
|
||||||
SIGNAL(SelectionChanged(const IntVariable &)), this,
|
SIGNAL(SelectionChanged(const IntVariable &)), this,
|
||||||
SLOT(ActionIndexChanged(const IntVariable &)));
|
SLOT(ActionIndexChanged(const IntVariable &)));
|
||||||
|
QWidget::connect(_label, SIGNAL(editingFinished()), this,
|
||||||
|
SLOT(LabelChanged()));
|
||||||
|
QWidget::connect(_actionTypes, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(ActionTypeChanged(int)));
|
||||||
|
QWidget::connect(_regex,
|
||||||
|
SIGNAL(RegexConfigChanged(const RegexConfig &)), this,
|
||||||
|
SLOT(RegexChanged(const RegexConfig &)));
|
||||||
QWidget::connect(_conditionMacros,
|
QWidget::connect(_conditionMacros,
|
||||||
SIGNAL(currentTextChanged(const QString &)), this,
|
SIGNAL(currentTextChanged(const QString &)), this,
|
||||||
SLOT(ConditionMacroChanged(const QString &)));
|
SLOT(ConditionMacroChanged(const QString &)));
|
||||||
QWidget::connect(_conditionBehaviors, SIGNAL(currentIndexChanged(int)),
|
QWidget::connect(_conditionBehaviors, SIGNAL(currentIndexChanged(int)),
|
||||||
this, SLOT(ConditionBehaviorChanged(int)));
|
this, SLOT(ConditionBehaviorChanged(int)));
|
||||||
QWidget::connect(_actionTypes, SIGNAL(currentIndexChanged(int)), this,
|
QWidget::connect(_actionSections, SIGNAL(currentIndexChanged(int)),
|
||||||
SLOT(ActionTypeChanged(int)));
|
this, SLOT(ActionSectionChanged(int)));
|
||||||
QWidget::connect(_skipWhenPaused, SIGNAL(stateChanged(int)), this,
|
QWidget::connect(_skipWhenPaused, SIGNAL(stateChanged(int)), this,
|
||||||
SLOT(SkipWhenPausedChanged(int)));
|
SLOT(SkipWhenPausedChanged(int)));
|
||||||
QWidget::connect(_setInputs, SIGNAL(stateChanged(int)), this,
|
QWidget::connect(_setInputs, SIGNAL(stateChanged(int)), this,
|
||||||
@@ -303,6 +455,7 @@ MacroActionMacroEdit::MacroActionMacroEdit(
|
|||||||
layout->addLayout(_setInputsLayout);
|
layout->addLayout(_setInputsLayout);
|
||||||
layout->addWidget(_inputs);
|
layout->addWidget(_inputs);
|
||||||
layout->addWidget(_skipWhenPaused);
|
layout->addWidget(_skipWhenPaused);
|
||||||
|
layout->addWidget(_nestedMacro);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
_entryData = entryData;
|
_entryData = entryData;
|
||||||
UpdateEntryData();
|
UpdateEntryData();
|
||||||
@@ -314,6 +467,12 @@ void HighlightMacroSettingsButton(bool enable);
|
|||||||
MacroActionMacroEdit::~MacroActionMacroEdit()
|
MacroActionMacroEdit::~MacroActionMacroEdit()
|
||||||
{
|
{
|
||||||
HighlightMacroSettingsButton(false);
|
HighlightMacroSettingsButton(false);
|
||||||
|
|
||||||
|
if (!_entryData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_entryData->_customWidgetHeight = GetCustomHeight();
|
||||||
|
_nestedMacro->SetMacro({}); // Save splitter states
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionMacroEdit::UpdateEntryData()
|
void MacroActionMacroEdit::UpdateEntryData()
|
||||||
@@ -321,23 +480,42 @@ void MacroActionMacroEdit::UpdateEntryData()
|
|||||||
if (!_entryData) {
|
if (!_entryData) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_actions->setCurrentIndex(static_cast<int>(_entryData->_action));
|
|
||||||
|
_actions->setCurrentIndex(
|
||||||
|
_actions->findData(static_cast<int>(_entryData->_action)));
|
||||||
|
_actionSelectionType->setCurrentIndex(_actionSelectionType->findData(
|
||||||
|
static_cast<int>(_entryData->_actionSelectionType)));
|
||||||
_actionIndex->SetValue(_entryData->_actionIndex);
|
_actionIndex->SetValue(_entryData->_actionIndex);
|
||||||
_actionIndex->SetMacro(_entryData->_macro.GetMacro());
|
_actionIndex->SetMacro(_entryData->_macro.GetMacro());
|
||||||
|
_label->setText(_entryData->_label);
|
||||||
|
_actionTypes->setCurrentIndex(_actionTypes->findData(
|
||||||
|
QString::fromStdString(_entryData->_actionId)));
|
||||||
|
_regex->SetRegexConfig(_entryData->_regex);
|
||||||
_macros->SetCurrentMacro(_entryData->_macro);
|
_macros->SetCurrentMacro(_entryData->_macro);
|
||||||
_conditionMacros->SetCurrentMacro(_entryData->_runOptions.macro);
|
_conditionMacros->SetCurrentMacro(_entryData->_runOptions.macro);
|
||||||
_conditionBehaviors->setCurrentIndex(
|
_conditionBehaviors->setCurrentIndex(
|
||||||
static_cast<int>(_entryData->_runOptions.logic));
|
static_cast<int>(_entryData->_runOptions.logic));
|
||||||
_reevaluateConditionState->setChecked(
|
_reevaluateConditionState->setChecked(
|
||||||
_entryData->_runOptions.reevaluateConditionState);
|
_entryData->_runOptions.reevaluateConditionState);
|
||||||
_actionTypes->setCurrentIndex(
|
_actionSections->setCurrentIndex(
|
||||||
_entryData->_runOptions.runElseActions ? 1 : 0);
|
_entryData->_runOptions.runElseActions ? 1 : 0);
|
||||||
_skipWhenPaused->setChecked(_entryData->_runOptions.skipWhenPaused);
|
_skipWhenPaused->setChecked(_entryData->_runOptions.skipWhenPaused);
|
||||||
_setInputs->setChecked(_entryData->_runOptions.setInputs);
|
_setInputs->setChecked(_entryData->_runOptions.setInputs);
|
||||||
SetupMacroInput(_entryData->_macro.GetMacro().get());
|
SetupMacroInput(_entryData->_macro.GetMacro().get());
|
||||||
|
|
||||||
|
const auto ¯o = _entryData->_nestedMacro;
|
||||||
|
_nestedMacro->SetMacro(macro);
|
||||||
|
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWidget *MacroActionMacroEdit::Create(QWidget *parent,
|
||||||
|
std::shared_ptr<MacroAction> action)
|
||||||
|
{
|
||||||
|
return new MacroActionMacroEdit(
|
||||||
|
parent, std::dynamic_pointer_cast<MacroActionMacro>(action));
|
||||||
|
}
|
||||||
|
|
||||||
void MacroActionMacroEdit::MacroChanged(const QString &text)
|
void MacroActionMacroEdit::MacroChanged(const QString &text)
|
||||||
{
|
{
|
||||||
GUARD_LOADING_AND_LOCK();
|
GUARD_LOADING_AND_LOCK();
|
||||||
@@ -350,10 +528,20 @@ void MacroActionMacroEdit::MacroChanged(const QString &text)
|
|||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionMacroEdit::ActionChanged(int value)
|
void MacroActionMacroEdit::ActionChanged(int idx)
|
||||||
{
|
{
|
||||||
GUARD_LOADING_AND_LOCK();
|
GUARD_LOADING_AND_LOCK();
|
||||||
_entryData->_action = static_cast<MacroActionMacro::Action>(value);
|
_entryData->_action = static_cast<MacroActionMacro::Action>(
|
||||||
|
_actions->itemData(idx).toInt());
|
||||||
|
SetWidgetVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionMacroEdit::ActionSelectionTypeChanged(int idx)
|
||||||
|
{
|
||||||
|
GUARD_LOADING_AND_LOCK();
|
||||||
|
_entryData->_actionSelectionType =
|
||||||
|
static_cast<MacroActionMacro::SelectionType>(
|
||||||
|
_actionSelectionType->itemData(idx).toInt());
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -363,6 +551,25 @@ void MacroActionMacroEdit::ActionIndexChanged(const IntVariable &value)
|
|||||||
_entryData->_actionIndex = value;
|
_entryData->_actionIndex = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroActionMacroEdit::LabelChanged()
|
||||||
|
{
|
||||||
|
GUARD_LOADING_AND_LOCK();
|
||||||
|
_entryData->_label = _label->text().toStdString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionMacroEdit::ActionTypeChanged(int idx)
|
||||||
|
{
|
||||||
|
GUARD_LOADING_AND_LOCK();
|
||||||
|
_entryData->_actionId =
|
||||||
|
_actionTypes->itemData(idx).toString().toStdString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionMacroEdit::RegexChanged(const RegexConfig ®ex)
|
||||||
|
{
|
||||||
|
GUARD_LOADING_AND_LOCK();
|
||||||
|
_entryData->_regex = regex;
|
||||||
|
}
|
||||||
|
|
||||||
void MacroActionMacroEdit::ConditionMacroChanged(const QString &text)
|
void MacroActionMacroEdit::ConditionMacroChanged(const QString &text)
|
||||||
{
|
{
|
||||||
GUARD_LOADING_AND_LOCK();
|
GUARD_LOADING_AND_LOCK();
|
||||||
@@ -384,10 +591,13 @@ void MacroActionMacroEdit::ReevaluateConditionStateChanged(int value)
|
|||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionMacroEdit::ActionTypeChanged(int value)
|
void MacroActionMacroEdit::ActionSectionChanged(int useElse)
|
||||||
{
|
{
|
||||||
GUARD_LOADING_AND_LOCK();
|
GUARD_LOADING_AND_LOCK();
|
||||||
_entryData->_runOptions.runElseActions = value;
|
_entryData->_runOptions.runElseActions = useElse;
|
||||||
|
_entryData->_useElseSection = useElse;
|
||||||
|
_actionIndex->SetType(useElse ? MacroSegmentSelection::Type::ELSE_ACTION
|
||||||
|
: MacroSegmentSelection::Type::ACTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionMacroEdit::SkipWhenPausedChanged(int value)
|
void MacroActionMacroEdit::SkipWhenPausedChanged(int value)
|
||||||
@@ -416,7 +626,11 @@ void MacroActionMacroEdit::SetWidgetVisibility()
|
|||||||
_entryLayout->removeWidget(_actions);
|
_entryLayout->removeWidget(_actions);
|
||||||
_entryLayout->removeWidget(_actionIndex);
|
_entryLayout->removeWidget(_actionIndex);
|
||||||
_entryLayout->removeWidget(_macros);
|
_entryLayout->removeWidget(_macros);
|
||||||
|
_entryLayout->removeWidget(_actionSections);
|
||||||
|
_entryLayout->removeWidget(_label);
|
||||||
|
_entryLayout->removeWidget(_regex);
|
||||||
_entryLayout->removeWidget(_actionTypes);
|
_entryLayout->removeWidget(_actionTypes);
|
||||||
|
_entryLayout->removeWidget(_actionSelectionType);
|
||||||
_conditionLayout->removeWidget(_conditionBehaviors);
|
_conditionLayout->removeWidget(_conditionBehaviors);
|
||||||
_conditionLayout->removeWidget(_conditionMacros);
|
_conditionLayout->removeWidget(_conditionMacros);
|
||||||
|
|
||||||
@@ -427,18 +641,40 @@ void MacroActionMacroEdit::SetWidgetVisibility()
|
|||||||
{"{{actions}}", _actions},
|
{"{{actions}}", _actions},
|
||||||
{"{{actionIndex}}", _actionIndex},
|
{"{{actionIndex}}", _actionIndex},
|
||||||
{"{{macros}}", _macros},
|
{"{{macros}}", _macros},
|
||||||
{"{{actionTypes}}", _actionTypes},
|
{"{{actionSections}}", _actionSections},
|
||||||
{"{{conditionBehaviors}}", _conditionBehaviors},
|
{"{{conditionBehaviors}}", _conditionBehaviors},
|
||||||
{"{{conditionMacros}}", _conditionMacros},
|
{"{{conditionMacros}}", _conditionMacros},
|
||||||
|
{"{{actionSelectionType}}", _actionSelectionType},
|
||||||
|
{"{{label}}", _label},
|
||||||
|
{"{{regex}}", _regex},
|
||||||
|
{"{{actionTypes}}", _actionTypes},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
PlaceWidgets(
|
const auto action = _entryData->_action;
|
||||||
obs_module_text(
|
const char *layoutText = "";
|
||||||
_entryData->_action == MacroActionMacro::Action::RUN
|
switch (action) {
|
||||||
? "AdvSceneSwitcher.action.macro.entry.run"
|
case MacroActionMacro::Action::PAUSE:
|
||||||
: "AdvSceneSwitcher.action.macro.entry.other"),
|
case MacroActionMacro::Action::UNPAUSE:
|
||||||
_entryLayout, placeholders);
|
case MacroActionMacro::Action::TOGGLE_PAUSE:
|
||||||
|
case MacroActionMacro::Action::RESET_COUNTER:
|
||||||
|
case MacroActionMacro::Action::STOP:
|
||||||
|
case MacroActionMacro::Action::NESTED_MACRO:
|
||||||
|
layoutText = "AdvSceneSwitcher.action.macro.layout.other";
|
||||||
|
break;
|
||||||
|
case MacroActionMacro::Action::RUN_ACTIONS:
|
||||||
|
layoutText = "AdvSceneSwitcher.action.macro.layout.run";
|
||||||
|
break;
|
||||||
|
case MacroActionMacro::Action::DISABLE_ACTION:
|
||||||
|
case MacroActionMacro::Action::ENABLE_ACTION:
|
||||||
|
case MacroActionMacro::Action::TOGGLE_ACTION:
|
||||||
|
layoutText = "AdvSceneSwitcher.action.macro.layout.actionState";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
PlaceWidgets(obs_module_text(layoutText), _entryLayout, placeholders);
|
||||||
|
|
||||||
if (_entryData->_runOptions.logic ==
|
if (_entryData->_runOptions.logic ==
|
||||||
MacroActionMacro::RunOptions::Logic::IGNORE_CONDITIONS) {
|
MacroActionMacro::RunOptions::Logic::IGNORE_CONDITIONS) {
|
||||||
@@ -447,47 +683,70 @@ void MacroActionMacroEdit::SetWidgetVisibility()
|
|||||||
} else {
|
} else {
|
||||||
PlaceWidgets(
|
PlaceWidgets(
|
||||||
obs_module_text(
|
obs_module_text(
|
||||||
"AdvSceneSwitcher.action.macro.entry.run.condition"),
|
"AdvSceneSwitcher.action.macro.layout.run.condition"),
|
||||||
_conditionLayout, placeholders);
|
_conditionLayout, placeholders);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_entryData->_action == MacroActionMacro::Action::RUN ||
|
if (action == MacroActionMacro::Action::RUN_ACTIONS ||
|
||||||
_entryData->_action == MacroActionMacro::Action::STOP) {
|
action == MacroActionMacro::Action::STOP) {
|
||||||
_macros->HideSelectedMacro();
|
_macros->HideSelectedMacro();
|
||||||
} else {
|
} else {
|
||||||
_macros->ShowAllMacros();
|
_macros->ShowAllMacros();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto actionSelectionType = _entryData->_actionSelectionType;
|
||||||
const bool isModifyingActionState =
|
const bool isModifyingActionState =
|
||||||
_entryData->_action ==
|
action == MacroActionMacro::Action::DISABLE_ACTION ||
|
||||||
MacroActionMacro::Action::DISABLE_ACTION ||
|
action == MacroActionMacro::Action::ENABLE_ACTION ||
|
||||||
_entryData->_action ==
|
action == MacroActionMacro::Action::TOGGLE_ACTION;
|
||||||
MacroActionMacro::Action::ENABLE_ACTION ||
|
_actionSelectionType->setVisible(isModifyingActionState);
|
||||||
_entryData->_action == MacroActionMacro::Action::TOGGLE_ACTION;
|
_actionIndex->setVisible(
|
||||||
_actionIndex->setVisible(isModifyingActionState);
|
isModifyingActionState &&
|
||||||
|
actionSelectionType == MacroActionMacro::SelectionType::INDEX);
|
||||||
|
_label->setVisible(isModifyingActionState &&
|
||||||
|
actionSelectionType ==
|
||||||
|
MacroActionMacro::SelectionType::LABEL);
|
||||||
|
_regex->setVisible(isModifyingActionState &&
|
||||||
|
actionSelectionType ==
|
||||||
|
MacroActionMacro::SelectionType::LABEL);
|
||||||
|
_actionTypes->setVisible(isModifyingActionState &&
|
||||||
|
actionSelectionType ==
|
||||||
|
MacroActionMacro::SelectionType::ID);
|
||||||
|
|
||||||
SetLayoutVisible(_conditionLayout,
|
SetLayoutVisible(_conditionLayout,
|
||||||
_entryData->_action == MacroActionMacro::Action::RUN);
|
action == MacroActionMacro::Action::RUN_ACTIONS);
|
||||||
const bool needsAdditionalConditionWidgets =
|
const bool needsAdditionalConditionWidgets =
|
||||||
_entryData->_action == MacroActionMacro::Action::RUN &&
|
action == MacroActionMacro::Action::RUN_ACTIONS &&
|
||||||
_entryData->_runOptions.logic !=
|
_entryData->_runOptions.logic !=
|
||||||
MacroActionMacro::RunOptions::Logic::IGNORE_CONDITIONS;
|
MacroActionMacro::RunOptions::Logic::IGNORE_CONDITIONS;
|
||||||
_conditionMacros->setVisible(needsAdditionalConditionWidgets);
|
_conditionMacros->setVisible(needsAdditionalConditionWidgets);
|
||||||
SetLayoutVisible(_reevaluateConditionStateLayout,
|
SetLayoutVisible(_reevaluateConditionStateLayout,
|
||||||
needsAdditionalConditionWidgets);
|
needsAdditionalConditionWidgets);
|
||||||
SetLayoutVisible(_setInputsLayout,
|
SetLayoutVisible(_setInputsLayout,
|
||||||
_entryData->_action == MacroActionMacro::Action::RUN);
|
action == MacroActionMacro::Action::RUN_ACTIONS);
|
||||||
_inputs->setVisible(_entryData->_action ==
|
_inputs->setVisible(action == MacroActionMacro::Action::RUN_ACTIONS &&
|
||||||
MacroActionMacro::Action::RUN &&
|
|
||||||
_entryData->_runOptions.setInputs);
|
_entryData->_runOptions.setInputs);
|
||||||
HighlightMacroSettingsButton(_entryData->_action ==
|
HighlightMacroSettingsButton(
|
||||||
MacroActionMacro::Action::RUN &&
|
action == MacroActionMacro::Action::RUN_ACTIONS &&
|
||||||
_entryData->_runOptions.setInputs &&
|
_entryData->_runOptions.setInputs &&
|
||||||
!_inputs->HasInputsToSet());
|
!_inputs->HasInputsToSet());
|
||||||
_actionTypes->setVisible(_entryData->_action ==
|
_actionSections->setVisible(
|
||||||
MacroActionMacro::Action::RUN);
|
action == MacroActionMacro::Action::RUN_ACTIONS ||
|
||||||
_skipWhenPaused->setVisible(_entryData->_action ==
|
isModifyingActionState);
|
||||||
MacroActionMacro::Action::RUN);
|
_skipWhenPaused->setVisible(action ==
|
||||||
|
MacroActionMacro::Action::RUN_ACTIONS);
|
||||||
|
|
||||||
|
_nestedMacro->setVisible(action ==
|
||||||
|
MacroActionMacro::Action::NESTED_MACRO);
|
||||||
|
_macros->setVisible(action != MacroActionMacro::Action::NESTED_MACRO);
|
||||||
|
SetResizingEnabled(action == MacroActionMacro::Action::NESTED_MACRO);
|
||||||
|
|
||||||
|
if (_nestedMacro->IsEmpty()) {
|
||||||
|
_nestedMacro->ShowAllMacroSections();
|
||||||
|
// TODO: find a better solution than setting a fixed height
|
||||||
|
_entryData->_customWidgetHeight = 600;
|
||||||
|
}
|
||||||
|
SetCustomHeight(_entryData->_customWidgetHeight);
|
||||||
|
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "macro-action-edit.hpp"
|
#include "macro-action-edit.hpp"
|
||||||
|
#include "macro.hpp"
|
||||||
|
#include "macro-edit.hpp"
|
||||||
#include "macro-input.hpp"
|
#include "macro-input.hpp"
|
||||||
#include "macro-selection.hpp"
|
#include "macro-selection.hpp"
|
||||||
#include "macro-segment-selection.hpp"
|
#include "macro-segment-selection.hpp"
|
||||||
|
#include "regex-config.hpp"
|
||||||
|
#include "resizable-widget.hpp"
|
||||||
|
#include "variable-line-edit.hpp"
|
||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
@@ -44,24 +49,37 @@ public:
|
|||||||
PAUSE,
|
PAUSE,
|
||||||
UNPAUSE,
|
UNPAUSE,
|
||||||
RESET_COUNTER,
|
RESET_COUNTER,
|
||||||
RUN,
|
RUN_ACTIONS,
|
||||||
STOP,
|
STOP,
|
||||||
DISABLE_ACTION,
|
DISABLE_ACTION,
|
||||||
ENABLE_ACTION,
|
ENABLE_ACTION,
|
||||||
TOGGLE_ACTION,
|
TOGGLE_ACTION,
|
||||||
|
TOGGLE_PAUSE,
|
||||||
|
NESTED_MACRO,
|
||||||
};
|
};
|
||||||
Action _action = Action::RUN;
|
|
||||||
|
enum class SelectionType { INDEX, LABEL, ID };
|
||||||
|
|
||||||
|
Action _action = Action::NESTED_MACRO;
|
||||||
|
SelectionType _actionSelectionType = SelectionType::INDEX;
|
||||||
|
bool _useElseSection = false;
|
||||||
IntVariable _actionIndex = 1;
|
IntVariable _actionIndex = 1;
|
||||||
|
StringVariable _label = "Custom label";
|
||||||
|
std::string _actionId;
|
||||||
|
RegexConfig _regex;
|
||||||
RunOptions _runOptions = {};
|
RunOptions _runOptions = {};
|
||||||
|
std::shared_ptr<Macro> _nestedMacro = std::make_shared<Macro>();
|
||||||
|
int _customWidgetHeight = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void RunActions(Macro *actionMacro) const;
|
void RunActions(Macro *actionMacro) const;
|
||||||
|
void AdjustActionState(Macro *) const;
|
||||||
|
|
||||||
static bool _registered;
|
static bool _registered;
|
||||||
static const std::string id;
|
static const std::string id;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MacroActionMacroEdit final : public QWidget {
|
class MacroActionMacroEdit final : public ResizableWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -70,22 +88,20 @@ public:
|
|||||||
std::shared_ptr<MacroActionMacro> entryData = nullptr);
|
std::shared_ptr<MacroActionMacro> entryData = nullptr);
|
||||||
~MacroActionMacroEdit();
|
~MacroActionMacroEdit();
|
||||||
void UpdateEntryData();
|
void UpdateEntryData();
|
||||||
static QWidget *Create(QWidget *parent,
|
static QWidget *Create(QWidget *, std::shared_ptr<MacroAction>);
|
||||||
std::shared_ptr<MacroAction> action)
|
|
||||||
{
|
|
||||||
return new MacroActionMacroEdit(
|
|
||||||
parent,
|
|
||||||
std::dynamic_pointer_cast<MacroActionMacro>(action));
|
|
||||||
}
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void MacroChanged(const QString &text);
|
void MacroChanged(const QString &text);
|
||||||
void ActionChanged(int value);
|
void ActionChanged(int value);
|
||||||
|
void ActionSelectionTypeChanged(int value);
|
||||||
void ActionIndexChanged(const IntVariable &value);
|
void ActionIndexChanged(const IntVariable &value);
|
||||||
|
void LabelChanged();
|
||||||
|
void ActionTypeChanged(int value);
|
||||||
|
void RegexChanged(const RegexConfig &);
|
||||||
void ConditionMacroChanged(const QString &text);
|
void ConditionMacroChanged(const QString &text);
|
||||||
void ConditionBehaviorChanged(int value);
|
void ConditionBehaviorChanged(int value);
|
||||||
void ReevaluateConditionStateChanged(int value);
|
void ReevaluateConditionStateChanged(int value);
|
||||||
void ActionTypeChanged(int value);
|
void ActionSectionChanged(int value);
|
||||||
void SkipWhenPausedChanged(int value);
|
void SkipWhenPausedChanged(int value);
|
||||||
void SetInputsChanged(int value);
|
void SetInputsChanged(int value);
|
||||||
void InputsChanged(const StringList &);
|
void InputsChanged(const StringList &);
|
||||||
@@ -97,13 +113,17 @@ private:
|
|||||||
void SetWidgetVisibility();
|
void SetWidgetVisibility();
|
||||||
void SetupMacroInput(Macro *) const;
|
void SetupMacroInput(Macro *) const;
|
||||||
|
|
||||||
MacroSelection *_macros;
|
|
||||||
MacroSegmentSelection *_actionIndex;
|
|
||||||
QComboBox *_actions;
|
QComboBox *_actions;
|
||||||
|
MacroSelection *_macros;
|
||||||
|
QComboBox *_actionSelectionType;
|
||||||
|
MacroSegmentSelection *_actionIndex;
|
||||||
|
VariableLineEdit *_label;
|
||||||
|
FilterComboBox *_actionTypes;
|
||||||
|
RegexConfigWidget *_regex;
|
||||||
MacroSelection *_conditionMacros;
|
MacroSelection *_conditionMacros;
|
||||||
QComboBox *_conditionBehaviors;
|
QComboBox *_conditionBehaviors;
|
||||||
QCheckBox *_reevaluateConditionState;
|
QCheckBox *_reevaluateConditionState;
|
||||||
QComboBox *_actionTypes;
|
QComboBox *_actionSections;
|
||||||
QCheckBox *_skipWhenPaused;
|
QCheckBox *_skipWhenPaused;
|
||||||
QCheckBox *_setInputs;
|
QCheckBox *_setInputs;
|
||||||
MacroInputEdit *_inputs;
|
MacroInputEdit *_inputs;
|
||||||
@@ -111,6 +131,7 @@ private:
|
|||||||
QHBoxLayout *_conditionLayout;
|
QHBoxLayout *_conditionLayout;
|
||||||
QHBoxLayout *_reevaluateConditionStateLayout;
|
QHBoxLayout *_reevaluateConditionStateLayout;
|
||||||
QHBoxLayout *_setInputsLayout;
|
QHBoxLayout *_setInputsLayout;
|
||||||
|
MacroEdit *_nestedMacro;
|
||||||
|
|
||||||
std::shared_ptr<MacroActionMacro> _entryData;
|
std::shared_ptr<MacroActionMacro> _entryData;
|
||||||
bool _loading = true;
|
bool _loading = true;
|
||||||
|
|||||||
@@ -170,11 +170,7 @@ void MacroActionQueueEdit::UpdateEntryData()
|
|||||||
|
|
||||||
void MacroActionQueueEdit::MacroChanged(const QString &text)
|
void MacroActionQueueEdit::MacroChanged(const QString &text)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_macro = text;
|
_entryData->_macro = text;
|
||||||
emit HeaderInfoChanged(
|
emit HeaderInfoChanged(
|
||||||
QString::fromStdString(_entryData->GetShortDesc()));
|
QString::fromStdString(_entryData->GetShortDesc()));
|
||||||
@@ -182,11 +178,7 @@ void MacroActionQueueEdit::MacroChanged(const QString &text)
|
|||||||
|
|
||||||
void MacroActionQueueEdit::QueueChanged(const QString &text)
|
void MacroActionQueueEdit::QueueChanged(const QString &text)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_queue = GetWeakActionQueueByQString(text);
|
_entryData->_queue = GetWeakActionQueueByQString(text);
|
||||||
emit HeaderInfoChanged(
|
emit HeaderInfoChanged(
|
||||||
QString::fromStdString(_entryData->GetShortDesc()));
|
QString::fromStdString(_entryData->GetShortDesc()));
|
||||||
@@ -194,11 +186,7 @@ void MacroActionQueueEdit::QueueChanged(const QString &text)
|
|||||||
|
|
||||||
void MacroActionQueueEdit::ActionChanged(int value)
|
void MacroActionQueueEdit::ActionChanged(int value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_action = static_cast<MacroActionQueue::Action>(value);
|
_entryData->_action = static_cast<MacroActionQueue::Action>(value);
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
emit HeaderInfoChanged(
|
emit HeaderInfoChanged(
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
#include "macro-action-variable.hpp"
|
#include "macro-action-variable.hpp"
|
||||||
#include "advanced-scene-switcher.hpp"
|
#include "help-icon.hpp"
|
||||||
|
#include "json-helpers.hpp"
|
||||||
#include "layout-helpers.hpp"
|
#include "layout-helpers.hpp"
|
||||||
#include "math-helpers.hpp"
|
|
||||||
#include "macro-condition-edit.hpp"
|
#include "macro-condition-edit.hpp"
|
||||||
|
#include "macro-signals.hpp"
|
||||||
|
#include "math-helpers.hpp"
|
||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
#include "non-modal-dialog.hpp"
|
#include "non-modal-dialog.hpp"
|
||||||
#include "source-helpers.hpp"
|
#include "source-helpers.hpp"
|
||||||
|
#include "ui-helpers.hpp"
|
||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
@@ -283,6 +286,14 @@ bool MacroActionVariable::PerformAction()
|
|||||||
case Action::APPEND:
|
case Action::APPEND:
|
||||||
apppend(*var, _strValue);
|
apppend(*var, _strValue);
|
||||||
break;
|
break;
|
||||||
|
case Action::COPY_VAR: {
|
||||||
|
auto var2 = _variable2.lock();
|
||||||
|
if (!var2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var->SetValue(var2->Value());
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Action::APPEND_VAR: {
|
case Action::APPEND_VAR: {
|
||||||
auto var2 = _variable2.lock();
|
auto var2 = _variable2.lock();
|
||||||
if (!var2) {
|
if (!var2) {
|
||||||
@@ -385,6 +396,22 @@ bool MacroActionVariable::PerformAction()
|
|||||||
var->SetValue(*value);
|
var->SetValue(*value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
case Action::QUERY_JSON: {
|
||||||
|
auto value = QueryJson(var->Value(), _jsonQuery);
|
||||||
|
if (!value.has_value()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var->SetValue(*value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case Action::ARRAY_JSON: {
|
||||||
|
auto value = AccessJsonArrayIndex(var->Value(), _jsonIndex);
|
||||||
|
if (!value.has_value()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var->SetValue(*value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
case Action::SET_TO_TEMPVAR: {
|
case Action::SET_TO_TEMPVAR: {
|
||||||
auto tempVar = _tempVar.GetTempVariable(GetMacro());
|
auto tempVar = _tempVar.GetTempVariable(GetMacro());
|
||||||
if (!tempVar) {
|
if (!tempVar) {
|
||||||
@@ -462,7 +489,7 @@ bool MacroActionVariable::Save(obs_data_t *obj) const
|
|||||||
_inputPlaceholder.Save(obj, "inputPlaceholder");
|
_inputPlaceholder.Save(obj, "inputPlaceholder");
|
||||||
_envVariableName.Save(obj, "environmentVariableName");
|
_envVariableName.Save(obj, "environmentVariableName");
|
||||||
_scene.Save(obj);
|
_scene.Save(obj);
|
||||||
_tempVar.Save(obj);
|
_tempVar.Save(obj, GetMacro());
|
||||||
_sceneItemIndex.Save(obj, "sceneItemIndex");
|
_sceneItemIndex.Save(obj, "sceneItemIndex");
|
||||||
obs_data_set_int(obj, "direction", static_cast<int>(_direction));
|
obs_data_set_int(obj, "direction", static_cast<int>(_direction));
|
||||||
_stringLength.Save(obj, "stringLength");
|
_stringLength.Save(obj, "stringLength");
|
||||||
@@ -471,6 +498,8 @@ bool MacroActionVariable::Save(obs_data_t *obj) const
|
|||||||
_randomNumberStart.Save(obj, "randomNumberStart");
|
_randomNumberStart.Save(obj, "randomNumberStart");
|
||||||
_randomNumberEnd.Save(obj, "randomNumberEnd");
|
_randomNumberEnd.Save(obj, "randomNumberEnd");
|
||||||
obs_data_set_bool(obj, "generateInteger", _generateInteger);
|
obs_data_set_bool(obj, "generateInteger", _generateInteger);
|
||||||
|
_jsonQuery.Save(obj, "jsonQuery");
|
||||||
|
_jsonIndex.Save(obj, "jsonIndex");
|
||||||
|
|
||||||
obs_data_set_int(obj, "version", 1);
|
obs_data_set_int(obj, "version", 1);
|
||||||
|
|
||||||
@@ -527,6 +556,8 @@ bool MacroActionVariable::Load(obs_data_t *obj)
|
|||||||
_randomNumberStart.Load(obj, "randomNumberStart");
|
_randomNumberStart.Load(obj, "randomNumberStart");
|
||||||
_randomNumberEnd.Load(obj, "randomNumberEnd");
|
_randomNumberEnd.Load(obj, "randomNumberEnd");
|
||||||
_generateInteger = obs_data_get_bool(obj, "generateInteger");
|
_generateInteger = obs_data_get_bool(obj, "generateInteger");
|
||||||
|
_jsonQuery.Load(obj, "jsonQuery");
|
||||||
|
_jsonIndex.Load(obj, "jsonIndex");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -626,6 +657,8 @@ void MacroActionVariable::ResolveVariablesToFixedValues()
|
|||||||
_envVariableName.ResolveVariables();
|
_envVariableName.ResolveVariables();
|
||||||
_scene.ResolveVariables();
|
_scene.ResolveVariables();
|
||||||
_sceneItemIndex.ResolveVariables();
|
_sceneItemIndex.ResolveVariables();
|
||||||
|
_jsonQuery.ResolveVariables();
|
||||||
|
_jsonIndex.ResolveVariables();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariable::DecrementCurrentSegmentVariableRef()
|
void MacroActionVariable::DecrementCurrentSegmentVariableRef()
|
||||||
@@ -645,6 +678,8 @@ static inline void populateActionSelection(QComboBox *list)
|
|||||||
actions = {
|
actions = {
|
||||||
{MacroActionVariable::Action::SET_VALUE,
|
{MacroActionVariable::Action::SET_VALUE,
|
||||||
"AdvSceneSwitcher.action.variable.type.set"},
|
"AdvSceneSwitcher.action.variable.type.set"},
|
||||||
|
{MacroActionVariable::Action::COPY_VAR,
|
||||||
|
"AdvSceneSwitcher.action.variable.type.copy"},
|
||||||
{MacroActionVariable::Action::APPEND,
|
{MacroActionVariable::Action::APPEND,
|
||||||
"AdvSceneSwitcher.action.variable.type.append"},
|
"AdvSceneSwitcher.action.variable.type.append"},
|
||||||
{MacroActionVariable::Action::PAD,
|
{MacroActionVariable::Action::PAD,
|
||||||
@@ -655,8 +690,6 @@ static inline void populateActionSelection(QComboBox *list)
|
|||||||
"AdvSceneSwitcher.action.variable.type.subString"},
|
"AdvSceneSwitcher.action.variable.type.subString"},
|
||||||
{MacroActionVariable::Action::FIND_AND_REPLACE,
|
{MacroActionVariable::Action::FIND_AND_REPLACE,
|
||||||
"AdvSceneSwitcher.action.variable.type.findAndReplace"},
|
"AdvSceneSwitcher.action.variable.type.findAndReplace"},
|
||||||
{MacroActionVariable::Action::EXTRACT_JSON,
|
|
||||||
"AdvSceneSwitcher.action.variable.type.extractJson"},
|
|
||||||
{MacroActionVariable::Action::STRING_LENGTH,
|
{MacroActionVariable::Action::STRING_LENGTH,
|
||||||
"AdvSceneSwitcher.action.variable.type.stringLength"},
|
"AdvSceneSwitcher.action.variable.type.stringLength"},
|
||||||
{MacroActionVariable::Action::TRIM,
|
{MacroActionVariable::Action::TRIM,
|
||||||
@@ -665,6 +698,14 @@ static inline void populateActionSelection(QComboBox *list)
|
|||||||
"AdvSceneSwitcher.action.variable.type.changeCase"},
|
"AdvSceneSwitcher.action.variable.type.changeCase"},
|
||||||
{true, ""}, // Separator
|
{true, ""}, // Separator
|
||||||
|
|
||||||
|
{MacroActionVariable::Action::EXTRACT_JSON,
|
||||||
|
"AdvSceneSwitcher.action.variable.type.extractJsonField"},
|
||||||
|
{MacroActionVariable::Action::QUERY_JSON,
|
||||||
|
"AdvSceneSwitcher.action.variable.type.queryJson"},
|
||||||
|
{MacroActionVariable::Action::ARRAY_JSON,
|
||||||
|
"AdvSceneSwitcher.action.variable.type.accessJsonArray"},
|
||||||
|
{true, ""}, // Separator
|
||||||
|
|
||||||
{MacroActionVariable::Action::SET_TO_TEMPVAR,
|
{MacroActionVariable::Action::SET_TO_TEMPVAR,
|
||||||
"AdvSceneSwitcher.action.variable.type.setToTempvar"},
|
"AdvSceneSwitcher.action.variable.type.setToTempvar"},
|
||||||
{MacroActionVariable::Action::SET_CONDITION_VALUE,
|
{MacroActionVariable::Action::SET_CONDITION_VALUE,
|
||||||
@@ -797,6 +838,12 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||||||
"AdvSceneSwitcher.action.variable.generateInteger"),
|
"AdvSceneSwitcher.action.variable.generateInteger"),
|
||||||
this)),
|
this)),
|
||||||
_randomLayout(new QVBoxLayout()),
|
_randomLayout(new QVBoxLayout()),
|
||||||
|
_jsonQuery(new VariableLineEdit(this)),
|
||||||
|
_jsonQueryHelp(new HelpIcon(
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.variable.type.queryJson.info"),
|
||||||
|
this)),
|
||||||
|
_jsonIndex(new VariableSpinBox(this)),
|
||||||
_entryLayout(new QHBoxLayout())
|
_entryLayout(new QHBoxLayout())
|
||||||
{
|
{
|
||||||
_numValue->setMinimum(-9999999999);
|
_numValue->setMinimum(-9999999999);
|
||||||
@@ -826,6 +873,7 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||||||
_randomNumberStart->setMaximum(9999999999);
|
_randomNumberStart->setMaximum(9999999999);
|
||||||
_randomNumberEnd->setMinimum(-9999999999);
|
_randomNumberEnd->setMinimum(-9999999999);
|
||||||
_randomNumberEnd->setMaximum(9999999999);
|
_randomNumberEnd->setMaximum(9999999999);
|
||||||
|
_jsonIndex->setMaximum(999);
|
||||||
|
|
||||||
QWidget::connect(_variables, SIGNAL(SelectionChanged(const QString &)),
|
QWidget::connect(_variables, SIGNAL(SelectionChanged(const QString &)),
|
||||||
this, SLOT(VariableChanged(const QString &)));
|
this, SLOT(VariableChanged(const QString &)));
|
||||||
@@ -842,7 +890,8 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||||||
QWidget::connect(_segmentIdx,
|
QWidget::connect(_segmentIdx,
|
||||||
SIGNAL(SelectionChanged(const IntVariable &)), this,
|
SIGNAL(SelectionChanged(const IntVariable &)), this,
|
||||||
SLOT(SegmentIndexChanged(const IntVariable &)));
|
SLOT(SegmentIndexChanged(const IntVariable &)));
|
||||||
QWidget::connect(window(), SIGNAL(MacroSegmentOrderChanged()), this,
|
QWidget::connect(MacroSignalManager::Instance(),
|
||||||
|
SIGNAL(SegmentOrderChanged()), this,
|
||||||
SLOT(MacroSegmentOrderChanged()));
|
SLOT(MacroSegmentOrderChanged()));
|
||||||
QWidget::connect(
|
QWidget::connect(
|
||||||
_subStringStart,
|
_subStringStart,
|
||||||
@@ -912,6 +961,12 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||||||
SLOT(RandomNumberEndChanged(const NumberVariable<double> &)));
|
SLOT(RandomNumberEndChanged(const NumberVariable<double> &)));
|
||||||
QWidget::connect(_generateInteger, SIGNAL(stateChanged(int)), this,
|
QWidget::connect(_generateInteger, SIGNAL(stateChanged(int)), this,
|
||||||
SLOT(GenerateIntegerChanged(int)));
|
SLOT(GenerateIntegerChanged(int)));
|
||||||
|
QWidget::connect(_jsonQuery, SIGNAL(editingFinished()), this,
|
||||||
|
SLOT(JsonQueryChanged()));
|
||||||
|
QWidget::connect(
|
||||||
|
_jsonIndex,
|
||||||
|
SIGNAL(NumberVariableChanged(const NumberVariable<int> &)),
|
||||||
|
this, SLOT(JsonIndexChanged(const NumberVariable<int> &)));
|
||||||
|
|
||||||
const std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
const std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||||
{"{{variables}}", _variables},
|
{"{{variables}}", _variables},
|
||||||
@@ -943,39 +998,42 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||||||
{"{{randomNumberStart}}", _randomNumberStart},
|
{"{{randomNumberStart}}", _randomNumberStart},
|
||||||
{"{{randomNumberEnd}}", _randomNumberEnd},
|
{"{{randomNumberEnd}}", _randomNumberEnd},
|
||||||
{"{{generateInteger}}", _generateInteger},
|
{"{{generateInteger}}", _generateInteger},
|
||||||
|
{"{{jsonQuery}}", _jsonQuery},
|
||||||
|
{"{{jsonQueryHelp}}", _jsonQueryHelp},
|
||||||
|
{"{{jsonIndex}}", _jsonIndex},
|
||||||
};
|
};
|
||||||
PlaceWidgets(
|
PlaceWidgets(obs_module_text(
|
||||||
obs_module_text("AdvSceneSwitcher.action.variable.entry.other"),
|
"AdvSceneSwitcher.action.variable.layout.other"),
|
||||||
_entryLayout, widgetPlaceholders);
|
_entryLayout, widgetPlaceholders);
|
||||||
|
|
||||||
PlaceWidgets(
|
PlaceWidgets(
|
||||||
obs_module_text(
|
obs_module_text(
|
||||||
"AdvSceneSwitcher.action.variable.entry.substringIndex"),
|
"AdvSceneSwitcher.action.variable.layout.substringIndex"),
|
||||||
_subStringIndexEntryLayout, widgetPlaceholders);
|
_subStringIndexEntryLayout, widgetPlaceholders);
|
||||||
|
|
||||||
PlaceWidgets(
|
PlaceWidgets(
|
||||||
obs_module_text(
|
obs_module_text(
|
||||||
"AdvSceneSwitcher.action.variable.entry.substringRegex"),
|
"AdvSceneSwitcher.action.variable.layout.substringRegex"),
|
||||||
_subStringRegexEntryLayout, widgetPlaceholders);
|
_subStringRegexEntryLayout, widgetPlaceholders);
|
||||||
|
|
||||||
PlaceWidgets(
|
PlaceWidgets(
|
||||||
obs_module_text(
|
obs_module_text(
|
||||||
"AdvSceneSwitcher.action.variable.entry.findAndReplace"),
|
"AdvSceneSwitcher.action.variable.layout.findAndReplace"),
|
||||||
_findReplaceLayout, widgetPlaceholders, false);
|
_findReplaceLayout, widgetPlaceholders, false);
|
||||||
|
|
||||||
PlaceWidgets(
|
PlaceWidgets(
|
||||||
obs_module_text(
|
obs_module_text(
|
||||||
"AdvSceneSwitcher.action.variable.entry.userInput.customPrompt"),
|
"AdvSceneSwitcher.action.variable.layout.userInput.customPrompt"),
|
||||||
_promptLayout, widgetPlaceholders);
|
_promptLayout, widgetPlaceholders);
|
||||||
PlaceWidgets(
|
PlaceWidgets(
|
||||||
obs_module_text(
|
obs_module_text(
|
||||||
"AdvSceneSwitcher.action.variable.entry.userInput.placeholder"),
|
"AdvSceneSwitcher.action.variable.layout.userInput.placeholder"),
|
||||||
_placeholderLayout, widgetPlaceholders);
|
_placeholderLayout, widgetPlaceholders);
|
||||||
|
|
||||||
auto randomLayout = new QHBoxLayout();
|
auto randomLayout = new QHBoxLayout();
|
||||||
PlaceWidgets(
|
PlaceWidgets(
|
||||||
obs_module_text(
|
obs_module_text(
|
||||||
"AdvSceneSwitcher.action.variable.entry.randomNumber"),
|
"AdvSceneSwitcher.action.variable.layout.randomNumber"),
|
||||||
randomLayout, widgetPlaceholders);
|
randomLayout, widgetPlaceholders);
|
||||||
_randomLayout->addLayout(randomLayout);
|
_randomLayout->addLayout(randomLayout);
|
||||||
_randomLayout->addWidget(_generateInteger);
|
_randomLayout->addWidget(_generateInteger);
|
||||||
@@ -1057,17 +1115,15 @@ void MacroActionVariableEdit::UpdateEntryData()
|
|||||||
_randomNumberStart->SetValue(_entryData->_randomNumberStart);
|
_randomNumberStart->SetValue(_entryData->_randomNumberStart);
|
||||||
_randomNumberEnd->SetValue(_entryData->_randomNumberEnd);
|
_randomNumberEnd->SetValue(_entryData->_randomNumberEnd);
|
||||||
_generateInteger->setChecked(_entryData->_generateInteger);
|
_generateInteger->setChecked(_entryData->_generateInteger);
|
||||||
|
_jsonQuery->setText(_entryData->_jsonQuery);
|
||||||
|
_jsonIndex->SetValue(_entryData->_jsonIndex);
|
||||||
|
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::VariableChanged(const QString &text)
|
void MacroActionVariableEdit::VariableChanged(const QString &text)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_variable = GetWeakVariableByQString(text);
|
_entryData->_variable = GetWeakVariableByQString(text);
|
||||||
emit HeaderInfoChanged(
|
emit HeaderInfoChanged(
|
||||||
QString::fromStdString(_entryData->GetShortDesc()));
|
QString::fromStdString(_entryData->GetShortDesc()));
|
||||||
@@ -1075,11 +1131,7 @@ void MacroActionVariableEdit::VariableChanged(const QString &text)
|
|||||||
|
|
||||||
void MacroActionVariableEdit::Variable2Changed(const QString &text)
|
void MacroActionVariableEdit::Variable2Changed(const QString &text)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_variable2 = GetWeakVariableByQString(text);
|
_entryData->_variable2 = GetWeakVariableByQString(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1105,11 +1157,7 @@ void MacroActionVariableEdit::ActionChanged(int idx)
|
|||||||
|
|
||||||
void MacroActionVariableEdit::StrValueChanged()
|
void MacroActionVariableEdit::StrValueChanged()
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_strValue = _strValue->toPlainText().toStdString();
|
_entryData->_strValue = _strValue->toPlainText().toStdString();
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@@ -1118,21 +1166,13 @@ void MacroActionVariableEdit::StrValueChanged()
|
|||||||
void MacroActionVariableEdit::NumValueChanged(
|
void MacroActionVariableEdit::NumValueChanged(
|
||||||
const NumberVariable<double> &value)
|
const NumberVariable<double> &value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_numValue = value;
|
_entryData->_numValue = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::SegmentIndexChanged(const IntVariable &val)
|
void MacroActionVariableEdit::SegmentIndexChanged(const IntVariable &val)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->SetSegmentIndexValue(val - 1);
|
_entryData->SetSegmentIndexValue(val - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1238,32 +1278,20 @@ void MacroActionVariableEdit::MacroSegmentOrderChanged()
|
|||||||
void MacroActionVariableEdit::SubStringStartChanged(
|
void MacroActionVariableEdit::SubStringStartChanged(
|
||||||
const NumberVariable<int> &start)
|
const NumberVariable<int> &start)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_subStringStart = start;
|
_entryData->_subStringStart = start;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::SubStringSizeChanged(
|
void MacroActionVariableEdit::SubStringSizeChanged(
|
||||||
const NumberVariable<int> &size)
|
const NumberVariable<int> &size)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_subStringSize = size;
|
_entryData->_subStringSize = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::SubStringRegexChanged(const RegexConfig &conf)
|
void MacroActionVariableEdit::SubStringRegexChanged(const RegexConfig &conf)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_subStringRegex = conf;
|
_entryData->_subStringRegex = conf;
|
||||||
|
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
@@ -1271,11 +1299,7 @@ void MacroActionVariableEdit::SubStringRegexChanged(const RegexConfig &conf)
|
|||||||
|
|
||||||
void MacroActionVariableEdit::RegexPatternChanged()
|
void MacroActionVariableEdit::RegexPatternChanged()
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_regexPattern = _regexPattern->toPlainText().toStdString();
|
_entryData->_regexPattern = _regexPattern->toPlainText().toStdString();
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@@ -1284,21 +1308,13 @@ void MacroActionVariableEdit::RegexPatternChanged()
|
|||||||
void MacroActionVariableEdit::RegexMatchIdxChanged(
|
void MacroActionVariableEdit::RegexMatchIdxChanged(
|
||||||
const NumberVariable<int> &index)
|
const NumberVariable<int> &index)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_regexMatchIdx = index;
|
_entryData->_regexMatchIdx = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::FindStrValueChanged()
|
void MacroActionVariableEdit::FindStrValueChanged()
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_findStr = _findStr->toPlainText().toStdString();
|
_entryData->_findStr = _findStr->toPlainText().toStdString();
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@@ -1306,11 +1322,7 @@ void MacroActionVariableEdit::FindStrValueChanged()
|
|||||||
|
|
||||||
void MacroActionVariableEdit::FindRegexChanged(const RegexConfig &conf)
|
void MacroActionVariableEdit::FindRegexChanged(const RegexConfig &conf)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_findRegex = conf;
|
_entryData->_findRegex = conf;
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@@ -1318,11 +1330,7 @@ void MacroActionVariableEdit::FindRegexChanged(const RegexConfig &conf)
|
|||||||
|
|
||||||
void MacroActionVariableEdit::ReplaceStrValueChanged()
|
void MacroActionVariableEdit::ReplaceStrValueChanged()
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_replaceStr = _replaceStr->toPlainText().toStdString();
|
_entryData->_replaceStr = _replaceStr->toPlainText().toStdString();
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@@ -1330,11 +1338,7 @@ void MacroActionVariableEdit::ReplaceStrValueChanged()
|
|||||||
|
|
||||||
void MacroActionVariableEdit::MathExpressionChanged()
|
void MacroActionVariableEdit::MathExpressionChanged()
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_mathExpression = _mathExpression->text().toStdString();
|
_entryData->_mathExpression = _mathExpression->text().toStdString();
|
||||||
|
|
||||||
// In case of invalid expression display an error
|
// In case of invalid expression display an error
|
||||||
@@ -1352,73 +1356,45 @@ void MacroActionVariableEdit::MathExpressionChanged()
|
|||||||
|
|
||||||
void MacroActionVariableEdit::UseCustomPromptChanged(int value)
|
void MacroActionVariableEdit::UseCustomPromptChanged(int value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_useCustomPrompt = value;
|
_entryData->_useCustomPrompt = value;
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::InputPromptChanged()
|
void MacroActionVariableEdit::InputPromptChanged()
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_inputPrompt = _inputPrompt->text().toStdString();
|
_entryData->_inputPrompt = _inputPrompt->text().toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::UseInputPlaceholderChanged(int value)
|
void MacroActionVariableEdit::UseInputPlaceholderChanged(int value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_useInputPlaceholder = value;
|
_entryData->_useInputPlaceholder = value;
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::InputPlaceholderChanged()
|
void MacroActionVariableEdit::InputPlaceholderChanged()
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_inputPlaceholder = _inputPlaceholder->text().toStdString();
|
_entryData->_inputPlaceholder = _inputPlaceholder->text().toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::EnvVariableChanged()
|
void MacroActionVariableEdit::EnvVariableChanged()
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_envVariableName = _envVariable->text().toStdString();
|
_entryData->_envVariableName = _envVariable->text().toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::SceneChanged(const SceneSelection &scene)
|
void MacroActionVariableEdit::SceneChanged(const SceneSelection &scene)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_scene = scene;
|
_entryData->_scene = scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::SelectionChanged(const TempVariableRef &var)
|
void MacroActionVariableEdit::SelectionChanged(const TempVariableRef &var)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_tempVar = var;
|
_entryData->_tempVar = var;
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
@@ -1426,21 +1402,13 @@ void MacroActionVariableEdit::SelectionChanged(const TempVariableRef &var)
|
|||||||
void MacroActionVariableEdit::SceneItemIndexChanged(
|
void MacroActionVariableEdit::SceneItemIndexChanged(
|
||||||
const NumberVariable<int> &value)
|
const NumberVariable<int> &value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_sceneItemIndex = value;
|
_entryData->_sceneItemIndex = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::DirectionChanged(int value)
|
void MacroActionVariableEdit::DirectionChanged(int value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_direction =
|
_entryData->_direction =
|
||||||
static_cast<MacroActionVariable::Direction>(value);
|
static_cast<MacroActionVariable::Direction>(value);
|
||||||
}
|
}
|
||||||
@@ -1448,21 +1416,13 @@ void MacroActionVariableEdit::DirectionChanged(int value)
|
|||||||
void MacroActionVariableEdit::StringLengthChanged(
|
void MacroActionVariableEdit::StringLengthChanged(
|
||||||
const NumberVariable<int> &value)
|
const NumberVariable<int> &value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_stringLength = value;
|
_entryData->_stringLength = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::CharSelectionChanged(const QString &character)
|
void MacroActionVariableEdit::CharSelectionChanged(const QString &character)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
if (character.isEmpty()) {
|
if (character.isEmpty()) {
|
||||||
_entryData->_paddingChar = ' ';
|
_entryData->_paddingChar = ' ';
|
||||||
} else {
|
} else {
|
||||||
@@ -1472,11 +1432,7 @@ void MacroActionVariableEdit::CharSelectionChanged(const QString &character)
|
|||||||
|
|
||||||
void MacroActionVariableEdit::CaseTypeChanged(int index)
|
void MacroActionVariableEdit::CaseTypeChanged(int index)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_caseType = static_cast<MacroActionVariable::CaseType>(
|
_entryData->_caseType = static_cast<MacroActionVariable::CaseType>(
|
||||||
_caseType->itemData(index).toInt());
|
_caseType->itemData(index).toInt());
|
||||||
}
|
}
|
||||||
@@ -1501,6 +1457,18 @@ void MacroActionVariableEdit::GenerateIntegerChanged(int value)
|
|||||||
_entryData->_generateInteger = value;
|
_entryData->_generateInteger = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroActionVariableEdit::JsonQueryChanged()
|
||||||
|
{
|
||||||
|
GUARD_LOADING_AND_LOCK();
|
||||||
|
_entryData->_jsonQuery = _jsonQuery->text().toStdString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionVariableEdit::JsonIndexChanged(const NumberVariable<int> &value)
|
||||||
|
{
|
||||||
|
GUARD_LOADING_AND_LOCK();
|
||||||
|
_entryData->_jsonIndex = value;
|
||||||
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::SetWidgetVisibility()
|
void MacroActionVariableEdit::SetWidgetVisibility()
|
||||||
{
|
{
|
||||||
if (!_entryData) {
|
if (!_entryData) {
|
||||||
@@ -1524,19 +1492,22 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
|||||||
{"{{stringLength}}", _stringLength},
|
{"{{stringLength}}", _stringLength},
|
||||||
{"{{paddingCharSelection}}", _paddingCharSelection},
|
{"{{paddingCharSelection}}", _paddingCharSelection},
|
||||||
{"{{caseType}}", _caseType},
|
{"{{caseType}}", _caseType},
|
||||||
|
{"{{jsonQuery}}", _jsonQuery},
|
||||||
|
{"{{jsonQueryHelp}}", _jsonQueryHelp},
|
||||||
|
{"{{jsonIndex}}", _jsonIndex},
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *layoutString = "";
|
const char *layoutString = "";
|
||||||
if (_entryData->_action == MacroActionVariable::Action::PAD) {
|
if (_entryData->_action == MacroActionVariable::Action::PAD) {
|
||||||
layoutString = obs_module_text(
|
layoutString = obs_module_text(
|
||||||
"AdvSceneSwitcher.action.variable.entry.pad");
|
"AdvSceneSwitcher.action.variable.layout.pad");
|
||||||
} else if (_entryData->_action ==
|
} else if (_entryData->_action ==
|
||||||
MacroActionVariable::Action::TRUNCATE) {
|
MacroActionVariable::Action::TRUNCATE) {
|
||||||
layoutString = obs_module_text(
|
layoutString = obs_module_text(
|
||||||
"AdvSceneSwitcher.action.variable.entry.truncate");
|
"AdvSceneSwitcher.action.variable.layout.truncate");
|
||||||
} else {
|
} else {
|
||||||
layoutString = obs_module_text(
|
layoutString = obs_module_text(
|
||||||
"AdvSceneSwitcher.action.variable.entry.other");
|
"AdvSceneSwitcher.action.variable.layout.other");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &[_, widget] : widgetPlaceholders) {
|
for (const auto &[_, widget] : widgetPlaceholders) {
|
||||||
@@ -1552,13 +1523,15 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
|||||||
MacroActionVariable::Action::MATH_EXPRESSION ||
|
MacroActionVariable::Action::MATH_EXPRESSION ||
|
||||||
_entryData->_action == MacroActionVariable::Action::ENV_VARIABLE ||
|
_entryData->_action == MacroActionVariable::Action::ENV_VARIABLE ||
|
||||||
_entryData->_action == MacroActionVariable::Action::STRING_LENGTH ||
|
_entryData->_action == MacroActionVariable::Action::STRING_LENGTH ||
|
||||||
_entryData->_action == MacroActionVariable::Action::EXTRACT_JSON) {
|
_entryData->_action == MacroActionVariable::Action::EXTRACT_JSON ||
|
||||||
|
_entryData->_action == MacroActionVariable::Action::QUERY_JSON) {
|
||||||
RemoveStretchIfPresent(_entryLayout);
|
RemoveStretchIfPresent(_entryLayout);
|
||||||
} else {
|
} else {
|
||||||
AddStretchIfNecessary(_entryLayout);
|
AddStretchIfNecessary(_entryLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
_variables2->setVisible(
|
_variables2->setVisible(
|
||||||
|
_entryData->_action == MacroActionVariable::Action::COPY_VAR ||
|
||||||
_entryData->_action ==
|
_entryData->_action ==
|
||||||
MacroActionVariable::Action::APPEND_VAR ||
|
MacroActionVariable::Action::APPEND_VAR ||
|
||||||
_entryData->_action ==
|
_entryData->_action ==
|
||||||
@@ -1664,6 +1637,12 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
|||||||
SetLayoutVisible(_randomLayout,
|
SetLayoutVisible(_randomLayout,
|
||||||
_entryData->_action ==
|
_entryData->_action ==
|
||||||
MacroActionVariable::Action::RANDOM_NUMBER);
|
MacroActionVariable::Action::RANDOM_NUMBER);
|
||||||
|
_jsonQuery->setVisible(_entryData->_action ==
|
||||||
|
MacroActionVariable::Action::QUERY_JSON);
|
||||||
|
_jsonQueryHelp->setVisible(_entryData->_action ==
|
||||||
|
MacroActionVariable::Action::QUERY_JSON);
|
||||||
|
_jsonIndex->setVisible(_entryData->_action ==
|
||||||
|
MacroActionVariable::Action::ARRAY_JSON);
|
||||||
|
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ public:
|
|||||||
TRIM,
|
TRIM,
|
||||||
CHANGE_CASE,
|
CHANGE_CASE,
|
||||||
RANDOM_NUMBER,
|
RANDOM_NUMBER,
|
||||||
|
QUERY_JSON,
|
||||||
|
ARRAY_JSON,
|
||||||
|
COPY_VAR,
|
||||||
};
|
};
|
||||||
|
|
||||||
Action _action = Action::SET_VALUE;
|
Action _action = Action::SET_VALUE;
|
||||||
@@ -104,6 +107,9 @@ public:
|
|||||||
DoubleVariable _randomNumberEnd = 100;
|
DoubleVariable _randomNumberEnd = 100;
|
||||||
bool _generateInteger = true;
|
bool _generateInteger = true;
|
||||||
|
|
||||||
|
StringVariable _jsonQuery = "$.some.nested.value";
|
||||||
|
IntVariable _jsonIndex = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void DecrementCurrentSegmentVariableRef();
|
void DecrementCurrentSegmentVariableRef();
|
||||||
void HandleIndexSubString(Variable *);
|
void HandleIndexSubString(Variable *);
|
||||||
@@ -169,6 +175,8 @@ private slots:
|
|||||||
void RandomNumberStartChanged(const NumberVariable<double> &);
|
void RandomNumberStartChanged(const NumberVariable<double> &);
|
||||||
void RandomNumberEndChanged(const NumberVariable<double> &);
|
void RandomNumberEndChanged(const NumberVariable<double> &);
|
||||||
void GenerateIntegerChanged(int);
|
void GenerateIntegerChanged(int);
|
||||||
|
void JsonQueryChanged();
|
||||||
|
void JsonIndexChanged(const NumberVariable<int> &);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void HeaderInfoChanged(const QString &);
|
void HeaderInfoChanged(const QString &);
|
||||||
@@ -218,6 +226,9 @@ private:
|
|||||||
VariableDoubleSpinBox *_randomNumberEnd;
|
VariableDoubleSpinBox *_randomNumberEnd;
|
||||||
QCheckBox *_generateInteger;
|
QCheckBox *_generateInteger;
|
||||||
QVBoxLayout *_randomLayout;
|
QVBoxLayout *_randomLayout;
|
||||||
|
VariableLineEdit *_jsonQuery;
|
||||||
|
QLabel *_jsonQueryHelp;
|
||||||
|
VariableSpinBox *_jsonIndex;
|
||||||
QHBoxLayout *_entryLayout;
|
QHBoxLayout *_entryLayout;
|
||||||
|
|
||||||
std::shared_ptr<MacroActionVariable> _entryData;
|
std::shared_ptr<MacroActionVariable> _entryData;
|
||||||
|
|||||||
@@ -11,15 +11,12 @@ bool MacroAction::Save(obs_data_t *obj) const
|
|||||||
{
|
{
|
||||||
MacroSegment::Save(obj);
|
MacroSegment::Save(obj);
|
||||||
obs_data_set_string(obj, "id", GetId().c_str());
|
obs_data_set_string(obj, "id", GetId().c_str());
|
||||||
obs_data_set_bool(obj, "enabled", _enabled);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroAction::Load(obs_data_t *obj)
|
bool MacroAction::Load(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
MacroSegment::Load(obj);
|
MacroSegment::Load(obj);
|
||||||
obs_data_set_default_bool(obj, "enabled", true);
|
|
||||||
_enabled = obs_data_get_bool(obj, "enabled");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,16 +25,6 @@ void MacroAction::LogAction() const
|
|||||||
ablog(LOG_INFO, "performed action %s", GetId().c_str());
|
ablog(LOG_INFO, "performed action %s", GetId().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroAction::SetEnabled(bool value)
|
|
||||||
{
|
|
||||||
_enabled = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MacroAction::Enabled() const
|
|
||||||
{
|
|
||||||
return _enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MacroAction::ResolveVariablesToFixedValues() {}
|
void MacroAction::ResolveVariablesToFixedValues() {}
|
||||||
|
|
||||||
std::string_view MacroAction::GetDefaultID()
|
std::string_view MacroAction::GetDefaultID()
|
||||||
|
|||||||
@@ -19,13 +19,9 @@ public:
|
|||||||
// Used to resolve variables before actions are added to action queues
|
// Used to resolve variables before actions are added to action queues
|
||||||
virtual void ResolveVariablesToFixedValues();
|
virtual void ResolveVariablesToFixedValues();
|
||||||
|
|
||||||
void SetEnabled(bool);
|
|
||||||
bool Enabled() const;
|
|
||||||
|
|
||||||
static std::string_view GetDefaultID();
|
static std::string_view GetDefaultID();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _enabled = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class EXPORT MacroRefAction : virtual public MacroAction {
|
class EXPORT MacroRefAction : virtual public MacroAction {
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ void DurationModifierEdit::Collapse(bool collapse)
|
|||||||
|
|
||||||
MacroConditionEdit::MacroConditionEdit(
|
MacroConditionEdit::MacroConditionEdit(
|
||||||
QWidget *parent, std::shared_ptr<MacroCondition> *entryData,
|
QWidget *parent, std::shared_ptr<MacroCondition> *entryData,
|
||||||
const std::string &id, bool isRootCondition)
|
bool isRootCondition)
|
||||||
: MacroSegmentEdit(parent),
|
: MacroSegmentEdit(parent),
|
||||||
_logicSelection(new QComboBox()),
|
_logicSelection(new QComboBox()),
|
||||||
_conditionSelection(new FilterComboBox()),
|
_conditionSelection(new FilterComboBox()),
|
||||||
@@ -138,7 +138,7 @@ MacroConditionEdit::MacroConditionEdit(
|
|||||||
mainLayout->addWidget(_frame);
|
mainLayout->addWidget(_frame);
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
UpdateEntryData(id);
|
SetupWidgets(true);
|
||||||
_loading = false;
|
_loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,9 +152,11 @@ void MacroConditionEdit::LogicSelectionChanged(int idx)
|
|||||||
const auto logic = static_cast<Logic::Type>(
|
const auto logic = static_cast<Logic::Type>(
|
||||||
_logicSelection->itemData(idx).toInt());
|
_logicSelection->itemData(idx).toInt());
|
||||||
(*_entryData)->SetLogicType(logic);
|
(*_entryData)->SetLogicType(logic);
|
||||||
|
|
||||||
|
SetEnableAppearance(logic != Logic::Type::NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroConditionEdit::IsRootNode()
|
bool MacroConditionEdit::IsRootNode() const
|
||||||
{
|
{
|
||||||
return _isRoot;
|
return _isRoot;
|
||||||
}
|
}
|
||||||
@@ -164,6 +166,7 @@ void MacroConditionEdit::SetLogicSelection()
|
|||||||
const auto logic = (*_entryData)->GetLogicType();
|
const auto logic = (*_entryData)->GetLogicType();
|
||||||
_logicSelection->setCurrentIndex(
|
_logicSelection->setCurrentIndex(
|
||||||
_logicSelection->findData(static_cast<int>(logic)));
|
_logicSelection->findData(static_cast<int>(logic)));
|
||||||
|
SetEnableAppearance(logic != Logic::Type::NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionEdit::SetRootNode(bool root)
|
void MacroConditionEdit::SetRootNode(bool root)
|
||||||
@@ -175,23 +178,36 @@ void MacroConditionEdit::SetRootNode(bool root)
|
|||||||
SetLogicSelection();
|
SetLogicSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionEdit::UpdateEntryData(const std::string &id)
|
void MacroConditionEdit::SetupWidgets(bool basicSetup)
|
||||||
{
|
{
|
||||||
|
if (_allWidgetsAreSetup) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto id = (*_entryData)->GetId();
|
||||||
_conditionSelection->setCurrentText(obs_module_text(
|
_conditionSelection->setCurrentText(obs_module_text(
|
||||||
MacroConditionFactory::GetConditionName(id).c_str()));
|
MacroConditionFactory::GetConditionName(id).c_str()));
|
||||||
auto widget =
|
|
||||||
MacroConditionFactory::CreateWidget(id, this, *_entryData);
|
|
||||||
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
|
||||||
this, SLOT(HeaderInfoChanged(const QString &)));
|
|
||||||
HeaderInfoChanged(
|
HeaderInfoChanged(
|
||||||
QString::fromStdString((*_entryData)->GetShortDesc()));
|
QString::fromStdString((*_entryData)->GetShortDesc()));
|
||||||
SetLogicSelection();
|
SetLogicSelection();
|
||||||
_section->SetContent(widget, (*_entryData)->GetCollapsed());
|
|
||||||
|
|
||||||
_dur->setVisible(MacroConditionFactory::UsesDurationModifier(id));
|
_dur->setVisible(MacroConditionFactory::UsesDurationModifier(id));
|
||||||
auto modifier = (*_entryData)->GetDurationModifier();
|
auto modifier = (*_entryData)->GetDurationModifier();
|
||||||
_dur->SetValue(modifier);
|
_dur->SetValue(modifier);
|
||||||
|
|
||||||
|
if (basicSetup) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto widget =
|
||||||
|
MacroConditionFactory::CreateWidget(id, this, *_entryData);
|
||||||
|
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
||||||
|
this, SLOT(HeaderInfoChanged(const QString &)));
|
||||||
|
_section->SetContent(widget, (*_entryData)->GetCollapsed());
|
||||||
SetFocusPolicyOfWidgets();
|
SetFocusPolicyOfWidgets();
|
||||||
|
|
||||||
|
_allWidgetsAreSetup = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionEdit::SetEntryData(std::shared_ptr<MacroCondition> *data)
|
void MacroConditionEdit::SetEntryData(std::shared_ptr<MacroCondition> *data)
|
||||||
@@ -223,7 +239,7 @@ void MacroConditionEdit::ConditionSelectionChanged(const QString &text)
|
|||||||
(*_entryData)->SetIndex(idx);
|
(*_entryData)->SetIndex(idx);
|
||||||
(*_entryData)->SetLogicType(logic);
|
(*_entryData)->SetLogicType(logic);
|
||||||
(*_entryData)->PostLoad();
|
(*_entryData)->PostLoad();
|
||||||
RunPostLoadSteps();
|
RunAndClearPostLoadSteps();
|
||||||
}
|
}
|
||||||
auto widget =
|
auto widget =
|
||||||
MacroConditionFactory::CreateWidget(id, this, *_entryData);
|
MacroConditionFactory::CreateWidget(id, this, *_entryData);
|
||||||
@@ -259,289 +275,4 @@ std::shared_ptr<MacroSegment> MacroConditionEdit::Data() const
|
|||||||
return *_entryData;
|
return *_entryData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::AddMacroCondition(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 0 || idx > (int)macro->Conditions().size()) {
|
|
||||||
assert(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string id;
|
|
||||||
Logic::Type logic;
|
|
||||||
if (idx >= 1) {
|
|
||||||
id = macro->Conditions().at(idx - 1)->GetId();
|
|
||||||
if (idx == 1) {
|
|
||||||
logic = Logic::Type::OR;
|
|
||||||
} else {
|
|
||||||
logic = macro->Conditions().at(idx - 1)->GetLogicType();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
id = MacroCondition::GetDefaultID();
|
|
||||||
logic = Logic::Type::ROOT_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
OBSDataAutoRelease data;
|
|
||||||
if (idx - 1 >= 0) {
|
|
||||||
data = obs_data_create();
|
|
||||||
macro->Conditions().at(idx - 1)->Save(data);
|
|
||||||
}
|
|
||||||
AddMacroCondition(macro.get(), idx, id, data.Get(), logic);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::AddMacroCondition(Macro *macro, int idx,
|
|
||||||
const std::string &id,
|
|
||||||
obs_data_t *data, Logic::Type logic)
|
|
||||||
{
|
|
||||||
if (idx < 0 || idx > (int)macro->Conditions().size()) {
|
|
||||||
assert(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
|
||||||
auto cond = macro->Conditions().emplace(
|
|
||||||
macro->Conditions().begin() + idx,
|
|
||||||
MacroConditionFactory::Create(id, macro));
|
|
||||||
if (data) {
|
|
||||||
macro->Conditions().at(idx)->Load(data);
|
|
||||||
}
|
|
||||||
macro->Conditions().at(idx)->PostLoad();
|
|
||||||
RunPostLoadSteps();
|
|
||||||
(*cond)->SetLogicType(logic);
|
|
||||||
macro->UpdateConditionIndices();
|
|
||||||
ui->conditionsList->Insert(
|
|
||||||
idx,
|
|
||||||
new MacroConditionEdit(this, ¯o->Conditions()[idx],
|
|
||||||
id, idx == 0));
|
|
||||||
SetConditionData(*macro);
|
|
||||||
}
|
|
||||||
HighlightCondition(idx);
|
|
||||||
ui->conditionsList->SetHelpMsgVisible(false);
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_conditionAdd_clicked()
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentConditionIdx == -1) {
|
|
||||||
AddMacroCondition((int)macro->Conditions().size());
|
|
||||||
} else {
|
|
||||||
AddMacroCondition(currentConditionIdx + 1);
|
|
||||||
}
|
|
||||||
if (currentConditionIdx != -1) {
|
|
||||||
MacroConditionSelectionChanged(currentConditionIdx + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::RemoveMacroCondition(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 0 || idx >= (int)macro->Conditions().size()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
|
||||||
ui->conditionsList->Remove(idx);
|
|
||||||
macro->Conditions().erase(macro->Conditions().begin() + idx);
|
|
||||||
macro->UpdateConditionIndices();
|
|
||||||
if (idx == 0 && macro->Conditions().size() > 0) {
|
|
||||||
auto newRoot = macro->Conditions().at(0);
|
|
||||||
newRoot->SetLogicType(Logic::Type::ROOT_NONE);
|
|
||||||
static_cast<MacroConditionEdit *>(
|
|
||||||
ui->conditionsList->WidgetAt(0))
|
|
||||||
->SetRootNode(true);
|
|
||||||
}
|
|
||||||
SetConditionData(*macro);
|
|
||||||
}
|
|
||||||
MacroConditionSelectionChanged(-1);
|
|
||||||
lastInteracted = MacroSection::CONDITIONS;
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_conditionRemove_clicked()
|
|
||||||
{
|
|
||||||
if (currentConditionIdx == -1) {
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RemoveMacroCondition((int)macro->Conditions().size() - 1);
|
|
||||||
} else {
|
|
||||||
RemoveMacroCondition(currentConditionIdx);
|
|
||||||
}
|
|
||||||
MacroConditionSelectionChanged(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_conditionTop_clicked()
|
|
||||||
{
|
|
||||||
if (currentConditionIdx == -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MacroConditionReorder(0, currentConditionIdx);
|
|
||||||
MacroConditionSelectionChanged(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_conditionUp_clicked()
|
|
||||||
{
|
|
||||||
if (currentConditionIdx == -1 || currentConditionIdx == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveMacroConditionUp(currentConditionIdx);
|
|
||||||
MacroConditionSelectionChanged(currentConditionIdx - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_conditionDown_clicked()
|
|
||||||
{
|
|
||||||
if (currentConditionIdx == -1 ||
|
|
||||||
currentConditionIdx ==
|
|
||||||
ui->conditionsList->ContentLayout()->count() - 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveMacroConditionDown(currentConditionIdx);
|
|
||||||
MacroConditionSelectionChanged(currentConditionIdx + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_conditionBottom_clicked()
|
|
||||||
{
|
|
||||||
if (currentConditionIdx == -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const int newIdx = ui->conditionsList->ContentLayout()->count() - 1;
|
|
||||||
MacroConditionReorder(newIdx, currentConditionIdx);
|
|
||||||
MacroConditionSelectionChanged(newIdx);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::SwapConditions(Macro *m, int pos1, int pos2)
|
|
||||||
{
|
|
||||||
if (pos1 == pos2) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (pos1 > pos2) {
|
|
||||||
std::swap(pos1, pos2);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool root = pos1 == 0;
|
|
||||||
auto lock = LockContext();
|
|
||||||
iter_swap(m->Conditions().begin() + pos1,
|
|
||||||
m->Conditions().begin() + pos2);
|
|
||||||
m->UpdateConditionIndices();
|
|
||||||
|
|
||||||
auto c1 = m->Conditions().begin() + pos1;
|
|
||||||
auto c2 = m->Conditions().begin() + pos2;
|
|
||||||
if (root) {
|
|
||||||
auto logic1 = (*c1)->GetLogicType();
|
|
||||||
auto logic2 = (*c2)->GetLogicType();
|
|
||||||
(*c1)->SetLogicType(logic2);
|
|
||||||
(*c2)->SetLogicType(logic1);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto widget1 = static_cast<MacroConditionEdit *>(
|
|
||||||
ui->conditionsList->ContentLayout()->takeAt(pos1)->widget());
|
|
||||||
auto widget2 = static_cast<MacroConditionEdit *>(
|
|
||||||
ui->conditionsList->ContentLayout()->takeAt(pos2 - 1)->widget());
|
|
||||||
ui->conditionsList->Insert(pos1, widget2);
|
|
||||||
ui->conditionsList->Insert(pos2, widget1);
|
|
||||||
SetConditionData(*m);
|
|
||||||
widget2->SetRootNode(root);
|
|
||||||
widget1->SetRootNode(false);
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MoveMacroConditionUp(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 1 || idx >= (int)macro->Conditions().size()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SwapConditions(macro.get(), idx, idx - 1);
|
|
||||||
HighlightCondition(idx - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MoveMacroConditionDown(int idx)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx < 0 || idx >= (int)macro->Conditions().size() - 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SwapConditions(macro.get(), idx, idx + 1);
|
|
||||||
HighlightCondition(idx + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MacroConditionSelectionChanged(int idx)
|
|
||||||
{
|
|
||||||
SetupMacroSegmentSelection(MacroSection::CONDITIONS, idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::MacroConditionReorder(int to, int from)
|
|
||||||
{
|
|
||||||
auto macro = GetSelectedMacro();
|
|
||||||
if (!macro) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (to == from || from < 0 || from > (int)macro->Conditions().size() ||
|
|
||||||
to < 0 || to > (int)macro->Conditions().size()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
|
||||||
auto condition = macro->Conditions().at(from);
|
|
||||||
if (to == 0) {
|
|
||||||
condition->SetLogicType(Logic::Type::ROOT_NONE);
|
|
||||||
static_cast<MacroConditionEdit *>(
|
|
||||||
ui->conditionsList->WidgetAt(from))
|
|
||||||
->SetRootNode(true);
|
|
||||||
macro->Conditions().at(0)->SetLogicType(
|
|
||||||
Logic::Type::AND);
|
|
||||||
static_cast<MacroConditionEdit *>(
|
|
||||||
ui->conditionsList->WidgetAt(0))
|
|
||||||
->SetRootNode(false);
|
|
||||||
}
|
|
||||||
if (from == 0) {
|
|
||||||
condition->SetLogicType(Logic::Type::AND);
|
|
||||||
static_cast<MacroConditionEdit *>(
|
|
||||||
ui->conditionsList->WidgetAt(from))
|
|
||||||
->SetRootNode(false);
|
|
||||||
macro->Conditions().at(1)->SetLogicType(
|
|
||||||
Logic::Type::ROOT_NONE);
|
|
||||||
static_cast<MacroConditionEdit *>(
|
|
||||||
ui->conditionsList->WidgetAt(1))
|
|
||||||
->SetRootNode(true);
|
|
||||||
}
|
|
||||||
macro->Conditions().erase(macro->Conditions().begin() + from);
|
|
||||||
macro->Conditions().insert(macro->Conditions().begin() + to,
|
|
||||||
condition);
|
|
||||||
macro->UpdateConditionIndices();
|
|
||||||
ui->conditionsList->ContentLayout()->insertItem(
|
|
||||||
to, ui->conditionsList->ContentLayout()->takeAt(from));
|
|
||||||
SetConditionData(*macro);
|
|
||||||
}
|
|
||||||
HighlightCondition(to);
|
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -34,14 +34,12 @@ class MacroConditionEdit : public MacroSegmentEdit {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MacroConditionEdit(
|
MacroConditionEdit(QWidget *parent = nullptr,
|
||||||
QWidget *parent = nullptr,
|
std::shared_ptr<MacroCondition> * = nullptr,
|
||||||
std::shared_ptr<MacroCondition> * = nullptr,
|
bool root = true);
|
||||||
const std::string &id = MacroCondition::GetDefaultID().data(),
|
bool IsRootNode() const;
|
||||||
bool root = true);
|
|
||||||
bool IsRootNode();
|
|
||||||
void SetRootNode(bool);
|
void SetRootNode(bool);
|
||||||
void UpdateEntryData(const std::string &id);
|
void SetupWidgets(bool basicSetup = false);
|
||||||
void SetEntryData(std::shared_ptr<MacroCondition> *);
|
void SetEntryData(std::shared_ptr<MacroCondition> *);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
#include "macro-condition-factory.hpp"
|
#include "macro-condition-factory.hpp"
|
||||||
|
#include "macro-segment-unknown.hpp"
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
namespace {
|
using MacroConditionUnknown = MacroSegmentUnknown<MacroCondition>;
|
||||||
|
|
||||||
class MacroConditionUnknown : public MacroCondition {
|
|
||||||
public:
|
|
||||||
MacroConditionUnknown(Macro *m) : MacroCondition(m) {}
|
|
||||||
bool CheckCondition() { return false; }
|
|
||||||
bool Save(obs_data_t *obj) const { return MacroCondition::Save(obj); };
|
|
||||||
bool Load(obs_data_t *obj) { return MacroCondition::Load(obj); };
|
|
||||||
std::string GetId() const { return "unknown"; }
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
static std::recursive_mutex mutex;
|
static std::recursive_mutex mutex;
|
||||||
|
|
||||||
@@ -46,9 +36,10 @@ bool MacroConditionFactory::Deregister(const std::string &id)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::shared_ptr<MacroCondition> createUnknownCondition(Macro *m)
|
static std::shared_ptr<MacroCondition>
|
||||||
|
createUnknownCondition(Macro *m, const std::string &id)
|
||||||
{
|
{
|
||||||
return std::make_shared<MacroConditionUnknown>(m);
|
return std::make_shared<MacroConditionUnknown>(m, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<MacroCondition>
|
std::shared_ptr<MacroCondition>
|
||||||
@@ -58,13 +49,7 @@ MacroConditionFactory::Create(const std::string &id, Macro *m)
|
|||||||
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
||||||
return it->second._create(m);
|
return it->second._create(m);
|
||||||
}
|
}
|
||||||
return createUnknownCondition(m);
|
return createUnknownCondition(m, id);
|
||||||
}
|
|
||||||
|
|
||||||
static QWidget *createUnknownConditionWidget()
|
|
||||||
{
|
|
||||||
return new QLabel(
|
|
||||||
obs_module_text("AdvSceneSwitcher.condition.unknown"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *
|
QWidget *
|
||||||
@@ -75,7 +60,7 @@ MacroConditionFactory::CreateWidget(const std::string &id, QWidget *parent,
|
|||||||
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
||||||
return it->second._createWidget(parent, cond);
|
return it->second._createWidget(parent, cond);
|
||||||
}
|
}
|
||||||
return createUnknownConditionWidget();
|
return CreateUnknownSegmentWidget(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string MacroConditionFactory::GetConditionName(const std::string &id)
|
std::string MacroConditionFactory::GetConditionName(const std::string &id)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class MacroConditionFactory {
|
|||||||
public:
|
public:
|
||||||
MacroConditionFactory() = delete;
|
MacroConditionFactory() = delete;
|
||||||
EXPORT static bool Register(const std::string &, MacroConditionInfo);
|
EXPORT static bool Register(const std::string &, MacroConditionInfo);
|
||||||
static bool Deregister(const std::string &);
|
EXPORT static bool Deregister(const std::string &);
|
||||||
static std::shared_ptr<MacroCondition> Create(const std::string &,
|
static std::shared_ptr<MacroCondition> Create(const std::string &,
|
||||||
Macro *m);
|
Macro *m);
|
||||||
static QWidget *CreateWidget(const std::string &id, QWidget *parent,
|
static QWidget *CreateWidget(const std::string &id, QWidget *parent,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "macro-condition-macro.hpp"
|
#include "macro-condition-macro.hpp"
|
||||||
#include "layout-helpers.hpp"
|
#include "layout-helpers.hpp"
|
||||||
#include "macro-action-edit.hpp"
|
#include "macro-action-edit.hpp"
|
||||||
|
#include "macro-signals.hpp"
|
||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
@@ -26,6 +27,8 @@ const static std::map<MacroConditionMacro::Type, std::string>
|
|||||||
"AdvSceneSwitcher.condition.macro.type.actionEnabled"},
|
"AdvSceneSwitcher.condition.macro.type.actionEnabled"},
|
||||||
{MacroConditionMacro::Type::PAUSED,
|
{MacroConditionMacro::Type::PAUSED,
|
||||||
"AdvSceneSwitcher.condition.macro.type.paused"},
|
"AdvSceneSwitcher.condition.macro.type.paused"},
|
||||||
|
{MacroConditionMacro::Type::ACTIONS_PERFORMED,
|
||||||
|
"AdvSceneSwitcher.condition.macro.type.actionsPerformed"},
|
||||||
};
|
};
|
||||||
|
|
||||||
const static std::map<MacroConditionMacro::CounterCondition, std::string>
|
const static std::map<MacroConditionMacro::CounterCondition, std::string>
|
||||||
@@ -99,7 +102,7 @@ bool MacroConditionMacro::CheckActionStateCondition()
|
|||||||
if (!macro) {
|
if (!macro) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!IsValidMacroSegmentIndex(macro.get(), _actionIndex - 1, false)) {
|
if (!IsValidActionIndex(macro.get(), _actionIndex - 1)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_type == Type::ACTION_DISABLED) {
|
if (_type == Type::ACTION_DISABLED) {
|
||||||
@@ -121,6 +124,16 @@ bool MacroConditionMacro::CheckPauseState()
|
|||||||
return macro->Paused();
|
return macro->Paused();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MacroConditionMacro::CheckActionsPerformed()
|
||||||
|
{
|
||||||
|
auto macro = _macro.GetMacro();
|
||||||
|
if (!macro) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return macro->WasExecutedSince(macro->LastConditionCheckTime());
|
||||||
|
}
|
||||||
|
|
||||||
bool MacroConditionMacro::CheckCountCondition()
|
bool MacroConditionMacro::CheckCountCondition()
|
||||||
{
|
{
|
||||||
auto macro = _macro.GetMacro();
|
auto macro = _macro.GetMacro();
|
||||||
@@ -158,6 +171,8 @@ bool MacroConditionMacro::CheckCondition()
|
|||||||
return CheckActionStateCondition();
|
return CheckActionStateCondition();
|
||||||
case Type::PAUSED:
|
case Type::PAUSED:
|
||||||
return CheckPauseState();
|
return CheckPauseState();
|
||||||
|
case Type::ACTIONS_PERFORMED:
|
||||||
|
return CheckActionsPerformed();
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -307,7 +322,8 @@ MacroConditionMacroEdit::MacroConditionMacroEdit(
|
|||||||
|
|
||||||
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
|
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
|
||||||
this, SLOT(MacroChanged(const QString &)));
|
this, SLOT(MacroChanged(const QString &)));
|
||||||
QWidget::connect(parent, SIGNAL(MacroRemoved(const QString &)), this,
|
QWidget::connect(MacroSignalManager::Instance(),
|
||||||
|
SIGNAL(Remove(const QString &)), this,
|
||||||
SLOT(MacroRemove(const QString &)));
|
SLOT(MacroRemove(const QString &)));
|
||||||
QWidget::connect(_types, SIGNAL(currentIndexChanged(int)), this,
|
QWidget::connect(_types, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(TypeChanged(int)));
|
SLOT(TypeChanged(int)));
|
||||||
@@ -414,6 +430,9 @@ void MacroConditionMacroEdit::SetupWidgets()
|
|||||||
case MacroConditionMacro::Type::PAUSED:
|
case MacroConditionMacro::Type::PAUSED:
|
||||||
SetupPauseWidgets();
|
SetupPauseWidgets();
|
||||||
break;
|
break;
|
||||||
|
case MacroConditionMacro::Type::ACTIONS_PERFORMED:
|
||||||
|
SetupActionsPerformedWidgets();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -472,6 +491,14 @@ void MacroConditionMacroEdit::SetupPauseWidgets()
|
|||||||
_settingsLine1, {{"{{macros}}", _macros}});
|
_settingsLine1, {{"{{macros}}", _macros}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroConditionMacroEdit::SetupActionsPerformedWidgets()
|
||||||
|
{
|
||||||
|
PlaceWidgets(
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.condition.macro.actionsPerformed.entry"),
|
||||||
|
_settingsLine1, {{"{{macros}}", _macros}});
|
||||||
|
}
|
||||||
|
|
||||||
void MacroConditionMacroEdit::SetWidgetVisibility()
|
void MacroConditionMacroEdit::SetWidgetVisibility()
|
||||||
{
|
{
|
||||||
_macros->setVisible(
|
_macros->setVisible(
|
||||||
@@ -481,7 +508,9 @@ void MacroConditionMacroEdit::SetWidgetVisibility()
|
|||||||
MacroConditionMacro::Type::ACTION_DISABLED ||
|
MacroConditionMacro::Type::ACTION_DISABLED ||
|
||||||
_entryData->GetType() ==
|
_entryData->GetType() ==
|
||||||
MacroConditionMacro::Type::ACTION_ENABLED ||
|
MacroConditionMacro::Type::ACTION_ENABLED ||
|
||||||
_entryData->GetType() == MacroConditionMacro::Type::PAUSED);
|
_entryData->GetType() == MacroConditionMacro::Type::PAUSED ||
|
||||||
|
_entryData->GetType() ==
|
||||||
|
MacroConditionMacro::Type::ACTIONS_PERFORMED);
|
||||||
_counterConditions->setVisible(_entryData->GetType() ==
|
_counterConditions->setVisible(_entryData->GetType() ==
|
||||||
MacroConditionMacro::Type::COUNT);
|
MacroConditionMacro::Type::COUNT);
|
||||||
_count->setVisible(_entryData->GetType() ==
|
_count->setVisible(_entryData->GetType() ==
|
||||||
@@ -538,11 +567,7 @@ void MacroConditionMacroEdit::UpdateEntryData()
|
|||||||
|
|
||||||
void MacroConditionMacroEdit::MacroChanged(const QString &text)
|
void MacroConditionMacroEdit::MacroChanged(const QString &text)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_macro = text;
|
_entryData->_macro = text;
|
||||||
_actionIndex->SetMacro(_entryData->_macro.GetMacro());
|
_actionIndex->SetMacro(_entryData->_macro.GetMacro());
|
||||||
emit HeaderInfoChanged(
|
emit HeaderInfoChanged(
|
||||||
@@ -551,21 +576,13 @@ void MacroConditionMacroEdit::MacroChanged(const QString &text)
|
|||||||
|
|
||||||
void MacroConditionMacroEdit::CountChanged(const NumberVariable<int> &value)
|
void MacroConditionMacroEdit::CountChanged(const NumberVariable<int> &value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_count = value;
|
_entryData->_count = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionMacroEdit::CountConditionChanged(int cond)
|
void MacroConditionMacroEdit::CountConditionChanged(int cond)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_counterCondition =
|
_entryData->_counterCondition =
|
||||||
static_cast<MacroConditionMacro::CounterCondition>(cond);
|
static_cast<MacroConditionMacro::CounterCondition>(cond);
|
||||||
}
|
}
|
||||||
@@ -590,11 +607,7 @@ void MacroConditionMacroEdit::MacroRemove(const QString &)
|
|||||||
|
|
||||||
void MacroConditionMacroEdit::TypeChanged(int type)
|
void MacroConditionMacroEdit::TypeChanged(int type)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->SetType(static_cast<MacroConditionMacro::Type>(type));
|
_entryData->SetType(static_cast<MacroConditionMacro::Type>(type));
|
||||||
SetupWidgets();
|
SetupWidgets();
|
||||||
}
|
}
|
||||||
@@ -640,11 +653,7 @@ void MacroConditionMacroEdit::UpdatePaused()
|
|||||||
|
|
||||||
void MacroConditionMacroEdit::MultiStateConditionChanged(int cond)
|
void MacroConditionMacroEdit::MultiStateConditionChanged(int cond)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_multiSateCondition =
|
_entryData->_multiSateCondition =
|
||||||
static_cast<MacroConditionMacro::MultiStateCondition>(cond);
|
static_cast<MacroConditionMacro::MultiStateCondition>(cond);
|
||||||
}
|
}
|
||||||
@@ -652,21 +661,13 @@ void MacroConditionMacroEdit::MultiStateConditionChanged(int cond)
|
|||||||
void MacroConditionMacroEdit::MultiStateCountChanged(
|
void MacroConditionMacroEdit::MultiStateCountChanged(
|
||||||
const NumberVariable<int> &value)
|
const NumberVariable<int> &value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_multiSateCount = value;
|
_entryData->_multiSateCount = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionMacroEdit::Add(const std::string &name)
|
void MacroConditionMacroEdit::Add(const std::string &name)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
MacroRef macro(name);
|
MacroRef macro(name);
|
||||||
_entryData->_macros.push_back(macro);
|
_entryData->_macros.push_back(macro);
|
||||||
adjustSize();
|
adjustSize();
|
||||||
@@ -675,11 +676,7 @@ void MacroConditionMacroEdit::Add(const std::string &name)
|
|||||||
|
|
||||||
void MacroConditionMacroEdit::Remove(int idx)
|
void MacroConditionMacroEdit::Remove(int idx)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_macros.erase(std::next(_entryData->_macros.begin(), idx));
|
_entryData->_macros.erase(std::next(_entryData->_macros.begin(), idx));
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@@ -687,12 +684,8 @@ void MacroConditionMacroEdit::Remove(int idx)
|
|||||||
|
|
||||||
void MacroConditionMacroEdit::Replace(int idx, const std::string &name)
|
void MacroConditionMacroEdit::Replace(int idx, const std::string &name)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
MacroRef macro(name);
|
MacroRef macro(name);
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_macros[idx] = macro;
|
_entryData->_macros[idx] = macro;
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@@ -700,11 +693,7 @@ void MacroConditionMacroEdit::Replace(int idx, const std::string &name)
|
|||||||
|
|
||||||
void MacroConditionMacroEdit::ActionIndexChanged(const IntVariable &value)
|
void MacroConditionMacroEdit::ActionIndexChanged(const IntVariable &value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_actionIndex = value;
|
_entryData->_actionIndex = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public:
|
|||||||
ACTION_DISABLED,
|
ACTION_DISABLED,
|
||||||
ACTION_ENABLED,
|
ACTION_ENABLED,
|
||||||
PAUSED,
|
PAUSED,
|
||||||
|
ACTIONS_PERFORMED,
|
||||||
};
|
};
|
||||||
void SetType(Type);
|
void SetType(Type);
|
||||||
Type GetType() const { return _type; }
|
Type GetType() const { return _type; }
|
||||||
@@ -66,6 +67,7 @@ private:
|
|||||||
bool CheckMultiStateCondition();
|
bool CheckMultiStateCondition();
|
||||||
bool CheckActionStateCondition();
|
bool CheckActionStateCondition();
|
||||||
bool CheckPauseState();
|
bool CheckPauseState();
|
||||||
|
bool CheckActionsPerformed();
|
||||||
|
|
||||||
void SetupTempVars();
|
void SetupTempVars();
|
||||||
|
|
||||||
@@ -134,6 +136,7 @@ private:
|
|||||||
void SetupCountWidgets();
|
void SetupCountWidgets();
|
||||||
void SetupActionStateWidgets(bool enable);
|
void SetupActionStateWidgets(bool enable);
|
||||||
void SetupPauseWidgets();
|
void SetupPauseWidgets();
|
||||||
|
void SetupActionsPerformedWidgets();
|
||||||
void SetWidgetVisibility();
|
void SetWidgetVisibility();
|
||||||
bool _loading = true;
|
bool _loading = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -115,11 +115,7 @@ MacroConditionQueueEdit::MacroConditionQueueEdit(
|
|||||||
|
|
||||||
void MacroConditionQueueEdit::ConditionChanged(int condition)
|
void MacroConditionQueueEdit::ConditionChanged(int condition)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_condition =
|
_entryData->_condition =
|
||||||
static_cast<MacroConditionQueue::Condition>(condition);
|
static_cast<MacroConditionQueue::Condition>(condition);
|
||||||
emit HeaderInfoChanged(
|
emit HeaderInfoChanged(
|
||||||
@@ -129,11 +125,7 @@ void MacroConditionQueueEdit::ConditionChanged(int condition)
|
|||||||
|
|
||||||
void MacroConditionQueueEdit::QueueChanged(const QString &text)
|
void MacroConditionQueueEdit::QueueChanged(const QString &text)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_queue = GetWeakActionQueueByQString(text);
|
_entryData->_queue = GetWeakActionQueueByQString(text);
|
||||||
emit HeaderInfoChanged(
|
emit HeaderInfoChanged(
|
||||||
QString::fromStdString(_entryData->GetShortDesc()));
|
QString::fromStdString(_entryData->GetShortDesc()));
|
||||||
@@ -141,11 +133,7 @@ void MacroConditionQueueEdit::QueueChanged(const QString &text)
|
|||||||
|
|
||||||
void MacroConditionQueueEdit::SizeChanged(const NumberVariable<int> &value)
|
void MacroConditionQueueEdit::SizeChanged(const NumberVariable<int> &value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_size = value;
|
_entryData->_size = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ bool MacroConditionTempVar::CheckCondition()
|
|||||||
bool MacroConditionTempVar::Save(obs_data_t *obj) const
|
bool MacroConditionTempVar::Save(obs_data_t *obj) const
|
||||||
{
|
{
|
||||||
MacroCondition::Save(obj);
|
MacroCondition::Save(obj);
|
||||||
_tempVar.Save(obj);
|
_tempVar.Save(obj, GetMacro());
|
||||||
obs_data_set_string(obj, "variableName",
|
obs_data_set_string(obj, "variableName",
|
||||||
GetWeakVariableName(_variable2).c_str());
|
GetWeakVariableName(_variable2).c_str());
|
||||||
_strValue.Save(obj, "strValue");
|
_strValue.Save(obj, "strValue");
|
||||||
@@ -264,32 +264,19 @@ void MacroConditionTempVarEdit::UpdateEntryData()
|
|||||||
|
|
||||||
void MacroConditionTempVarEdit::VariableChanged(const TempVariableRef &var)
|
void MacroConditionTempVarEdit::VariableChanged(const TempVariableRef &var)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_tempVar = var;
|
_entryData->_tempVar = var;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionTempVarEdit::Variable2Changed(const QString &text)
|
void MacroConditionTempVarEdit::Variable2Changed(const QString &text)
|
||||||
{
|
{
|
||||||
|
GUARD_LOADING_AND_LOCK();
|
||||||
if (_loading || !_entryData) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_variable2 = GetWeakVariableByQString(text);
|
_entryData->_variable2 = GetWeakVariableByQString(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionTempVarEdit::ConditionChanged(int value)
|
void MacroConditionTempVarEdit::ConditionChanged(int value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_type =
|
_entryData->_type =
|
||||||
static_cast<MacroConditionTempVar::Condition>(value);
|
static_cast<MacroConditionTempVar::Condition>(value);
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
@@ -297,11 +284,7 @@ void MacroConditionTempVarEdit::ConditionChanged(int value)
|
|||||||
|
|
||||||
void MacroConditionTempVarEdit::StrValueChanged()
|
void MacroConditionTempVarEdit::StrValueChanged()
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_strValue = _strValue->toPlainText().toStdString();
|
_entryData->_strValue = _strValue->toPlainText().toStdString();
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@@ -309,21 +292,13 @@ void MacroConditionTempVarEdit::StrValueChanged()
|
|||||||
|
|
||||||
void MacroConditionTempVarEdit::NumValueChanged(double val)
|
void MacroConditionTempVarEdit::NumValueChanged(double val)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_numValue = val;
|
_entryData->_numValue = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionTempVarEdit::RegexChanged(const RegexConfig &conf)
|
void MacroConditionTempVarEdit::RegexChanged(const RegexConfig &conf)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_regex = conf;
|
_entryData->_regex = conf;
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
|
|||||||
@@ -236,11 +236,7 @@ void MacroConditionVariableEdit::UpdateEntryData()
|
|||||||
|
|
||||||
void MacroConditionVariableEdit::VariableChanged(const QString &text)
|
void MacroConditionVariableEdit::VariableChanged(const QString &text)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_variable = GetWeakVariableByQString(text);
|
_entryData->_variable = GetWeakVariableByQString(text);
|
||||||
emit HeaderInfoChanged(
|
emit HeaderInfoChanged(
|
||||||
QString::fromStdString(_entryData->GetShortDesc()));
|
QString::fromStdString(_entryData->GetShortDesc()));
|
||||||
@@ -248,22 +244,13 @@ void MacroConditionVariableEdit::VariableChanged(const QString &text)
|
|||||||
|
|
||||||
void MacroConditionVariableEdit::Variable2Changed(const QString &text)
|
void MacroConditionVariableEdit::Variable2Changed(const QString &text)
|
||||||
{
|
{
|
||||||
|
GUARD_LOADING_AND_LOCK();
|
||||||
if (_loading || !_entryData) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_variable2 = GetWeakVariableByQString(text);
|
_entryData->_variable2 = GetWeakVariableByQString(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionVariableEdit::ConditionChanged(int value)
|
void MacroConditionVariableEdit::ConditionChanged(int value)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_type =
|
_entryData->_type =
|
||||||
static_cast<MacroConditionVariable::Condition>(value);
|
static_cast<MacroConditionVariable::Condition>(value);
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
@@ -271,11 +258,7 @@ void MacroConditionVariableEdit::ConditionChanged(int value)
|
|||||||
|
|
||||||
void MacroConditionVariableEdit::StrValueChanged()
|
void MacroConditionVariableEdit::StrValueChanged()
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_strValue = _strValue->toPlainText().toStdString();
|
_entryData->_strValue = _strValue->toPlainText().toStdString();
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@@ -283,21 +266,13 @@ void MacroConditionVariableEdit::StrValueChanged()
|
|||||||
|
|
||||||
void MacroConditionVariableEdit::NumValueChanged(double val)
|
void MacroConditionVariableEdit::NumValueChanged(double val)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_numValue = val;
|
_entryData->_numValue = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionVariableEdit::RegexChanged(const RegexConfig &conf)
|
void MacroConditionVariableEdit::RegexChanged(const RegexConfig &conf)
|
||||||
{
|
{
|
||||||
if (_loading || !_entryData) {
|
GUARD_LOADING_AND_LOCK();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto lock = LockContext();
|
|
||||||
_entryData->_regex = conf;
|
_entryData->_regex = conf;
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
|
|||||||
394
lib/macro/macro-dock-settings.cpp
Normal file
394
lib/macro/macro-dock-settings.cpp
Normal file
@@ -0,0 +1,394 @@
|
|||||||
|
#include "macro-dock-settings.hpp"
|
||||||
|
#include "macro-dock.hpp"
|
||||||
|
#include "macro-dock-window.hpp"
|
||||||
|
#include "macro.hpp"
|
||||||
|
#include "plugin-state-helpers.hpp"
|
||||||
|
|
||||||
|
#include <obs-frontend-api.h>
|
||||||
|
#include <util/platform.h>
|
||||||
|
|
||||||
|
#if LIBOBS_API_VER < MAKE_SEMANTIC_VERSION(30, 0, 0)
|
||||||
|
#include <QDockWidget>
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
struct DockMapEntry {
|
||||||
|
QAction *action = nullptr;
|
||||||
|
QWidget *dock = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
static std::unordered_map<const char *, DockMapEntry> dockIds;
|
||||||
|
static std::mutex dockMutex;
|
||||||
|
|
||||||
|
static bool obs_frontend_add_dock_by_id(const char *id, const char *title,
|
||||||
|
QWidget *widget)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(dockMutex);
|
||||||
|
if (dockIds.count(id) > 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
widget->setObjectName(id);
|
||||||
|
|
||||||
|
auto dock = new QDockWidget();
|
||||||
|
dock->setWindowTitle(title);
|
||||||
|
dock->setWidget(widget);
|
||||||
|
dock->setFloating(true);
|
||||||
|
dock->setVisible(false);
|
||||||
|
dock->setFeatures(QDockWidget::DockWidgetClosable |
|
||||||
|
QDockWidget::DockWidgetMovable |
|
||||||
|
QDockWidget::DockWidgetFloatable);
|
||||||
|
|
||||||
|
auto action = static_cast<QAction *>(obs_frontend_add_dock(dock));
|
||||||
|
if (!action) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
dockIds[id] = {action, dock};
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void obs_frontend_remove_dock(const char *id)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(dockMutex);
|
||||||
|
auto it = dockIds.find(id);
|
||||||
|
if (it == dockIds.end()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
it->second.action->deleteLater();
|
||||||
|
it->second.dock->deleteLater();
|
||||||
|
dockIds.erase(it);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
MacroDockSettings::MacroDockSettings(Macro *macro) : _macro(macro) {}
|
||||||
|
|
||||||
|
MacroDockSettings::~MacroDockSettings()
|
||||||
|
{
|
||||||
|
// Keep the dock widgets in case of shutdown so they can be restored by
|
||||||
|
// OBS on startup
|
||||||
|
if (!OBSIsShuttingDown()) {
|
||||||
|
RemoveDock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::Save(obs_data_t *obj, bool saveForCopy) const
|
||||||
|
{
|
||||||
|
OBSDataAutoRelease dockSettings = obs_data_create();
|
||||||
|
obs_data_set_bool(dockSettings, "register", _registerDock);
|
||||||
|
obs_data_set_bool(dockSettings, "standaloneDock", _standaloneDock);
|
||||||
|
obs_data_set_string(dockSettings, "dockWindow", _dockWindow.c_str());
|
||||||
|
obs_data_set_bool(dockSettings, "hasRunButton", _hasRunButton);
|
||||||
|
obs_data_set_bool(dockSettings, "hasPauseButton", _hasPauseButton);
|
||||||
|
obs_data_set_bool(dockSettings, "hasStatusLabel", _hasStatusLabel);
|
||||||
|
obs_data_set_bool(dockSettings, "highlightIfConditionsTrue",
|
||||||
|
_highlight);
|
||||||
|
_runButtonText.Save(dockSettings, "runButtonText");
|
||||||
|
_pauseButtonText.Save(dockSettings, "pauseButtonText");
|
||||||
|
_unpauseButtonText.Save(dockSettings, "unpauseButtonText");
|
||||||
|
_conditionsTrueStatusText.Save(dockSettings,
|
||||||
|
"conditionsTrueStatusText");
|
||||||
|
_conditionsFalseStatusText.Save(dockSettings,
|
||||||
|
"conditionsFalseStatusText");
|
||||||
|
if (saveForCopy) {
|
||||||
|
auto uuid = GenerateId();
|
||||||
|
obs_data_set_string(dockSettings, "dockId", uuid.c_str());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
obs_data_set_string(dockSettings, "dockId", _id.c_str());
|
||||||
|
}
|
||||||
|
obs_data_set_int(dockSettings, "version", 1);
|
||||||
|
obs_data_set_obj(obj, "dockSettings", dockSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::Load(obs_data_t *obj)
|
||||||
|
{
|
||||||
|
OBSDataAutoRelease dockSettings = obs_data_get_obj(obj, "dockSettings");
|
||||||
|
if (!dockSettings) {
|
||||||
|
// TODO: Remove this fallback
|
||||||
|
_hasRunButton = obs_data_get_bool(obj, "dockHasRunButton");
|
||||||
|
_hasPauseButton = obs_data_get_bool(obj, "dockHasPauseButton");
|
||||||
|
_registerDock = obs_data_get_bool(obj, "registerDock");
|
||||||
|
ResetDockIfEnabled();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_macroName = _macro->Name();
|
||||||
|
if (!obs_data_has_user_value(dockSettings, "version")) {
|
||||||
|
assert(_macro);
|
||||||
|
_id = std::string("ADVSS-") + _macroName;
|
||||||
|
} else {
|
||||||
|
_id = obs_data_get_string(dockSettings, "dockId");
|
||||||
|
}
|
||||||
|
|
||||||
|
_registerDock = obs_data_get_bool(dockSettings, "register");
|
||||||
|
|
||||||
|
// TODO: remove these default settings in a future version
|
||||||
|
obs_data_set_default_bool(dockSettings, "standaloneDock", true);
|
||||||
|
obs_data_set_default_string(dockSettings, "dockWindow", "Dock");
|
||||||
|
obs_data_set_default_string(
|
||||||
|
dockSettings, "runButtonText",
|
||||||
|
obs_module_text("AdvSceneSwitcher.macroDock.run"));
|
||||||
|
obs_data_set_default_string(
|
||||||
|
dockSettings, "pauseButtonText",
|
||||||
|
obs_module_text("AdvSceneSwitcher.macroDock.pause"));
|
||||||
|
obs_data_set_default_string(
|
||||||
|
dockSettings, "unpauseButtonText",
|
||||||
|
obs_module_text("AdvSceneSwitcher.macroDock.unpause"));
|
||||||
|
_standaloneDock = obs_data_get_bool(dockSettings, "standaloneDock");
|
||||||
|
_dockWindow = obs_data_get_string(dockSettings, "dockWindow");
|
||||||
|
_runButtonText.Load(dockSettings, "runButtonText");
|
||||||
|
_pauseButtonText.Load(dockSettings, "pauseButtonText");
|
||||||
|
_unpauseButtonText.Load(dockSettings, "unpauseButtonText");
|
||||||
|
_conditionsTrueStatusText.Load(dockSettings,
|
||||||
|
"conditionsTrueStatusText");
|
||||||
|
_conditionsFalseStatusText.Load(dockSettings,
|
||||||
|
"conditionsFalseStatusText");
|
||||||
|
if (_registerDock) {
|
||||||
|
_hasRunButton = obs_data_get_bool(dockSettings, "hasRunButton");
|
||||||
|
_hasPauseButton =
|
||||||
|
obs_data_get_bool(dockSettings, "hasPauseButton");
|
||||||
|
_hasStatusLabel =
|
||||||
|
obs_data_get_bool(dockSettings, "hasStatusLabel");
|
||||||
|
_highlight = obs_data_get_bool(dockSettings,
|
||||||
|
"highlightIfConditionsTrue");
|
||||||
|
}
|
||||||
|
|
||||||
|
ResetDockIfEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::EnableDock(bool enable)
|
||||||
|
{
|
||||||
|
// Only apply "on change" to avoid recreation of the dock widget
|
||||||
|
if (_registerDock == enable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RemoveDock();
|
||||||
|
|
||||||
|
if (!enable) {
|
||||||
|
_registerDock = enable;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(_macro);
|
||||||
|
_macroName = _macro->Name();
|
||||||
|
_dock = new MacroDock(GetWeakMacroByName(_macroName.c_str()),
|
||||||
|
_runButtonText, _pauseButtonText,
|
||||||
|
_unpauseButtonText, _conditionsTrueStatusText,
|
||||||
|
_conditionsFalseStatusText, _highlight);
|
||||||
|
|
||||||
|
if (!_standaloneDock) {
|
||||||
|
auto window = GetDockWindowByName(_dockWindow);
|
||||||
|
if (!window) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window->AddMacroDock(_dock, QString::fromStdString(_macroName));
|
||||||
|
_registerDock = enable;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!obs_frontend_add_dock_by_id(_id.c_str(), _macroName.c_str(),
|
||||||
|
_dock)) {
|
||||||
|
blog(LOG_INFO, "failed to add macro dock for macro %s",
|
||||||
|
_macroName.c_str());
|
||||||
|
_dock->deleteLater();
|
||||||
|
_dock = nullptr;
|
||||||
|
_registerDock = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_registerDock = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetIsStandaloneDock(bool value)
|
||||||
|
{
|
||||||
|
if (_standaloneDock == value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RemoveDock();
|
||||||
|
_standaloneDock = value;
|
||||||
|
ResetDockIfEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetDockWindowName(const std::string &name)
|
||||||
|
{
|
||||||
|
if (_dockWindow == name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RemoveDock();
|
||||||
|
_dockWindow = name;
|
||||||
|
ResetDockIfEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetHasRunButton(bool value)
|
||||||
|
{
|
||||||
|
_hasRunButton = value;
|
||||||
|
if (!_dock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dock->ShowRunButton(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetHasPauseButton(bool value)
|
||||||
|
{
|
||||||
|
_hasPauseButton = value;
|
||||||
|
if (!_dock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dock->ShowPauseButton(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetHasStatusLabel(bool value)
|
||||||
|
{
|
||||||
|
_hasStatusLabel = value;
|
||||||
|
if (!_dock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dock->ShowStatusLabel(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetHighlightEnable(bool value)
|
||||||
|
{
|
||||||
|
_highlight = value;
|
||||||
|
if (!_dock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dock->EnableHighlight(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetRunButtonText(const std::string &text)
|
||||||
|
{
|
||||||
|
_runButtonText = text;
|
||||||
|
if (!_dock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dock->SetRunButtonText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetPauseButtonText(const std::string &text)
|
||||||
|
{
|
||||||
|
_pauseButtonText = text;
|
||||||
|
if (!_dock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dock->SetPauseButtonText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetUnpauseButtonText(const std::string &text)
|
||||||
|
{
|
||||||
|
_unpauseButtonText = text;
|
||||||
|
if (!_dock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dock->SetUnpauseButtonText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetConditionsTrueStatusText(const std::string &text)
|
||||||
|
{
|
||||||
|
_conditionsTrueStatusText = text;
|
||||||
|
if (!_dock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dock->SetConditionsTrueText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
StringVariable MacroDockSettings::ConditionsTrueStatusText() const
|
||||||
|
{
|
||||||
|
return _conditionsTrueStatusText;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::SetConditionsFalseStatusText(const std::string &text)
|
||||||
|
{
|
||||||
|
_conditionsFalseStatusText = text;
|
||||||
|
if (!_dock) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dock->SetConditionsFalseText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
StringVariable MacroDockSettings::ConditionsFalseStatusText() const
|
||||||
|
{
|
||||||
|
return _conditionsFalseStatusText;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::HandleMacroNameChange()
|
||||||
|
{
|
||||||
|
const auto newName = _macro->Name();
|
||||||
|
|
||||||
|
if (!_standaloneDock) {
|
||||||
|
auto window = GetDockWindowByName(_dockWindow);
|
||||||
|
if (!window) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window->RenameMacro(_macroName, newName);
|
||||||
|
_macroName = newName;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_macroName != newName) {
|
||||||
|
RemoveDock();
|
||||||
|
_id = GenerateId();
|
||||||
|
_macroName = newName;
|
||||||
|
}
|
||||||
|
|
||||||
|
ResetDockIfEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::ResetDockIfEnabled()
|
||||||
|
{
|
||||||
|
if (_registerDock) {
|
||||||
|
_registerDock = false;
|
||||||
|
EnableDock(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockSettings::RemoveDock()
|
||||||
|
{
|
||||||
|
if (_standaloneDock) {
|
||||||
|
obs_frontend_remove_dock(_id.c_str());
|
||||||
|
_dock = nullptr;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto window = GetDockWindowByName(_dockWindow);
|
||||||
|
if (window) {
|
||||||
|
window->RemoveMacroDock(_dock);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_dock) {
|
||||||
|
_dock = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string MacroDockSettings::GenerateId()
|
||||||
|
{
|
||||||
|
#if LIBOBS_API_VER > MAKE_SEMANTIC_VERSION(30, 0, 0)
|
||||||
|
auto uuid = os_generate_uuid();
|
||||||
|
auto id = std::string("advss-macro-dock-") + std::string(uuid);
|
||||||
|
bfree(uuid);
|
||||||
|
return id;
|
||||||
|
|
||||||
|
#else
|
||||||
|
static std::atomic_int16_t idCounter = 0;
|
||||||
|
return std::to_string(++idCounter);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
76
lib/macro/macro-dock-settings.hpp
Normal file
76
lib/macro/macro-dock-settings.hpp
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "obs-module-helper.hpp"
|
||||||
|
#include "variable-string.hpp"
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
class Macro;
|
||||||
|
class MacroDock;
|
||||||
|
|
||||||
|
class MacroDockSettings {
|
||||||
|
public:
|
||||||
|
MacroDockSettings(Macro *macro);
|
||||||
|
~MacroDockSettings();
|
||||||
|
|
||||||
|
void Save(obs_data_t *obj, bool saveForCopy) const;
|
||||||
|
void Load(obs_data_t *obj);
|
||||||
|
|
||||||
|
void EnableDock(bool);
|
||||||
|
bool DockEnabled() const { return _registerDock; }
|
||||||
|
|
||||||
|
bool IsStandaloneDock() const { return _standaloneDock; }
|
||||||
|
void SetIsStandaloneDock(bool value);
|
||||||
|
std::string DockWindowName() const { return _dockWindow; }
|
||||||
|
void SetDockWindowName(const std::string &name);
|
||||||
|
|
||||||
|
void SetHasRunButton(bool value);
|
||||||
|
bool HasRunButton() const { return _hasRunButton; }
|
||||||
|
void SetHasPauseButton(bool value);
|
||||||
|
bool HasPauseButton() const { return _hasPauseButton; }
|
||||||
|
void SetHasStatusLabel(bool value);
|
||||||
|
bool HasStatusLabel() const { return _hasStatusLabel; }
|
||||||
|
void SetHighlightEnable(bool value);
|
||||||
|
bool HighlightEnabled() const { return _highlight; }
|
||||||
|
StringVariable RunButtonText() const { return _runButtonText; }
|
||||||
|
void SetRunButtonText(const std::string &text);
|
||||||
|
StringVariable PauseButtonText() const { return _pauseButtonText; }
|
||||||
|
void SetPauseButtonText(const std::string &text);
|
||||||
|
StringVariable UnpauseButtonText() const { return _unpauseButtonText; }
|
||||||
|
void SetUnpauseButtonText(const std::string &text);
|
||||||
|
void SetConditionsTrueStatusText(const std::string &text);
|
||||||
|
StringVariable ConditionsTrueStatusText() const;
|
||||||
|
void SetConditionsFalseStatusText(const std::string &text);
|
||||||
|
StringVariable ConditionsFalseStatusText() const;
|
||||||
|
|
||||||
|
void HandleMacroNameChange();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void ResetDockIfEnabled();
|
||||||
|
void RemoveDock();
|
||||||
|
static std::string GenerateId();
|
||||||
|
|
||||||
|
bool _registerDock = false;
|
||||||
|
bool _standaloneDock = true;
|
||||||
|
std::string _dockWindow = "Dock";
|
||||||
|
bool _hasRunButton = true;
|
||||||
|
bool _hasPauseButton = true;
|
||||||
|
bool _hasStatusLabel = false;
|
||||||
|
bool _highlight = false;
|
||||||
|
StringVariable _runButtonText =
|
||||||
|
obs_module_text("AdvSceneSwitcher.macroDock.run");
|
||||||
|
StringVariable _pauseButtonText =
|
||||||
|
obs_module_text("AdvSceneSwitcher.macroDock.pause");
|
||||||
|
StringVariable _unpauseButtonText =
|
||||||
|
obs_module_text("AdvSceneSwitcher.macroDock.unpause");
|
||||||
|
StringVariable _conditionsTrueStatusText =
|
||||||
|
obs_module_text("AdvSceneSwitcher.macroDock.statusLabel.true");
|
||||||
|
StringVariable _conditionsFalseStatusText =
|
||||||
|
obs_module_text("AdvSceneSwitcher.macroDock.statusLabel.false");
|
||||||
|
std::string _id = GenerateId();
|
||||||
|
std::string _macroName = "";
|
||||||
|
|
||||||
|
Macro *_macro = nullptr;
|
||||||
|
MacroDock *_dock = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
170
lib/macro/macro-dock-window.cpp
Normal file
170
lib/macro/macro-dock-window.cpp
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
#include "macro-dock-window.hpp"
|
||||||
|
#include "log-helper.hpp"
|
||||||
|
#include "plugin-state-helpers.hpp"
|
||||||
|
|
||||||
|
#include <obs-frontend-api.h>
|
||||||
|
|
||||||
|
#include <QDockWidget>
|
||||||
|
#include <QLayout>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
static std::unordered_map<std::string, MacroDockWindow *> windows;
|
||||||
|
static std::unordered_map<std::string, QByteArray> windowGeometries;
|
||||||
|
static std::mutex mutex;
|
||||||
|
|
||||||
|
static void saveDocks(obs_data_t *obj)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
OBSDataAutoRelease data = obs_data_create();
|
||||||
|
OBSDataArrayAutoRelease array = obs_data_array_create();
|
||||||
|
for (const auto &[name, window] : windows) {
|
||||||
|
OBSDataAutoRelease dockData = obs_data_create();
|
||||||
|
obs_data_set_string(dockData, "name", name.c_str());
|
||||||
|
obs_data_set_string(dockData, "geometry",
|
||||||
|
window->GetWindow()
|
||||||
|
->saveState()
|
||||||
|
.toBase64()
|
||||||
|
.toStdString()
|
||||||
|
.c_str());
|
||||||
|
obs_data_array_push_back(array, dockData);
|
||||||
|
}
|
||||||
|
obs_data_set_array(data, "docks", array);
|
||||||
|
obs_data_set_obj(obj, "dockWindows", data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void restoreDockGeometry()
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
for (const auto &[name, dock] : windows) {
|
||||||
|
const auto it = windowGeometries.find(name);
|
||||||
|
if (it == windowGeometries.end()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
dock->GetWindow()->restoreState(it->second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void loadDocks(obs_data_t *obj)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
windowGeometries.clear();
|
||||||
|
OBSDataAutoRelease data = obs_data_get_obj(obj, "dockWindows");
|
||||||
|
OBSDataArrayAutoRelease array = obs_data_get_array(data, "docks");
|
||||||
|
auto size = obs_data_array_count(array);
|
||||||
|
for (size_t i = 0; i < size; ++i) {
|
||||||
|
OBSDataAutoRelease dockData = obs_data_array_item(array, i);
|
||||||
|
const auto name = obs_data_get_string(dockData, "name");
|
||||||
|
const auto geometry = QByteArray::fromBase64(
|
||||||
|
obs_data_get_string(dockData, "geometry"));
|
||||||
|
windowGeometries[name] = geometry;
|
||||||
|
}
|
||||||
|
AddPostLoadStep(restoreDockGeometry);
|
||||||
|
}
|
||||||
|
|
||||||
|
[[maybe_unused]] static bool _ = []() {
|
||||||
|
AddPluginInitStep([]() {
|
||||||
|
AddSaveStep(saveDocks);
|
||||||
|
AddLoadStep(loadDocks);
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}();
|
||||||
|
|
||||||
|
MacroDockWindow::MacroDockWindow(const std::string &name)
|
||||||
|
: QFrame(),
|
||||||
|
_name(name),
|
||||||
|
_window(new QMainWindow())
|
||||||
|
{
|
||||||
|
setFrameShape(QFrame::StyledPanel);
|
||||||
|
setFrameShadow(QFrame::Sunken);
|
||||||
|
_window->setDockNestingEnabled(true);
|
||||||
|
auto layout = new QVBoxLayout;
|
||||||
|
layout->addWidget(_window);
|
||||||
|
setLayout(layout);
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget *MacroDockWindow::AddMacroDock(QWidget *widget, const QString &title)
|
||||||
|
{
|
||||||
|
auto dock = new QDockWidget();
|
||||||
|
dock->setWindowTitle(title);
|
||||||
|
dock->setWidget(widget);
|
||||||
|
dock->setVisible(true);
|
||||||
|
dock->setFeatures(QDockWidget::DockWidgetMovable);
|
||||||
|
dock->setObjectName(title);
|
||||||
|
_window->addDockWidget(Qt::RightDockWidgetArea, dock);
|
||||||
|
return dock;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockWindow::RenameMacro(const std::string &oldName,
|
||||||
|
const std::string &newName)
|
||||||
|
{
|
||||||
|
auto docks = _window->findChildren<QDockWidget *>();
|
||||||
|
for (const auto dock : docks) {
|
||||||
|
if (dock->windowTitle() == QString::fromStdString(oldName)) {
|
||||||
|
dock->setWindowTitle(QString::fromStdString(newName));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroDockWindow::RemoveMacroDock(QWidget *widget)
|
||||||
|
{
|
||||||
|
bool removedDock = false;
|
||||||
|
auto docks = _window->findChildren<QDockWidget *>();
|
||||||
|
for (const auto dock : docks) {
|
||||||
|
if (dock->widget() == widget) {
|
||||||
|
_window->removeDockWidget(dock);
|
||||||
|
dock->deleteLater();
|
||||||
|
removedDock = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OBSIsShuttingDown()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool shouldRemoveDockWindow = docks.isEmpty() ||
|
||||||
|
(removedDock && docks.count() == 1);
|
||||||
|
if (!shouldRemoveDockWindow) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
auto it = windows.find(_name);
|
||||||
|
if (it != windows.end()) {
|
||||||
|
windows.erase(it);
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto id = "advss-dock-window-" + _name;
|
||||||
|
obs_frontend_remove_dock(id.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
QMainWindow *MacroDockWindow::GetWindow() const
|
||||||
|
{
|
||||||
|
return _window;
|
||||||
|
}
|
||||||
|
|
||||||
|
MacroDockWindow *GetDockWindowByName(const std::string &name)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
auto it = windows.find(name);
|
||||||
|
if (it != windows.end()) {
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto window = new MacroDockWindow(name);
|
||||||
|
const auto id = "advss-dock-window-" + name;
|
||||||
|
if (!obs_frontend_add_dock_by_id(id.c_str(), name.c_str(), window)) {
|
||||||
|
blog(LOG_INFO, "failed to add macro dock window '%s'",
|
||||||
|
id.c_str());
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
windows[name] = window;
|
||||||
|
return window;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
29
lib/macro/macro-dock-window.hpp
Normal file
29
lib/macro/macro-dock-window.hpp
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <QFrame>
|
||||||
|
#include <QMainWindow>
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
class MacroDockWindow : public QFrame {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
MacroDockWindow(const std::string &name);
|
||||||
|
QWidget *AddMacroDock(QWidget *, const QString &title);
|
||||||
|
void RenameMacro(const std::string &oldName,
|
||||||
|
const std::string &newName);
|
||||||
|
void RemoveMacroDock(QWidget *);
|
||||||
|
QMainWindow *GetWindow() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string _name;
|
||||||
|
QMainWindow *_window;
|
||||||
|
};
|
||||||
|
|
||||||
|
MacroDockWindow *GetDockWindowByName(const std::string &name);
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
@@ -30,9 +30,10 @@ MacroDock::MacroDock(std::weak_ptr<Macro> m,
|
|||||||
|
|
||||||
auto macro = _macro.lock();
|
auto macro = _macro.lock();
|
||||||
if (macro) {
|
if (macro) {
|
||||||
_run->setVisible(macro->DockHasRunButton());
|
const auto &settings = macro->GetDockSettings();
|
||||||
_pauseToggle->setVisible(macro->DockHasPauseButton());
|
_run->setVisible(settings.HasRunButton());
|
||||||
_statusText->setVisible(macro->DockHasStatusLabel());
|
_pauseToggle->setVisible(settings.HasPauseButton());
|
||||||
|
_statusText->setVisible(settings.HasStatusLabel());
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget::connect(_run, SIGNAL(clicked()), this, SLOT(RunClicked()));
|
QWidget::connect(_run, SIGNAL(clicked()), this, SLOT(RunClicked()));
|
||||||
@@ -109,7 +110,7 @@ void MacroDock::RunClicked()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ret = macro->PerformActions(true);
|
auto ret = macro->PerformActions(true, true, true);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
QString err =
|
QString err =
|
||||||
obs_module_text("AdvSceneSwitcher.macroTab.runFail");
|
obs_module_text("AdvSceneSwitcher.macroTab.runFail");
|
||||||
|
|||||||
1838
lib/macro/macro-edit.cpp
Normal file
1838
lib/macro/macro-edit.cpp
Normal file
File diff suppressed because it is too large
Load Diff
144
lib/macro/macro-edit.hpp
Normal file
144
lib/macro/macro-edit.hpp
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "condition-logic.hpp"
|
||||||
|
|
||||||
|
#include <ui_macro-edit.h>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
class Macro;
|
||||||
|
class MacroSegment;
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Advanced Scene Switcher window
|
||||||
|
*******************************************************************************/
|
||||||
|
class MacroEdit : public QWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
MacroEdit(QWidget *parent, QStringList helpMsg = {});
|
||||||
|
void SetMacro(const std::shared_ptr<Macro> &);
|
||||||
|
std::shared_ptr<Macro> GetMacro() const;
|
||||||
|
void ClearSegmentWidgetCacheFor(Macro *) const;
|
||||||
|
void SetControlsDisabled(bool disable) const;
|
||||||
|
void HighlightAction(int idx, QColor color = QColor(Qt::green)) const;
|
||||||
|
void HighlightElseAction(int idx,
|
||||||
|
QColor color = QColor(Qt::green)) const;
|
||||||
|
void HighlightCondition(int idx,
|
||||||
|
QColor color = QColor(Qt::green)) const;
|
||||||
|
void ResetConditionHighlights();
|
||||||
|
void ResetActionHighlights();
|
||||||
|
void SetActionData(Macro &m) const;
|
||||||
|
void SetElseActionData(Macro &m) const;
|
||||||
|
void SetConditionData(Macro &m) const;
|
||||||
|
void SwapActions(Macro *m, int pos1, int pos2);
|
||||||
|
void SwapElseActions(Macro *m, int pos1, int pos2);
|
||||||
|
void SwapConditions(Macro *m, int pos1, int pos2);
|
||||||
|
void CopyMacroSegment();
|
||||||
|
void PasteMacroSegment();
|
||||||
|
bool IsEmpty() const;
|
||||||
|
void ShowAllMacroSections();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_conditionAdd_clicked();
|
||||||
|
void on_conditionRemove_clicked();
|
||||||
|
void on_conditionTop_clicked();
|
||||||
|
void on_conditionUp_clicked();
|
||||||
|
void on_conditionDown_clicked();
|
||||||
|
void on_conditionBottom_clicked();
|
||||||
|
void on_actionAdd_clicked();
|
||||||
|
void on_actionRemove_clicked();
|
||||||
|
void on_actionTop_clicked();
|
||||||
|
void on_actionUp_clicked();
|
||||||
|
void on_actionDown_clicked();
|
||||||
|
void on_actionBottom_clicked();
|
||||||
|
void on_toggleElseActions_clicked() const;
|
||||||
|
void on_elseActionAdd_clicked();
|
||||||
|
void on_elseActionRemove_clicked();
|
||||||
|
void on_elseActionTop_clicked();
|
||||||
|
void on_elseActionUp_clicked();
|
||||||
|
void on_elseActionDown_clicked();
|
||||||
|
void on_elseActionBottom_clicked();
|
||||||
|
void UpMacroSegmentHotkey();
|
||||||
|
void DownMacroSegmentHotkey();
|
||||||
|
void DeleteMacroSegmentHotkey();
|
||||||
|
void ShowMacroActionsContextMenu(const QPoint &);
|
||||||
|
void ShowMacroElseActionsContextMenu(const QPoint &);
|
||||||
|
void ShowMacroConditionsContextMenu(const QPoint &);
|
||||||
|
void ExpandAllActions() const;
|
||||||
|
void ExpandAllElseActions() const;
|
||||||
|
void ExpandAllConditions() const;
|
||||||
|
void CollapseAllActions() const;
|
||||||
|
void CollapseAllElseActions() const;
|
||||||
|
void CollapseAllConditions() const;
|
||||||
|
void MinimizeActions() const;
|
||||||
|
void MaximizeActions() const;
|
||||||
|
void MinimizeElseActions() const;
|
||||||
|
void MaximizeElseActions() const;
|
||||||
|
void MinimizeConditions() const;
|
||||||
|
void MaximizeConditions() const;
|
||||||
|
void SetElseActionsStateToHidden() const;
|
||||||
|
void SetElseActionsStateToVisible() const;
|
||||||
|
void MacroActionSelectionChanged(int idx);
|
||||||
|
void MacroActionReorder(int to, int target);
|
||||||
|
void AddMacroAction(Macro *macro, int idx, const std::string &id,
|
||||||
|
obs_data_t *data);
|
||||||
|
void AddMacroAction(int idx);
|
||||||
|
void RemoveMacroAction(int idx);
|
||||||
|
void MoveMacroActionUp(int idx);
|
||||||
|
void MoveMacroActionDown(int idx);
|
||||||
|
void MacroElseActionSelectionChanged(int idx);
|
||||||
|
void MacroElseActionReorder(int to, int target);
|
||||||
|
void AddMacroElseAction(Macro *macro, int idx, const std::string &id,
|
||||||
|
obs_data_t *data);
|
||||||
|
void AddMacroElseAction(int idx);
|
||||||
|
void RemoveMacroElseAction(int idx);
|
||||||
|
void MoveMacroElseActionUp(int idx);
|
||||||
|
void MoveMacroElseActionDown(int idx);
|
||||||
|
void MacroConditionSelectionChanged(int idx);
|
||||||
|
void MacroConditionReorder(int to, int target);
|
||||||
|
void AddMacroCondition(int idx);
|
||||||
|
void AddMacroCondition(Macro *macro, int idx, const std::string &id,
|
||||||
|
obs_data_t *data, Logic::Type logic);
|
||||||
|
void RemoveMacroCondition(int idx);
|
||||||
|
void MoveMacroConditionUp(int idx);
|
||||||
|
void MoveMacroConditionDown(int idx);
|
||||||
|
void HighlightControls() const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void MacroAdded(const QString &name);
|
||||||
|
void MacroRemoved(const QString &name);
|
||||||
|
void MacroRenamed(const QString &oldName, const QString &newName);
|
||||||
|
void MacroSegmentOrderChanged();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
enum class MacroSection { CONDITIONS, ACTIONS, ELSE_ACTIONS };
|
||||||
|
|
||||||
|
void PopulateMacroActions(Macro &m, uint32_t afterIdx = 0);
|
||||||
|
void PopulateMacroElseActions(Macro &m, uint32_t afterIdx = 0);
|
||||||
|
void PopulateMacroConditions(Macro &m, uint32_t afterIdx = 0);
|
||||||
|
void SetupMacroSegmentSelection(MacroSection type, int idx);
|
||||||
|
void
|
||||||
|
SetupContextMenu(const QPoint &pos,
|
||||||
|
const std::function<void(MacroEdit *, int)> &remove,
|
||||||
|
const std::function<void(MacroEdit *)> &expand,
|
||||||
|
const std::function<void(MacroEdit *)> &collapse,
|
||||||
|
const std::function<void(MacroEdit *)> &maximize,
|
||||||
|
const std::function<void(MacroEdit *)> &minimize,
|
||||||
|
MacroSegmentList *list);
|
||||||
|
void RunSegmentHighlightChecks();
|
||||||
|
bool ElseSectionIsVisible() const;
|
||||||
|
|
||||||
|
MacroSection lastInteracted = MacroSection::CONDITIONS;
|
||||||
|
int currentConditionIdx = -1;
|
||||||
|
int currentActionIdx = -1;
|
||||||
|
int currentElseActionIdx = -1;
|
||||||
|
|
||||||
|
std::shared_ptr<Macro> _currentMacro;
|
||||||
|
|
||||||
|
std::unique_ptr<Ui_MacroEdit> ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "macro-helpers.hpp"
|
#include "macro-helpers.hpp"
|
||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
|
#include "macro-action-macro.hpp"
|
||||||
#include "plugin-state-helpers.hpp"
|
#include "plugin-state-helpers.hpp"
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
@@ -8,6 +9,87 @@ static std::atomic_bool abortMacroWait = {false};
|
|||||||
static std::atomic_bool macroSceneSwitched = {false};
|
static std::atomic_bool macroSceneSwitched = {false};
|
||||||
static std::atomic_int shutdownConditionCount = {0};
|
static std::atomic_int shutdownConditionCount = {0};
|
||||||
|
|
||||||
|
static void appendNestedMacros(std::deque<std::shared_ptr<Macro>> ¯os,
|
||||||
|
Macro *macro)
|
||||||
|
{
|
||||||
|
if (!macro) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto iterate = [¯os](const std::deque<
|
||||||
|
std::shared_ptr<MacroAction>> &actions) {
|
||||||
|
for (const auto &action : actions) {
|
||||||
|
const auto nestedMacroAction =
|
||||||
|
dynamic_cast<MacroActionMacro *>(action.get());
|
||||||
|
if (!nestedMacroAction) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
macros.push_back(nestedMacroAction->_nestedMacro);
|
||||||
|
appendNestedMacros(
|
||||||
|
macros, nestedMacroAction->_nestedMacro.get());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
iterate(macro->Actions());
|
||||||
|
iterate(macro->ElseActions());
|
||||||
|
}
|
||||||
|
|
||||||
|
std::deque<std::shared_ptr<Macro>> &GetTopLevelMacros()
|
||||||
|
{
|
||||||
|
static std::deque<std::shared_ptr<Macro>> macros;
|
||||||
|
return macros;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::deque<std::shared_ptr<Macro>> &GetTemporaryMacros()
|
||||||
|
{
|
||||||
|
static std::deque<std::shared_ptr<Macro>> tempMacros;
|
||||||
|
return tempMacros;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::deque<std::shared_ptr<Macro>> GetAllMacros()
|
||||||
|
{
|
||||||
|
auto macros = GetTopLevelMacros();
|
||||||
|
for (const auto &topLevelMacro : macros) {
|
||||||
|
appendNestedMacros(macros, topLevelMacro.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto &tempMacros = GetTemporaryMacros();
|
||||||
|
macros.insert(macros.end(), tempMacros.begin(), tempMacros.end());
|
||||||
|
for (const auto &tempMacro : tempMacros) {
|
||||||
|
appendNestedMacros(macros, tempMacro.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
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>>>
|
std::optional<std::deque<std::shared_ptr<MacroAction>>>
|
||||||
GetMacroActions(Macro *macro)
|
GetMacroActions(Macro *macro)
|
||||||
{
|
{
|
||||||
@@ -17,6 +99,15 @@ GetMacroActions(Macro *macro)
|
|||||||
return macro->Actions();
|
return macro->Actions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<std::deque<std::shared_ptr<MacroAction>>>
|
||||||
|
GetMacroElseActions(Macro *macro)
|
||||||
|
{
|
||||||
|
if (!macro) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return macro->ElseActions();
|
||||||
|
}
|
||||||
|
|
||||||
std::optional<std::deque<std::shared_ptr<MacroCondition>>>
|
std::optional<std::deque<std::shared_ptr<MacroCondition>>>
|
||||||
GetMacroConditions(Macro *macro)
|
GetMacroConditions(Macro *macro)
|
||||||
{
|
{
|
||||||
@@ -78,36 +169,36 @@ bool MacroSwitchedScene()
|
|||||||
return macroSceneSwitched;
|
return macroSceneSwitched;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetMacroName(Macro *macro)
|
std::string GetMacroName(const Macro *macro)
|
||||||
{
|
{
|
||||||
return macro ? macro->Name() : "";
|
return macro ? macro->Name() : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::chrono::high_resolution_clock::time_point
|
std::chrono::high_resolution_clock::time_point
|
||||||
LastMacroConditionCheckTime(Macro *macro)
|
LastMacroConditionCheckTime(const Macro *macro)
|
||||||
{
|
{
|
||||||
return macro ? macro->LastConditionCheckTime()
|
return macro ? macro->LastConditionCheckTime()
|
||||||
: std::chrono::high_resolution_clock::time_point{};
|
: std::chrono::high_resolution_clock::time_point{};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroIsStopped(Macro *macro)
|
bool MacroIsStopped(const Macro *macro)
|
||||||
{
|
{
|
||||||
return macro ? macro->GetStop() : true;
|
return macro ? macro->GetStop() : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroIsPaused(Macro *macro)
|
bool MacroIsPaused(const Macro *macro)
|
||||||
{
|
{
|
||||||
return macro ? macro->Paused() : true;
|
return macro ? macro->Paused() : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroWasPausedSince(
|
bool MacroWasPausedSince(
|
||||||
Macro *macro,
|
const Macro *macro,
|
||||||
const std::chrono::high_resolution_clock::time_point &time)
|
const std::chrono::high_resolution_clock::time_point &time)
|
||||||
{
|
{
|
||||||
return macro ? macro->WasPausedSince(time) : false;
|
return macro ? macro->WasPausedSince(time) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroWasCheckedSinceLastStart(Macro *macro)
|
bool MacroWasCheckedSinceLastStart(const Macro *macro)
|
||||||
{
|
{
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
return false;
|
return false;
|
||||||
@@ -144,20 +235,42 @@ void ResetMacroRunCount(Macro *macro)
|
|||||||
macro->ResetRunCount();
|
macro->ResetRunCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsValidMacroSegmentIndex(Macro *m, const int idx, bool isCondition)
|
bool IsValidActionIndex(const Macro *m, const int idx)
|
||||||
{
|
{
|
||||||
if (!m || idx < 0) {
|
if (!m || idx < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (isCondition) {
|
|
||||||
if (idx >= (int)m->Conditions().size()) {
|
if (idx >= (int)m->Actions().size()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (idx >= (int)m->Actions().size()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsValidElseActionIndex(const Macro *m, const int idx)
|
||||||
|
{
|
||||||
|
if (!m || idx < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (idx >= (int)m->ElseActions().size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsValidConditionIndex(const Macro *m, const int idx)
|
||||||
|
{
|
||||||
|
if (!m || idx < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (idx >= (int)m->Conditions().size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "export-symbol-helper.hpp"
|
#include "export-symbol-helper.hpp"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
@@ -18,10 +20,18 @@ class Macro;
|
|||||||
class MacroAction;
|
class MacroAction;
|
||||||
class MacroCondition;
|
class MacroCondition;
|
||||||
|
|
||||||
EXPORT std::deque<std::shared_ptr<Macro>> &GetMacros();
|
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>>>
|
EXPORT std::optional<std::deque<std::shared_ptr<MacroAction>>>
|
||||||
GetMacroActions(Macro *);
|
GetMacroActions(Macro *);
|
||||||
|
EXPORT std::optional<std::deque<std::shared_ptr<MacroAction>>>
|
||||||
|
GetMacroElseActions(Macro *);
|
||||||
EXPORT std::optional<std::deque<std::shared_ptr<MacroCondition>>>
|
EXPORT std::optional<std::deque<std::shared_ptr<MacroCondition>>>
|
||||||
GetMacroConditions(Macro *);
|
GetMacroConditions(Macro *);
|
||||||
|
|
||||||
@@ -41,17 +51,17 @@ EXPORT std::atomic_int &GetShutdownConditionCount();
|
|||||||
EXPORT void SetMacroSwitchedScene(bool value);
|
EXPORT void SetMacroSwitchedScene(bool value);
|
||||||
EXPORT bool MacroSwitchedScene();
|
EXPORT bool MacroSwitchedScene();
|
||||||
|
|
||||||
EXPORT std::string GetMacroName(Macro *);
|
EXPORT std::string GetMacroName(const Macro *);
|
||||||
|
|
||||||
EXPORT std::chrono::high_resolution_clock::time_point
|
EXPORT std::chrono::high_resolution_clock::time_point
|
||||||
LastMacroConditionCheckTime(Macro *);
|
LastMacroConditionCheckTime(const Macro *);
|
||||||
|
|
||||||
EXPORT bool MacroIsStopped(Macro *);
|
EXPORT bool MacroIsStopped(const Macro *);
|
||||||
EXPORT bool MacroIsPaused(Macro *);
|
EXPORT bool MacroIsPaused(const Macro *);
|
||||||
EXPORT bool
|
EXPORT bool
|
||||||
MacroWasPausedSince(Macro *,
|
MacroWasPausedSince(const Macro *,
|
||||||
const std::chrono::high_resolution_clock::time_point &);
|
const std::chrono::high_resolution_clock::time_point &);
|
||||||
EXPORT bool MacroWasCheckedSinceLastStart(Macro *);
|
EXPORT bool MacroWasCheckedSinceLastStart(const Macro *);
|
||||||
|
|
||||||
EXPORT void AddMacroHelperThread(Macro *, std::thread &&);
|
EXPORT void AddMacroHelperThread(Macro *, std::thread &&);
|
||||||
|
|
||||||
@@ -68,6 +78,8 @@ EXPORT void InvalidateMacroTempVarValues();
|
|||||||
EXPORT void ResetMacroConditionTimers(Macro *);
|
EXPORT void ResetMacroConditionTimers(Macro *);
|
||||||
EXPORT void ResetMacroRunCount(Macro *);
|
EXPORT void ResetMacroRunCount(Macro *);
|
||||||
|
|
||||||
bool IsValidMacroSegmentIndex(Macro *m, const int idx, bool isCondition);
|
bool IsValidActionIndex(const Macro *m, const int idx);
|
||||||
|
bool IsValidElseActionIndex(const Macro *m, const int idx);
|
||||||
|
bool IsValidConditionIndex(const Macro *m, const int idx);
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "macro-list.hpp"
|
#include "macro-list.hpp"
|
||||||
#include "macro-helpers.hpp"
|
#include "macro-helpers.hpp"
|
||||||
#include "macro-selection.hpp"
|
#include "macro-selection.hpp"
|
||||||
|
#include "macro-signals.hpp"
|
||||||
#include "obs-module-helper.hpp"
|
#include "obs-module-helper.hpp"
|
||||||
#include "ui-helpers.hpp"
|
#include "ui-helpers.hpp"
|
||||||
|
|
||||||
@@ -10,11 +11,11 @@ MacroList::MacroList(QWidget *parent, bool allowDuplicates, bool reorder)
|
|||||||
: ListEditor(parent, reorder),
|
: ListEditor(parent, reorder),
|
||||||
_allowDuplicates(allowDuplicates)
|
_allowDuplicates(allowDuplicates)
|
||||||
{
|
{
|
||||||
QWidget::connect(window(),
|
QWidget::connect(MacroSignalManager::Instance(),
|
||||||
SIGNAL(MacroRenamed(const QString &, const QString &)),
|
SIGNAL(Rename(const QString &, const QString &)), this,
|
||||||
this,
|
|
||||||
SLOT(MacroRename(const QString &, const QString &)));
|
SLOT(MacroRename(const QString &, const QString &)));
|
||||||
QWidget::connect(window(), SIGNAL(MacroRemoved(const QString &)), this,
|
QWidget::connect(MacroSignalManager::Instance(),
|
||||||
|
SIGNAL(Remove(const QString &)), this,
|
||||||
SLOT(MacroRemove(const QString &)));
|
SLOT(MacroRemove(const QString &)));
|
||||||
UpdateListSize();
|
UpdateListSize();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,14 @@ namespace advss {
|
|||||||
MacroRunButton::MacroRunButton(QWidget *parent) : QPushButton(parent)
|
MacroRunButton::MacroRunButton(QWidget *parent) : QPushButton(parent)
|
||||||
{
|
{
|
||||||
installEventFilter(this);
|
installEventFilter(this);
|
||||||
auto parentWindow = window();
|
|
||||||
if (parentWindow) {
|
// GetSettingsWindow() might still return null while this constructor is called
|
||||||
parentWindow->installEventFilter(this);
|
QTimer::singleShot(0, this, [this]() {
|
||||||
}
|
auto parentWindow = GetSettingsWindow();
|
||||||
|
if (parentWindow) {
|
||||||
|
parentWindow->installEventFilter(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
setToolTip(obs_module_text("AdvSceneSwitcher.macroTab.run.tooltip"));
|
setToolTip(obs_module_text("AdvSceneSwitcher.macroTab.run.tooltip"));
|
||||||
|
|
||||||
|
|||||||
336
lib/macro/macro-search.cpp
Normal file
336
lib/macro/macro-search.cpp
Normal file
@@ -0,0 +1,336 @@
|
|||||||
|
#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()) {
|
||||||
|
std::vector<std::shared_ptr<Macro>> subItems;
|
||||||
|
subItems.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++) {
|
||||||
|
subItems.emplace_back(*std::next(it, i));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto &item : subItems) {
|
||||||
|
if (MacroMatchesSearchFilter(item.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
|
||||||
@@ -13,7 +13,7 @@ struct MacroSegmentCopyInfo {
|
|||||||
};
|
};
|
||||||
static MacroSegmentCopyInfo copyInfo;
|
static MacroSegmentCopyInfo copyInfo;
|
||||||
|
|
||||||
void AdvSceneSwitcher::CopyMacroSegment()
|
void MacroEdit::CopyMacroSegment()
|
||||||
{
|
{
|
||||||
copyInfo.segment.reset();
|
copyInfo.segment.reset();
|
||||||
copyInfo.type = MacroSegmentCopyInfo::Type::NONE;
|
copyInfo.type = MacroSegmentCopyInfo::Type::NONE;
|
||||||
@@ -23,7 +23,7 @@ void AdvSceneSwitcher::CopyMacroSegment()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto macro = GetSelectedMacro();
|
auto macro = _currentMacro;
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -43,13 +43,13 @@ void AdvSceneSwitcher::CopyMacroSegment()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::PasteMacroSegment()
|
void MacroEdit::PasteMacroSegment()
|
||||||
{
|
{
|
||||||
if (copyInfo.type == MacroSegmentCopyInfo::Type::NONE) {
|
if (copyInfo.type == MacroSegmentCopyInfo::Type::NONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto macro = GetSelectedMacro();
|
auto macro = _currentMacro;
|
||||||
if (!macro || !copyInfo.segment) {
|
if (!macro || !copyInfo.segment) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -113,14 +113,14 @@ void SetCopySegmentTargetActionType(bool setToElseAction)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupSegmentCopyPasteShortcutHandlers(AdvSceneSwitcher *window)
|
void SetupSegmentCopyPasteShortcutHandlers(MacroEdit *edit)
|
||||||
{
|
{
|
||||||
auto copyShortcut = new QShortcut(QKeySequence("Ctrl+C"), window);
|
auto copyShortcut = new QShortcut(QKeySequence("Ctrl+C"), edit);
|
||||||
QWidget::connect(copyShortcut, &QShortcut::activated, window,
|
QWidget::connect(copyShortcut, &QShortcut::activated, edit,
|
||||||
&AdvSceneSwitcher::CopyMacroSegment);
|
&MacroEdit::CopyMacroSegment);
|
||||||
auto pasteShortcut = new QShortcut(QKeySequence("Ctrl+V"), window);
|
auto pasteShortcut = new QShortcut(QKeySequence("Ctrl+V"), edit);
|
||||||
QWidget::connect(pasteShortcut, &QShortcut::activated, window,
|
QWidget::connect(pasteShortcut, &QShortcut::activated, edit,
|
||||||
&AdvSceneSwitcher::PasteMacroSegment);
|
&MacroEdit::PasteMacroSegment);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
class AdvSceneSwitcher;
|
class MacroEdit;
|
||||||
|
|
||||||
bool MacroSegmentIsInClipboard();
|
bool MacroSegmentIsInClipboard();
|
||||||
bool MacroActionIsInClipboard();
|
bool MacroActionIsInClipboard();
|
||||||
void SetCopySegmentTargetActionType(bool setToElseAction);
|
void SetCopySegmentTargetActionType(bool setToElseAction);
|
||||||
void SetupSegmentCopyPasteShortcutHandlers(AdvSceneSwitcher *window);
|
void SetupSegmentCopyPasteShortcutHandlers(MacroEdit *edit);
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -13,36 +13,62 @@
|
|||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
|
bool MacroSegmentList::_useCache = true;
|
||||||
|
|
||||||
MacroSegmentList::MacroSegmentList(QWidget *parent)
|
MacroSegmentList::MacroSegmentList(QWidget *parent)
|
||||||
: QScrollArea(parent),
|
: QScrollArea(parent),
|
||||||
|
_stackedWidget(new QStackedWidget(this)),
|
||||||
_layout(new QVBoxLayout),
|
_layout(new QVBoxLayout),
|
||||||
_contentLayout(new QVBoxLayout),
|
_contentLayout(new QVBoxLayout),
|
||||||
_helpMsg(new QLabel)
|
_helpMsg(new QLabel(this))
|
||||||
{
|
{
|
||||||
_helpMsg->setWordWrap(true);
|
_helpMsg->setWordWrap(true);
|
||||||
_helpMsg->setAlignment(Qt::AlignCenter);
|
_helpMsg->setAlignment(Qt::AlignCenter);
|
||||||
|
auto helpWidget = new QWidget(this);
|
||||||
|
auto helpLayout = new QVBoxLayout(helpWidget);
|
||||||
|
helpLayout->addWidget(_helpMsg);
|
||||||
|
helpLayout->setAlignment(Qt::AlignCenter);
|
||||||
|
|
||||||
|
auto contentWidget = new QWidget(this);
|
||||||
|
contentWidget->setLayout(_contentLayout);
|
||||||
_contentLayout->setSpacing(0);
|
_contentLayout->setSpacing(0);
|
||||||
auto helperLayout = new QGridLayout();
|
|
||||||
helperLayout->addWidget(_helpMsg, 0, 0,
|
auto contentWrapper = new QWidget(this);
|
||||||
Qt::AlignHCenter | Qt::AlignVCenter);
|
auto wrapperLayout = new QVBoxLayout(contentWrapper);
|
||||||
helperLayout->addLayout(_contentLayout, 0, 0);
|
wrapperLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
helperLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
|
wrapperLayout->addWidget(contentWidget);
|
||||||
_layout->addLayout(helperLayout, 10);
|
// Move macro segments to the top of the list
|
||||||
_layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding,
|
wrapperLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding,
|
||||||
QSizePolicy::Expanding));
|
QSizePolicy::Expanding));
|
||||||
auto wrapper = new QWidget;
|
|
||||||
wrapper->setLayout(_layout);
|
_stackedWidget->addWidget(helpWidget);
|
||||||
setWidget(wrapper);
|
_stackedWidget->addWidget(contentWrapper);
|
||||||
|
|
||||||
|
setWidget(_stackedWidget);
|
||||||
setWidgetResizable(true);
|
setWidgetResizable(true);
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
|
||||||
|
SetHelpMsgVisible(true);
|
||||||
|
|
||||||
|
connect(verticalScrollBar(), &QScrollBar::valueChanged, this,
|
||||||
|
[this]() { SetupVisibleMacroSegmentWidgets(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void clearWidgetVector(const std::vector<QWidget *> &widgets)
|
||||||
|
{
|
||||||
|
for (auto widget : widgets) {
|
||||||
|
widget->deleteLater();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
MacroSegmentList::~MacroSegmentList()
|
MacroSegmentList::~MacroSegmentList()
|
||||||
{
|
{
|
||||||
if (_autoScrollThread.joinable()) {
|
if (_autoScrollThread.joinable()) {
|
||||||
_autoScroll = false;
|
_autoScroll = false;
|
||||||
_autoScrollThread.join();
|
_autoScrollThread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClearWidgetCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool posIsInScrollbar(const QScrollBar *scrollbar, const QPoint &pos)
|
static bool posIsInScrollbar(const QScrollBar *scrollbar, const QPoint &pos)
|
||||||
@@ -53,7 +79,7 @@ static bool posIsInScrollbar(const QScrollBar *scrollbar, const QPoint &pos)
|
|||||||
if (!scrollbar->isVisible()) {
|
if (!scrollbar->isVisible()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const auto geo = scrollbar->geometry();
|
const auto &geo = scrollbar->geometry();
|
||||||
const auto globalGeo = QRect(scrollbar->mapToGlobal(geo.topLeft()),
|
const auto globalGeo = QRect(scrollbar->mapToGlobal(geo.topLeft()),
|
||||||
scrollbar->mapToGlobal(geo.bottomRight()));
|
scrollbar->mapToGlobal(geo.bottomRight()));
|
||||||
return globalGeo.contains(pos);
|
return globalGeo.contains(pos);
|
||||||
@@ -93,31 +119,102 @@ void MacroSegmentList::SetHelpMsg(const QString &msg) const
|
|||||||
_helpMsg->setText(msg);
|
_helpMsg->setText(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSegmentList::SetHelpMsgVisible(bool visible) const
|
void MacroSegmentList::SetHelpMsgVisible(bool visible)
|
||||||
{
|
{
|
||||||
_helpMsg->setVisible(visible);
|
_stackedWidget->setCurrentIndex(visible ? 0 : 1);
|
||||||
|
adjustSize();
|
||||||
|
updateGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSegmentList::Insert(int idx, MacroSegmentEdit *widget)
|
void MacroSegmentList::Insert(int idx, QWidget *widget)
|
||||||
{
|
{
|
||||||
widget->installEventFilter(this);
|
widget->installEventFilter(this);
|
||||||
_contentLayout->insertWidget(idx, widget);
|
_contentLayout->insertWidget(idx, widget);
|
||||||
|
SetupVisibleMacroSegmentWidgets();
|
||||||
|
SetHelpMsgVisible(false);
|
||||||
|
adjustSize();
|
||||||
|
updateGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSegmentList::Add(QWidget *widget)
|
void MacroSegmentList::Add(QWidget *widget)
|
||||||
{
|
{
|
||||||
widget->installEventFilter(this);
|
Insert(_contentLayout->count(), widget);
|
||||||
_contentLayout->addWidget(widget);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSegmentList::Remove(int idx) const
|
void MacroSegmentList::Remove(int idx)
|
||||||
{
|
{
|
||||||
DeleteLayoutItemWidget(_contentLayout->takeAt(idx));
|
DeleteLayoutItemWidget(_contentLayout->takeAt(idx));
|
||||||
|
adjustSize();
|
||||||
|
updateGeometry();
|
||||||
|
if (IsEmpty()) {
|
||||||
|
SetHelpMsgVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSegmentList::Clear(int idx) const
|
void MacroSegmentList::Clear(int idx)
|
||||||
{
|
{
|
||||||
ClearLayout(_contentLayout, idx);
|
ClearLayout(_contentLayout, idx);
|
||||||
|
adjustSize();
|
||||||
|
updateGeometry();
|
||||||
|
|
||||||
|
SetHelpMsgVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroSegmentList::SetCachingEnabled(bool enable)
|
||||||
|
{
|
||||||
|
_useCache = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroSegmentList::CacheCurrentWidgetsFor(const Macro *macro)
|
||||||
|
{
|
||||||
|
if (!_useCache) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<QWidget *> result;
|
||||||
|
int idx = 0;
|
||||||
|
QLayoutItem *item;
|
||||||
|
while ((item = _contentLayout->takeAt(idx))) {
|
||||||
|
if (!item || !item->widget()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
auto widget = item->widget();
|
||||||
|
widget->hide();
|
||||||
|
result.emplace_back(widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
_widgetCache[macro] = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MacroSegmentList::PopulateWidgetsFromCache(const Macro *macro)
|
||||||
|
{
|
||||||
|
if (!_useCache) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto it = _widgetCache.find(macro);
|
||||||
|
if (it == _widgetCache.end()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto widget : it->second) {
|
||||||
|
_contentLayout->addWidget(widget);
|
||||||
|
widget->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
adjustSize();
|
||||||
|
updateGeometry();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroSegmentList::ClearWidgetsFromCacheFor(const Macro *macro)
|
||||||
|
{
|
||||||
|
auto it = _widgetCache.find(macro);
|
||||||
|
if (it == _widgetCache.end()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
clearWidgetVector(it->second);
|
||||||
|
_widgetCache.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSegmentList::Highlight(int idx, QColor color)
|
void MacroSegmentList::Highlight(int idx, QColor color)
|
||||||
@@ -265,6 +362,13 @@ void MacroSegmentList::HideLastDropLine()
|
|||||||
_dropLineIdx = -1;
|
_dropLineIdx = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroSegmentList::ClearWidgetCache()
|
||||||
|
{
|
||||||
|
for (const auto &[_, widgets] : _widgetCache) {
|
||||||
|
clearWidgetVector(widgets);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static bool isInUpperHalfOf(const QPoint &pos, const QRect &rect)
|
static bool isInUpperHalfOf(const QPoint &pos, const QRect &rect)
|
||||||
{
|
{
|
||||||
return QRect(rect.topLeft(),
|
return QRect(rect.topLeft(),
|
||||||
@@ -322,6 +426,55 @@ QRect MacroSegmentList::GetContentItemRectWithPadding(int idx) const
|
|||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroSegmentList::SetVisibilityCheckEnable(bool enable)
|
||||||
|
{
|
||||||
|
_checkVisibility = enable;
|
||||||
|
|
||||||
|
if (_checkVisibility) {
|
||||||
|
QTimer::singleShot(0, this, [this]() {
|
||||||
|
SetupVisibleMacroSegmentWidgets();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MacroSegmentList::IsEmpty() const
|
||||||
|
{
|
||||||
|
return _contentLayout->count() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize MacroSegmentList::minimumSizeHint() const
|
||||||
|
{
|
||||||
|
return _stackedWidget->currentWidget()->minimumSizeHint();
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize MacroSegmentList::sizeHint() const
|
||||||
|
{
|
||||||
|
const auto contentSize = _stackedWidget->currentWidget()->sizeHint();
|
||||||
|
const auto hint =
|
||||||
|
QSize(width(), contentSize.height() + 2 * frameWidth());
|
||||||
|
return hint;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroSegmentList::SetupVisibleMacroSegmentWidgets()
|
||||||
|
{
|
||||||
|
if (!_checkVisibility) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto viewportRect = viewport()->rect();
|
||||||
|
|
||||||
|
for (auto segment : widget()->findChildren<MacroSegmentEdit *>()) {
|
||||||
|
const auto pos = segment->mapTo(viewport(), QPoint(0, 0));
|
||||||
|
const QRect rect(pos, segment->size());
|
||||||
|
if (!viewportRect.intersects(rect)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
segment->SetupWidgets();
|
||||||
|
}
|
||||||
|
updateGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
int MacroSegmentList::GetSegmentIndexFromPos(const QPoint &pos) const
|
int MacroSegmentList::GetSegmentIndexFromPos(const QPoint &pos) const
|
||||||
{
|
{
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
@@ -455,4 +608,10 @@ void MacroSegmentList::dropEvent(QDropEvent *event)
|
|||||||
_dragPosition = -1;
|
_dragPosition = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroSegmentList::resizeEvent(QResizeEvent *event)
|
||||||
|
{
|
||||||
|
QScrollArea::resizeEvent(event);
|
||||||
|
SetupVisibleMacroSegmentWidgets();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -1,56 +1,80 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "macro-segment.hpp"
|
#include "macro-segment.hpp"
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QScrollArea>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QScrollArea>
|
||||||
|
#include <QStackedWidget>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
|
class Macro;
|
||||||
|
|
||||||
class MacroSegmentList : public QScrollArea {
|
class MacroSegmentList : public QScrollArea {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MacroSegmentList(QWidget *parent = nullptr);
|
MacroSegmentList(QWidget *parent = nullptr);
|
||||||
virtual ~MacroSegmentList();
|
~MacroSegmentList();
|
||||||
|
|
||||||
void SetHelpMsg(const QString &msg) const;
|
void SetHelpMsg(const QString &msg) const;
|
||||||
void SetHelpMsgVisible(bool visible) const;
|
void SetHelpMsgVisible(bool visible);
|
||||||
|
|
||||||
MacroSegmentEdit *WidgetAt(int idx) const;
|
MacroSegmentEdit *WidgetAt(int idx) const;
|
||||||
MacroSegmentEdit *WidgetAt(const QPoint &) const;
|
MacroSegmentEdit *WidgetAt(const QPoint &) const;
|
||||||
|
|
||||||
int IndexAt(const QPoint &) const;
|
int IndexAt(const QPoint &) const;
|
||||||
void Insert(int idx, MacroSegmentEdit *widget);
|
void Insert(int idx, QWidget *widget);
|
||||||
void Add(QWidget *widget);
|
void Add(QWidget *widget);
|
||||||
void Remove(int idx) const;
|
void Remove(int idx);
|
||||||
void Clear(int idx = 0) const; // Clear all elements >= idx
|
void Clear(int idx = 0); // Clear all elements >= idx
|
||||||
|
bool IsEmpty() const;
|
||||||
|
|
||||||
|
static void SetCachingEnabled(bool enable);
|
||||||
|
void CacheCurrentWidgetsFor(const Macro *);
|
||||||
|
bool PopulateWidgetsFromCache(const Macro *);
|
||||||
|
void ClearWidgetsFromCacheFor(const Macro *);
|
||||||
|
void SetVisibilityCheckEnable(bool enable);
|
||||||
|
|
||||||
void Highlight(int idx, QColor color = QColor(Qt::green));
|
void Highlight(int idx, QColor color = QColor(Qt::green));
|
||||||
|
|
||||||
void SetCollapsed(bool) const;
|
void SetCollapsed(bool) const;
|
||||||
void SetSelection(int idx) const;
|
void SetSelection(int idx) const;
|
||||||
QVBoxLayout *ContentLayout() const { return _contentLayout; }
|
QVBoxLayout *ContentLayout() const { return _contentLayout; }
|
||||||
|
|
||||||
|
QSize minimumSizeHint() const override;
|
||||||
|
QSize sizeHint() const override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void SelectionChanged(int idx);
|
void SelectionChanged(int idx);
|
||||||
void Reorder(int source, int target);
|
void Reorder(int source, int target);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *object, QEvent *event);
|
bool eventFilter(QObject *object, QEvent *event) override;
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent *event) override;
|
||||||
void mouseMoveEvent(QMouseEvent *event);
|
void mouseMoveEvent(QMouseEvent *event) override;
|
||||||
void mouseReleaseEvent(QMouseEvent *event);
|
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||||
void dragLeaveEvent(QDragLeaveEvent *event);
|
void dragLeaveEvent(QDragLeaveEvent *event) override;
|
||||||
void dragEnterEvent(QDragEnterEvent *event);
|
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||||
void dragMoveEvent(QDragMoveEvent *event);
|
void dragMoveEvent(QDragMoveEvent *event) override;
|
||||||
void dropEvent(QDropEvent *event);
|
void dropEvent(QDropEvent *event) override;
|
||||||
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void SetupVisibleMacroSegmentWidgets();
|
||||||
|
void ClearWidgetCache();
|
||||||
|
|
||||||
int GetSegmentIndexFromPos(const QPoint &) const;
|
int GetSegmentIndexFromPos(const QPoint &) const;
|
||||||
|
bool IsInListArea(const QPoint &) const;
|
||||||
|
QRect GetContentItemRectWithPadding(int idx) const;
|
||||||
|
|
||||||
int GetDragIndex(const QPoint &) const;
|
int GetDragIndex(const QPoint &) const;
|
||||||
int GetDropIndex(const QPoint &) const;
|
int GetDropIndex(const QPoint &) const;
|
||||||
void CheckScroll() const;
|
void CheckScroll() const;
|
||||||
void CheckDropLine(const QPoint &);
|
void CheckDropLine(const QPoint &);
|
||||||
bool IsInListArea(const QPoint &) const;
|
|
||||||
QRect GetContentItemRectWithPadding(int idx) const;
|
|
||||||
void HideLastDropLine();
|
void HideLastDropLine();
|
||||||
|
|
||||||
int _dragPosition = -1;
|
int _dragPosition = -1;
|
||||||
@@ -59,9 +83,15 @@ private:
|
|||||||
std::thread _autoScrollThread;
|
std::thread _autoScrollThread;
|
||||||
std::atomic_bool _autoScroll{false};
|
std::atomic_bool _autoScroll{false};
|
||||||
|
|
||||||
|
QStackedWidget *_stackedWidget;
|
||||||
QVBoxLayout *_layout;
|
QVBoxLayout *_layout;
|
||||||
QVBoxLayout *_contentLayout;
|
QVBoxLayout *_contentLayout;
|
||||||
QLabel *_helpMsg;
|
QLabel *_helpMsg;
|
||||||
|
|
||||||
|
bool _checkVisibility = true;
|
||||||
|
|
||||||
|
static bool _useCache;
|
||||||
|
std::unordered_map<const Macro *, std::vector<QWidget *>> _widgetCache;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "macro-condition-factory.hpp"
|
#include "macro-condition-factory.hpp"
|
||||||
#include "macro-helpers.hpp"
|
#include "macro-helpers.hpp"
|
||||||
#include "macro-segment.hpp"
|
#include "macro-segment.hpp"
|
||||||
|
#include "macro-signals.hpp"
|
||||||
#include "obs-module-helper.hpp"
|
#include "obs-module-helper.hpp"
|
||||||
#include "plugin-state-helpers.hpp"
|
#include "plugin-state-helpers.hpp"
|
||||||
#include "ui-helpers.hpp"
|
#include "ui-helpers.hpp"
|
||||||
@@ -31,7 +32,8 @@ MacroSegmentSelection::MacroSegmentSelection(QWidget *parent, Type type,
|
|||||||
_index,
|
_index,
|
||||||
SIGNAL(NumberVariableChanged(const NumberVariable<int> &)),
|
SIGNAL(NumberVariableChanged(const NumberVariable<int> &)),
|
||||||
this, SLOT(IndexChanged(const NumberVariable<int> &)));
|
this, SLOT(IndexChanged(const NumberVariable<int> &)));
|
||||||
QWidget::connect(window(), SIGNAL(MacroSegmentOrderChanged()), this,
|
QWidget::connect(MacroSignalManager::Instance(),
|
||||||
|
SIGNAL(SegmentOrderChanged()), this,
|
||||||
SLOT(MacroSegmentOrderChanged()));
|
SLOT(MacroSegmentOrderChanged()));
|
||||||
|
|
||||||
auto layout = new QHBoxLayout;
|
auto layout = new QHBoxLayout;
|
||||||
@@ -71,35 +73,46 @@ void MacroSegmentSelection::MacroSegmentOrderChanged()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static QString GetMacroSegmentDescription(Macro *macro, int idx,
|
static QString GetMacroSegmentDescription(Macro *macro, int idx,
|
||||||
bool isCondition)
|
MacroSegmentSelection::Type type)
|
||||||
{
|
{
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if (!IsValidMacroSegmentIndex(macro, idx, isCondition)) {
|
|
||||||
|
MacroSegment *segment;
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case MacroSegmentSelection::Type::CONDITION:
|
||||||
|
if (!IsValidConditionIndex(macro, idx)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
segment = GetMacroConditions(macro)->at(idx).get();
|
||||||
|
break;
|
||||||
|
case MacroSegmentSelection::Type::ACTION:
|
||||||
|
if (!IsValidActionIndex(macro, idx)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
segment = GetMacroActions(macro)->at(idx).get();
|
||||||
|
break;
|
||||||
|
case MacroSegmentSelection::Type::ELSE_ACTION:
|
||||||
|
if (!IsValidElseActionIndex(macro, idx)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
segment = GetMacroElseActions(macro)->at(idx).get();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
MacroSegment *segment;
|
const auto idToName = type == MacroSegmentSelection::Type::CONDITION
|
||||||
if (isCondition) {
|
? MacroConditionFactory::GetConditionName
|
||||||
segment = GetMacroConditions(macro)->at(idx).get();
|
: MacroActionFactory::GetActionName;
|
||||||
} else {
|
const QString typeStr =
|
||||||
segment = GetMacroActions(macro)->at(idx).get();
|
obs_module_text(idToName(segment->GetId()).c_str());
|
||||||
}
|
const QString description =
|
||||||
|
QString::fromStdString(segment->GetShortDesc());
|
||||||
|
|
||||||
QString description = QString::fromStdString(segment->GetShortDesc());
|
QString result = typeStr;
|
||||||
QString type;
|
|
||||||
if (isCondition) {
|
|
||||||
type = obs_module_text(MacroConditionFactory::GetConditionName(
|
|
||||||
segment->GetId())
|
|
||||||
.c_str());
|
|
||||||
} else {
|
|
||||||
type = obs_module_text(
|
|
||||||
MacroActionFactory::GetActionName(segment->GetId())
|
|
||||||
.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
QString result = type;
|
|
||||||
if (!description.isEmpty()) {
|
if (!description.isEmpty()) {
|
||||||
result += ": " + description;
|
result += ": " + description;
|
||||||
}
|
}
|
||||||
@@ -121,11 +134,25 @@ void MacroSegmentSelection::SetupDescription() const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool validIndex = false;
|
||||||
|
switch (_type) {
|
||||||
|
case Type::CONDITION:
|
||||||
|
validIndex = IsValidConditionIndex(_macro, index - 1);
|
||||||
|
break;
|
||||||
|
case Type::ACTION:
|
||||||
|
validIndex = IsValidActionIndex(_macro, index - 1);
|
||||||
|
break;
|
||||||
|
case Type::ELSE_ACTION:
|
||||||
|
validIndex = IsValidElseActionIndex(_macro, index - 1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
QString description;
|
QString description;
|
||||||
if (IsValidMacroSegmentIndex(_macro, index - 1,
|
if (validIndex) {
|
||||||
_type == Type::CONDITION)) {
|
description =
|
||||||
description = GetMacroSegmentDescription(
|
GetMacroSegmentDescription(_macro, index - 1, _type);
|
||||||
_macro, index - 1, _type == Type::CONDITION);
|
|
||||||
} else {
|
} else {
|
||||||
description = obs_module_text(
|
description = obs_module_text(
|
||||||
"AdvSceneSwitcher.macroSegmentSelection.invalid");
|
"AdvSceneSwitcher.macroSegmentSelection.invalid");
|
||||||
@@ -163,8 +190,23 @@ void MacroSegmentSelection::MarkSelectedSegment()
|
|||||||
if (index.GetType() == IntVariable::Type::VARIABLE) {
|
if (index.GetType() == IntVariable::Type::VARIABLE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!IsValidMacroSegmentIndex(_macro, index - 1,
|
|
||||||
_type == Type::CONDITION)) {
|
bool validIndex = false;
|
||||||
|
switch (_type) {
|
||||||
|
case Type::CONDITION:
|
||||||
|
validIndex = IsValidConditionIndex(_macro, index - 1);
|
||||||
|
break;
|
||||||
|
case Type::ACTION:
|
||||||
|
validIndex = IsValidActionIndex(_macro, index - 1);
|
||||||
|
break;
|
||||||
|
case Type::ELSE_ACTION:
|
||||||
|
validIndex = IsValidElseActionIndex(_macro, index - 1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!validIndex) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class Macro;
|
|||||||
class MacroSegmentSelection : public QWidget {
|
class MacroSegmentSelection : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
enum class Type { CONDITION, ACTION };
|
enum class Type { CONDITION, ACTION, ELSE_ACTION };
|
||||||
|
|
||||||
MacroSegmentSelection(QWidget *parent, Type type,
|
MacroSegmentSelection(QWidget *parent, Type type,
|
||||||
bool allowVariables = true);
|
bool allowVariables = true);
|
||||||
|
|||||||
74
lib/macro/macro-segment-unknown.hpp
Normal file
74
lib/macro/macro-segment-unknown.hpp
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "macro-action.hpp"
|
||||||
|
#include "macro-condition.hpp"
|
||||||
|
|
||||||
|
#include <obs.hpp>
|
||||||
|
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
// Retains the settings and ID of the macro segment even if they can't be
|
||||||
|
// interpreted correctly right now.
|
||||||
|
//
|
||||||
|
// As soon as a version of the plugin supporting the original ID is running it
|
||||||
|
// will take over again
|
||||||
|
template<typename T> class MacroSegmentUnknown : public T {
|
||||||
|
public:
|
||||||
|
MacroSegmentUnknown(Macro *macro, const std::string &originalId);
|
||||||
|
bool CheckCondition() { return false; }
|
||||||
|
std::shared_ptr<MacroAction> Copy() const;
|
||||||
|
bool PerformAction() { return true; };
|
||||||
|
bool Save(obs_data_t *data) const;
|
||||||
|
bool Load(obs_data_t *data);
|
||||||
|
std::string GetId() const { return "unknown"; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string _id;
|
||||||
|
OBSData _settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
inline MacroSegmentUnknown<T>::MacroSegmentUnknown(
|
||||||
|
Macro *macro, const std::string &originalId)
|
||||||
|
: T(macro),
|
||||||
|
_id(originalId),
|
||||||
|
_settings(obs_data_create())
|
||||||
|
{
|
||||||
|
obs_data_release(_settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
inline std::shared_ptr<MacroAction> MacroSegmentUnknown<T>::Copy() const
|
||||||
|
{
|
||||||
|
if constexpr (std::is_same_v<T, MacroAction>) {
|
||||||
|
return std::make_shared<MacroSegmentUnknown<T>>(
|
||||||
|
MacroAction::GetMacro(), _id);
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
inline bool MacroSegmentUnknown<T>::Save(obs_data_t *data) const
|
||||||
|
{
|
||||||
|
T::Save(data);
|
||||||
|
obs_data_apply(data, _settings);
|
||||||
|
obs_data_set_string(_settings, "id", _id.c_str());
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T> inline bool MacroSegmentUnknown<T>::Load(obs_data_t *data)
|
||||||
|
{
|
||||||
|
T::Load(data);
|
||||||
|
obs_data_apply(_settings, data);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline QWidget *CreateUnknownSegmentWidget(bool isAction)
|
||||||
|
{
|
||||||
|
return new QLabel(obs_module_text(
|
||||||
|
isAction ? "AdvSceneSwitcher.action.unknown"
|
||||||
|
: "AdvSceneSwitcher.condition.unknown"));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
|
#include <QGraphicsOpacityEffect>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
@@ -24,24 +25,24 @@ bool MacroSegment::Save(obs_data_t *obj) const
|
|||||||
obs_data_set_bool(data, "collapsed", _collapsed);
|
obs_data_set_bool(data, "collapsed", _collapsed);
|
||||||
obs_data_set_bool(data, "useCustomLabel", _useCustomLabel);
|
obs_data_set_bool(data, "useCustomLabel", _useCustomLabel);
|
||||||
obs_data_set_string(data, "customLabel", _customLabel.c_str());
|
obs_data_set_string(data, "customLabel", _customLabel.c_str());
|
||||||
|
obs_data_set_bool(data, "enabled", _enabled);
|
||||||
|
obs_data_set_int(data, "version", 1);
|
||||||
obs_data_set_obj(obj, "segmentSettings", data);
|
obs_data_set_obj(obj, "segmentSettings", data);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroSegment::Load(obs_data_t *obj)
|
bool MacroSegment::Load(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
|
OBSDataAutoRelease data = obs_data_get_obj(obj, "segmentSettings");
|
||||||
|
_collapsed = obs_data_get_bool(data, "collapsed");
|
||||||
|
_useCustomLabel = obs_data_get_bool(data, "useCustomLabel");
|
||||||
|
_customLabel = obs_data_get_string(data, "customLabel");
|
||||||
|
obs_data_set_default_bool(data, "enabled", true);
|
||||||
|
_enabled = obs_data_get_bool(data, "enabled");
|
||||||
|
|
||||||
// TODO: remove this fallback at some point
|
// TODO: remove this fallback at some point
|
||||||
if (obs_data_has_user_value(obj, "segmentSettings")) {
|
if (!obs_data_has_user_value(data, "version")) {
|
||||||
OBSDataAutoRelease data =
|
_enabled = obs_data_get_bool(obj, "enabled");
|
||||||
obs_data_get_obj(obj, "segmentSettings");
|
|
||||||
_collapsed = obs_data_get_bool(data, "collapsed");
|
|
||||||
_useCustomLabel = obs_data_get_bool(data, "useCustomLabel");
|
|
||||||
_customLabel = obs_data_get_string(data, "customLabel");
|
|
||||||
} else {
|
|
||||||
_collapsed = obs_data_get_bool(obj, "collapsed");
|
|
||||||
_useCustomLabel = false;
|
|
||||||
_customLabel = obs_module_text(
|
|
||||||
"AdvSceneSwitcher.macroTab.segment.defaultCustomLabel");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearAvailableTempvars();
|
ClearAvailableTempvars();
|
||||||
@@ -73,6 +74,16 @@ bool MacroSegment::GetHighlightAndReset()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroSegment::SetEnabled(bool value)
|
||||||
|
{
|
||||||
|
_enabled = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MacroSegment::Enabled() const
|
||||||
|
{
|
||||||
|
return _enabled;
|
||||||
|
}
|
||||||
|
|
||||||
std::string MacroSegment::GetVariableValue() const
|
std::string MacroSegment::GetVariableValue() const
|
||||||
{
|
{
|
||||||
if (_supportsVariableValue) {
|
if (_supportsVariableValue) {
|
||||||
@@ -96,7 +107,7 @@ void MacroSegment::SetupTempVars()
|
|||||||
void MacroSegment::ClearAvailableTempvars()
|
void MacroSegment::ClearAvailableTempvars()
|
||||||
{
|
{
|
||||||
_tempVariables.clear();
|
_tempVariables.clear();
|
||||||
NotifyUIAboutTempVarChange();
|
NotifyUIAboutTempVarChange(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::shared_ptr<MacroSegment>
|
static std::shared_ptr<MacroSegment>
|
||||||
@@ -138,7 +149,7 @@ void MacroSegment::AddTempvar(const std::string &id, const std::string &name,
|
|||||||
|
|
||||||
TempVariable var(id, name, description, sharedSegment);
|
TempVariable var(id, name, description, sharedSegment);
|
||||||
_tempVariables.emplace_back(std::move(var));
|
_tempVariables.emplace_back(std::move(var));
|
||||||
NotifyUIAboutTempVarChange();
|
NotifyUIAboutTempVarChange(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSegment::SetTempVarValue(const std::string &id,
|
void MacroSegment::SetTempVarValue(const std::string &id,
|
||||||
@@ -245,23 +256,6 @@ MacroSegmentEdit::MacroSegmentEdit(QWidget *parent)
|
|||||||
|
|
||||||
QWidget::connect(_section, &Section::Collapsed, this,
|
QWidget::connect(_section, &Section::Collapsed, this,
|
||||||
&MacroSegmentEdit::Collapsed);
|
&MacroSegmentEdit::Collapsed);
|
||||||
// Macro signals
|
|
||||||
QWidget::connect(parent, SIGNAL(MacroAdded(const QString &)), this,
|
|
||||||
SIGNAL(MacroAdded(const QString &)));
|
|
||||||
QWidget::connect(parent, SIGNAL(MacroRemoved(const QString &)), this,
|
|
||||||
SIGNAL(MacroRemoved(const QString &)));
|
|
||||||
QWidget::connect(
|
|
||||||
parent, SIGNAL(MacroRenamed(const QString &, const QString &)),
|
|
||||||
this, SIGNAL(MacroRenamed(const QString &, const QString &)));
|
|
||||||
// Scene group signals
|
|
||||||
QWidget::connect(parent, SIGNAL(SceneGroupAdded(const QString &)), this,
|
|
||||||
SIGNAL(SceneGroupAdded(const QString &)));
|
|
||||||
QWidget::connect(parent, SIGNAL(SceneGroupRemoved(const QString &)),
|
|
||||||
this, SIGNAL(SceneGroupRemoved(const QString &)));
|
|
||||||
QWidget::connect(
|
|
||||||
parent,
|
|
||||||
SIGNAL(SceneGroupRenamed(const QString &, const QString)), this,
|
|
||||||
SIGNAL(SceneGroupRenamed(const QString &, const QString)));
|
|
||||||
|
|
||||||
auto frameLayout = new QGridLayout;
|
auto frameLayout = new QGridLayout;
|
||||||
frameLayout->setContentsMargins(0, 0, 0, 0);
|
frameLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
@@ -313,13 +307,29 @@ void MacroSegmentEdit::HeaderInfoChanged(const QString &text)
|
|||||||
_headerInfo->setText(text);
|
_headerInfo->setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSegmentEdit::Collapsed(bool collapsed)
|
void MacroSegmentEdit::Collapsed(bool collapsed) const
|
||||||
{
|
{
|
||||||
if (Data()) {
|
if (Data()) {
|
||||||
Data()->SetCollapsed(collapsed);
|
Data()->SetCollapsed(collapsed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroSegmentEdit::SetDisableEffect(bool value)
|
||||||
|
{
|
||||||
|
if (value) {
|
||||||
|
auto effect = new QGraphicsOpacityEffect(this);
|
||||||
|
effect->setOpacity(0.5);
|
||||||
|
_section->setGraphicsEffect(effect);
|
||||||
|
} else {
|
||||||
|
_section->setGraphicsEffect(nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroSegmentEdit::SetEnableAppearance(bool value)
|
||||||
|
{
|
||||||
|
SetDisableEffect(!value);
|
||||||
|
}
|
||||||
|
|
||||||
void MacroSegmentEdit::SetFocusPolicyOfWidgets()
|
void MacroSegmentEdit::SetFocusPolicyOfWidgets()
|
||||||
{
|
{
|
||||||
QList<QWidget *> widgets = this->findChildren<QWidget *>();
|
QList<QWidget *> widgets = this->findChildren<QWidget *>();
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace advss {
|
|||||||
|
|
||||||
class Macro;
|
class Macro;
|
||||||
|
|
||||||
class EXPORT MacroSegment {
|
class EXPORT MacroSegment : public Lockable {
|
||||||
public:
|
public:
|
||||||
MacroSegment(Macro *m, bool supportsVariableValue);
|
MacroSegment(Macro *m, bool supportsVariableValue);
|
||||||
virtual ~MacroSegment() = default;
|
virtual ~MacroSegment() = default;
|
||||||
@@ -39,6 +39,8 @@ public:
|
|||||||
virtual std::string GetId() const = 0;
|
virtual std::string GetId() const = 0;
|
||||||
void EnableHighlight();
|
void EnableHighlight();
|
||||||
bool GetHighlightAndReset();
|
bool GetHighlightAndReset();
|
||||||
|
void SetEnabled(bool);
|
||||||
|
bool Enabled() const;
|
||||||
virtual std::string GetVariableValue() const;
|
virtual std::string GetVariableValue() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -46,7 +48,7 @@ protected:
|
|||||||
friend void IncrementVariableRef(MacroSegment *);
|
friend void IncrementVariableRef(MacroSegment *);
|
||||||
friend void DecrementVariableRef(MacroSegment *);
|
friend void DecrementVariableRef(MacroSegment *);
|
||||||
void SetVariableValue(const std::string &value);
|
void SetVariableValue(const std::string &value);
|
||||||
bool IsReferencedInVars() { return _variableRefs != 0; }
|
bool IsReferencedInVars() const { return _variableRefs != 0; }
|
||||||
|
|
||||||
virtual void SetupTempVars();
|
virtual void SetupTempVars();
|
||||||
void AddTempvar(const std::string &id, const std::string &name,
|
void AddTempvar(const std::string &id, const std::string &name,
|
||||||
@@ -75,6 +77,7 @@ private:
|
|||||||
// UI helper
|
// UI helper
|
||||||
bool _highlight = false;
|
bool _highlight = false;
|
||||||
bool _collapsed = false;
|
bool _collapsed = false;
|
||||||
|
bool _enabled = true;
|
||||||
|
|
||||||
// Custom header labels
|
// Custom header labels
|
||||||
bool _useCustomLabel = false;
|
bool _useCustomLabel = false;
|
||||||
@@ -103,27 +106,25 @@ public:
|
|||||||
void SetCollapsed(bool collapsed);
|
void SetCollapsed(bool collapsed);
|
||||||
void SetSelected(bool);
|
void SetSelected(bool);
|
||||||
virtual std::shared_ptr<MacroSegment> Data() const = 0;
|
virtual std::shared_ptr<MacroSegment> Data() const = 0;
|
||||||
|
virtual void SetupWidgets(bool basicSetup = false) = 0;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void HeaderInfoChanged(const QString &);
|
void HeaderInfoChanged(const QString &);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void Collapsed(bool);
|
void Collapsed(bool) const;
|
||||||
signals:
|
|
||||||
void MacroAdded(const QString &name);
|
|
||||||
void MacroRemoved(const QString &name);
|
|
||||||
void MacroRenamed(const QString &oldName, const QString &newName);
|
|
||||||
void SceneGroupAdded(const QString &name);
|
|
||||||
void SceneGroupRemoved(const QString &name);
|
|
||||||
void SceneGroupRenamed(const QString &oldName, const QString newName);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void SetDisableEffect(bool);
|
||||||
|
void SetEnableAppearance(bool);
|
||||||
|
|
||||||
bool eventFilter(QObject *obj, QEvent *ev) override;
|
bool eventFilter(QObject *obj, QEvent *ev) override;
|
||||||
|
|
||||||
Section *_section;
|
Section *_section;
|
||||||
QLabel *_headerInfo;
|
QLabel *_headerInfo;
|
||||||
QWidget *_frame;
|
QWidget *_frame;
|
||||||
QVBoxLayout *_contentLayout;
|
QVBoxLayout *_contentLayout;
|
||||||
|
bool _allWidgetsAreSetup = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class DropLineState {
|
enum class DropLineState {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include "advanced-scene-switcher.hpp"
|
#include "advanced-scene-switcher.hpp"
|
||||||
#include "layout-helpers.hpp"
|
#include "layout-helpers.hpp"
|
||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
|
#include "macro-signals.hpp"
|
||||||
#include "ui-helpers.hpp"
|
#include "ui-helpers.hpp"
|
||||||
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
@@ -13,22 +14,21 @@ MacroSelection::MacroSelection(QWidget *parent)
|
|||||||
: FilterComboBox(parent,
|
: FilterComboBox(parent,
|
||||||
obs_module_text("AdvSceneSwitcher.selectMacro"))
|
obs_module_text("AdvSceneSwitcher.selectMacro"))
|
||||||
{
|
{
|
||||||
for (const auto &m : GetMacros()) {
|
for (const auto &m : GetTopLevelMacros()) {
|
||||||
if (m->IsGroup()) {
|
if (m->IsGroup()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
addItem(QString::fromStdString(m->Name()));
|
addItem(QString::fromStdString(m->Name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget::connect(GetSettingsWindow(),
|
QWidget::connect(MacroSignalManager::Instance(),
|
||||||
SIGNAL(MacroAdded(const QString &)), this,
|
SIGNAL(Add(const QString &)), this,
|
||||||
SLOT(MacroAdd(const QString &)));
|
SLOT(MacroAdd(const QString &)));
|
||||||
QWidget::connect(GetSettingsWindow(),
|
QWidget::connect(MacroSignalManager::Instance(),
|
||||||
SIGNAL(MacroRemoved(const QString &)), this,
|
SIGNAL(Remove(const QString &)), this,
|
||||||
SLOT(MacroRemove(const QString &)));
|
SLOT(MacroRemove(const QString &)));
|
||||||
QWidget::connect(GetSettingsWindow(),
|
QWidget::connect(MacroSignalManager::Instance(),
|
||||||
SIGNAL(MacroRenamed(const QString &, const QString &)),
|
SIGNAL(Rename(const QString &, const QString &)), this,
|
||||||
this,
|
|
||||||
SLOT(MacroRename(const QString &, const QString &)));
|
SLOT(MacroRename(const QString &, const QString &)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ void MacroSelection::SetCurrentMacro(const MacroRef ¯o)
|
|||||||
|
|
||||||
void MacroSelection::HideSelectedMacro()
|
void MacroSelection::HideSelectedMacro()
|
||||||
{
|
{
|
||||||
auto ssWindow = static_cast<AdvSceneSwitcher *>(window());
|
auto ssWindow = static_cast<AdvSceneSwitcher *>(GetSettingsWindow());
|
||||||
if (!ssWindow) {
|
if (!ssWindow) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -76,12 +76,16 @@ void MacroSelection::ShowAllMacros()
|
|||||||
|
|
||||||
void MacroSelection::MacroRemove(const QString &name)
|
void MacroSelection::MacroRemove(const QString &name)
|
||||||
{
|
{
|
||||||
|
const bool currentSelectionWasRemoved = name == currentText();
|
||||||
|
|
||||||
int idx = findText(name);
|
int idx = findText(name);
|
||||||
if (idx == -1) {
|
if (idx == -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
removeItem(idx);
|
removeItem(idx);
|
||||||
setCurrentIndex(-1);
|
if (currentSelectionWasRemoved) {
|
||||||
|
setCurrentIndex(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSelection::MacroRename(const QString &oldName, const QString &newName)
|
void MacroSelection::MacroRename(const QString &oldName, const QString &newName)
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ void GlobalMacroSettings::Save(obs_data_t *obj) const
|
|||||||
obs_data_set_bool(data, "highlightExecuted", _highlightExecuted);
|
obs_data_set_bool(data, "highlightExecuted", _highlightExecuted);
|
||||||
obs_data_set_bool(data, "highlightConditions", _highlightConditions);
|
obs_data_set_bool(data, "highlightConditions", _highlightConditions);
|
||||||
obs_data_set_bool(data, "highlightActions", _highlightActions);
|
obs_data_set_bool(data, "highlightActions", _highlightActions);
|
||||||
|
obs_data_set_bool(data, "newMacroCheckInParallel",
|
||||||
|
_newMacroCheckInParallel);
|
||||||
obs_data_set_bool(data, "newMacroRegisterHotkey",
|
obs_data_set_bool(data, "newMacroRegisterHotkey",
|
||||||
_newMacroRegisterHotkeys);
|
_newMacroRegisterHotkeys);
|
||||||
obs_data_set_bool(data, "newMacroUseShortCircuitEvaluation",
|
obs_data_set_bool(data, "newMacroUseShortCircuitEvaluation",
|
||||||
@@ -41,6 +43,8 @@ void GlobalMacroSettings::Load(obs_data_t *obj)
|
|||||||
_highlightExecuted = obs_data_get_bool(data, "highlightExecuted");
|
_highlightExecuted = obs_data_get_bool(data, "highlightExecuted");
|
||||||
_highlightConditions = obs_data_get_bool(data, "highlightConditions");
|
_highlightConditions = obs_data_get_bool(data, "highlightConditions");
|
||||||
_highlightActions = obs_data_get_bool(data, "highlightActions");
|
_highlightActions = obs_data_get_bool(data, "highlightActions");
|
||||||
|
_newMacroCheckInParallel =
|
||||||
|
obs_data_get_bool(data, "newMacroCheckInParallel");
|
||||||
_newMacroRegisterHotkeys =
|
_newMacroRegisterHotkeys =
|
||||||
obs_data_get_bool(data, "newMacroRegisterHotkey");
|
obs_data_get_bool(data, "newMacroRegisterHotkey");
|
||||||
_newMacroUseShortCircuitEvaluation =
|
_newMacroUseShortCircuitEvaluation =
|
||||||
@@ -62,12 +66,16 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
|||||||
"AdvSceneSwitcher.macroTab.highlightTrueConditions"))),
|
"AdvSceneSwitcher.macroTab.highlightTrueConditions"))),
|
||||||
_highlightActions(new QCheckBox(obs_module_text(
|
_highlightActions(new QCheckBox(obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.highlightPerformedActions"))),
|
"AdvSceneSwitcher.macroTab.highlightPerformedActions"))),
|
||||||
|
_newMacroCheckInParallel(new QCheckBox(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.newMacroCheckInParallel"))),
|
||||||
_newMacroRegisterHotkeys(new QCheckBox(obs_module_text(
|
_newMacroRegisterHotkeys(new QCheckBox(obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.newMacroRegisterHotkey"))),
|
"AdvSceneSwitcher.macroTab.newMacroRegisterHotkey"))),
|
||||||
_newMacroUseShortCircuitEvaluation(new QCheckBox(obs_module_text(
|
_newMacroUseShortCircuitEvaluation(new QCheckBox(obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.newMacroUseShortCircuitEvaluation"))),
|
"AdvSceneSwitcher.macroTab.newMacroUseShortCircuitEvaluation"))),
|
||||||
_saveSettingsOnMacroChange(new QCheckBox(obs_module_text(
|
_saveSettingsOnMacroChange(new QCheckBox(obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.saveSettingsOnMacroChange"))),
|
"AdvSceneSwitcher.macroTab.saveSettingsOnMacroChange"))),
|
||||||
|
_currentCheckInParallel(new QCheckBox(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.currentCheckInParallel"))),
|
||||||
_currentMacroRegisterHotkeys(new QCheckBox(obs_module_text(
|
_currentMacroRegisterHotkeys(new QCheckBox(obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.currentRegisterHotkeys"))),
|
"AdvSceneSwitcher.macroTab.currentRegisterHotkeys"))),
|
||||||
_currentUseShortCircuitEvaluation(new QCheckBox(obs_module_text(
|
_currentUseShortCircuitEvaluation(new QCheckBox(obs_module_text(
|
||||||
@@ -86,6 +94,9 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
|||||||
_currentInputs(new MacroInputSelection()),
|
_currentInputs(new MacroInputSelection()),
|
||||||
_currentMacroRegisterDock(new QCheckBox(obs_module_text(
|
_currentMacroRegisterDock(new QCheckBox(obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.currentRegisterDock"))),
|
"AdvSceneSwitcher.macroTab.currentRegisterDock"))),
|
||||||
|
_currentMacroIsStandaloneDock(new QCheckBox(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.currentIsStandaloneDock"))),
|
||||||
|
_currentMacroDockWindowName(new QLineEdit(this)),
|
||||||
_currentMacroDockAddRunButton(new QCheckBox(obs_module_text(
|
_currentMacroDockAddRunButton(new QCheckBox(obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.currentDockAddRunButton"))),
|
"AdvSceneSwitcher.macroTab.currentDockAddRunButton"))),
|
||||||
_currentMacroDockAddPauseButton(new QCheckBox(obs_module_text(
|
_currentMacroDockAddPauseButton(new QCheckBox(obs_module_text(
|
||||||
@@ -107,6 +118,11 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
|||||||
setWindowModality(Qt::WindowModality::WindowModal);
|
setWindowModality(Qt::WindowModality::WindowModal);
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
|
_newMacroCheckInParallel->setToolTip(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.checkInParallel.tooltip"));
|
||||||
|
_currentCheckInParallel->setToolTip(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.checkInParallel.tooltip"));
|
||||||
|
|
||||||
_newMacroUseShortCircuitEvaluation->setToolTip(obs_module_text(
|
_newMacroUseShortCircuitEvaluation->setToolTip(obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.shortCircuit.tooltip"));
|
"AdvSceneSwitcher.macroTab.shortCircuit.tooltip"));
|
||||||
_saveSettingsOnMacroChange->setToolTip(obs_module_text(
|
_saveSettingsOnMacroChange->setToolTip(obs_module_text(
|
||||||
@@ -146,6 +162,8 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
|||||||
obs_module_text("AdvSceneSwitcher.macroTab.generalSettings"));
|
obs_module_text("AdvSceneSwitcher.macroTab.generalSettings"));
|
||||||
auto generalLayout = new QVBoxLayout;
|
auto generalLayout = new QVBoxLayout;
|
||||||
generalLayout->addWidget(_saveSettingsOnMacroChange);
|
generalLayout->addWidget(_saveSettingsOnMacroChange);
|
||||||
|
generalLayout->addWidget(_currentCheckInParallel);
|
||||||
|
generalLayout->addWidget(_newMacroCheckInParallel);
|
||||||
generalLayout->addWidget(_currentSkipOnStartup);
|
generalLayout->addWidget(_currentSkipOnStartup);
|
||||||
generalLayout->addWidget(_currentStopActionsIfNotDone);
|
generalLayout->addWidget(_currentStopActionsIfNotDone);
|
||||||
generalLayout->addWidget(_currentUseShortCircuitEvaluation);
|
generalLayout->addWidget(_currentUseShortCircuitEvaluation);
|
||||||
@@ -183,6 +201,15 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
|||||||
int row = 0;
|
int row = 0;
|
||||||
_dockLayout->addWidget(_currentMacroRegisterDock, row, 1, 1, 2);
|
_dockLayout->addWidget(_currentMacroRegisterDock, row, 1, 1, 2);
|
||||||
row++;
|
row++;
|
||||||
|
_dockLayout->addWidget(_currentMacroIsStandaloneDock, row, 1, 1, 2);
|
||||||
|
row++;
|
||||||
|
_dockLayout->addWidget(
|
||||||
|
new QLabel(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.currentDockWindowName")),
|
||||||
|
row, 1);
|
||||||
|
_dockLayout->addWidget(_currentMacroDockWindowName, row, 2);
|
||||||
|
_dockWindowNameRow = row;
|
||||||
|
row++;
|
||||||
_dockLayout->addWidget(_currentMacroDockAddRunButton, row, 1, 1, 2);
|
_dockLayout->addWidget(_currentMacroDockAddRunButton, row, 1, 1, 2);
|
||||||
row++;
|
row++;
|
||||||
_dockLayout->addWidget(
|
_dockLayout->addWidget(
|
||||||
@@ -237,6 +264,8 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
|||||||
|
|
||||||
connect(_currentMacroRegisterDock, &QCheckBox::stateChanged, this,
|
connect(_currentMacroRegisterDock, &QCheckBox::stateChanged, this,
|
||||||
&MacroSettingsDialog::DockEnableChanged);
|
&MacroSettingsDialog::DockEnableChanged);
|
||||||
|
connect(_currentMacroIsStandaloneDock, &QCheckBox::stateChanged, this,
|
||||||
|
&MacroSettingsDialog::IsStandaloneDockChanged);
|
||||||
connect(_currentMacroDockAddRunButton, &QCheckBox::stateChanged, this,
|
connect(_currentMacroDockAddRunButton, &QCheckBox::stateChanged, this,
|
||||||
&MacroSettingsDialog::RunButtonEnableChanged);
|
&MacroSettingsDialog::RunButtonEnableChanged);
|
||||||
connect(_currentMacroDockAddPauseButton, &QCheckBox::stateChanged, this,
|
connect(_currentMacroDockAddPauseButton, &QCheckBox::stateChanged, this,
|
||||||
@@ -273,6 +302,7 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
|||||||
_highlightExecutedMacros->setChecked(settings._highlightExecuted);
|
_highlightExecutedMacros->setChecked(settings._highlightExecuted);
|
||||||
_highlightConditions->setChecked(settings._highlightConditions);
|
_highlightConditions->setChecked(settings._highlightConditions);
|
||||||
_highlightActions->setChecked(settings._highlightActions);
|
_highlightActions->setChecked(settings._highlightActions);
|
||||||
|
_newMacroCheckInParallel->setChecked(settings._newMacroCheckInParallel);
|
||||||
_newMacroRegisterHotkeys->setChecked(settings._newMacroRegisterHotkeys);
|
_newMacroRegisterHotkeys->setChecked(settings._newMacroRegisterHotkeys);
|
||||||
_newMacroUseShortCircuitEvaluation->setChecked(
|
_newMacroUseShortCircuitEvaluation->setChecked(
|
||||||
settings._newMacroUseShortCircuitEvaluation);
|
settings._newMacroUseShortCircuitEvaluation);
|
||||||
@@ -280,20 +310,23 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
|||||||
settings._saveSettingsOnMacroChange);
|
settings._saveSettingsOnMacroChange);
|
||||||
|
|
||||||
if (!macro || macro->IsGroup()) {
|
if (!macro || macro->IsGroup()) {
|
||||||
hotkeyOptions->hide();
|
|
||||||
|
|
||||||
// General group
|
// General group
|
||||||
_currentSkipOnStartup->hide();
|
_currentSkipOnStartup->hide();
|
||||||
_currentStopActionsIfNotDone->hide();
|
_currentStopActionsIfNotDone->hide();
|
||||||
_currentUseShortCircuitEvaluation->hide();
|
_currentUseShortCircuitEvaluation->hide();
|
||||||
|
_currentCheckInParallel->hide();
|
||||||
SetLayoutVisible(customConditionIntervalLayout, false);
|
SetLayoutVisible(customConditionIntervalLayout, false);
|
||||||
SetLayoutVisible(pauseStateSaveBehavorLayout, false);
|
SetLayoutVisible(pauseStateSaveBehavorLayout, false);
|
||||||
|
|
||||||
|
// Hotkey group
|
||||||
|
_currentMacroRegisterHotkeys->hide();
|
||||||
|
|
||||||
inputOptions->hide();
|
inputOptions->hide();
|
||||||
_dockOptions->hide();
|
_dockOptions->hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_currentCheckInParallel->setChecked(macro->CheckInParallel());
|
||||||
_currentMacroRegisterHotkeys->setChecked(macro->PauseHotkeysEnabled());
|
_currentMacroRegisterHotkeys->setChecked(macro->PauseHotkeysEnabled());
|
||||||
_currentUseShortCircuitEvaluation->setChecked(
|
_currentUseShortCircuitEvaluation->setChecked(
|
||||||
macro->ShortCircuitEvaluationEnabled());
|
macro->ShortCircuitEvaluationEnabled());
|
||||||
@@ -310,55 +343,37 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
|||||||
_currentSkipOnStartup->setChecked(macro->SkipExecOnStart());
|
_currentSkipOnStartup->setChecked(macro->SkipExecOnStart());
|
||||||
_currentStopActionsIfNotDone->setChecked(macro->StopActionsIfNotDone());
|
_currentStopActionsIfNotDone->setChecked(macro->StopActionsIfNotDone());
|
||||||
_currentInputs->SetInputs(macro->GetInputVariables());
|
_currentInputs->SetInputs(macro->GetInputVariables());
|
||||||
const bool dockEnabled = macro->DockEnabled();
|
const auto &dockSettings = macro->GetDockSettings();
|
||||||
|
const bool dockEnabled = dockSettings.DockEnabled();
|
||||||
_currentMacroRegisterDock->setChecked(dockEnabled);
|
_currentMacroRegisterDock->setChecked(dockEnabled);
|
||||||
_currentMacroDockAddRunButton->setChecked(macro->DockHasRunButton());
|
_currentMacroIsStandaloneDock->setChecked(
|
||||||
|
dockSettings.IsStandaloneDock());
|
||||||
|
_currentMacroDockWindowName->setText(
|
||||||
|
QString::fromStdString(dockSettings.DockWindowName()));
|
||||||
|
_currentMacroDockAddRunButton->setChecked(dockSettings.HasRunButton());
|
||||||
_currentMacroDockAddPauseButton->setChecked(
|
_currentMacroDockAddPauseButton->setChecked(
|
||||||
macro->DockHasPauseButton());
|
dockSettings.HasPauseButton());
|
||||||
_currentMacroDockAddStatusLabel->setChecked(
|
_currentMacroDockAddStatusLabel->setChecked(
|
||||||
macro->DockHasStatusLabel());
|
dockSettings.HasStatusLabel());
|
||||||
_currentMacroDockHighlightIfConditionsTrue->setChecked(
|
_currentMacroDockHighlightIfConditionsTrue->setChecked(
|
||||||
macro->DockHighlightEnabled());
|
dockSettings.HighlightEnabled());
|
||||||
_runButtonText->setText(macro->RunButtonText());
|
_runButtonText->setText(dockSettings.RunButtonText());
|
||||||
_pauseButtonText->setText(macro->PauseButtonText());
|
_pauseButtonText->setText(dockSettings.PauseButtonText());
|
||||||
_unpauseButtonText->setText(macro->UnpauseButtonText());
|
_unpauseButtonText->setText(dockSettings.UnpauseButtonText());
|
||||||
_conditionsTrueStatusText->setText(macro->ConditionsTrueStatusText());
|
_conditionsTrueStatusText->setText(
|
||||||
_conditionsFalseStatusText->setText(macro->ConditionsFalseStatusText());
|
dockSettings.ConditionsTrueStatusText());
|
||||||
|
_conditionsFalseStatusText->setText(
|
||||||
|
dockSettings.ConditionsFalseStatusText());
|
||||||
|
|
||||||
_currentMacroDockAddRunButton->setVisible(dockEnabled);
|
DockEnableChanged(dockEnabled);
|
||||||
_currentMacroDockAddPauseButton->setVisible(dockEnabled);
|
|
||||||
_currentMacroDockAddStatusLabel->setVisible(dockEnabled);
|
|
||||||
_currentMacroDockHighlightIfConditionsTrue->setVisible(dockEnabled);
|
|
||||||
SetGridLayoutRowVisible(_dockLayout, _runButtonTextRow,
|
|
||||||
dockEnabled && macro->DockHasRunButton());
|
|
||||||
SetGridLayoutRowVisible(_dockLayout, _pauseButtonTextRow,
|
|
||||||
dockEnabled && macro->DockHasPauseButton());
|
|
||||||
SetGridLayoutRowVisible(_dockLayout, _unpauseButtonTextRow,
|
|
||||||
dockEnabled && macro->DockHasPauseButton());
|
|
||||||
SetGridLayoutRowVisible(_dockLayout, _conditionsTrueTextRow,
|
|
||||||
dockEnabled && macro->DockHasStatusLabel());
|
|
||||||
SetGridLayoutRowVisible(_dockLayout, _conditionsFalseTextRow,
|
|
||||||
dockEnabled && macro->DockHasStatusLabel());
|
|
||||||
MinimizeSizeOfColumn(_dockLayout, 0);
|
MinimizeSizeOfColumn(_dockLayout, 0);
|
||||||
Resize();
|
|
||||||
|
|
||||||
// Try to set sensible initial size for the dialog window
|
Resize();
|
||||||
QSize contentSize = contentWidget->sizeHint();
|
|
||||||
resize(contentSize.width() + layout->contentsMargins().left() +
|
|
||||||
layout->contentsMargins().right() +
|
|
||||||
dialogLayout->contentsMargins().left() +
|
|
||||||
dialogLayout->contentsMargins().right() +
|
|
||||||
scrollArea->verticalScrollBar()->sizeHint().width() + 20,
|
|
||||||
contentSize.height() + dialogLayout->spacing() +
|
|
||||||
buttonbox->sizeHint().height() +
|
|
||||||
dialogLayout->contentsMargins().top() +
|
|
||||||
dialogLayout->contentsMargins().bottom() +
|
|
||||||
scrollArea->horizontalScrollBar()->sizeHint().height() +
|
|
||||||
20);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSettingsDialog::DockEnableChanged(int enabled)
|
void MacroSettingsDialog::DockEnableChanged(int enabled)
|
||||||
{
|
{
|
||||||
|
_currentMacroIsStandaloneDock->setVisible(enabled);
|
||||||
_currentMacroDockAddRunButton->setVisible(enabled);
|
_currentMacroDockAddRunButton->setVisible(enabled);
|
||||||
_currentMacroDockAddPauseButton->setVisible(enabled);
|
_currentMacroDockAddPauseButton->setVisible(enabled);
|
||||||
_currentMacroDockAddStatusLabel->setVisible(enabled);
|
_currentMacroDockAddStatusLabel->setVisible(enabled);
|
||||||
@@ -382,6 +397,12 @@ void MacroSettingsDialog::DockEnableChanged(int enabled)
|
|||||||
Resize();
|
Resize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroSettingsDialog::IsStandaloneDockChanged(int enabled)
|
||||||
|
{
|
||||||
|
SetGridLayoutRowVisible(_dockLayout, _dockWindowNameRow, !enabled);
|
||||||
|
Resize();
|
||||||
|
}
|
||||||
|
|
||||||
void MacroSettingsDialog::RunButtonEnableChanged(int enabled)
|
void MacroSettingsDialog::RunButtonEnableChanged(int enabled)
|
||||||
{
|
{
|
||||||
SetGridLayoutRowVisible(_dockLayout, _runButtonTextRow, enabled);
|
SetGridLayoutRowVisible(_dockLayout, _runButtonTextRow, enabled);
|
||||||
@@ -431,6 +452,8 @@ bool MacroSettingsDialog::AskForSettings(QWidget *parent,
|
|||||||
userInput._highlightConditions =
|
userInput._highlightConditions =
|
||||||
dialog._highlightConditions->isChecked();
|
dialog._highlightConditions->isChecked();
|
||||||
userInput._highlightActions = dialog._highlightActions->isChecked();
|
userInput._highlightActions = dialog._highlightActions->isChecked();
|
||||||
|
userInput._newMacroCheckInParallel =
|
||||||
|
dialog._newMacroCheckInParallel->isChecked();
|
||||||
userInput._newMacroRegisterHotkeys =
|
userInput._newMacroRegisterHotkeys =
|
||||||
dialog._newMacroRegisterHotkeys->isChecked();
|
dialog._newMacroRegisterHotkeys->isChecked();
|
||||||
userInput._newMacroUseShortCircuitEvaluation =
|
userInput._newMacroUseShortCircuitEvaluation =
|
||||||
@@ -441,6 +464,7 @@ bool MacroSettingsDialog::AskForSettings(QWidget *parent,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
macro->SetCheckInParallel(dialog._currentCheckInParallel->isChecked());
|
||||||
macro->EnablePauseHotkeys(
|
macro->EnablePauseHotkeys(
|
||||||
dialog._currentMacroRegisterHotkeys->isChecked());
|
dialog._currentMacroRegisterHotkeys->isChecked());
|
||||||
macro->SetShortCircuitEvaluation(
|
macro->SetShortCircuitEvaluation(
|
||||||
@@ -456,23 +480,30 @@ bool MacroSettingsDialog::AskForSettings(QWidget *parent,
|
|||||||
macro->SetSkipExecOnStart(dialog._currentSkipOnStartup->isChecked());
|
macro->SetSkipExecOnStart(dialog._currentSkipOnStartup->isChecked());
|
||||||
macro->SetStopActionsIfNotDone(
|
macro->SetStopActionsIfNotDone(
|
||||||
dialog._currentStopActionsIfNotDone->isChecked());
|
dialog._currentStopActionsIfNotDone->isChecked());
|
||||||
macro->EnableDock(dialog._currentMacroRegisterDock->isChecked());
|
|
||||||
macro->SetDockHasRunButton(
|
auto &dockSettings = macro->GetDockSettings();
|
||||||
|
dockSettings.EnableDock(dialog._currentMacroRegisterDock->isChecked());
|
||||||
|
dockSettings.SetIsStandaloneDock(
|
||||||
|
dialog._currentMacroIsStandaloneDock->isChecked());
|
||||||
|
dockSettings.SetDockWindowName(
|
||||||
|
dialog._currentMacroDockWindowName->text().toStdString());
|
||||||
|
dockSettings.SetHasRunButton(
|
||||||
dialog._currentMacroDockAddRunButton->isChecked());
|
dialog._currentMacroDockAddRunButton->isChecked());
|
||||||
macro->SetDockHasPauseButton(
|
dockSettings.SetHasPauseButton(
|
||||||
dialog._currentMacroDockAddPauseButton->isChecked());
|
dialog._currentMacroDockAddPauseButton->isChecked());
|
||||||
macro->SetDockHasStatusLabel(
|
dockSettings.SetHasStatusLabel(
|
||||||
dialog._currentMacroDockAddStatusLabel->isChecked());
|
dialog._currentMacroDockAddStatusLabel->isChecked());
|
||||||
macro->SetHighlightEnable(
|
dockSettings.SetHighlightEnable(
|
||||||
dialog._currentMacroDockHighlightIfConditionsTrue->isChecked());
|
dialog._currentMacroDockHighlightIfConditionsTrue->isChecked());
|
||||||
macro->SetRunButtonText(dialog._runButtonText->text().toStdString());
|
dockSettings.SetRunButtonText(
|
||||||
macro->SetPauseButtonText(
|
dialog._runButtonText->text().toStdString());
|
||||||
|
dockSettings.SetPauseButtonText(
|
||||||
dialog._pauseButtonText->text().toStdString());
|
dialog._pauseButtonText->text().toStdString());
|
||||||
macro->SetUnpauseButtonText(
|
dockSettings.SetUnpauseButtonText(
|
||||||
dialog._unpauseButtonText->text().toStdString());
|
dialog._unpauseButtonText->text().toStdString());
|
||||||
macro->SetConditionsTrueStatusText(
|
dockSettings.SetConditionsTrueStatusText(
|
||||||
dialog._conditionsTrueStatusText->text().toStdString());
|
dialog._conditionsTrueStatusText->text().toStdString());
|
||||||
macro->SetConditionsFalseStatusText(
|
dockSettings.SetConditionsFalseStatusText(
|
||||||
dialog._conditionsFalseStatusText->text().toStdString());
|
dialog._conditionsFalseStatusText->text().toStdString());
|
||||||
macro->SetInputVariables(dialog._currentInputs->GetInputs());
|
macro->SetInputVariables(dialog._currentInputs->GetInputs());
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ public:
|
|||||||
void Save(obs_data_t *obj) const;
|
void Save(obs_data_t *obj) const;
|
||||||
void Load(obs_data_t *obj);
|
void Load(obs_data_t *obj);
|
||||||
|
|
||||||
bool _highlightExecuted = false;
|
bool _highlightExecuted = true;
|
||||||
bool _highlightConditions = false;
|
bool _highlightConditions = true;
|
||||||
bool _highlightActions = false;
|
bool _highlightActions = true;
|
||||||
|
bool _newMacroCheckInParallel = false;
|
||||||
bool _newMacroRegisterHotkeys = true;
|
bool _newMacroRegisterHotkeys = true;
|
||||||
bool _newMacroUseShortCircuitEvaluation = false;
|
bool _newMacroUseShortCircuitEvaluation = false;
|
||||||
bool _saveSettingsOnMacroChange = true;
|
bool _saveSettingsOnMacroChange = true;
|
||||||
@@ -40,6 +41,7 @@ public:
|
|||||||
Macro *macro);
|
Macro *macro);
|
||||||
private slots:
|
private slots:
|
||||||
void DockEnableChanged(int);
|
void DockEnableChanged(int);
|
||||||
|
void IsStandaloneDockChanged(int);
|
||||||
void RunButtonEnableChanged(int);
|
void RunButtonEnableChanged(int);
|
||||||
void PauseButtonEnableChanged(int);
|
void PauseButtonEnableChanged(int);
|
||||||
void StatusLabelEnableChanged(int);
|
void StatusLabelEnableChanged(int);
|
||||||
@@ -52,10 +54,12 @@ private:
|
|||||||
QCheckBox *_highlightExecutedMacros;
|
QCheckBox *_highlightExecutedMacros;
|
||||||
QCheckBox *_highlightConditions;
|
QCheckBox *_highlightConditions;
|
||||||
QCheckBox *_highlightActions;
|
QCheckBox *_highlightActions;
|
||||||
|
QCheckBox *_newMacroCheckInParallel;
|
||||||
QCheckBox *_newMacroRegisterHotkeys;
|
QCheckBox *_newMacroRegisterHotkeys;
|
||||||
QCheckBox *_newMacroUseShortCircuitEvaluation;
|
QCheckBox *_newMacroUseShortCircuitEvaluation;
|
||||||
QCheckBox *_saveSettingsOnMacroChange;
|
QCheckBox *_saveSettingsOnMacroChange;
|
||||||
// Current macro specific settings
|
// Current macro specific settings
|
||||||
|
QCheckBox *_currentCheckInParallel;
|
||||||
QCheckBox *_currentMacroRegisterHotkeys;
|
QCheckBox *_currentMacroRegisterHotkeys;
|
||||||
QCheckBox *_currentUseShortCircuitEvaluation;
|
QCheckBox *_currentUseShortCircuitEvaluation;
|
||||||
QCheckBox *_currentUseCustomConditionCheckInterval;
|
QCheckBox *_currentUseCustomConditionCheckInterval;
|
||||||
@@ -66,6 +70,8 @@ private:
|
|||||||
QCheckBox *_currentStopActionsIfNotDone;
|
QCheckBox *_currentStopActionsIfNotDone;
|
||||||
MacroInputSelection *_currentInputs;
|
MacroInputSelection *_currentInputs;
|
||||||
QCheckBox *_currentMacroRegisterDock;
|
QCheckBox *_currentMacroRegisterDock;
|
||||||
|
QCheckBox *_currentMacroIsStandaloneDock;
|
||||||
|
QLineEdit *_currentMacroDockWindowName;
|
||||||
QCheckBox *_currentMacroDockAddRunButton;
|
QCheckBox *_currentMacroDockAddRunButton;
|
||||||
QCheckBox *_currentMacroDockAddPauseButton;
|
QCheckBox *_currentMacroDockAddPauseButton;
|
||||||
QCheckBox *_currentMacroDockAddStatusLabel;
|
QCheckBox *_currentMacroDockAddStatusLabel;
|
||||||
@@ -78,6 +84,7 @@ private:
|
|||||||
QGroupBox *_dockOptions;
|
QGroupBox *_dockOptions;
|
||||||
QGridLayout *_dockLayout;
|
QGridLayout *_dockLayout;
|
||||||
|
|
||||||
|
int _dockWindowNameRow = -1;
|
||||||
int _runButtonTextRow = -1;
|
int _runButtonTextRow = -1;
|
||||||
int _pauseButtonTextRow = -1;
|
int _pauseButtonTextRow = -1;
|
||||||
int _unpauseButtonTextRow = -1;
|
int _unpauseButtonTextRow = -1;
|
||||||
|
|||||||
13
lib/macro/macro-signals.cpp
Normal file
13
lib/macro/macro-signals.cpp
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#include "macro-signals.hpp"
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
MacroSignalManager::MacroSignalManager(QObject *parent) : QObject(parent) {}
|
||||||
|
|
||||||
|
MacroSignalManager *MacroSignalManager::Instance()
|
||||||
|
{
|
||||||
|
static MacroSignalManager manager;
|
||||||
|
return &manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
26
lib/macro/macro-signals.hpp
Normal file
26
lib/macro/macro-signals.hpp
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "export-symbol-helper.hpp"
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
class ADVSS_EXPORT MacroSignalManager : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static MacroSignalManager *Instance();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void Rename(const QString &, const QString &);
|
||||||
|
void Add(const QString &);
|
||||||
|
void Remove(const QString &);
|
||||||
|
void SegmentOrderChanged();
|
||||||
|
void HighlightChanged(bool value);
|
||||||
|
|
||||||
|
private:
|
||||||
|
MacroSignalManager(QObject *parent = nullptr);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,7 @@
|
|||||||
#include "macro-tree.hpp"
|
#include "macro-tree.hpp"
|
||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
|
#include "macro-search.hpp"
|
||||||
|
#include "macro-signals.hpp"
|
||||||
#include "path-helpers.hpp"
|
#include "path-helpers.hpp"
|
||||||
#include "sync-helpers.hpp"
|
#include "sync-helpers.hpp"
|
||||||
#include "ui-helpers.hpp"
|
#include "ui-helpers.hpp"
|
||||||
@@ -79,10 +81,10 @@ MacroTreeItem::MacroTreeItem(MacroTree *tree, std::shared_ptr<Macro> macroItem,
|
|||||||
_macro->SetPaused(!val);
|
_macro->SetPaused(!val);
|
||||||
};
|
};
|
||||||
connect(_running, &QAbstractButton::clicked, setRunning);
|
connect(_running, &QAbstractButton::clicked, setRunning);
|
||||||
connect(_tree->window(), SIGNAL(HighlightMacrosChanged(bool)), this,
|
connect(MacroSignalManager::Instance(), SIGNAL(HighlightChanged(bool)),
|
||||||
SLOT(EnableHighlight(bool)));
|
this, SLOT(EnableHighlight(bool)));
|
||||||
connect(_tree->window(),
|
connect(MacroSignalManager::Instance(),
|
||||||
SIGNAL(MacroRenamed(const QString &, const QString &)), this,
|
SIGNAL(Rename(const QString &, const QString &)), this,
|
||||||
SLOT(MacroRenamed(const QString &, const QString &)));
|
SLOT(MacroRenamed(const QString &, const QString &)));
|
||||||
connect(&_timer, SIGNAL(timeout()), this, SLOT(HighlightIfExecuted()));
|
connect(&_timer, SIGNAL(timeout()), this, SLOT(HighlightIfExecuted()));
|
||||||
connect(&_timer, SIGNAL(timeout()), this, SLOT(UpdatePaused()));
|
connect(&_timer, SIGNAL(timeout()), this, SLOT(UpdatePaused()));
|
||||||
@@ -414,6 +416,20 @@ void MacroTreeModel::Add(std::shared_ptr<Macro> item)
|
|||||||
QItemSelectionModel::Select);
|
QItemSelectionModel::Select);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroTreeModel::MoveToBeginningOfGroup(std::shared_ptr<Macro> item,
|
||||||
|
std::shared_ptr<Macro> group)
|
||||||
|
{
|
||||||
|
auto it = std::find(_macros.begin(), _macros.end(), item);
|
||||||
|
assert(it != _macros.end());
|
||||||
|
std::shared_ptr<Macro> tmp = *it;
|
||||||
|
_macros.erase(it);
|
||||||
|
it = std::find(_macros.begin(), _macros.end(), group);
|
||||||
|
assert(it != _macros.end());
|
||||||
|
_macros.insert(std::next(it), tmp);
|
||||||
|
|
||||||
|
Reset(_macros);
|
||||||
|
}
|
||||||
|
|
||||||
void MacroTreeModel::Remove(std::shared_ptr<Macro> item)
|
void MacroTreeModel::Remove(std::shared_ptr<Macro> item)
|
||||||
{
|
{
|
||||||
auto lock = LockContext();
|
auto lock = LockContext();
|
||||||
@@ -768,7 +784,8 @@ void MacroTree::Reset(std::deque<std::shared_ptr<Macro>> ¯os,
|
|||||||
bool highlight)
|
bool highlight)
|
||||||
{
|
{
|
||||||
_highlight = highlight;
|
_highlight = highlight;
|
||||||
MacroTreeModel *mtm = new MacroTreeModel(this, macros);
|
|
||||||
|
auto mtm = new MacroTreeModel(this, macros);
|
||||||
setModel(mtm);
|
setModel(mtm);
|
||||||
GetModel()->Reset(macros);
|
GetModel()->Reset(macros);
|
||||||
connect(selectionModel(),
|
connect(selectionModel(),
|
||||||
@@ -789,6 +806,13 @@ void MacroTree::Add(std::shared_ptr<Macro> item,
|
|||||||
assert(GetModel()->IsInValidState());
|
assert(GetModel()->IsInValidState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroTree::AddToGroup(std::shared_ptr<Macro> item,
|
||||||
|
std::shared_ptr<Macro> group) const
|
||||||
|
{
|
||||||
|
GetModel()->Add(item);
|
||||||
|
GetModel()->MoveToBeginningOfGroup(item, group);
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<Macro> MacroTree::GetCurrentMacro() const
|
std::shared_ptr<Macro> MacroTree::GetCurrentMacro() const
|
||||||
{
|
{
|
||||||
return GetModel()->GetCurrentMacro();
|
return GetModel()->GetCurrentMacro();
|
||||||
@@ -847,7 +871,7 @@ void MacroTree::UpdateWidgets(bool force)
|
|||||||
|
|
||||||
for (int i = 0; i < (int)mtm->_macros.size(); i++) {
|
for (int i = 0; i < (int)mtm->_macros.size(); i++) {
|
||||||
std::shared_ptr<Macro> item = mtm->_macros[i];
|
std::shared_ptr<Macro> item = mtm->_macros[i];
|
||||||
MacroTreeItem *widget = GetItemWidget(i);
|
auto widget = GetItemWidget(i);
|
||||||
|
|
||||||
if (!widget) {
|
if (!widget) {
|
||||||
UpdateWidget(mtm->createIndex(i, 0, nullptr), item);
|
UpdateWidget(mtm->createIndex(i, 0, nullptr), item);
|
||||||
@@ -1160,6 +1184,34 @@ bool MacroTree::SelectionEmpty() const
|
|||||||
return selectedIndexes().empty();
|
return selectedIndexes().empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MacroTree::GroupsExist() const
|
||||||
|
{
|
||||||
|
for (const auto ¯o : GetTopLevelMacros()) {
|
||||||
|
if (macro->IsGroup()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroTree::ExpandGroup(std::shared_ptr<Macro> item) const
|
||||||
|
{
|
||||||
|
auto *mtm = GetModel();
|
||||||
|
mtm->ExpandGroup(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroTree::CollapseGroup(std::shared_ptr<Macro> item) const
|
||||||
|
{
|
||||||
|
auto *mtm = GetModel();
|
||||||
|
mtm->CollapseGroup(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroTree::RefreshFilter()
|
||||||
|
{
|
||||||
|
UpdateWidgets();
|
||||||
|
doItemsLayout();
|
||||||
|
}
|
||||||
|
|
||||||
void MacroTree::MoveItemBefore(const std::shared_ptr<Macro> &item,
|
void MacroTree::MoveItemBefore(const std::shared_ptr<Macro> &item,
|
||||||
const std::shared_ptr<Macro> &after) const
|
const std::shared_ptr<Macro> &after) const
|
||||||
{
|
{
|
||||||
@@ -1174,7 +1226,7 @@ void MacroTree::MoveItemAfter(const std::shared_ptr<Macro> &item,
|
|||||||
|
|
||||||
MacroTreeModel *MacroTree::GetModel() const
|
MacroTreeModel *MacroTree::GetModel() const
|
||||||
{
|
{
|
||||||
return reinterpret_cast<MacroTreeModel *>(model());
|
return qobject_cast<MacroTreeModel *>(model());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroTree::Remove(std::shared_ptr<Macro> item) const
|
void MacroTree::Remove(std::shared_ptr<Macro> item) const
|
||||||
@@ -1260,6 +1312,26 @@ void MacroTree::UngroupSelectedGroups()
|
|||||||
assert(GetModel()->IsInValidState());
|
assert(GetModel()->IsInValidState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroTree::ExpandAll()
|
||||||
|
{
|
||||||
|
for (const auto ¯o : GetTopLevelMacros()) {
|
||||||
|
if (!macro->IsGroup()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ExpandGroup(macro);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroTree::CollapseAll()
|
||||||
|
{
|
||||||
|
for (const auto ¯o : GetTopLevelMacros()) {
|
||||||
|
if (!macro->IsGroup()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
CollapseGroup(macro);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MacroTree::SelectionChangedHelper(const QItemSelection &,
|
void MacroTree::SelectionChangedHelper(const QItemSelection &,
|
||||||
const QItemSelection &)
|
const QItemSelection &)
|
||||||
{
|
{
|
||||||
@@ -1269,8 +1341,8 @@ void MacroTree::SelectionChangedHelper(const QItemSelection &,
|
|||||||
|
|
||||||
inline MacroTreeItem *MacroTree::GetItemWidget(int idx) const
|
inline MacroTreeItem *MacroTree::GetItemWidget(int idx) const
|
||||||
{
|
{
|
||||||
QWidget *widget = indexWidget(GetModel()->createIndex(idx, 0, nullptr));
|
auto widget = indexWidget(GetModel()->createIndex(idx, 0, nullptr));
|
||||||
return reinterpret_cast<MacroTreeItem *>(widget);
|
return qobject_cast<MacroTreeItem *>(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroTree::paintEvent(QPaintEvent *event)
|
void MacroTree::paintEvent(QPaintEvent *event)
|
||||||
@@ -1297,14 +1369,25 @@ MacroTreeDelegate::MacroTreeDelegate(QObject *parent)
|
|||||||
QSize MacroTreeDelegate::sizeHint(const QStyleOptionViewItem &option,
|
QSize MacroTreeDelegate::sizeHint(const QStyleOptionViewItem &option,
|
||||||
const QModelIndex &index) const
|
const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
MacroTree *tree = qobject_cast<MacroTree *>(parent());
|
auto tree = qobject_cast<MacroTree *>(parent());
|
||||||
QWidget *item = tree->indexWidget(index);
|
auto widget = tree->indexWidget(index);
|
||||||
|
|
||||||
if (!item) {
|
if (!widget) {
|
||||||
return (QSize(0, 0));
|
return QStyledItemDelegate::sizeHint(option, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (QSize(option.widget->minimumWidth(), item->height()));
|
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
|
} // namespace advss
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ private:
|
|||||||
void MoveItemAfter(const std::shared_ptr<Macro> &item,
|
void MoveItemAfter(const std::shared_ptr<Macro> &item,
|
||||||
const std::shared_ptr<Macro> &after);
|
const std::shared_ptr<Macro> &after);
|
||||||
void Add(std::shared_ptr<Macro> item);
|
void Add(std::shared_ptr<Macro> item);
|
||||||
|
void MoveToBeginningOfGroup(std::shared_ptr<Macro> item,
|
||||||
|
std::shared_ptr<Macro>);
|
||||||
void Remove(std::shared_ptr<Macro> item);
|
void Remove(std::shared_ptr<Macro> item);
|
||||||
std::shared_ptr<Macro> Neighbor(const std::shared_ptr<Macro> &m,
|
std::shared_ptr<Macro> Neighbor(const std::shared_ptr<Macro> &m,
|
||||||
bool above) const;
|
bool above) const;
|
||||||
@@ -126,6 +128,8 @@ public:
|
|||||||
void Reset(std::deque<std::shared_ptr<Macro>> &, bool highlight);
|
void Reset(std::deque<std::shared_ptr<Macro>> &, bool highlight);
|
||||||
void Add(std::shared_ptr<Macro> item,
|
void Add(std::shared_ptr<Macro> item,
|
||||||
std::shared_ptr<Macro> after = {}) const;
|
std::shared_ptr<Macro> after = {}) const;
|
||||||
|
void AddToGroup(std::shared_ptr<Macro> item,
|
||||||
|
std::shared_ptr<Macro> group) const;
|
||||||
void Remove(std::shared_ptr<Macro> item) const;
|
void Remove(std::shared_ptr<Macro> item) const;
|
||||||
void Up(std::shared_ptr<Macro> item) const;
|
void Up(std::shared_ptr<Macro> item) const;
|
||||||
void Down(std::shared_ptr<Macro> item) const;
|
void Down(std::shared_ptr<Macro> item) const;
|
||||||
@@ -135,10 +139,16 @@ public:
|
|||||||
bool GroupedItemsSelected() const;
|
bool GroupedItemsSelected() const;
|
||||||
bool SingleItemSelected() const;
|
bool SingleItemSelected() const;
|
||||||
bool SelectionEmpty() const;
|
bool SelectionEmpty() const;
|
||||||
|
bool GroupsExist() const;
|
||||||
|
void ExpandGroup(std::shared_ptr<Macro> item) const;
|
||||||
|
void CollapseGroup(std::shared_ptr<Macro> item) const;
|
||||||
|
void RefreshFilter();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void GroupSelectedItems();
|
void GroupSelectedItems();
|
||||||
void UngroupSelectedGroups();
|
void UngroupSelectedGroups();
|
||||||
|
void ExpandAll();
|
||||||
|
void CollapseAll();
|
||||||
void SelectionChangedHelper(const QItemSelection &,
|
void SelectionChangedHelper(const QItemSelection &,
|
||||||
const QItemSelection &);
|
const QItemSelection &);
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
#include "macro-action-factory.hpp"
|
#include "macro-action-factory.hpp"
|
||||||
#include "macro-condition-factory.hpp"
|
#include "macro-condition-factory.hpp"
|
||||||
#include "macro-dock.hpp"
|
|
||||||
#include "macro-helpers.hpp"
|
#include "macro-helpers.hpp"
|
||||||
|
#include "macro-settings.hpp"
|
||||||
#include "plugin-state-helpers.hpp"
|
#include "plugin-state-helpers.hpp"
|
||||||
#include "splitter-helpers.hpp"
|
#include "splitter-helpers.hpp"
|
||||||
#include "sync-helpers.hpp"
|
#include "sync-helpers.hpp"
|
||||||
@@ -14,77 +14,24 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <util/platform.h>
|
|
||||||
|
|
||||||
#if LIBOBS_API_VER < MAKE_SEMANTIC_VERSION(30, 0, 0)
|
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
struct DockMapEntry {
|
|
||||||
QAction *action = nullptr;
|
|
||||||
QWidget *dock = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
static std::unordered_map<const char *, DockMapEntry> dockIds;
|
|
||||||
static std::mutex dockMutex;
|
|
||||||
|
|
||||||
static bool obs_frontend_add_dock_by_id(const char *id, const char *title,
|
|
||||||
QWidget *widget)
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(dockMutex);
|
|
||||||
if (dockIds.count(id) > 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
widget->setObjectName(id);
|
|
||||||
|
|
||||||
auto dock = new QDockWidget();
|
|
||||||
dock->setWindowTitle(title);
|
|
||||||
dock->setWidget(widget);
|
|
||||||
dock->setFloating(true);
|
|
||||||
dock->setVisible(false);
|
|
||||||
dock->setFeatures(QDockWidget::DockWidgetClosable |
|
|
||||||
QDockWidget::DockWidgetMovable |
|
|
||||||
QDockWidget::DockWidgetFloatable);
|
|
||||||
|
|
||||||
auto action = static_cast<QAction *>(obs_frontend_add_dock(dock));
|
|
||||||
if (!action) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
dockIds[id] = {action, dock};
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void obs_frontend_remove_dock(const char *id)
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(dockMutex);
|
|
||||||
auto it = dockIds.find(id);
|
|
||||||
if (it == dockIds.end()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
it->second.action->deleteLater();
|
|
||||||
it->second.dock->deleteLater();
|
|
||||||
dockIds.erase(it);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
static std::deque<std::shared_ptr<Macro>> macros;
|
Macro::Macro(const std::string &name) : _dockSettings(this)
|
||||||
|
|
||||||
Macro::Macro(const std::string &name, const bool addHotkey,
|
|
||||||
const bool shortCircuitEvaluation)
|
|
||||||
{
|
{
|
||||||
SetName(name);
|
SetName(name);
|
||||||
if (addHotkey) {
|
}
|
||||||
|
|
||||||
|
Macro::Macro(const std::string &name, const GlobalMacroSettings &settings)
|
||||||
|
: Macro(name)
|
||||||
|
{
|
||||||
|
if (settings._newMacroRegisterHotkeys) {
|
||||||
SetupHotkeys();
|
SetupHotkeys();
|
||||||
}
|
}
|
||||||
_registerHotkeys = addHotkey;
|
_registerHotkeys = settings._newMacroRegisterHotkeys;
|
||||||
_useShortCircuitEvaluation = shortCircuitEvaluation;
|
_checkInParallel = settings._newMacroCheckInParallel;
|
||||||
|
_useShortCircuitEvaluation =
|
||||||
|
settings._newMacroUseShortCircuitEvaluation;
|
||||||
}
|
}
|
||||||
|
|
||||||
Macro::~Macro()
|
Macro::~Macro()
|
||||||
@@ -92,19 +39,14 @@ Macro::~Macro()
|
|||||||
_die = true;
|
_die = true;
|
||||||
Stop();
|
Stop();
|
||||||
ClearHotkeys();
|
ClearHotkeys();
|
||||||
|
|
||||||
// Keep the dock widgets in case of shutdown so they can be restored by
|
|
||||||
// OBS on startup
|
|
||||||
if (!OBSIsShuttingDown()) {
|
|
||||||
RemoveDock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Macro>
|
std::shared_ptr<Macro>
|
||||||
Macro::CreateGroup(const std::string &name,
|
Macro::CreateGroup(const std::string &name,
|
||||||
std::vector<std::shared_ptr<Macro>> &children)
|
std::vector<std::shared_ptr<Macro>> &children)
|
||||||
{
|
{
|
||||||
auto group = std::make_shared<Macro>(name, false);
|
auto group = std::make_shared<Macro>(name);
|
||||||
|
group->_registerHotkeys = false;
|
||||||
for (auto &c : children) {
|
for (auto &c : children) {
|
||||||
c->SetParent(group);
|
c->SetParent(group);
|
||||||
}
|
}
|
||||||
@@ -115,6 +57,7 @@ Macro::CreateGroup(const std::string &name,
|
|||||||
|
|
||||||
void Macro::RemoveGroup(std::shared_ptr<Macro> group)
|
void Macro::RemoveGroup(std::shared_ptr<Macro> group)
|
||||||
{
|
{
|
||||||
|
auto ¯os = GetTopLevelMacros();
|
||||||
auto it = std::find(macros.begin(), macros.end(), group);
|
auto it = std::find(macros.begin(), macros.end(), group);
|
||||||
if (it == macros.end()) {
|
if (it == macros.end()) {
|
||||||
return;
|
return;
|
||||||
@@ -131,6 +74,7 @@ void Macro::RemoveGroup(std::shared_ptr<Macro> group)
|
|||||||
|
|
||||||
void Macro::PrepareMoveToGroup(Macro *group, std::shared_ptr<Macro> item)
|
void Macro::PrepareMoveToGroup(Macro *group, std::shared_ptr<Macro> item)
|
||||||
{
|
{
|
||||||
|
auto ¯os = GetTopLevelMacros();
|
||||||
for (const auto &m : macros) {
|
for (const auto &m : macros) {
|
||||||
if (m.get() == group) {
|
if (m.get() == group) {
|
||||||
PrepareMoveToGroup(m, item);
|
PrepareMoveToGroup(m, item);
|
||||||
@@ -165,7 +109,10 @@ static bool checkCondition(const std::shared_ptr<MacroCondition> &condition)
|
|||||||
static constexpr auto perfLogThreshold = 300ms;
|
static constexpr auto perfLogThreshold = 300ms;
|
||||||
|
|
||||||
const auto startTime = std::chrono::high_resolution_clock::now();
|
const auto startTime = std::chrono::high_resolution_clock::now();
|
||||||
const bool conditionMatched = condition->CheckCondition();
|
bool conditionMatched = false;
|
||||||
|
condition->WithLock([&condition, &conditionMatched]() {
|
||||||
|
conditionMatched = condition->CheckCondition();
|
||||||
|
});
|
||||||
const auto endTime = std::chrono::high_resolution_clock::now();
|
const auto endTime = std::chrono::high_resolution_clock::now();
|
||||||
const auto timeSpent = endTime - startTime;
|
const auto timeSpent = endTime - startTime;
|
||||||
|
|
||||||
@@ -244,19 +191,52 @@ bool Macro::CheckConditions(bool ignorePause)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_stop = false;
|
const auto checkConditionsTask =
|
||||||
_matched = false;
|
[this,
|
||||||
for (auto &condition : _conditions) {
|
ignorePause](const std::deque<std::shared_ptr<MacroCondition>>
|
||||||
if (!condition) {
|
&conditions) {
|
||||||
continue;
|
for (auto &condition : conditions) {
|
||||||
}
|
if (!condition) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (_paused && !ignorePause) {
|
if (_paused && !ignorePause) {
|
||||||
vblog(LOG_INFO, "Macro %s is paused", _name.c_str());
|
vblog(LOG_INFO, "Macro %s is paused",
|
||||||
|
_name.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
_matched = CheckConditionHelper(condition);
|
||||||
|
}
|
||||||
|
return _matched;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (CheckInParallel()) {
|
||||||
|
if (!_conditionCheckFuture.valid()) {
|
||||||
|
_stop = false;
|
||||||
|
_matched = false;
|
||||||
|
_conditionCheckFuture = std::async(
|
||||||
|
std::launch::async,
|
||||||
|
[this, checkConditionsTask]() {
|
||||||
|
// Copy to avoid settings modifications
|
||||||
|
// causing issues
|
||||||
|
const auto conditionsCopy = _conditions;
|
||||||
|
checkConditionsTask(conditionsCopy);
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (_conditionCheckFuture.wait_for(std::chrono::seconds(0)) !=
|
||||||
_matched = CheckConditionHelper(condition);
|
std::future_status::ready) {
|
||||||
|
vblog(LOG_INFO,
|
||||||
|
"Macro %s still waiting for condition check result",
|
||||||
|
_name.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_conditionCheckFuture.get();
|
||||||
|
} else {
|
||||||
|
_stop = false;
|
||||||
|
_matched = false;
|
||||||
|
_matched = checkConditionsTask(_conditions);
|
||||||
}
|
}
|
||||||
|
|
||||||
vblog(LOG_INFO, "Macro %s returned %d", _name.c_str(), _matched);
|
vblog(LOG_INFO, "Macro %s returned %d", _name.c_str(), _matched);
|
||||||
@@ -273,7 +253,9 @@ bool Macro::CheckConditions(bool ignorePause)
|
|||||||
|
|
||||||
bool Macro::PerformActions(bool match, bool forceParallel, bool ignorePause)
|
bool Macro::PerformActions(bool match, bool forceParallel, bool ignorePause)
|
||||||
{
|
{
|
||||||
if (!_done) {
|
if (_actionRunFuture.valid() &&
|
||||||
|
_actionRunFuture.wait_for(std::chrono::seconds(0)) !=
|
||||||
|
std::future_status::ready) {
|
||||||
vblog(LOG_INFO, "Macro %s already running", _name.c_str());
|
vblog(LOG_INFO, "Macro %s already running", _name.c_str());
|
||||||
|
|
||||||
if (!_stopActionsIfNotDone) {
|
if (!_stopActionsIfNotDone) {
|
||||||
@@ -291,14 +273,15 @@ bool Macro::PerformActions(bool match, bool forceParallel, bool ignorePause)
|
|||||||
: std::bind(&Macro::RunElseActions, this,
|
: std::bind(&Macro::RunElseActions, this,
|
||||||
std::placeholders::_1);
|
std::placeholders::_1);
|
||||||
_stop = false;
|
_stop = false;
|
||||||
_done = false;
|
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
if (_runInParallel || forceParallel) {
|
if (_runInParallel || forceParallel) {
|
||||||
if (_backgroundThread.joinable()) {
|
if (_actionRunFuture.valid()) {
|
||||||
_backgroundThread.join();
|
_actionRunFuture.get();
|
||||||
}
|
}
|
||||||
_backgroundThread = std::thread(
|
_actionRunFuture = std::async(std::launch::async,
|
||||||
[this, runFunc, ignorePause] { runFunc(ignorePause); });
|
[this, runFunc, ignorePause] {
|
||||||
|
runFunc(ignorePause);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
ret = runFunc(ignorePause);
|
ret = runFunc(ignorePause);
|
||||||
}
|
}
|
||||||
@@ -336,6 +319,13 @@ bool Macro::ConditionsShouldBeChecked() const
|
|||||||
|
|
||||||
bool Macro::ShouldRunActions() const
|
bool Macro::ShouldRunActions() const
|
||||||
{
|
{
|
||||||
|
if (CheckInParallel() && _conditionCheckFuture.valid()) {
|
||||||
|
vblog(LOG_INFO,
|
||||||
|
"%s not ready to perform actions as condition check is still running",
|
||||||
|
_name.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const bool hasActionsToExecute =
|
const bool hasActionsToExecute =
|
||||||
!_paused && (_matched || _elseActions.size() > 0) &&
|
!_paused && (_matched || _elseActions.size() > 0) &&
|
||||||
(!_performActionsOnChange || _conditionSateChanged);
|
(!_performActionsOnChange || _conditionSateChanged);
|
||||||
@@ -358,15 +348,9 @@ bool Macro::ShouldRunActions() const
|
|||||||
|
|
||||||
void Macro::SetName(const std::string &name)
|
void Macro::SetName(const std::string &name)
|
||||||
{
|
{
|
||||||
const bool nameChanged = _name == name;
|
|
||||||
_name = name;
|
_name = name;
|
||||||
|
|
||||||
SetHotkeysDesc();
|
SetHotkeysDesc();
|
||||||
|
_dockSettings.HandleMacroNameChange();
|
||||||
if (nameChanged) {
|
|
||||||
_dockId = GenerateDockId();
|
|
||||||
}
|
|
||||||
EnableDock(_registerDock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Macro::ResetTimers()
|
void Macro::ResetTimers()
|
||||||
@@ -393,9 +377,12 @@ bool Macro::RunActionsHelper(
|
|||||||
}
|
}
|
||||||
if (action->Enabled()) {
|
if (action->Enabled()) {
|
||||||
action->LogAction();
|
action->LogAction();
|
||||||
|
bool actionResult = false;
|
||||||
|
action->WithLock([&action, &actionResult]() {
|
||||||
|
actionResult = action->PerformAction();
|
||||||
|
});
|
||||||
actionsExecutedSuccessfully =
|
actionsExecutedSuccessfully =
|
||||||
actionsExecutedSuccessfully &&
|
actionsExecutedSuccessfully && actionResult;
|
||||||
action->PerformAction();
|
|
||||||
} else {
|
} else {
|
||||||
vblog(LOG_INFO, "skipping disabled action %s",
|
vblog(LOG_INFO, "skipping disabled action %s",
|
||||||
action->GetId().c_str());
|
action->GetId().c_str());
|
||||||
@@ -408,7 +395,6 @@ bool Macro::RunActionsHelper(
|
|||||||
action->EnableHighlight();
|
action->EnableHighlight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_done = true;
|
|
||||||
return actionsExecutedSuccessfully;
|
return actionsExecutedSuccessfully;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,9 +494,35 @@ void Macro::Stop()
|
|||||||
t.join();
|
t.join();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_backgroundThread.joinable()) {
|
if (_actionRunFuture.valid()) {
|
||||||
_backgroundThread.join();
|
_actionRunFuture.get();
|
||||||
}
|
}
|
||||||
|
if (_conditionCheckFuture.valid()) {
|
||||||
|
_conditionCheckFuture.get();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Macro::SetCheckInParallel(bool parallel)
|
||||||
|
{
|
||||||
|
_checkInParallel = parallel;
|
||||||
|
_conditionCheckFuture = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Macro::ParallelTasksCompleted() const
|
||||||
|
{
|
||||||
|
// A parallel action run might be triggered by RunInParallel() or the
|
||||||
|
// "Run Macro" button, so checking just for RunInParallel() will not
|
||||||
|
// suffice
|
||||||
|
if (!CheckInParallel() && !_actionRunFuture.valid()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (_actionRunFuture.valid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (CheckInParallel() && _conditionCheckFuture.valid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
MacroInputVariables Macro::GetInputVariables() const
|
MacroInputVariables Macro::GetInputVariables() const
|
||||||
@@ -523,7 +535,7 @@ void Macro::SetInputVariables(const MacroInputVariables &inputVariables)
|
|||||||
_inputVariables = inputVariables;
|
_inputVariables = inputVariables;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<TempVariable> Macro::GetTempVars(MacroSegment *filter) const
|
std::vector<TempVariable> Macro::GetTempVars(const MacroSegment *filter) const
|
||||||
{
|
{
|
||||||
std::vector<TempVariable> res;
|
std::vector<TempVariable> res;
|
||||||
|
|
||||||
@@ -551,7 +563,7 @@ std::vector<TempVariable> Macro::GetTempVars(MacroSegment *filter) const
|
|||||||
return ptr.get() == segment;
|
return ptr.get() == segment;
|
||||||
}) != _conditions.end();
|
}) != _conditions.end();
|
||||||
};
|
};
|
||||||
auto isAction = [this](MacroSegment *segment) -> bool {
|
auto isAction = [this](const MacroSegment *segment) -> bool {
|
||||||
return std::find_if(_actions.begin(), _actions.end(),
|
return std::find_if(_actions.begin(), _actions.end(),
|
||||||
[segment](
|
[segment](
|
||||||
const std::shared_ptr<MacroSegment>
|
const std::shared_ptr<MacroSegment>
|
||||||
@@ -559,7 +571,7 @@ std::vector<TempVariable> Macro::GetTempVars(MacroSegment *filter) const
|
|||||||
return ptr.get() == segment;
|
return ptr.get() == segment;
|
||||||
}) != _actions.end();
|
}) != _actions.end();
|
||||||
};
|
};
|
||||||
auto isElseAction = [this](MacroSegment *segment) -> bool {
|
auto isElseAction = [this](const MacroSegment *segment) -> bool {
|
||||||
return std::find_if(_elseActions.begin(), _elseActions.end(),
|
return std::find_if(_elseActions.begin(), _elseActions.end(),
|
||||||
[segment](
|
[segment](
|
||||||
const std::shared_ptr<MacroSegment>
|
const std::shared_ptr<MacroSegment>
|
||||||
@@ -648,16 +660,31 @@ std::deque<std::shared_ptr<MacroCondition>> &Macro::Conditions()
|
|||||||
return _conditions;
|
return _conditions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::deque<std::shared_ptr<MacroCondition>> &Macro::Conditions() const
|
||||||
|
{
|
||||||
|
return _conditions;
|
||||||
|
}
|
||||||
|
|
||||||
std::deque<std::shared_ptr<MacroAction>> &Macro::Actions()
|
std::deque<std::shared_ptr<MacroAction>> &Macro::Actions()
|
||||||
{
|
{
|
||||||
return _actions;
|
return _actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::deque<std::shared_ptr<MacroAction>> &Macro::Actions() const
|
||||||
|
{
|
||||||
|
return _actions;
|
||||||
|
}
|
||||||
|
|
||||||
std::deque<std::shared_ptr<MacroAction>> &Macro::ElseActions()
|
std::deque<std::shared_ptr<MacroAction>> &Macro::ElseActions()
|
||||||
{
|
{
|
||||||
return _elseActions;
|
return _elseActions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::deque<std::shared_ptr<MacroAction>> &Macro::ElseActions() const
|
||||||
|
{
|
||||||
|
return _elseActions;
|
||||||
|
}
|
||||||
|
|
||||||
static void updateIndicesHelper(std::deque<std::shared_ptr<MacroSegment>> &list)
|
static void updateIndicesHelper(std::deque<std::shared_ptr<MacroSegment>> &list)
|
||||||
{
|
{
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
@@ -712,6 +739,7 @@ bool Macro::Save(obs_data_t *obj, bool saveForCopy) const
|
|||||||
static_cast<int>(_pauseSaveBehavior));
|
static_cast<int>(_pauseSaveBehavior));
|
||||||
obs_data_set_bool(obj, "pause", _paused);
|
obs_data_set_bool(obj, "pause", _paused);
|
||||||
obs_data_set_bool(obj, "parallel", _runInParallel);
|
obs_data_set_bool(obj, "parallel", _runInParallel);
|
||||||
|
obs_data_set_bool(obj, "checkConditionsInParallel", _checkInParallel);
|
||||||
obs_data_set_bool(obj, "onChange", _performActionsOnChange);
|
obs_data_set_bool(obj, "onChange", _performActionsOnChange);
|
||||||
obs_data_set_bool(obj, "skipExecOnStart", _skipExecOnStart);
|
obs_data_set_bool(obj, "skipExecOnStart", _skipExecOnStart);
|
||||||
obs_data_set_bool(obj, "stopActionsIfNotDone", _stopActionsIfNotDone);
|
obs_data_set_bool(obj, "stopActionsIfNotDone", _stopActionsIfNotDone);
|
||||||
@@ -721,7 +749,7 @@ bool Macro::Save(obs_data_t *obj, bool saveForCopy) const
|
|||||||
_useCustomConditionCheckInterval);
|
_useCustomConditionCheckInterval);
|
||||||
_customConditionCheckInterval.Save(obj, "customConditionCheckInterval");
|
_customConditionCheckInterval.Save(obj, "customConditionCheckInterval");
|
||||||
|
|
||||||
SaveDockSettings(obj, saveForCopy);
|
_dockSettings.Save(obj, saveForCopy);
|
||||||
|
|
||||||
SaveSplitterPos(_actionConditionSplitterPosition, obj,
|
SaveSplitterPos(_actionConditionSplitterPosition, obj,
|
||||||
"macroActionConditionSplitterPosition");
|
"macroActionConditionSplitterPosition");
|
||||||
@@ -797,6 +825,7 @@ bool Macro::Load(obs_data_t *obj)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_runInParallel = obs_data_get_bool(obj, "parallel");
|
_runInParallel = obs_data_get_bool(obj, "parallel");
|
||||||
|
_checkInParallel = obs_data_get_bool(obj, "checkConditionsInParallel");
|
||||||
_performActionsOnChange = obs_data_get_bool(obj, "onChange");
|
_performActionsOnChange = obs_data_get_bool(obj, "onChange");
|
||||||
_skipExecOnStart = obs_data_get_bool(obj, "skipExecOnStart");
|
_skipExecOnStart = obs_data_get_bool(obj, "skipExecOnStart");
|
||||||
_stopActionsIfNotDone = obs_data_get_bool(obj, "stopActionsIfNotDone");
|
_stopActionsIfNotDone = obs_data_get_bool(obj, "stopActionsIfNotDone");
|
||||||
@@ -806,7 +835,7 @@ bool Macro::Load(obs_data_t *obj)
|
|||||||
obs_data_get_bool(obj, "useCustomConditionCheckInterval");
|
obs_data_get_bool(obj, "useCustomConditionCheckInterval");
|
||||||
_customConditionCheckInterval.Load(obj, "customConditionCheckInterval");
|
_customConditionCheckInterval.Load(obj, "customConditionCheckInterval");
|
||||||
|
|
||||||
LoadDockSettings(obj);
|
_dockSettings.Load(obj);
|
||||||
|
|
||||||
LoadSplitterPos(_actionConditionSplitterPosition, obj,
|
LoadSplitterPos(_actionConditionSplitterPosition, obj,
|
||||||
"macroActionConditionSplitterPosition");
|
"macroActionConditionSplitterPosition");
|
||||||
@@ -840,9 +869,12 @@ bool Macro::Load(obs_data_t *obj)
|
|||||||
auto newEntry = MacroConditionFactory::Create(id, this);
|
auto newEntry = MacroConditionFactory::Create(id, this);
|
||||||
if (newEntry) {
|
if (newEntry) {
|
||||||
_conditions.emplace_back(newEntry);
|
_conditions.emplace_back(newEntry);
|
||||||
auto c = _conditions.back().get();
|
auto condition = _conditions.back().get();
|
||||||
c->Load(arrayObj);
|
condition->WithLock([&]() {
|
||||||
c->ValidateLogicSelection(root, Name().c_str());
|
condition->Load(arrayObj);
|
||||||
|
condition->ValidateLogicSelection(
|
||||||
|
root, Name().c_str());
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
blog(LOG_WARNING,
|
blog(LOG_WARNING,
|
||||||
"discarding condition entry with unknown id (%s) for macro %s",
|
"discarding condition entry with unknown id (%s) for macro %s",
|
||||||
@@ -855,12 +887,15 @@ bool Macro::Load(obs_data_t *obj)
|
|||||||
OBSDataArrayAutoRelease actions = obs_data_get_array(obj, "actions");
|
OBSDataArrayAutoRelease actions = obs_data_get_array(obj, "actions");
|
||||||
count = obs_data_array_count(actions);
|
count = obs_data_array_count(actions);
|
||||||
for (size_t i = 0; i < count; i++) {
|
for (size_t i = 0; i < count; i++) {
|
||||||
OBSDataAutoRelease array_obj = obs_data_array_item(actions, i);
|
OBSDataAutoRelease arrayObj = obs_data_array_item(actions, i);
|
||||||
std::string id = obs_data_get_string(array_obj, "id");
|
std::string id = obs_data_get_string(arrayObj, "id");
|
||||||
auto newEntry = MacroActionFactory::Create(id, this);
|
auto newEntry = MacroActionFactory::Create(id, this);
|
||||||
if (newEntry) {
|
if (newEntry) {
|
||||||
_actions.emplace_back(newEntry);
|
_actions.emplace_back(newEntry);
|
||||||
_actions.back()->Load(array_obj);
|
auto action = _actions.back().get();
|
||||||
|
action->WithLock([action, &arrayObj]() {
|
||||||
|
action->Load(arrayObj);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
blog(LOG_WARNING,
|
blog(LOG_WARNING,
|
||||||
"discarding action entry with unknown id (%s) for macro %s",
|
"discarding action entry with unknown id (%s) for macro %s",
|
||||||
@@ -873,13 +908,16 @@ bool Macro::Load(obs_data_t *obj)
|
|||||||
obs_data_get_array(obj, "elseActions");
|
obs_data_get_array(obj, "elseActions");
|
||||||
count = obs_data_array_count(elseActions);
|
count = obs_data_array_count(elseActions);
|
||||||
for (size_t i = 0; i < count; i++) {
|
for (size_t i = 0; i < count; i++) {
|
||||||
OBSDataAutoRelease array_obj =
|
OBSDataAutoRelease arrayObj =
|
||||||
obs_data_array_item(elseActions, i);
|
obs_data_array_item(elseActions, i);
|
||||||
std::string id = obs_data_get_string(array_obj, "id");
|
std::string id = obs_data_get_string(arrayObj, "id");
|
||||||
auto newEntry = MacroActionFactory::Create(id, this);
|
auto newEntry = MacroActionFactory::Create(id, this);
|
||||||
if (newEntry) {
|
if (newEntry) {
|
||||||
_elseActions.emplace_back(newEntry);
|
_elseActions.emplace_back(newEntry);
|
||||||
_elseActions.back()->Load(array_obj);
|
auto action = _elseActions.back().get();
|
||||||
|
action->WithLock([action, &arrayObj]() {
|
||||||
|
action->Load(arrayObj);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
blog(LOG_WARNING,
|
blog(LOG_WARNING,
|
||||||
"discarding elseAction entry with unknown id (%s) for macro %s",
|
"discarding elseAction entry with unknown id (%s) for macro %s",
|
||||||
@@ -896,13 +934,13 @@ bool Macro::Load(obs_data_t *obj)
|
|||||||
bool Macro::PostLoad()
|
bool Macro::PostLoad()
|
||||||
{
|
{
|
||||||
for (auto &c : _conditions) {
|
for (auto &c : _conditions) {
|
||||||
c->PostLoad();
|
c->WithLock([c]() { c->PostLoad(); });
|
||||||
}
|
}
|
||||||
for (auto &a : _actions) {
|
for (auto &a : _actions) {
|
||||||
a->PostLoad();
|
a->WithLock([a]() { a->PostLoad(); });
|
||||||
}
|
}
|
||||||
for (auto &a : _elseActions) {
|
for (auto &a : _elseActions) {
|
||||||
a->PostLoad();
|
a->WithLock([a]() { a->PostLoad(); });
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -987,224 +1025,6 @@ bool Macro::PauseHotkeysEnabled() const
|
|||||||
return _registerHotkeys;
|
return _registerHotkeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Macro::SaveDockSettings(obs_data_t *obj, bool saveForCopy) const
|
|
||||||
{
|
|
||||||
auto dockSettings = obs_data_create();
|
|
||||||
obs_data_set_bool(dockSettings, "register", _registerDock);
|
|
||||||
obs_data_set_bool(dockSettings, "hasRunButton", _dockHasRunButton);
|
|
||||||
obs_data_set_bool(dockSettings, "hasPauseButton", _dockHasPauseButton);
|
|
||||||
obs_data_set_bool(dockSettings, "hasStatusLabel", _dockHasStatusLabel);
|
|
||||||
obs_data_set_bool(dockSettings, "highlightIfConditionsTrue",
|
|
||||||
_dockHighlight);
|
|
||||||
_runButtonText.Save(dockSettings, "runButtonText");
|
|
||||||
_pauseButtonText.Save(dockSettings, "pauseButtonText");
|
|
||||||
_unpauseButtonText.Save(dockSettings, "unpauseButtonText");
|
|
||||||
_conditionsTrueStatusText.Save(dockSettings,
|
|
||||||
"conditionsTrueStatusText");
|
|
||||||
_conditionsFalseStatusText.Save(dockSettings,
|
|
||||||
"conditionsFalseStatusText");
|
|
||||||
if (saveForCopy) {
|
|
||||||
auto uuid = GenerateDockId();
|
|
||||||
obs_data_set_string(dockSettings, "dockId", uuid.c_str());
|
|
||||||
|
|
||||||
} else {
|
|
||||||
obs_data_set_string(dockSettings, "dockId", _dockId.c_str());
|
|
||||||
}
|
|
||||||
obs_data_set_int(dockSettings, "version", 1);
|
|
||||||
obs_data_set_obj(obj, "dockSettings", dockSettings);
|
|
||||||
obs_data_release(dockSettings);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::LoadDockSettings(obs_data_t *obj)
|
|
||||||
{
|
|
||||||
auto dockSettings = obs_data_get_obj(obj, "dockSettings");
|
|
||||||
if (!dockSettings) {
|
|
||||||
// TODO: Remove this fallback
|
|
||||||
_dockHasRunButton = obs_data_get_bool(obj, "dockHasRunButton");
|
|
||||||
_dockHasPauseButton =
|
|
||||||
obs_data_get_bool(obj, "dockHasPauseButton");
|
|
||||||
EnableDock(obs_data_get_bool(obj, "registerDock"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!obs_data_has_user_value(dockSettings, "version")) {
|
|
||||||
_dockId = std::string("ADVSS-") + _name;
|
|
||||||
} else {
|
|
||||||
_dockId = obs_data_get_string(dockSettings, "dockId");
|
|
||||||
}
|
|
||||||
|
|
||||||
const bool dockEnabled = obs_data_get_bool(dockSettings, "register");
|
|
||||||
|
|
||||||
// TODO: remove these default settings in a future version
|
|
||||||
obs_data_set_default_string(
|
|
||||||
dockSettings, "runButtonText",
|
|
||||||
obs_module_text("AdvSceneSwitcher.macroDock.run"));
|
|
||||||
obs_data_set_default_string(
|
|
||||||
dockSettings, "pauseButtonText",
|
|
||||||
obs_module_text("AdvSceneSwitcher.macroDock.pause"));
|
|
||||||
obs_data_set_default_string(
|
|
||||||
dockSettings, "unpauseButtonText",
|
|
||||||
obs_module_text("AdvSceneSwitcher.macroDock.unpause"));
|
|
||||||
_runButtonText.Load(dockSettings, "runButtonText");
|
|
||||||
_pauseButtonText.Load(dockSettings, "pauseButtonText");
|
|
||||||
_unpauseButtonText.Load(dockSettings, "unpauseButtonText");
|
|
||||||
_conditionsTrueStatusText.Load(dockSettings,
|
|
||||||
"conditionsTrueStatusText");
|
|
||||||
_conditionsFalseStatusText.Load(dockSettings,
|
|
||||||
"conditionsFalseStatusText");
|
|
||||||
if (dockEnabled) {
|
|
||||||
_dockHasRunButton =
|
|
||||||
obs_data_get_bool(dockSettings, "hasRunButton");
|
|
||||||
_dockHasPauseButton =
|
|
||||||
obs_data_get_bool(dockSettings, "hasPauseButton");
|
|
||||||
_dockHasStatusLabel =
|
|
||||||
obs_data_get_bool(dockSettings, "hasStatusLabel");
|
|
||||||
_dockHighlight = obs_data_get_bool(dockSettings,
|
|
||||||
"highlightIfConditionsTrue");
|
|
||||||
}
|
|
||||||
EnableDock(dockEnabled);
|
|
||||||
obs_data_release(dockSettings);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::EnableDock(bool value)
|
|
||||||
{
|
|
||||||
// Reset dock regardless
|
|
||||||
RemoveDock();
|
|
||||||
|
|
||||||
if (!value) {
|
|
||||||
_registerDock = value;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_dock = new MacroDock(GetWeakMacroByName(_name.c_str()), _runButtonText,
|
|
||||||
_pauseButtonText, _unpauseButtonText,
|
|
||||||
_conditionsTrueStatusText,
|
|
||||||
_conditionsFalseStatusText, _dockHighlight);
|
|
||||||
|
|
||||||
if (!obs_frontend_add_dock_by_id(_dockId.c_str(), _name.c_str(),
|
|
||||||
_dock)) {
|
|
||||||
blog(LOG_INFO, "failed to add macro dock for macro %s",
|
|
||||||
_name.c_str());
|
|
||||||
_dock->deleteLater();
|
|
||||||
_dock = nullptr;
|
|
||||||
_registerDock = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_registerDock = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::SetDockHasRunButton(bool value)
|
|
||||||
{
|
|
||||||
_dockHasRunButton = value;
|
|
||||||
if (!_dock) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_dock->ShowRunButton(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::SetDockHasPauseButton(bool value)
|
|
||||||
{
|
|
||||||
_dockHasPauseButton = value;
|
|
||||||
if (!_dock) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_dock->ShowPauseButton(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::SetDockHasStatusLabel(bool value)
|
|
||||||
{
|
|
||||||
_dockHasStatusLabel = value;
|
|
||||||
if (!_dock) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_dock->ShowStatusLabel(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::SetHighlightEnable(bool value)
|
|
||||||
{
|
|
||||||
_dockHighlight = value;
|
|
||||||
if (!_dock) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_dock->EnableHighlight(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::SetRunButtonText(const std::string &text)
|
|
||||||
{
|
|
||||||
_runButtonText = text;
|
|
||||||
if (!_dock) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_dock->SetRunButtonText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::SetPauseButtonText(const std::string &text)
|
|
||||||
{
|
|
||||||
_pauseButtonText = text;
|
|
||||||
if (!_dock) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_dock->SetPauseButtonText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::SetUnpauseButtonText(const std::string &text)
|
|
||||||
{
|
|
||||||
_unpauseButtonText = text;
|
|
||||||
if (!_dock) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_dock->SetUnpauseButtonText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::SetConditionsTrueStatusText(const std::string &text)
|
|
||||||
{
|
|
||||||
_conditionsTrueStatusText = text;
|
|
||||||
if (!_dock) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_dock->SetConditionsTrueText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
StringVariable Macro::ConditionsTrueStatusText() const
|
|
||||||
{
|
|
||||||
return _conditionsTrueStatusText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::SetConditionsFalseStatusText(const std::string &text)
|
|
||||||
{
|
|
||||||
_conditionsFalseStatusText = text;
|
|
||||||
if (!_dock) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_dock->SetConditionsFalseText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
StringVariable Macro::ConditionsFalseStatusText() const
|
|
||||||
{
|
|
||||||
return _conditionsFalseStatusText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Macro::RemoveDock()
|
|
||||||
{
|
|
||||||
obs_frontend_remove_dock(_dockId.c_str());
|
|
||||||
_dock = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string Macro::GenerateDockId()
|
|
||||||
{
|
|
||||||
#if LIBOBS_API_VER > MAKE_SEMANTIC_VERSION(30, 0, 0)
|
|
||||||
auto uuid = os_generate_uuid();
|
|
||||||
auto id = std::string("advss-macro-dock-") + std::string(uuid);
|
|
||||||
bfree(uuid);
|
|
||||||
return id;
|
|
||||||
|
|
||||||
#else
|
|
||||||
static std::atomic_int16_t idCounter = 0;
|
|
||||||
return std::to_string(++idCounter);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void pauseCB(void *data, obs_hotkey_id, obs_hotkey_t *, bool pressed)
|
static void pauseCB(void *data, obs_hotkey_id, obs_hotkey_t *, bool pressed)
|
||||||
{
|
{
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
@@ -1294,7 +1114,7 @@ void Macro::SetHotkeysDesc() const
|
|||||||
void SaveMacros(obs_data_t *obj)
|
void SaveMacros(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
obs_data_array_t *macroArray = obs_data_array_create();
|
obs_data_array_t *macroArray = obs_data_array_create();
|
||||||
for (const auto &m : macros) {
|
for (const auto &m : GetTopLevelMacros()) {
|
||||||
obs_data_t *array_obj = obs_data_create();
|
obs_data_t *array_obj = obs_data_create();
|
||||||
|
|
||||||
m->Save(array_obj);
|
m->Save(array_obj);
|
||||||
@@ -1308,7 +1128,9 @@ void SaveMacros(obs_data_t *obj)
|
|||||||
|
|
||||||
void LoadMacros(obs_data_t *obj)
|
void LoadMacros(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
|
auto ¯os = GetTopLevelMacros();
|
||||||
macros.clear();
|
macros.clear();
|
||||||
|
|
||||||
obs_data_array_t *macroArray = obs_data_get_array(obj, "macros");
|
obs_data_array_t *macroArray = obs_data_get_array(obj, "macros");
|
||||||
size_t count = obs_data_array_count(macroArray);
|
size_t count = obs_data_array_count(macroArray);
|
||||||
|
|
||||||
@@ -1358,15 +1180,10 @@ void LoadMacros(obs_data_t *obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::deque<std::shared_ptr<Macro>> &GetMacros()
|
|
||||||
{
|
|
||||||
return macros;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CheckMacros()
|
bool CheckMacros()
|
||||||
{
|
{
|
||||||
bool matchFound = false;
|
bool matchFound = false;
|
||||||
for (const auto &m : macros) {
|
for (const auto &m : GetTopLevelMacros()) {
|
||||||
if (!m->ConditionsShouldBeChecked()) {
|
if (!m->ConditionsShouldBeChecked()) {
|
||||||
vblog(LOG_INFO,
|
vblog(LOG_INFO,
|
||||||
"skipping condition check for macro \"%s\" "
|
"skipping condition check for macro \"%s\" "
|
||||||
@@ -1393,7 +1210,7 @@ bool RunMacros()
|
|||||||
// reordered while macros are currently being executed.
|
// reordered while macros are currently being executed.
|
||||||
// For example, this can happen if a macro is performing a wait action,
|
// For example, this can happen if a macro is performing a wait action,
|
||||||
// as the main lock will be unlocked during this time.
|
// as the main lock will be unlocked during this time.
|
||||||
auto runPhaseMacros = macros;
|
auto runPhaseMacros = GetTopLevelMacros();
|
||||||
|
|
||||||
// Avoid deadlocks when opening settings window and calling frontend
|
// Avoid deadlocks when opening settings window and calling frontend
|
||||||
// API functions at the same time.
|
// API functions at the same time.
|
||||||
@@ -1433,47 +1250,30 @@ bool RunMacros()
|
|||||||
|
|
||||||
void StopAllMacros()
|
void StopAllMacros()
|
||||||
{
|
{
|
||||||
for (const auto &m : macros) {
|
for (const auto &m : GetAllMacros()) {
|
||||||
m->Stop();
|
m->Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Macro *GetMacroByName(const char *name)
|
|
||||||
{
|
|
||||||
for (const auto &m : macros) {
|
|
||||||
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 : macros) {
|
|
||||||
if (m->Name() == name) {
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
void InvalidateMacroTempVarValues()
|
void InvalidateMacroTempVarValues()
|
||||||
{
|
{
|
||||||
for (const auto &m : macros) {
|
for (const auto &m : GetTopLevelMacros()) {
|
||||||
|
// Do not invalidate the temp vars set during condition checks
|
||||||
|
// or action executions running in parallel to the "main" macro
|
||||||
|
// loop, as otherwise access to the information stored in those
|
||||||
|
// variables might get lost while those checks or actions are
|
||||||
|
// still ongoing.
|
||||||
|
if (!m->ParallelTasksCompleted()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
m->InvalidateTempVarValues();
|
m->InvalidateTempVarValues();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Macro> GetMacroWithInvalidConditionInterval()
|
std::shared_ptr<Macro> GetMacroWithInvalidConditionInterval()
|
||||||
{
|
{
|
||||||
|
auto ¯os = GetTopLevelMacros();
|
||||||
|
|
||||||
if (macros.empty()) {
|
if (macros.empty()) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "macro-action.hpp"
|
#include "macro-action.hpp"
|
||||||
#include "macro-condition.hpp"
|
#include "macro-condition.hpp"
|
||||||
|
#include "macro-dock-settings.hpp"
|
||||||
#include "macro-helpers.hpp"
|
#include "macro-helpers.hpp"
|
||||||
#include "macro-input.hpp"
|
#include "macro-input.hpp"
|
||||||
#include "macro-ref.hpp"
|
#include "macro-ref.hpp"
|
||||||
#include "variable-string.hpp"
|
#include "variable-string.hpp"
|
||||||
#include "temp-variable.hpp"
|
#include "temp-variable.hpp"
|
||||||
|
|
||||||
#include <QString>
|
#include <future>
|
||||||
#include <QByteArray>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
class MacroDock;
|
class GlobalMacroSettings;
|
||||||
|
|
||||||
class Macro {
|
class Macro {
|
||||||
using TimePoint = std::chrono::high_resolution_clock::time_point;
|
using TimePoint = std::chrono::high_resolution_clock::time_point;
|
||||||
@@ -27,8 +27,8 @@ class Macro {
|
|||||||
public:
|
public:
|
||||||
enum class PauseStateSaveBehavior { PERSIST, PAUSE, UNPAUSE };
|
enum class PauseStateSaveBehavior { PERSIST, PAUSE, UNPAUSE };
|
||||||
|
|
||||||
Macro(const std::string &name = "", const bool addHotkey = false,
|
Macro(const std::string &name = "");
|
||||||
const bool shortCircuitEvaluation = false);
|
Macro(const std::string &name, const GlobalMacroSettings &settings);
|
||||||
~Macro();
|
~Macro();
|
||||||
|
|
||||||
std::string Name() const { return _name; }
|
std::string Name() const { return _name; }
|
||||||
@@ -77,21 +77,27 @@ public:
|
|||||||
void AddHelperThread(std::thread &&);
|
void AddHelperThread(std::thread &&);
|
||||||
void SetRunInParallel(bool parallel) { _runInParallel = parallel; }
|
void SetRunInParallel(bool parallel) { _runInParallel = parallel; }
|
||||||
bool RunInParallel() const { return _runInParallel; }
|
bool RunInParallel() const { return _runInParallel; }
|
||||||
|
bool CheckInParallel() const { return _checkInParallel; }
|
||||||
|
void SetCheckInParallel(bool parallel);
|
||||||
|
bool ParallelTasksCompleted() const;
|
||||||
|
|
||||||
// Input variables
|
// Input variables
|
||||||
MacroInputVariables GetInputVariables() const;
|
MacroInputVariables GetInputVariables() const;
|
||||||
void SetInputVariables(const MacroInputVariables &);
|
void SetInputVariables(const MacroInputVariables &);
|
||||||
|
|
||||||
// Temporary variable helpers
|
// Temporary variable helpers
|
||||||
std::vector<TempVariable> GetTempVars(MacroSegment *filter) const;
|
std::vector<TempVariable> GetTempVars(const MacroSegment *filter) const;
|
||||||
std::optional<const TempVariable>
|
std::optional<const TempVariable>
|
||||||
GetTempVar(const MacroSegment *, const std::string &id) const;
|
GetTempVar(const MacroSegment *, const std::string &id) const;
|
||||||
void InvalidateTempVarValues() const;
|
void InvalidateTempVarValues() const;
|
||||||
|
|
||||||
// Macro segments
|
// Macro segments
|
||||||
std::deque<std::shared_ptr<MacroCondition>> &Conditions();
|
std::deque<std::shared_ptr<MacroCondition>> &Conditions();
|
||||||
|
const std::deque<std::shared_ptr<MacroCondition>> &Conditions() const;
|
||||||
std::deque<std::shared_ptr<MacroAction>> &Actions();
|
std::deque<std::shared_ptr<MacroAction>> &Actions();
|
||||||
|
const std::deque<std::shared_ptr<MacroAction>> &Actions() const;
|
||||||
std::deque<std::shared_ptr<MacroAction>> &ElseActions();
|
std::deque<std::shared_ptr<MacroAction>> &ElseActions();
|
||||||
|
const std::deque<std::shared_ptr<MacroAction>> &ElseActions() const;
|
||||||
void UpdateActionIndices();
|
void UpdateActionIndices();
|
||||||
void UpdateElseActionIndices();
|
void UpdateElseActionIndices();
|
||||||
void UpdateConditionIndices();
|
void UpdateConditionIndices();
|
||||||
@@ -139,26 +145,7 @@ public:
|
|||||||
bool PauseHotkeysEnabled() const;
|
bool PauseHotkeysEnabled() const;
|
||||||
|
|
||||||
// Docks
|
// Docks
|
||||||
void EnableDock(bool);
|
MacroDockSettings &GetDockSettings() { return _dockSettings; }
|
||||||
bool DockEnabled() const { return _registerDock; }
|
|
||||||
void SetDockHasRunButton(bool value);
|
|
||||||
bool DockHasRunButton() const { return _dockHasRunButton; }
|
|
||||||
void SetDockHasPauseButton(bool value);
|
|
||||||
bool DockHasPauseButton() const { return _dockHasPauseButton; }
|
|
||||||
void SetDockHasStatusLabel(bool value);
|
|
||||||
bool DockHasStatusLabel() const { return _dockHasStatusLabel; }
|
|
||||||
void SetHighlightEnable(bool value);
|
|
||||||
bool DockHighlightEnabled() const { return _dockHighlight; }
|
|
||||||
StringVariable RunButtonText() const { return _runButtonText; }
|
|
||||||
void SetRunButtonText(const std::string &text);
|
|
||||||
StringVariable PauseButtonText() const { return _pauseButtonText; }
|
|
||||||
void SetPauseButtonText(const std::string &text);
|
|
||||||
StringVariable UnpauseButtonText() const { return _unpauseButtonText; }
|
|
||||||
void SetUnpauseButtonText(const std::string &text);
|
|
||||||
void SetConditionsTrueStatusText(const std::string &text);
|
|
||||||
StringVariable ConditionsTrueStatusText() const;
|
|
||||||
void SetConditionsFalseStatusText(const std::string &text);
|
|
||||||
StringVariable ConditionsFalseStatusText() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetupHotkeys();
|
void SetupHotkeys();
|
||||||
@@ -174,19 +161,13 @@ private:
|
|||||||
bool RunActions(bool ignorePause);
|
bool RunActions(bool ignorePause);
|
||||||
bool RunElseActions(bool ignorePause);
|
bool RunElseActions(bool ignorePause);
|
||||||
|
|
||||||
void SaveDockSettings(obs_data_t *obj, bool saveForCopy) const;
|
|
||||||
void LoadDockSettings(obs_data_t *obj);
|
|
||||||
void RemoveDock();
|
|
||||||
static std::string GenerateDockId();
|
|
||||||
|
|
||||||
std::string _name = "";
|
std::string _name = "";
|
||||||
bool _die = false;
|
bool _die = false;
|
||||||
bool _stop = false;
|
bool _stop = false;
|
||||||
bool _done = true;
|
std::future<void> _actionRunFuture;
|
||||||
TimePoint _lastCheckTime{};
|
TimePoint _lastCheckTime{};
|
||||||
TimePoint _lastUnpauseTime{};
|
TimePoint _lastUnpauseTime{};
|
||||||
TimePoint _lastExecutionTime{};
|
TimePoint _lastExecutionTime{};
|
||||||
std::thread _backgroundThread;
|
|
||||||
std::vector<std::thread> _helperThreads;
|
std::vector<std::thread> _helperThreads;
|
||||||
|
|
||||||
std::deque<std::shared_ptr<MacroCondition>> _conditions;
|
std::deque<std::shared_ptr<MacroCondition>> _conditions;
|
||||||
@@ -204,7 +185,9 @@ private:
|
|||||||
bool _conditionSateChanged = false;
|
bool _conditionSateChanged = false;
|
||||||
|
|
||||||
bool _runInParallel = false;
|
bool _runInParallel = false;
|
||||||
|
bool _checkInParallel = false;
|
||||||
bool _matched = false;
|
bool _matched = false;
|
||||||
|
std::future<void> _conditionCheckFuture;
|
||||||
bool _lastMatched = false;
|
bool _lastMatched = false;
|
||||||
bool _performActionsOnChange = true;
|
bool _performActionsOnChange = true;
|
||||||
bool _skipExecOnStart = false;
|
bool _skipExecOnStart = false;
|
||||||
@@ -227,34 +210,14 @@ private:
|
|||||||
QList<int> _actionConditionSplitterPosition;
|
QList<int> _actionConditionSplitterPosition;
|
||||||
QList<int> _elseActionSplitterPosition;
|
QList<int> _elseActionSplitterPosition;
|
||||||
|
|
||||||
bool _registerDock = false;
|
MacroDockSettings _dockSettings;
|
||||||
bool _dockHasRunButton = true;
|
|
||||||
bool _dockHasPauseButton = true;
|
|
||||||
bool _dockHasStatusLabel = false;
|
|
||||||
bool _dockHighlight = false;
|
|
||||||
StringVariable _runButtonText =
|
|
||||||
obs_module_text("AdvSceneSwitcher.macroDock.run");
|
|
||||||
StringVariable _pauseButtonText =
|
|
||||||
obs_module_text("AdvSceneSwitcher.macroDock.pause");
|
|
||||||
StringVariable _unpauseButtonText =
|
|
||||||
obs_module_text("AdvSceneSwitcher.macroDock.unpause");
|
|
||||||
StringVariable _conditionsTrueStatusText =
|
|
||||||
obs_module_text("AdvSceneSwitcher.macroDock.statusLabel.true");
|
|
||||||
StringVariable _conditionsFalseStatusText =
|
|
||||||
obs_module_text("AdvSceneSwitcher.macroDock.statusLabel.false");
|
|
||||||
MacroDock *_dock = nullptr;
|
|
||||||
std::string _dockId = GenerateDockId();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void LoadMacros(obs_data_t *obj);
|
void LoadMacros(obs_data_t *obj);
|
||||||
void SaveMacros(obs_data_t *obj);
|
void SaveMacros(obs_data_t *obj);
|
||||||
std::deque<std::shared_ptr<Macro>> &GetMacros();
|
|
||||||
bool CheckMacros();
|
bool CheckMacros();
|
||||||
bool RunMacros();
|
bool RunMacros();
|
||||||
void StopAllMacros();
|
void StopAllMacros();
|
||||||
Macro *GetMacroByName(const char *name);
|
|
||||||
Macro *GetMacroByQString(const QString &name);
|
|
||||||
std::weak_ptr<Macro> GetWeakMacroByName(const char *name);
|
|
||||||
void InvalidateMacroTempVarValues();
|
void InvalidateMacroTempVarValues();
|
||||||
std::shared_ptr<Macro> GetMacroWithInvalidConditionInterval();
|
std::shared_ptr<Macro> GetMacroWithInvalidConditionInterval();
|
||||||
|
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ bool IsFullscreen(const std::string &title)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<std::string> GetTextInWindow(const std::string &window)
|
std::optional<std::string> GetTextInWindow(const std::string &)
|
||||||
{
|
{
|
||||||
// Not implemented
|
// Not implemented
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ void ActionQueue::Add(const std::shared_ptr<MacroAction> &action)
|
|||||||
action->Save(data);
|
action->Save(data);
|
||||||
copy->Load(data);
|
copy->Load(data);
|
||||||
copy->PostLoad();
|
copy->PostLoad();
|
||||||
RunPostLoadSteps();
|
RunAndClearPostLoadSteps();
|
||||||
copy->ResolveVariablesToFixedValues();
|
copy->ResolveVariablesToFixedValues();
|
||||||
_actions.emplace_back(copy);
|
_actions.emplace_back(copy);
|
||||||
} else {
|
} else {
|
||||||
@@ -423,7 +423,7 @@ void ImportQueues(obs_data_t *data)
|
|||||||
importedQueues->emplace_back(queue);
|
importedQueues->emplace_back(queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
QeueUITask(signalImportedQueues, importedQueues);
|
QueueUITask(signalImportedQueues, importedQueues);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::weak_ptr<ActionQueue> GetWeakActionQueueByName(const std::string &name)
|
std::weak_ptr<ActionQueue> GetWeakActionQueueByName(const std::string &name)
|
||||||
|
|||||||
@@ -44,11 +44,6 @@ void SwitcherData::Prune()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nonMatchingScene && !WeakSourceValid(nonMatchingScene)) {
|
|
||||||
switchIfNotMatching = NoMatchBehavior::NO_SWITCH;
|
|
||||||
nonMatchingScene = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < randomSwitches.size(); i++) {
|
for (size_t i = 0; i < randomSwitches.size(); i++) {
|
||||||
RandomSwitch &s = randomSwitches[i];
|
RandomSwitch &s = randomSwitches[i];
|
||||||
if (!s.valid()) {
|
if (!s.valid()) {
|
||||||
@@ -168,31 +163,6 @@ void SwitcherData::SaveVersion(obs_data_t *obj,
|
|||||||
obs_data_set_string(obj, "version", currentVersion.c_str());
|
obs_data_set_string(obj, "version", currentVersion.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitcherData::RunPostLoadSteps()
|
|
||||||
{
|
|
||||||
for (const auto &func : postLoadSteps) {
|
|
||||||
func();
|
|
||||||
}
|
|
||||||
postLoadSteps.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwitcherData::AddSaveStep(std::function<void(obs_data_t *)> function)
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
|
||||||
saveSteps.emplace_back(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwitcherData::AddLoadStep(std::function<void(obs_data_t *)> function)
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
|
||||||
loadSteps.emplace_back(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwitcherData::AddPostLoadStep(std::function<void()> function)
|
|
||||||
{
|
|
||||||
postLoadSteps.emplace_back(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void startHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, bool pressed)
|
static void startHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, bool pressed)
|
||||||
{
|
{
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
@@ -255,6 +225,16 @@ static void removeMacroSegmentHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void addNewMacroHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
|
||||||
|
bool pressed)
|
||||||
|
{
|
||||||
|
if (pressed && SettingsWindowIsOpened()) {
|
||||||
|
QMetaObject::invokeMethod(GetSettingsWindow(),
|
||||||
|
"on_macroAdd_clicked",
|
||||||
|
Qt::QueuedConnection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void registerHotkeys()
|
static void registerHotkeys()
|
||||||
{
|
{
|
||||||
switcher->startHotkey = obs_hotkey_register_frontend(
|
switcher->startHotkey = obs_hotkey_register_frontend(
|
||||||
@@ -270,19 +250,21 @@ static void registerHotkeys()
|
|||||||
obs_module_text(
|
obs_module_text(
|
||||||
"AdvSceneSwitcher.hotkey.startStopToggleSwitcherHotkey"),
|
"AdvSceneSwitcher.hotkey.startStopToggleSwitcherHotkey"),
|
||||||
startStopToggleHotkeyFunc, NULL);
|
startStopToggleHotkeyFunc, NULL);
|
||||||
|
switcher->newMacroHotkey = obs_hotkey_register_frontend(
|
||||||
|
"newMacroSwitcherHotkey",
|
||||||
|
obs_module_text("AdvSceneSwitcher.hotkey.macro.new"),
|
||||||
|
addNewMacroHotkeyFunc, NULL);
|
||||||
switcher->upMacroSegment = obs_hotkey_register_frontend(
|
switcher->upMacroSegment = obs_hotkey_register_frontend(
|
||||||
"upMacroSegmentSwitcherHotkey",
|
"upMacroSegmentSwitcherHotkey",
|
||||||
obs_module_text("AdvSceneSwitcher.hotkey.upMacroSegmentHotkey"),
|
obs_module_text("AdvSceneSwitcher.hotkey.macro.segment.up"),
|
||||||
upMacroSegmentHotkeyFunc, NULL);
|
upMacroSegmentHotkeyFunc, NULL);
|
||||||
switcher->downMacroSegment = obs_hotkey_register_frontend(
|
switcher->downMacroSegment = obs_hotkey_register_frontend(
|
||||||
"downMacroSegmentSwitcherHotkey",
|
"downMacroSegmentSwitcherHotkey",
|
||||||
obs_module_text(
|
obs_module_text("AdvSceneSwitcher.hotkey.macro.segment.down"),
|
||||||
"AdvSceneSwitcher.hotkey.downMacroSegmentHotkey"),
|
|
||||||
downMacroSegmentHotkeyFunc, NULL);
|
downMacroSegmentHotkeyFunc, NULL);
|
||||||
switcher->removeMacroSegment = obs_hotkey_register_frontend(
|
switcher->removeMacroSegment = obs_hotkey_register_frontend(
|
||||||
"removeMacroSegmentSwitcherHotkey",
|
"removeMacroSegmentSwitcherHotkey",
|
||||||
obs_module_text(
|
obs_module_text("AdvSceneSwitcher.hotkey.macro.segment.remove"),
|
||||||
"AdvSceneSwitcher.hotkey.removeMacroSegmentHotkey"),
|
|
||||||
removeMacroSegmentHotkeyFunc, NULL);
|
removeMacroSegmentHotkeyFunc, NULL);
|
||||||
|
|
||||||
switcher->hotkeysRegistered = true;
|
switcher->hotkeysRegistered = true;
|
||||||
@@ -300,6 +282,7 @@ void SwitcherData::SaveHotkeys(obs_data_t *obj)
|
|||||||
saveHotkey(obj, startHotkey, "startHotkey");
|
saveHotkey(obj, startHotkey, "startHotkey");
|
||||||
saveHotkey(obj, stopHotkey, "stopHotkey");
|
saveHotkey(obj, stopHotkey, "stopHotkey");
|
||||||
saveHotkey(obj, toggleHotkey, "toggleHotkey");
|
saveHotkey(obj, toggleHotkey, "toggleHotkey");
|
||||||
|
saveHotkey(obj, newMacroHotkey, "newMacroHotkey");
|
||||||
saveHotkey(obj, upMacroSegment, "upMacroSegmentHotkey");
|
saveHotkey(obj, upMacroSegment, "upMacroSegmentHotkey");
|
||||||
saveHotkey(obj, downMacroSegment, "downMacroSegmentHotkey");
|
saveHotkey(obj, downMacroSegment, "downMacroSegmentHotkey");
|
||||||
saveHotkey(obj, removeMacroSegment, "removeMacroSegmentHotkey");
|
saveHotkey(obj, removeMacroSegment, "removeMacroSegmentHotkey");
|
||||||
@@ -312,14 +295,31 @@ static void loadHotkey(obs_data_t *obj, obs_hotkey_id id, const char *name)
|
|||||||
obs_data_array_release(a);
|
obs_data_array_release(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void setDefaultHotkeyBinding(obs_data_t *data, const char *name,
|
||||||
|
const char *value)
|
||||||
|
{
|
||||||
|
OBSDataAutoRelease hotkeyData = obs_data_create_from_json(value);
|
||||||
|
OBSDataArrayAutoRelease hotkeyArray = obs_data_array_create();
|
||||||
|
obs_data_array_push_back(hotkeyArray, hotkeyData);
|
||||||
|
obs_data_set_default_array(data, name, hotkeyArray);
|
||||||
|
}
|
||||||
|
|
||||||
void SwitcherData::LoadHotkeys(obs_data_t *obj)
|
void SwitcherData::LoadHotkeys(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
if (!hotkeysRegistered) {
|
if (!hotkeysRegistered) {
|
||||||
registerHotkeys();
|
registerHotkeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setDefaultHotkeyBinding(obj, "newMacroHotkey",
|
||||||
|
"{"
|
||||||
|
"\"control\": true,"
|
||||||
|
"\"key\": \"OBS_KEY_N\""
|
||||||
|
"}");
|
||||||
|
|
||||||
loadHotkey(obj, startHotkey, "startHotkey");
|
loadHotkey(obj, startHotkey, "startHotkey");
|
||||||
loadHotkey(obj, stopHotkey, "stopHotkey");
|
loadHotkey(obj, stopHotkey, "stopHotkey");
|
||||||
loadHotkey(obj, toggleHotkey, "toggleHotkey");
|
loadHotkey(obj, toggleHotkey, "toggleHotkey");
|
||||||
|
loadHotkey(obj, newMacroHotkey, "newMacroHotkey");
|
||||||
loadHotkey(obj, upMacroSegment, "upMacroSegmentHotkey");
|
loadHotkey(obj, upMacroSegment, "upMacroSegmentHotkey");
|
||||||
loadHotkey(obj, downMacroSegment, "downMacroSegmentHotkey");
|
loadHotkey(obj, downMacroSegment, "downMacroSegmentHotkey");
|
||||||
loadHotkey(obj, removeMacroSegment, "removeMacroSegmentHotkey");
|
loadHotkey(obj, removeMacroSegment, "removeMacroSegmentHotkey");
|
||||||
|
|||||||
@@ -14,10 +14,12 @@
|
|||||||
#include "switch-sequence.hpp"
|
#include "switch-sequence.hpp"
|
||||||
#include "switch-video.hpp"
|
#include "switch-video.hpp"
|
||||||
|
|
||||||
#include "macro-settings.hpp"
|
|
||||||
#include "duration-control.hpp"
|
#include "duration-control.hpp"
|
||||||
#include "priority-helper.hpp"
|
|
||||||
#include "plugin-state-helpers.hpp"
|
#include "plugin-state-helpers.hpp"
|
||||||
|
#include "priority-helper.hpp"
|
||||||
|
#include "regex-config.hpp"
|
||||||
|
#include "scene-selection.hpp"
|
||||||
|
#include "variable-string.hpp"
|
||||||
|
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -57,15 +59,12 @@ public:
|
|||||||
bool AnySceneTransitionStarted();
|
bool AnySceneTransitionStarted();
|
||||||
|
|
||||||
void SetPreconditions();
|
void SetPreconditions();
|
||||||
void AddSaveStep(std::function<void(obs_data_t *)>);
|
|
||||||
void AddLoadStep(std::function<void(obs_data_t *)>);
|
|
||||||
void AddPostLoadStep(std::function<void()>);
|
|
||||||
void RunPostLoadSteps();
|
|
||||||
bool CheckForMatch(OBSWeakSource &scene, OBSWeakSource &transition,
|
bool CheckForMatch(OBSWeakSource &scene, OBSWeakSource &transition,
|
||||||
int &linger, bool &setPreviousSceneAsMatch,
|
int &linger, bool &setPreviousSceneAsMatch,
|
||||||
bool ¯oMatch);
|
bool ¯oMatch);
|
||||||
void CheckNoMatchSwitch(bool &match, OBSWeakSource &scene,
|
void CheckNoMatchSwitch(bool &match, OBSWeakSource &scene,
|
||||||
OBSWeakSource &transition, int &sleep);
|
OBSWeakSource &transition, int &sleep);
|
||||||
|
void CheckAutoStart();
|
||||||
|
|
||||||
/* --- Start of saving / loading section --- */
|
/* --- Start of saving / loading section --- */
|
||||||
|
|
||||||
@@ -95,13 +94,9 @@ public:
|
|||||||
bool stop = false;
|
bool stop = false;
|
||||||
std::condition_variable cv;
|
std::condition_variable cv;
|
||||||
|
|
||||||
std::vector<std::function<void(obs_data_t *)>> saveSteps;
|
|
||||||
std::vector<std::function<void(obs_data_t *)>> loadSteps;
|
|
||||||
std::vector<std::function<void()>> postLoadSteps;
|
|
||||||
|
|
||||||
bool firstBoot = true;
|
bool firstBoot = true;
|
||||||
bool transitionActive = false;
|
bool transitionActive = false;
|
||||||
bool sceneColletionStop = false;
|
bool sceneCollectionStop = false;
|
||||||
bool obsIsShuttingDown = false;
|
bool obsIsShuttingDown = false;
|
||||||
bool firstInterval = true;
|
bool firstInterval = true;
|
||||||
bool firstIntervalAfterStop = true;
|
bool firstIntervalAfterStop = true;
|
||||||
@@ -114,7 +109,7 @@ public:
|
|||||||
/* --- Start of General tab section --- */
|
/* --- Start of General tab section --- */
|
||||||
|
|
||||||
int interval = default_interval;
|
int interval = default_interval;
|
||||||
OBSWeakSource nonMatchingScene;
|
SceneSelection nonMatchingScene;
|
||||||
NoMatchBehavior switchIfNotMatching = NoMatchBehavior::NO_SWITCH;
|
NoMatchBehavior switchIfNotMatching = NoMatchBehavior::NO_SWITCH;
|
||||||
Duration noMatchDelay;
|
Duration noMatchDelay;
|
||||||
enum class StartupBehavior { PERSIST = 0, START = 1, STOP = 2 };
|
enum class StartupBehavior { PERSIST = 0, START = 1, STOP = 2 };
|
||||||
@@ -126,15 +121,16 @@ public:
|
|||||||
RECORINDG_OR_STREAMING
|
RECORINDG_OR_STREAMING
|
||||||
};
|
};
|
||||||
AutoStart autoStartEvent = AutoStart::NEVER;
|
AutoStart autoStartEvent = AutoStart::NEVER;
|
||||||
|
bool useAutoStartScene = false;
|
||||||
|
SceneSelection autoStartScene;
|
||||||
|
StringVariable autoStartSceneName;
|
||||||
|
RegexConfig autoStartSceneRegex;
|
||||||
bool enableCooldown = false;
|
bool enableCooldown = false;
|
||||||
Duration cooldown;
|
Duration cooldown;
|
||||||
bool showSystemTrayNotifications = false;
|
bool showSystemTrayNotifications = false;
|
||||||
bool transitionOverrideOverride = false;
|
bool transitionOverrideOverride = false;
|
||||||
bool adjustActiveTransitionType = true;
|
bool adjustActiveTransitionType = true;
|
||||||
|
|
||||||
enum class LogLevel { DEFAULT, LOG_MACRO, LOG_ACTION, VERBOSE };
|
|
||||||
LogLevel logLevel = LogLevel::DEFAULT;
|
|
||||||
|
|
||||||
/* --- End of General tab section --- */
|
/* --- End of General tab section --- */
|
||||||
|
|
||||||
std::string lastTitle;
|
std::string lastTitle;
|
||||||
@@ -152,6 +148,7 @@ public:
|
|||||||
obs_hotkey_id startHotkey = OBS_INVALID_HOTKEY_ID;
|
obs_hotkey_id startHotkey = OBS_INVALID_HOTKEY_ID;
|
||||||
obs_hotkey_id stopHotkey = OBS_INVALID_HOTKEY_ID;
|
obs_hotkey_id stopHotkey = OBS_INVALID_HOTKEY_ID;
|
||||||
obs_hotkey_id toggleHotkey = OBS_INVALID_HOTKEY_ID;
|
obs_hotkey_id toggleHotkey = OBS_INVALID_HOTKEY_ID;
|
||||||
|
obs_hotkey_id newMacroHotkey = OBS_INVALID_HOTKEY_ID;
|
||||||
obs_hotkey_id upMacroSegment = OBS_INVALID_HOTKEY_ID;
|
obs_hotkey_id upMacroSegment = OBS_INVALID_HOTKEY_ID;
|
||||||
obs_hotkey_id downMacroSegment = OBS_INVALID_HOTKEY_ID;
|
obs_hotkey_id downMacroSegment = OBS_INVALID_HOTKEY_ID;
|
||||||
obs_hotkey_id removeMacroSegment = OBS_INVALID_HOTKEY_ID;
|
obs_hotkey_id removeMacroSegment = OBS_INVALID_HOTKEY_ID;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user