mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-29 04:36:21 -05:00
Compare commits
121 Commits
1.26.3
...
1.28.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d9519c849 | ||
|
|
0fd5f47982 | ||
|
|
62ce83a7f6 | ||
|
|
8ecee0070d | ||
|
|
a4970b1b07 | ||
|
|
140dc9c6f4 | ||
|
|
9a4d2935f8 | ||
|
|
335c964419 | ||
|
|
72b2a7a07a | ||
|
|
f863909f34 | ||
|
|
621ca201ef | ||
|
|
563ea1a5e7 | ||
|
|
2af6ee883b | ||
|
|
0e9875e6b5 | ||
|
|
c2d2e883c6 | ||
|
|
a196e56078 | ||
|
|
0536e4a60b | ||
|
|
55ab096e49 | ||
|
|
c39ea0854a | ||
|
|
aef080984e | ||
|
|
1aa2425e81 | ||
|
|
f5eadfa39c | ||
|
|
faa65facfe | ||
|
|
b60235d964 | ||
|
|
718b18248e | ||
|
|
4316e53039 | ||
|
|
790ac50385 | ||
|
|
3a87a8d155 | ||
|
|
91912f2aa5 | ||
|
|
624b841ca1 | ||
|
|
9eb4e90291 | ||
|
|
94263cc7a0 | ||
|
|
2d035758f4 | ||
|
|
86697002f7 | ||
|
|
2247152aa8 | ||
|
|
2528449c84 | ||
|
|
f2df3d18be | ||
|
|
c7c48d03e9 | ||
|
|
0906c6bb3f | ||
|
|
9f2daf1a15 | ||
|
|
6fb8619671 | ||
|
|
36fb83246b | ||
|
|
e729d15e97 | ||
|
|
7836298076 | ||
|
|
354880ad52 | ||
|
|
c1ac9bb890 | ||
|
|
49bf1ad379 | ||
|
|
a6e30a1e20 | ||
|
|
2f54c2ee62 | ||
|
|
6ccbaad41c | ||
|
|
57d78a996a | ||
|
|
2d3dada30e | ||
|
|
5bf20d155f | ||
|
|
2b95598958 | ||
|
|
b561a20dde | ||
|
|
835722af34 | ||
|
|
93efc7cab3 | ||
|
|
d69364ec19 | ||
|
|
d75066df5f | ||
|
|
863c84026e | ||
|
|
a523081d77 | ||
|
|
66534519d6 | ||
|
|
b3b2114c45 | ||
|
|
510f83246e | ||
|
|
c969b21f93 | ||
|
|
6ec40ef8e9 | ||
|
|
27859e83b3 | ||
|
|
263565700a | ||
|
|
5bb10a4aef | ||
|
|
ee72bb192c | ||
|
|
1a1028cbaa | ||
|
|
2f4f8bcc74 | ||
|
|
4113615cd6 | ||
|
|
9522d7c0b4 | ||
|
|
cc3ea79836 | ||
|
|
f72e802d00 | ||
|
|
36201cbfb4 | ||
|
|
685e28d161 | ||
|
|
82d23dcf0e | ||
|
|
ad322d54f0 | ||
|
|
8bac6fe829 | ||
|
|
ac7531decb | ||
|
|
7af4969ec6 | ||
|
|
a088325968 | ||
|
|
57bc58be8e | ||
|
|
f9730b1bc2 | ||
|
|
d4025214e5 | ||
|
|
c431e6c31d | ||
|
|
9941cfe9b5 | ||
|
|
15998012e5 | ||
|
|
bcb043f997 | ||
|
|
74116382b1 | ||
|
|
24f33fb0d2 | ||
|
|
d80df57ef8 | ||
|
|
240c47975c | ||
|
|
bedb3b8dc6 | ||
|
|
8032dde045 | ||
|
|
bfc51b2df5 | ||
|
|
2160da59f3 | ||
|
|
d3164e3ed6 | ||
|
|
17c72b772d | ||
|
|
3ff9a1f270 | ||
|
|
7d120d8b6a | ||
|
|
53cfe4b030 | ||
|
|
4dcd748a1f | ||
|
|
223ce0d0a0 | ||
|
|
5bd3341681 | ||
|
|
bb527d6910 | ||
|
|
dfedbcf31a | ||
|
|
1bbfd16b3f | ||
|
|
7f5737d03f | ||
|
|
7702541d81 | ||
|
|
3bc15e585c | ||
|
|
d77101b6aa | ||
|
|
c1e23f9c7a | ||
|
|
70415cd8f4 | ||
|
|
f50cd76493 | ||
|
|
e4af698881 | ||
|
|
33120a359c | ||
|
|
091a364097 | ||
|
|
e3ff6f34fc |
36
.github/ISSUE_TEMPLATE/bug_report.md
vendored
36
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,36 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Logs**
|
||||
Please provide a log of your issue with verbose logging enabled (See General tab of the plugin).
|
||||
In case of a crash, please also include the corresponding crash log.
|
||||
See [here](https://obsproject.com/forum/threads/please-post-a-log-with-your-issue-heres-how.23074/) for a description where to find the log files and how to share them.
|
||||
Please share the currently used plugin settings by exporting them them to a file (See General tab of the plugin).
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Version information**
|
||||
- OS: [e.g. Windows 10]
|
||||
- OBS Version [e.g. 27.1.3]
|
||||
- Plugin Version [e.g. 1.17.1]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
111
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
Normal file
111
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
# Based on the OBS issue templates
|
||||
# https://github.com/obsproject/.github/tree/master/.github/ISSUE_TEMPLATE
|
||||
|
||||
name: Bug Report
|
||||
description: Report a bug or crash
|
||||
body:
|
||||
- type: markdown
|
||||
id: md_welcome
|
||||
attributes:
|
||||
value: This form is for reporting bugs for Advanced Scene Switcher!
|
||||
- type: dropdown
|
||||
id: os_info
|
||||
attributes:
|
||||
label: Operating System Info
|
||||
description: What Operating System are you running?
|
||||
options:
|
||||
- Windows 11
|
||||
- Windows 10
|
||||
- macOS 14
|
||||
- macOS 13
|
||||
- macOS 12
|
||||
- macOS 11
|
||||
- Ubuntu 23.10
|
||||
- Ubuntu 22.04
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: os_info_other
|
||||
attributes:
|
||||
label: Other OS
|
||||
description: "If \"Other\" was selected above, what OS are you using?"
|
||||
placeholder: "e.g., Arch Linux, FreeBSD"
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
id: obs_version
|
||||
attributes:
|
||||
label: OBS Studio Version
|
||||
description: What version of OBS Studio are you using?
|
||||
placeholder: 30.2.2
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: advss_version
|
||||
attributes:
|
||||
label: Advanced Scene Switcher Version
|
||||
description: What version of the Advanced Scene Switcher are you using?
|
||||
placeholder: 1.27.2
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: settings
|
||||
attributes:
|
||||
label: Plugin settings
|
||||
description: |
|
||||
Please provide the plugin settings used.
|
||||
Either only [export the macros](https://github.com/WarmUpTill/SceneSwitcher/wiki/Exporting-and-importing-individual-macros) relevant to this issue or [export all settings](https://github.com/WarmUpTill/SceneSwitcher/wiki/Saving-and-loading-settings#how-to-create-and-import-a-backup-of-your-settings) on the General tab of the plugin.
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
id: obs_log_url
|
||||
attributes:
|
||||
label: OBS Studio Log URL
|
||||
description: Please provide the obsproject.com URL (from Help menu > Log Files > Upload Current/Previous Log File) to the OBS log file where this issue occurred.
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
id: obs_crash_log_url
|
||||
attributes:
|
||||
label: OBS Studio Crash Log URL
|
||||
description: If this is a crash report, please provide the obsproject.com URL to the OBS crash log file where this issue occurred.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
description: "What did you expect to happen?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: current_behavior
|
||||
attributes:
|
||||
label: Current Behavior
|
||||
description: "What actually happened?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: steps_to_reproduce
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: "How do you trigger this bug? Please walk us through it step by step."
|
||||
placeholder: |
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
...
|
||||
value: |
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
...
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: additional_notes
|
||||
attributes:
|
||||
label: Anything else we should know?
|
||||
validations:
|
||||
required: false
|
||||
7
.github/ISSUE_TEMPLATE/config.yml
vendored
7
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +1,8 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Help/Support
|
||||
- name: 📚 Wiki
|
||||
url: https://github.com/WarmUpTill/SceneSwitcher/wiki
|
||||
about: For general questions about how to use and configure the plugin please have a look at the wiki (https://github.com/WarmUpTill/SceneSwitcher/wiki) or ask questions in the OBS forum (https://obsproject.com/forum/threads/advanced-scene-switcher.48264/)
|
||||
about: For explanations on how the plugin works or to see example guides, check out the wiki.
|
||||
- name: 💬 OBS Forum Thread
|
||||
url: https://obsproject.com/forum/threads/advanced-scene-switcher.48264
|
||||
about: To discuss the plugin or get assistance, feel free to use the OBS forum thread or the GitHub discussions page.
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,20 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
37
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
Normal file
37
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# Based on the OBS issue templates
|
||||
# https://github.com/obsproject/.github/tree/master/.github/ISSUE_TEMPLATE
|
||||
|
||||
name: Feature request
|
||||
description: Suggest an idea for this projectReport a bug or crash
|
||||
body:
|
||||
- type: markdown
|
||||
id: md_welcome
|
||||
attributes:
|
||||
value: This form is for requesting new features for Advanced Scene Switcher!
|
||||
- type: textarea
|
||||
id: background
|
||||
attributes:
|
||||
label: Background
|
||||
description: "Is your feature request related to a problem? Please describe."
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: solution
|
||||
attributes:
|
||||
label: Solution
|
||||
description: "Describe the solution you'd like."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: Alternatives
|
||||
description: "Describe alternatives you've considered."
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: additional_notes
|
||||
attributes:
|
||||
label: Anything else we should know?
|
||||
validations:
|
||||
required: false
|
||||
3
.github/scripts/.Aptfile
vendored
3
.github/scripts/.Aptfile
vendored
@@ -9,4 +9,5 @@ package 'libxtst-dev'
|
||||
package 'libxss-dev'
|
||||
package 'libopencv-dev'
|
||||
package 'libtesseract-dev'
|
||||
package 'libprocps-dev'
|
||||
package 'libprocps-dev'
|
||||
package 'libusb-1.0-0-dev'
|
||||
2
.github/scripts/.Brewfile
vendored
2
.github/scripts/.Brewfile
vendored
@@ -3,3 +3,5 @@ brew "coreutils"
|
||||
brew "cmake"
|
||||
brew "jq"
|
||||
brew "xcbeautify"
|
||||
brew "automake"
|
||||
brew "libtool"
|
||||
|
||||
3
.github/scripts/.Wingetfile
vendored
3
.github/scripts/.Wingetfile
vendored
@@ -1,3 +1,4 @@
|
||||
package 'cmake', path: 'Cmake\bin', bin: 'cmake'
|
||||
package 'innosetup', path: 'Inno Setup 6', bin: 'iscc'
|
||||
package 'OpenSSL', path: 'OpenSSL', bin: 'openssl'
|
||||
package 'OpenSSL', path: 'OpenSSL', bin: 'openssl'
|
||||
package 'Microsoft.VisualStudio.Locator', path: 'vswhere', bin: 'vswhere'
|
||||
128
.github/scripts/.build-deps.zsh
vendored
128
.github/scripts/.build-deps.zsh
vendored
@@ -306,7 +306,7 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
|
||||
log_info "Building OpenCV ..."
|
||||
cmake --build ${opencv_build_dir} --config Release
|
||||
|
||||
log_info "Installing OpenCV..."
|
||||
log_info "Installing OpenCV ..."
|
||||
cmake --install ${opencv_build_dir} --prefix "${advss_dep_path}" --config Release || true
|
||||
popd
|
||||
|
||||
@@ -335,17 +335,22 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
|
||||
log_info "Building Leptonica ..."
|
||||
cmake --build ${leptonica_build_dir} --config Release
|
||||
|
||||
log_info "Installing Leptonica..."
|
||||
log_info "Installing Leptonica ..."
|
||||
# Workaround for "unknown file attribute: H" errors when running install
|
||||
cmake --install ${leptonica_build_dir} --prefix "${advss_dep_path}" --config Release || :
|
||||
popd
|
||||
|
||||
local tesseract_dir="${project_root}/deps/tesseract"
|
||||
local tesseract_build_dir="${tesseract_dir}/build_${target##*-}"
|
||||
local tesseract_build_dir_x86_64="${tesseract_dir}/build_x86_64"
|
||||
|
||||
pushd ${tesseract_dir}
|
||||
log_info "Configure Tesseract (x86_64) ..."
|
||||
|
||||
local -a tesseract_cmake_args=(
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_OSX_ARCHITECTURES=${${target##*-}//universal/x86_64;arm64}
|
||||
-DCMAKE_SYSTEM_NAME="Darwin"
|
||||
-DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
-DCMAKE_SYSTEM_PROCESSOR=x86_64
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
|
||||
-DSW_BUILD=OFF
|
||||
-DBUILD_TRAINING_TOOLS=OFF
|
||||
@@ -353,34 +358,46 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
|
||||
-DCMAKE_INSTALL_PREFIX="${advss_dep_path}"
|
||||
)
|
||||
|
||||
if [ "${target}" != "macos-x86_64" ]; then
|
||||
tesseract_cmake_args+=(
|
||||
-DCMAKE_SYSTEM_PROCESSOR=aarch64
|
||||
-DHAVE_AVX=FALSE
|
||||
-DHAVE_AVX2=FALSE
|
||||
-DHAVE_AVX512F=FALSE
|
||||
-DHAVE_FMA=FALSE
|
||||
-DHAVE_SSE4_1=FALSE
|
||||
-DHAVE_NEON=TRUE
|
||||
)
|
||||
sed -i'.original' 's/HAVE_NEON FALSE/HAVE_NEON TRUE/g' "${tesseract_dir}/CMakeLists.txt"
|
||||
fi
|
||||
cmake -S . -B ${tesseract_build_dir_x86_64} ${tesseract_cmake_args}
|
||||
|
||||
pushd ${tesseract_dir}
|
||||
log_info "Configure Tesseract ..."
|
||||
cmake -S . -B ${tesseract_build_dir} ${tesseract_cmake_args}
|
||||
log_info "Building Tesseract (x86_64) ..."
|
||||
cmake --build ${tesseract_build_dir_x86_64} --config Release
|
||||
|
||||
log_info "Building Tesseract ..."
|
||||
cmake --build ${tesseract_build_dir} --config Release
|
||||
log_info "Configure Tesseract (arm64) ..."
|
||||
|
||||
git checkout .
|
||||
|
||||
local tesseract_build_dir_arm64="${tesseract_dir}/build_arm64"
|
||||
local -a tesseract_cmake_args=(
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_SYSTEM_NAME="Darwin"
|
||||
-DCMAKE_OSX_ARCHITECTURES=arm64
|
||||
-DCMAKE_SYSTEM_PROCESSOR=arm64
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
|
||||
-DSW_BUILD=OFF
|
||||
-DBUILD_TRAINING_TOOLS=OFF
|
||||
-DCMAKE_PREFIX_PATH="${advss_dep_path};${_plugin_deps}"
|
||||
-DCMAKE_INSTALL_PREFIX="${advss_dep_path}"
|
||||
)
|
||||
|
||||
cmake -S . -B ${tesseract_build_dir_arm64} ${tesseract_cmake_args}
|
||||
|
||||
log_info "Building Tesseract (arm64) ..."
|
||||
cmake --build ${tesseract_build_dir_arm64} --config Release
|
||||
|
||||
log_info "Combine arm and x86 libtesseract binaries ..."
|
||||
mv ${tesseract_build_dir_arm64}/libtesseract.a ${tesseract_build_dir_arm64}/libtesseract_arm.a
|
||||
lipo -create ${tesseract_build_dir_x86_64}/libtesseract.a ${tesseract_build_dir_arm64}/libtesseract_arm.a -output ${tesseract_build_dir_arm64}/libtesseract.a
|
||||
|
||||
log_info "Installing Tesseract..."
|
||||
cmake --install ${tesseract_build_dir} --prefix "${advss_dep_path}" --config Release
|
||||
cmake --install ${tesseract_build_dir_arm64} --prefix "${advss_dep_path}" --config Release
|
||||
|
||||
popd
|
||||
|
||||
pushd ${advss_dep_path}
|
||||
log_info "Prepare openssl ..."
|
||||
rm -rf openssl
|
||||
git clone git://git.openssl.org/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
|
||||
cp -r openssl_x86 openssl_arm
|
||||
|
||||
@@ -402,12 +419,73 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
|
||||
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_arm
|
||||
popd
|
||||
|
||||
pushd ${project_root}/deps/libusb
|
||||
|
||||
log_info "Configure libusb x86 ..."
|
||||
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
|
||||
export CC=$(xcrun --sdk macosx --find clang)
|
||||
export CXX=$(xcrun --sdk macosx --find clang++)
|
||||
export CFLAGS="-arch x86_64 -isysroot $SDKROOT"
|
||||
export CXXFLAGS="-arch x86_64 -isysroot $SDKROOT"
|
||||
export LDFLAGS="-arch x86_64 -isysroot $SDKROOT"
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.15
|
||||
|
||||
log_info "Building libusb x86 ..."
|
||||
mkdir ${project_root}/deps/libusb/out_x86
|
||||
./autogen.sh
|
||||
./configure --host=x86_64-apple-darwin --prefix=${advss_dep_path}
|
||||
make && make install
|
||||
|
||||
log_info "Configure libusb arm ..."
|
||||
make clean
|
||||
rm -r ${project_root}/deps/libusb/out_x86
|
||||
mkdir ${project_root}/deps/libusb/out_x86
|
||||
./configure --host=aarch64-apple-darwin --prefix=${project_root}/deps/libusb/out_x86
|
||||
make && make install
|
||||
|
||||
log_info "Building libusb arm ..."
|
||||
make clean
|
||||
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
|
||||
export CC=$(xcrun --sdk macosx --find clang)
|
||||
export CXX=$(xcrun --sdk macosx --find clang++)
|
||||
export CFLAGS="-arch arm64 -isysroot $SDKROOT"
|
||||
export CXXFLAGS="-arch arm64 -isysroot $SDKROOT"
|
||||
export LDFLAGS="-arch arm64 -isysroot $SDKROOT"
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.15
|
||||
mkdir ${project_root}/deps/libusb/out_arm
|
||||
./configure --host=aarch64-apple-darwin --prefix=${project_root}/deps/libusb/out_arm
|
||||
make && make install
|
||||
|
||||
log_info "Combine arm and x86 libusb binaries ..."
|
||||
lipo -create ${project_root}/deps/libusb/out_x86/lib/libusb-1.0.0.dylib \
|
||||
${project_root}/deps/libusb/out_arm/lib/libusb-1.0.0.dylib \
|
||||
-output ${advss_dep_path}/lib/temp-libusb-1.0.0.dylib
|
||||
mv ${advss_dep_path}/lib/temp-libusb-1.0.0.dylib ${advss_dep_path}/lib/libusb-1.0.0.dylib
|
||||
install_name_tool -id @rpath/libusb-1.0.0.dylib ${advss_dep_path}/lib/libusb-1.0.0.dylib
|
||||
log_info "Clean up libusb ..."
|
||||
|
||||
unset SDKROOT
|
||||
unset CC
|
||||
unset CXX
|
||||
unset CFLAGS
|
||||
unset CXXFLAGS
|
||||
unset LDFLAGS
|
||||
unset MACOSX_DEPLOYMENT_TARGET
|
||||
|
||||
popd
|
||||
;;
|
||||
linux)
|
||||
# Nothing to do for now
|
||||
# Hacky workaround to support libproc2 with Ubuntu 22 build environment
|
||||
local lsb_version=$(lsb_release -r | cut -f 2 || true)
|
||||
if [[ "${lsb_version}" == '22.04' ]] {
|
||||
sudo apt install ${project_root}/build-aux/CI/linux/ubuntu22/libproc2-0_4.0.2-3_amd64.deb
|
||||
sudo apt install ${project_root}/build-aux/CI/linux/ubuntu22/libproc2-dev_4.0.2-3_amd64.deb
|
||||
}
|
||||
;;
|
||||
}
|
||||
}
|
||||
|
||||
20
.github/scripts/Build-Deps-Windows.ps1
vendored
20
.github/scripts/Build-Deps-Windows.ps1
vendored
@@ -199,6 +199,26 @@ function Build {
|
||||
|
||||
Log-Information "Install tesseract..."
|
||||
Invoke-External cmake --install "${TesseractBuildPath}" --prefix "${ADVSSDepPath}" @TesseractCmakeArgs
|
||||
|
||||
Push-Location -Stack BuildLibusbTemp
|
||||
Ensure-Location $ProjectRoot
|
||||
|
||||
$LibusbPath = "${ProjectRoot}/deps/libusb"
|
||||
|
||||
Log-Information "Building libusb..."
|
||||
$msbuildExe = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1
|
||||
|
||||
if ($msbuildExe) {
|
||||
Invoke-External $msbuildExe "${LibusbPath}/msvc/libusb.sln" /property:Configuration=Release /property:Platform=x64
|
||||
|
||||
$libusbBuildResultDirectory = "${LibusbPath}/build/v143/x64/Release"
|
||||
if (-not (Test-Path -Path $libusbBuildResultDirectory)) {
|
||||
$libusbBuildResultDirectory = "${LibusbPath}/x64/Release/dll"
|
||||
}
|
||||
Copy-Item -Path "${libusbBuildResultDirectory}/*" -Destination ${ADVSSDepPath} -Recurse -Force
|
||||
} else {
|
||||
Log-Information "Failed to locate msbuild.exe - skipping libusb build"
|
||||
}
|
||||
}
|
||||
|
||||
Build
|
||||
|
||||
2
.github/workflows/build-debian.yml
vendored
2
.github/workflows/build-debian.yml
vendored
@@ -50,7 +50,7 @@ jobs:
|
||||
mv ../*.deb .
|
||||
- name: Publish
|
||||
if: success()
|
||||
uses: actions/upload-artifact@v2.2.1
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: "obs-scene-switcher.deb"
|
||||
path: ${{ github.workspace }}/*.deb
|
||||
|
||||
6
.github/workflows/build-project.yaml
vendored
6
.github/workflows/build-project.yaml
vendored
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
macos-build:
|
||||
name: Build for macOS 🍏
|
||||
runs-on: macos-13
|
||||
runs-on: macos-14
|
||||
needs: check-event
|
||||
defaults:
|
||||
run:
|
||||
@@ -107,8 +107,8 @@ jobs:
|
||||
print "pluginName=${product_name}" >> $GITHUB_OUTPUT
|
||||
print "pluginVersion=${git_tag}" >> $GITHUB_OUTPUT
|
||||
|
||||
print '::group::Select Xcode version'
|
||||
sudo xcode-select --switch /Applications/Xcode_14.3.1.app
|
||||
print '::group::Enable Xcode 15.2'
|
||||
sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
|
||||
print '::endgroup::'
|
||||
|
||||
- uses: actions/cache@v4
|
||||
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -7,6 +7,7 @@
|
||||
!/cmake
|
||||
!/data
|
||||
!/deps
|
||||
!/scripting
|
||||
!/forms
|
||||
!/lib
|
||||
!/module
|
||||
@@ -34,4 +35,7 @@
|
||||
.DS_Store
|
||||
|
||||
# Exclude CMake build number cache
|
||||
/cmake/.CMakeBuildNumber
|
||||
/cmake/.CMakeBuildNumber
|
||||
|
||||
# Exclude python caches
|
||||
/**/__pycache__
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -25,3 +25,6 @@
|
||||
[submodule "deps/json"]
|
||||
path = deps/json
|
||||
url = https://github.com/nlohmann/json.git
|
||||
[submodule "deps/libusb"]
|
||||
path = deps/libusb
|
||||
url = https://github.com/libusb/libusb.git
|
||||
|
||||
@@ -52,8 +52,6 @@ target_sources(
|
||||
${LIB_NAME}
|
||||
PRIVATE lib/legacy/scene-group.cpp
|
||||
lib/legacy/scene-group.hpp
|
||||
lib/legacy/scene-trigger.cpp
|
||||
lib/legacy/scene-trigger.hpp
|
||||
lib/legacy/switch-audio.cpp
|
||||
lib/legacy/switch-audio.hpp
|
||||
lib/legacy/switch-executable.cpp
|
||||
@@ -66,8 +64,6 @@ target_sources(
|
||||
lib/legacy/switch-idle.hpp
|
||||
lib/legacy/switch-media.cpp
|
||||
lib/legacy/switch-media.hpp
|
||||
lib/legacy/switch-network.cpp
|
||||
lib/legacy/switch-network.hpp
|
||||
lib/legacy/switch-pause.cpp
|
||||
lib/legacy/switch-pause.hpp
|
||||
lib/legacy/switch-random.cpp
|
||||
@@ -96,6 +92,8 @@ target_sources(
|
||||
lib/macro/macro-action-macro.hpp
|
||||
lib/macro/macro-action-queue.cpp
|
||||
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.hpp
|
||||
lib/macro/macro-action.cpp
|
||||
@@ -108,6 +106,8 @@ target_sources(
|
||||
lib/macro/macro-condition-macro.hpp
|
||||
lib/macro/macro-condition-queue.cpp
|
||||
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.hpp
|
||||
lib/macro/macro-condition-variable.cpp
|
||||
@@ -128,10 +128,14 @@ target_sources(
|
||||
lib/macro/macro-ref.hpp
|
||||
lib/macro/macro-run-button.cpp
|
||||
lib/macro/macro-run-button.hpp
|
||||
lib/macro/macro-script-handler.cpp
|
||||
lib/macro/macro-script-handler.hpp
|
||||
lib/macro/macro-segment-copy-paste.cpp
|
||||
lib/macro/macro-segment-copy-paste.hpp
|
||||
lib/macro/macro-segment-list.cpp
|
||||
lib/macro/macro-segment-list.hpp
|
||||
lib/macro/macro-segment-script.cpp
|
||||
lib/macro/macro-segment-script.hpp
|
||||
lib/macro/macro-segment-selection.cpp
|
||||
lib/macro/macro-segment-selection.hpp
|
||||
lib/macro/macro-segment.cpp
|
||||
@@ -155,12 +159,18 @@ target_sources(
|
||||
lib/queue/action-queue-tab.hpp
|
||||
lib/utils/backup.cpp
|
||||
lib/utils/backup.hpp
|
||||
lib/utils/condition-logic.cpp
|
||||
lib/utils/condition-logic.hpp
|
||||
lib/utils/curl-helper.cpp
|
||||
lib/utils/curl-helper.hpp
|
||||
lib/utils/cursor-shape-changer.cpp
|
||||
lib/utils/cursor-shape-changer.hpp
|
||||
lib/utils/double-slider.cpp
|
||||
lib/utils/double-slider.hpp
|
||||
lib/utils/duration-control.cpp
|
||||
lib/utils/duration-control.hpp
|
||||
lib/utils/duration-modifier.cpp
|
||||
lib/utils/duration-modifier.hpp
|
||||
lib/utils/duration.cpp
|
||||
lib/utils/duration.hpp
|
||||
lib/utils/export-symbol-helper.hpp
|
||||
@@ -174,6 +184,8 @@ target_sources(
|
||||
lib/utils/item-selection-helpers.hpp
|
||||
lib/utils/layout-helpers.cpp
|
||||
lib/utils/layout-helpers.hpp
|
||||
lib/utils/list-controls.cpp
|
||||
lib/utils/list-controls.hpp
|
||||
lib/utils/list-editor.cpp
|
||||
lib/utils/list-editor.hpp
|
||||
lib/utils/log-helper.cpp
|
||||
@@ -188,7 +200,6 @@ target_sources(
|
||||
lib/utils/name-dialog.hpp
|
||||
lib/utils/non-modal-dialog.cpp
|
||||
lib/utils/non-modal-dialog.hpp
|
||||
lib/utils/obs-dock.hpp
|
||||
lib/utils/obs-module-helper.cpp
|
||||
lib/utils/obs-module-helper.hpp
|
||||
lib/utils/path-helpers.cpp
|
||||
@@ -197,6 +208,9 @@ target_sources(
|
||||
lib/utils/plugin-state-helpers.hpp
|
||||
lib/utils/priority-helper.cpp
|
||||
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.hpp
|
||||
lib/utils/resizing-text-edit.cpp
|
||||
@@ -237,12 +251,16 @@ target_sources(
|
||||
lib/utils/tab-helpers.hpp
|
||||
lib/utils/temp-variable.cpp
|
||||
lib/utils/temp-variable.hpp
|
||||
lib/utils/time-helpers.cpp
|
||||
lib/utils/time-helpers.hpp
|
||||
lib/utils/ui-helpers.cpp
|
||||
lib/utils/ui-helpers.hpp
|
||||
lib/utils/utility.cpp
|
||||
lib/utils/utility.hpp
|
||||
lib/utils/volume-control.cpp
|
||||
lib/utils/volume-control.hpp
|
||||
lib/utils/websocket-api.cpp
|
||||
lib/utils/websocket-api.hpp
|
||||
lib/variables/variable-line-edit.cpp
|
||||
lib/variables/variable-line-edit.hpp
|
||||
lib/variables/variable-number.hpp
|
||||
@@ -260,6 +278,11 @@ target_sources(
|
||||
|
||||
# --- End of section ---
|
||||
|
||||
# Subfolder for advanced scene switcher plugins
|
||||
set(ADVSS_PLUGIN_FOLDER "advanced-scene-switcher-plugins")
|
||||
target_compile_definitions(
|
||||
${LIB_NAME} PRIVATE ADVSS_PLUGIN_FOLDER=\"${ADVSS_PLUGIN_FOLDER}\")
|
||||
|
||||
include(cmake/common/advss_helpers.cmake)
|
||||
setup_obs_lib_dependency(${LIB_NAME})
|
||||
setup_obs_lib_dependency(${PROJECT_NAME})
|
||||
@@ -303,13 +326,9 @@ set_target_properties(${LIB_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
||||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
|
||||
target_compile_features(${LIB_NAME} PUBLIC cxx_std_17)
|
||||
|
||||
add_definitions(-DASIO_STANDALONE)
|
||||
target_include_directories(
|
||||
${LIB_NAME}
|
||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/deps/asio/asio/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/deps/websocketpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/deps/obs-websocket/lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/deps/exprtk")
|
||||
${LIB_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/deps/obs-websocket/lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/deps/exprtk")
|
||||
|
||||
if(NOT nlohmann_json_DIR
|
||||
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/deps/json/CMakeLists.txt")
|
||||
@@ -405,8 +424,7 @@ if(NOT OS_WINDOWS)
|
||||
target_compile_options(
|
||||
${LIB_NAME}
|
||||
PUBLIC -Wno-error=unused-parameter -Wno-error=conversion -Wno-error=shadow
|
||||
-Wno-error=float-conversion -Wno-error=enum-conversion
|
||||
-Wno-error=deprecated-declarations)
|
||||
-Wno-error=float-conversion -Wno-error=enum-conversion)
|
||||
endif()
|
||||
|
||||
# --- End of section ---
|
||||
|
||||
@@ -22,5 +22,6 @@ sudo snap install obs-studio
|
||||
## Contributing
|
||||
|
||||
- If you wish to contribute code to the project, have a look at this [section](BUILDING.md) describing how to compile the plugin.
|
||||
- You can add custom conditions and actions at runtime using the API described [here](https://github.com/WarmUpTill/SceneSwitcher/wiki/Scripting).
|
||||
- You can optionally use [pre-commit](https://pre-commit.com) to automatically handle formatting.
|
||||
- If you wish to contribute translations, feel free to submit pull requests for the corresponding files under `data/locale`.
|
||||
|
||||
@@ -6,17 +6,27 @@ import re
|
||||
import sys
|
||||
|
||||
defaultLocaleFile = "en-US.ini"
|
||||
commentChars = ";#"
|
||||
|
||||
|
||||
class localeEntry:
|
||||
locale = ""
|
||||
widgetPlaceholders = []
|
||||
qStringArgs = []
|
||||
lineNum = -1
|
||||
|
||||
def __init__(self, locale, widgetPlaceholders, qStringArgs) -> None:
|
||||
def __init__(self, locale, widgetPlaceholders, qStringArgs, lineNum) -> None:
|
||||
self.locale = locale
|
||||
self.widgetPlaceholders = widgetPlaceholders
|
||||
self.qStringArgs = qStringArgs
|
||||
self.lineNum = lineNum
|
||||
|
||||
|
||||
def isCommentLine(line):
|
||||
for char in commentChars:
|
||||
if line.startswith(char):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def getNonDefaultLocales(dir):
|
||||
@@ -32,11 +42,11 @@ def getNonDefaultLocales(dir):
|
||||
def getAllLocaleEntries(file):
|
||||
localeEntries = []
|
||||
with open(file, "r", encoding="UTF-8") as f:
|
||||
for line in f.readlines():
|
||||
for lineNum, line in enumerate(f):
|
||||
widgetPlaceholders = []
|
||||
qStringArgs = []
|
||||
|
||||
if line.startswith(";"):
|
||||
if isCommentLine(line):
|
||||
continue
|
||||
|
||||
for word in line.split("{{"):
|
||||
@@ -49,7 +59,9 @@ def getAllLocaleEntries(file):
|
||||
qStringArgs.append(match.group(0))
|
||||
|
||||
localeEntries.append(
|
||||
localeEntry(line.split("=")[0], widgetPlaceholders, qStringArgs)
|
||||
localeEntry(
|
||||
line.split("=")[0], widgetPlaceholders, qStringArgs, lineNum + 1
|
||||
)
|
||||
)
|
||||
|
||||
return localeEntries
|
||||
@@ -73,8 +85,8 @@ def checkLocaleEntries(file, expectedLocaleEntries):
|
||||
if expectedLocaleEntry is None:
|
||||
result = False
|
||||
print(
|
||||
'ERROR: Locale entry "{}" from "{}" not found in "{}"'.format(
|
||||
localeEntry.locale, file, defaultLocaleFile
|
||||
'ERROR: Locale entry "{}" from "{}:{}" not found in "{}"'.format(
|
||||
localeEntry.locale, file, localeEntry.lineNum, defaultLocaleFile
|
||||
)
|
||||
)
|
||||
continue
|
||||
@@ -83,8 +95,13 @@ def checkLocaleEntries(file, expectedLocaleEntries):
|
||||
if placeholder not in expectedLocaleEntry.widgetPlaceholders:
|
||||
result = False
|
||||
print(
|
||||
'ERROR: Locale entry "{}" from "{}" does contain "{}" widget placeholder while "{}" does not'.format(
|
||||
localeEntry.locale, file, placeholder, defaultLocaleFile
|
||||
'ERROR: Locale entry "{}" from "{}:{}" does contain "{}" widget placeholder while "{}:{}" does not'.format(
|
||||
localeEntry.locale,
|
||||
file,
|
||||
localeEntry.lineNum,
|
||||
placeholder,
|
||||
defaultLocaleFile,
|
||||
expectedLocaleEntry.lineNum,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -92,8 +109,8 @@ def checkLocaleEntries(file, expectedLocaleEntries):
|
||||
if placeholder not in localeEntry.widgetPlaceholders:
|
||||
result = False
|
||||
print(
|
||||
'ERROR: Locale entry "{}" from "{}" does not contain "{}" widget placeholder'.format(
|
||||
localeEntry.locale, file, placeholder
|
||||
'ERROR: Locale entry "{}" from "{}:{}" does not contain "{}" widget placeholder'.format(
|
||||
localeEntry.locale, file, localeEntry.lineNum, placeholder
|
||||
)
|
||||
)
|
||||
|
||||
@@ -101,8 +118,13 @@ def checkLocaleEntries(file, expectedLocaleEntries):
|
||||
if arg not in expectedLocaleEntry.qStringArgs:
|
||||
result = False
|
||||
print(
|
||||
'ERROR: Locale entry "{}" from "{}" does contain "{}" QString arg while "{}" does not'.format(
|
||||
localeEntry.locale, file, arg, defaultLocaleFile
|
||||
'ERROR: Locale entry "{}" from "{}:{}" does contain "{}" QString arg while "{}:{}" does not'.format(
|
||||
localeEntry.locale,
|
||||
file,
|
||||
localeEntry.lineNum,
|
||||
arg,
|
||||
defaultLocaleFile,
|
||||
expectedLocaleEntry.lineNum,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -110,8 +132,8 @@ def checkLocaleEntries(file, expectedLocaleEntries):
|
||||
if arg not in localeEntry.qStringArgs:
|
||||
result = False
|
||||
print(
|
||||
'ERROR: Locale entry "{}" from "{}" does not contain "{}" QString arg'.format(
|
||||
localeEntry.locale, file, arg
|
||||
'ERROR: Locale entry "{}" from "{}:{}" does not contain "{}" QString arg'.format(
|
||||
localeEntry.locale, file, localeEntry.lineNum, arg
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
BIN
build-aux/CI/linux/ubuntu22/libproc2-0_4.0.2-3_amd64.deb
Normal file
BIN
build-aux/CI/linux/ubuntu22/libproc2-0_4.0.2-3_amd64.deb
Normal file
Binary file not shown.
BIN
build-aux/CI/linux/ubuntu22/libproc2-dev_4.0.2-3_amd64.deb
Normal file
BIN
build-aux/CI/linux/ubuntu22/libproc2-dev_4.0.2-3_amd64.deb
Normal file
Binary file not shown.
@@ -1,33 +1,33 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"obs-studio": {
|
||||
"version": "29.1.2",
|
||||
"version": "30.1.2",
|
||||
"baseUrl": "https://github.com/obsproject/obs-studio/archive/refs/tags",
|
||||
"label": "OBS sources",
|
||||
"hashes": {
|
||||
"macos": "215f1fa5772c5dd9f3d6e35b0cb573912b00320149666a77864f9d305525504b",
|
||||
"windows-x64": "46d451f3f42b9d2c59339ec268165849c7b7904cdf1cc2a8d44c015815a9e37d"
|
||||
"macos": "490bae1c392b3b344b0270afd8cb887da4bc50bd92c0c426e96713c1ccb9701a",
|
||||
"windows-x64": "c2dd03fa7fd01fad5beafce8f7156da11f9ed9a588373fd40b44a06f4c03b867"
|
||||
}
|
||||
},
|
||||
"prebuilt": {
|
||||
"version": "2023-04-12",
|
||||
"version": "2024-03-19",
|
||||
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
|
||||
"label": "Pre-Built obs-deps",
|
||||
"hashes": {
|
||||
"macos": "9535c6e1ad96f7d49960251e85a245774088d48da1d602bb82f734b10219125a",
|
||||
"windows-x64": "c13a14a1acc4224b21304d97b63da4121de1ed6981297e50496fbc474abc0503"
|
||||
"macos": "2e9bfb55a5e0e4c1086fa1fda4cf268debfead473089df2aaea80e1c7a3ca7ff",
|
||||
"windows-x64": "6e86068371526a967e805f6f9903f9407adb683c21820db5f07da8f30d11e998"
|
||||
}
|
||||
},
|
||||
"qt6": {
|
||||
"version": "2023-04-12",
|
||||
"version": "2024-03-19",
|
||||
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
|
||||
"label": "Pre-Built Qt6",
|
||||
"hashes": {
|
||||
"macos": "eb7614544ab4f3d2c6052c797635602280ca5b028a6b987523d8484222ce45d1",
|
||||
"windows-x64": "4d39364b8a8dee5aa24fcebd8440d5c22bb4551c6b440ffeacce7d61f2ed1add"
|
||||
"macos": "694f1e639c017e3b1f456f735330dc5afae287cbea85757101af1368de3142c8",
|
||||
"windows-x64": "72d1df34a0ef7413a681d5fcc88cae81da60adc03dcd23ef17862ab170bcc0dd"
|
||||
},
|
||||
"debugSymbols": {
|
||||
"windows-x64": "f34ee5067be19ed370268b15c53684b7b8aaa867dc800b68931df905d679e31f"
|
||||
"windows-x64": "fbddd1f659c360f2291911ac5709b67b6f8182e6bca519d24712e4f6fd3cc865"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -8,14 +8,11 @@ if(BUILD_OUT_OF_TREE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Subfolder for advanced scene switcher plugins
|
||||
set(_PLUGIN_FOLDER "adv-ss-plugins")
|
||||
|
||||
# --- MACOS section ---
|
||||
if(OS_MACOS)
|
||||
set(ADVSS_BUNDLE_DIR "advanced-scene-switcher.plugin")
|
||||
set(ADVSS_BUNDLE_MODULE_DIR "${ADVSS_BUNDLE_DIR}/Contents/MacOS")
|
||||
set(ADVSS_BUNDLE_PLUGIN_DIR ${ADVSS_BUNDLE_MODULE_DIR}/${_PLUGIN_FOLDER})
|
||||
set(ADVSS_BUNDLE_PLUGIN_DIR ${ADVSS_BUNDLE_MODULE_DIR}/${ADVSS_PLUGIN_FOLDER})
|
||||
|
||||
function(install_advss_lib_helper target where)
|
||||
install(
|
||||
@@ -60,10 +57,36 @@ if(OS_MACOS)
|
||||
${dep}_Development)
|
||||
endfunction()
|
||||
|
||||
function(install_advss_plugin_dependency_file ${target} dep)
|
||||
target_sources(advanced-scene-switcher PRIVATE ${dep})
|
||||
set_source_files_properties(${dep} PROPERTIES MACOSX_PACKAGE_LOCATION
|
||||
${ADVSS_BUNDLE_PLUGIN_DIR})
|
||||
function(install_advss_plugin_dependency_file target dep)
|
||||
get_filename_component(_FILENAME ${dep} NAME)
|
||||
string(REGEX REPLACE "\\.[^.]*$" "" _FILENAMENOEXT ${_FILENAME})
|
||||
set(_DEP_NAME "${target}-${_FILENAMENOEXT}")
|
||||
|
||||
install(
|
||||
FILES "${dep}"
|
||||
DESTINATION "${ADVSS_BUNDLE_PLUGIN_DIR}"
|
||||
COMPONENT ${_DEP_NAME}_Runtime
|
||||
DESTINATION "${ADVSS_BUNDLE_PLUGIN_DIR}"
|
||||
COMPONENT ${_DEP_NAME}_Runtime
|
||||
NAMELINK_COMPONENT ${_DEP_NAME}_Development)
|
||||
|
||||
install(
|
||||
FILES "${dep}"
|
||||
DESTINATION "${ADVSS_BUNDLE_PLUGIN_DIR}"
|
||||
COMPONENT obs_${_DEP_NAME}
|
||||
EXCLUDE_FROM_ALL
|
||||
DESTINATION "${ADVSS_BUNDLE_PLUGIN_DIR}"
|
||||
COMPONENT obs_${_DEP_NAME}
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config
|
||||
$<CONFIG> --prefix ${CMAKE_INSTALL_PREFIX} --component obs_${_DEP_NAME}
|
||||
COMMENT "Installing ${_DEP_NAME} to OBS rundir\n"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
|
||||
# --- End of section ---
|
||||
@@ -128,8 +151,8 @@ else()
|
||||
|
||||
function(install_advss_plugin target)
|
||||
plugin_install_helper(
|
||||
"${target}" "${OBS_PLUGIN_DESTINATION}/${_PLUGIN_FOLDER}"
|
||||
"${_PLUGIN_FOLDER}")
|
||||
"${target}" "${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
|
||||
"${ADVSS_PLUGIN_FOLDER}")
|
||||
if(NOT OS_WINDOWS)
|
||||
set_target_properties(${target} PROPERTIES INSTALL_RPATH
|
||||
"$ORIGIN:$ORIGIN/..")
|
||||
@@ -143,12 +166,12 @@ else()
|
||||
${dep}
|
||||
RUNTIME
|
||||
DESTINATION
|
||||
"${OBS_PLUGIN_DESTINATION}/${_PLUGIN_FOLDER}"
|
||||
"${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
|
||||
COMPONENT
|
||||
${dep}_Runtime
|
||||
LIBRARY
|
||||
DESTINATION
|
||||
"${OBS_PLUGIN_DESTINATION}/${_PLUGIN_FOLDER}"
|
||||
"${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
|
||||
COMPONENT
|
||||
${dep}_Runtime
|
||||
NAMELINK_COMPONENT
|
||||
@@ -159,13 +182,13 @@ else()
|
||||
${dep}
|
||||
RUNTIME
|
||||
DESTINATION
|
||||
"${OBS_PLUGIN_DESTINATION}/${_PLUGIN_FOLDER}"
|
||||
"${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
|
||||
COMPONENT
|
||||
obs_${dep}
|
||||
EXCLUDE_FROM_ALL
|
||||
LIBRARY
|
||||
DESTINATION
|
||||
"${OBS_PLUGIN_DESTINATION}/${_PLUGIN_FOLDER}"
|
||||
"${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
|
||||
COMPONENT
|
||||
obs_${dep}
|
||||
EXCLUDE_FROM_ALL)
|
||||
@@ -188,18 +211,18 @@ else()
|
||||
|
||||
install(
|
||||
FILES "${dep}"
|
||||
DESTINATION "${OBS_PLUGIN_DESTINATION}/${_PLUGIN_FOLDER}"
|
||||
DESTINATION "${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
|
||||
COMPONENT ${_DEP_NAME}_Runtime
|
||||
DESTINATION "${OBS_PLUGIN_DESTINATION}/${_PLUGIN_FOLDER}"
|
||||
DESTINATION "${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
|
||||
COMPONENT ${_DEP_NAME}_Runtime
|
||||
NAMELINK_COMPONENT ${_DEP_NAME}_Development)
|
||||
|
||||
install(
|
||||
FILES "${dep}"
|
||||
DESTINATION "${OBS_PLUGIN_DESTINATION}/${_PLUGIN_FOLDER}"
|
||||
DESTINATION "${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
|
||||
COMPONENT obs_${_DEP_NAME}
|
||||
EXCLUDE_FROM_ALL
|
||||
DESTINATION "${OBS_PLUGIN_DESTINATION}/${_PLUGIN_FOLDER}"
|
||||
DESTINATION "${OBS_PLUGIN_DESTINATION}/${ADVSS_PLUGIN_FOLDER}"
|
||||
COMPONENT obs_${_DEP_NAME}
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
@@ -309,7 +332,6 @@ function(install_advss_plugin_dependency)
|
||||
if(NOT PARSED_ARGS_TARGET)
|
||||
message(FATAL_ERROR "You must provide a target")
|
||||
endif()
|
||||
set(_PLUGIN_FOLDER "adv-ss-plugins")
|
||||
foreach(_DEPENDENCY ${PARSED_ARGS_DEPENDENCIES})
|
||||
if(EXISTS ${_DEPENDENCY})
|
||||
install_advss_plugin_dependency_file(${PARSED_ARGS_TARGET} ${_DEPENDENCY})
|
||||
|
||||
@@ -19,11 +19,11 @@ AdvSceneSwitcher.generalTab.status.autoStart.streaming="Streamen"
|
||||
AdvSceneSwitcher.generalTab.status.autoStart.recordingAndStreaming="Aufnehmen oder Streamen"
|
||||
AdvSceneSwitcher.generalTab.status.checkInterval="Teste Bedingungen alle"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior="Allgemeines Verhalten"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet="Wenn keine Bedingung erfüllt ist für "
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="Kann nur so genau sein wie das eingestellte Interval zum Testen der Bedingungen."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Nicht wechseln"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Wechsle zu einer Szene auf dem Zufall-Tab"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Wechsle zu:"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch="Wenn keine Bedingung erfüllt ist für "
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatchDelay.tooltip="Kann nur so genau sein wie das eingestellte Interval zum Testen der Bedingungen."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch="Nicht wechseln"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Wechsle zu einer Szene auf dem Zufall-Tab"
|
||||
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.cooldownHint="In diesem Zeitraum werden potentielle erfüllte Bedingungen ignoriert!"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Ausführliches Logging"
|
||||
@@ -94,7 +94,7 @@ AdvSceneSwitcher.macroTab.highlightExecutedMacros="Kürzlich ausgeführte Makros
|
||||
AdvSceneSwitcher.macroTab.highlightTrueConditions="Bedingungen des aktuell ausgewählten Makros hervorheben, die kürzlich als wahr bewertet wurden"
|
||||
AdvSceneSwitcher.macroTab.highlightPerformedActions="Zuletzt ausgeführte Aktionen des aktuell ausgewählten Makros hervorheben"
|
||||
AdvSceneSwitcher.macroTab.newMacroRegisterHotkey="Hotkeys zur Steuerung des Pausen-Status neuer Makros registrieren"
|
||||
AdvSceneSwitcher.macroTab.currentDisableHotkeys="Hotkeys zur Steuerung des Pausen-Status ausgewählter Makros registrieren"
|
||||
AdvSceneSwitcher.macroTab.currentRegisterHotkeys="Hotkeys zur Steuerung des Pausen-Status ausgewählter Makros registrieren"
|
||||
|
||||
; Macro List
|
||||
AdvSceneSwitcher.macroList.deleted="gelöscht"
|
||||
@@ -142,8 +142,6 @@ AdvSceneSwitcher.condition.scene.type.currentPattern="Aktuelle Szene entspricht"
|
||||
AdvSceneSwitcher.condition.scene.type.previousPattern="Vorherige Szene entspricht"
|
||||
AdvSceneSwitcher.condition.scene.currentSceneTransitionBehaviour="Während des Übergangs die Ziel-Szene überprüfen"
|
||||
AdvSceneSwitcher.condition.scene.previousSceneTransitionBehaviour="Während des Übergangs die Quell-Szene überprüfen"
|
||||
AdvSceneSwitcher.condition.scene.entry.line1="{{sceneType}}{{scenes}}{{pattern}}"
|
||||
AdvSceneSwitcher.condition.scene.entry.line2="{{useTransitionTargetScene}}"
|
||||
AdvSceneSwitcher.condition.window="Fenster"
|
||||
AdvSceneSwitcher.condition.file="Datei"
|
||||
AdvSceneSwitcher.condition.file.type.match="entspricht"
|
||||
@@ -159,7 +157,7 @@ AdvSceneSwitcher.condition.media.source="Quelle"
|
||||
AdvSceneSwitcher.condition.media.anyOnScene="Beliebige Medienquelle in"
|
||||
AdvSceneSwitcher.condition.media.allOnScene="Alle Medienquellen in"
|
||||
AdvSceneSwitcher.condition.media.inconsistencyInfo="Leider verhalten sich nicht alle Medien-Quell-Typen gleich (z.B. Medien-Quelle vs. VLC-Video-Quelle \"Gestoppt\"-Status).\nBitte experimentieren, was in eurem Setup funktioniert!"
|
||||
AdvSceneSwitcher.condition.media.entry="{{sourceTypes}}{{mediaSources}}{{scenes}}Status ist{{states}}und{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.media.layout.legacy="{{sourceTypes}}{{mediaSources}}{{scenes}}{{checkTypes}}Status ist{{states}}und{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.video="Video"
|
||||
AdvSceneSwitcher.condition.video.condition.match="entspricht genau"
|
||||
AdvSceneSwitcher.condition.video.condition.differ="stimmt nicht überein"
|
||||
@@ -321,11 +319,8 @@ AdvSceneSwitcher.condition.date.entry.nextMatchDate="Nächster Treffer bei: %1"
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}} Bei Wiederholung ausgewähltes Datum auf Wiederholungsdatum aktualisieren"
|
||||
AdvSceneSwitcher.condition.sceneTransform="Szenenelement transformieren"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="Transformation erhalten"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line1="Auf{{scenes}}{{sources}}{{types}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.type.matches="entspricht Transformation"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.type.changed="hat sich geändert"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line2="{{settings}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line3="{{regex}} {{getSettings}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.match="entspricht Transformation"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.changed="hat sich geändert"
|
||||
AdvSceneSwitcher.condition.transition="Übergang"
|
||||
AdvSceneSwitcher.condition.transition.type.current="Aktueller Übergangstyp ist"
|
||||
AdvSceneSwitcher.condition.transition.type.duration="Aktuelle Übergangsdauer beträgt"
|
||||
@@ -427,7 +422,6 @@ AdvSceneSwitcher.action.replay.saveWarn="Warnung: Ein zu häufiges Speichern kan
|
||||
AdvSceneSwitcher.action.replay.type.stop="Replay Buffer stoppen"
|
||||
AdvSceneSwitcher.action.replay.type.start="Replay Buffer starten"
|
||||
AdvSceneSwitcher.action.replay.type.save="Replay Buffer speichern"
|
||||
AdvSceneSwitcher.action.replay.entry="{{actions}}"
|
||||
AdvSceneSwitcher.action.streaming="Stream"
|
||||
AdvSceneSwitcher.action.streaming.type.stop="Stream stoppen"
|
||||
AdvSceneSwitcher.action.streaming.type.start="Stream starten"
|
||||
@@ -499,7 +493,7 @@ AdvSceneSwitcher.action.sceneOrder.type.movePosition="An Position verschieben"
|
||||
AdvSceneSwitcher.action.sceneOrder.entry="Auf{{scenes}}{{actions}}{{sources}}{{position}}"
|
||||
AdvSceneSwitcher.action.sceneTransform="Szenenelement transformieren"
|
||||
AdvSceneSwitcher.action.sceneTransform.getTransform="Transformation erhalten"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="Auf{{scenes}}{{action}}{{rotation}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="Auf{{scenes}}{{action}}{{rotation}}{{sources}}{{settingSelection}}{{singleSettingValue}}"
|
||||
AdvSceneSwitcher.action.file="Datei"
|
||||
AdvSceneSwitcher.action.file.type.write="Schreiben"
|
||||
AdvSceneSwitcher.action.file.type.append="Anhängen"
|
||||
@@ -535,7 +529,7 @@ AdvSceneSwitcher.action.screenshot.type.source="Quelle"
|
||||
AdvSceneSwitcher.action.screenshot.type.scene="Szene"
|
||||
AdvSceneSwitcher.action.screenshot.mainOutput="OBS's Haupt-Ausgabe"
|
||||
AdvSceneSwitcher.action.screenshot.blackscreenNote="Quellen oder Szenen, die nicht immer gerendert werden, können dazu führen, dass einige Teile der Screenshots leer bleiben."
|
||||
AdvSceneSwitcher.action.screenshot.entry="Screenshot{{targetType}}{{sources}}{{scenes}}und speichere in{{saveType}}Pfad"
|
||||
AdvSceneSwitcher.action.screenshot.entry="Screenshot{{targetType}}{{sources}}{{scenes}}und speichere in{{saveType}}{{variables}}Pfad"
|
||||
AdvSceneSwitcher.action.profile="Profil"
|
||||
AdvSceneSwitcher.action.profile.entry="Aktives Profil umschalten auf {{profiles}}"
|
||||
AdvSceneSwitcher.action.sceneCollection="Szenensammlung"
|
||||
@@ -734,31 +728,6 @@ AdvSceneSwitcher.videoTab.ignoreInactiveSource="außer Video Quelle ist inaktiv"
|
||||
AdvSceneSwitcher.videoTab.entry="Wenn {{videoSources}} {{condition}} {{filePath}} {{browseButton}} für {{duration}} wechsle zu {{scenes}} mit {{transitions}} {{ignoreInactiveSource}}"
|
||||
AdvSceneSwitcher.videoTab.help="<html><head/><body><p>Dieser Tab ermöglicht es basierend auf der Videoausgabe von Quellen scenen zu wechseln.<br/>Für eine noch bessere Implementierung dieser Funktionalität siehe <a href=\"https://obsproject.com/forum/resources/pixel-match-switcher.1202/\"><span style=\" text-decoration: underline; color:#268bd2;\">Pixel Match Switcher</span></a>.<br/><br/>Klicke auf das markierte Plus Symbol, um einen neuen Eintrag hinzuzufügen..</p></body></html>"
|
||||
|
||||
; Network Tab
|
||||
AdvSceneSwitcher.networkTab.title="Netzwerk"
|
||||
AdvSceneSwitcher.networkTab.description="Über diesen Tab kann die aktive Szene einer anderen OBS-Instanz ferngesteuert werden.\nBitte beachten, dass die Szenennamen auf allen OBS-Instanzen exakt übereinstimmen müssen."
|
||||
AdvSceneSwitcher.networkTab.warning="Die Verwendung des Servers außerhalb eines lokalen Netzwerks kann dazu führen, dass die aktive Szene von dritten Personen ausgelesen werden kann."
|
||||
AdvSceneSwitcher.networkTab.server="Server starten (Sendet Szenenwechselnachrichten zu allen verbundenen Clients)"
|
||||
AdvSceneSwitcher.networkTab.server.port="Port"
|
||||
AdvSceneSwitcher.networkTab.server.lockToIPv4="Nur IPv4 verwenden (deaktiviert IPv6)"
|
||||
AdvSceneSwitcher.networkTab.server.sendSceneChange="Sende Nachrichten für Szenenwechsel"
|
||||
AdvSceneSwitcher.networkTab.server.restrictSendToAutomatedSwitches="Sende nur Szenenwechselnachrichten für automatisierte Szenenwechsel"
|
||||
AdvSceneSwitcher.networkTab.server.sendPreview="Sende Nachrichten für Vorschau Szenenwechsel im Studio-Modus"
|
||||
AdvSceneSwitcher.networkTab.startFailed.message="Der WebSocket-Server konnte nicht gestartet werden, mögliche Gründe:\n - Der TCP-Port %1 wird möglicherweise gerade von einem anderen Programm verwendet. Versuchen Sie einen anderen Port in den Websocket-Servereinstellungen zu setzen oder alle Programme zu beenden, die den Port möglicherweise verwenden.\n - Fehler: %2"
|
||||
AdvSceneSwitcher.networkTab.server.status.currentStatus="Aktueller Status"
|
||||
AdvSceneSwitcher.networkTab.server.status.notRunning="Nicht gestartet"
|
||||
AdvSceneSwitcher.networkTab.server.status.starting="Startet"
|
||||
AdvSceneSwitcher.networkTab.server.status.running="Server läuft"
|
||||
AdvSceneSwitcher.networkTab.server.restart="Server neu starten"
|
||||
AdvSceneSwitcher.networkTab.client="Client starten (Empfängt Szenenwechselnachrichten )"
|
||||
AdvSceneSwitcher.networkTab.client.address="Hostname oder IP-Adresse"
|
||||
AdvSceneSwitcher.networkTab.client.port="Port"
|
||||
AdvSceneSwitcher.networkTab.client.status.currentStatus="Aktueller status"
|
||||
AdvSceneSwitcher.networkTab.client.status.disconnected="Verbindung getrennt"
|
||||
AdvSceneSwitcher.networkTab.client.status.connecting="Verbinde"
|
||||
AdvSceneSwitcher.networkTab.client.status.connected="Verbunden"
|
||||
AdvSceneSwitcher.networkTab.client.reconnect="Erneutes Verbinden erzwingen"
|
||||
|
||||
; Scene Group Tab
|
||||
AdvSceneSwitcher.sceneGroupTab.title="Szenengruppe"
|
||||
AdvSceneSwitcher.sceneGroupTab.list="Szenengruppen"
|
||||
@@ -779,30 +748,6 @@ AdvSceneSwitcher.sceneGroupTab.exists="Szenengruppen- oder Szenenname existiert
|
||||
AdvSceneSwitcher.sceneGroupTab.help="Szenengruppen können, genau wie reguläre Szenen, als Ziel eines Szenenwechsler Eintrags ausgewählt werden.\n\nSzenengruppen bestehen aus einer Liste von Szenen.\nDie aktive Szene der Szenengruppe schreitet abhängig von den konfigurierten Einstellungen durch die Liste der zugewiesenen Szenen fort.\n\nMögliche Einstellungen zum Fortschreiten der aktiven Szene sind:\nAnzahl der Szenenwechsel.\nZeit seit dem letzten Szenenwechsel in der Szenengruppe.\nOder zufällig.\n\nSo kann zum Beispiel eine Szenengruppe welche die folgenden Szenen enthält ...\nSzene 1\nSzene 2\nSzene 3 \n... beim erstem Mal zu \"Szene 1\" wechseln.\nBeim zweiten Mal zu \"Szene 2\".\nDie restlichem Male wechselt die Szenengruppe zu \"Szene 3\".\n\nKlicke auf das markierte Plus Symbol, um eine neuen Szenengruppe hinzuzufügen."
|
||||
AdvSceneSwitcher.sceneGroupTab.scenes.help="Wähle die Szenengruppe, die du bearbeiten möchtest, auf der linken Seite aus.\n\nWähle oben eine Szene aus, die du zur Szenengruppe hinzufügen möchtest, und klicke das Plus Symbol.\n\nDie gleiche Szene kann mehrfach in derselben Szenengruppe auftauchen."
|
||||
|
||||
; Scene Trigger Tab
|
||||
AdvSceneSwitcher.sceneTriggerTab.title="Szenen Trigger"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.none="--Trigger auswählen--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneActive="aktiv ist"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneInactive="nicht aktiv ist"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneLeave="verlassen wird"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.none="--Aktion auswählen--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startRecording="Aufnahme starten"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.pauseRecording="Aufnahme pausieren"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unpauseRecording="Aufnahme fortsetzen"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopRecording="Aufnahme stoppen"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopStreaming="Streamen stoppen"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startStreaming="Streamen starten"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startReplayBuffer="Replay Buffer starten"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopReplayBuffer="Replay Buffer stoppen"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.muteSource="Audio Quelle stumm schalten"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unmuteSource="Audio Quelle aktiv schalten"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startSwitcher="Szenenwechsler starten"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopSwitcher="Szenenwechsler stoppen"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startVirtualCamera="Virtuelle Kamera starten"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopVirtualCamera="Virtuelle Kamera stoppen"
|
||||
AdvSceneSwitcher.sceneTriggerTab.entry="Wenn {{scenes}} {{triggers}} {{actions}} {{audioSources}} nach {{duration}} "
|
||||
AdvSceneSwitcher.sceneTriggerTab.help="Dieser Tab ermöglicht es automatisiert Handlungen, wie etwa das Stoppen von einer Aufnahme oder des Streamens, bei einem Szenenwechsel auszuführen."
|
||||
|
||||
; Hotkey
|
||||
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Starte den Erweiterten Szenenwechsler"
|
||||
AdvSceneSwitcher.hotkey.stopSwitcherHotkey="Stoppe den Erweiterten Szenenwechsler"
|
||||
@@ -899,7 +844,7 @@ AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>Dies scheint das erste
|
||||
AdvSceneSwitcher.deprecatedTabWarning="Die Entwicklung für dieses Tab wurde gestoppt!\nBitte stattdessen zur Verwendung des Makros-Tab übergehen.\nDieser Hinweis kann im Allgemein-Tab deaktiviert werden."
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="Millisekunden"
|
||||
AdvSceneSwitcher.unit.secends="Sekunden"
|
||||
AdvSceneSwitcher.unit.seconds="Sekunden"
|
||||
AdvSceneSwitcher.unit.minutes="Minuten"
|
||||
AdvSceneSwitcher.unit.hours="Stunden"
|
||||
AdvSceneSwitcher.duration.condition.none="Kein Dauer-Modifikator"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
AdvSceneSwitcher.pluginName="Advanced Scene Switcher"
|
||||
AdvSceneSwitcher.windowTitle="Advanced Scene Switcher"
|
||||
|
||||
; General Tab
|
||||
# General Tab
|
||||
AdvSceneSwitcher.generalTab.title="General"
|
||||
AdvSceneSwitcher.generalTab.status="Status"
|
||||
AdvSceneSwitcher.generalTab.status.hotkeytips="Hotkeys can be defined in the OBS settings"
|
||||
@@ -18,17 +18,20 @@ AdvSceneSwitcher.generalTab.status.autoStart.recording="Recording"
|
||||
AdvSceneSwitcher.generalTab.status.autoStart.streaming="Streaming"
|
||||
AdvSceneSwitcher.generalTab.status.autoStart.recordingAndStreaming="Recording or Streaming"
|
||||
AdvSceneSwitcher.generalTab.status.checkInterval="Check conditions every"
|
||||
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.generalBehavior="General behavior"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet="If no actions are performed for"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="Will only ever be as accurate as the configured check interval."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Don't switch"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Switch to any scene in Random tab"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Switch to:"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch="If no actions are performed for"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatchDelay.tooltip="Will only ever be as accurate as the configured check interval."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch="Don't switch"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Switch to any scene in Random tab"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Switch to:"
|
||||
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.logLevel="Log level:"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default="Default"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.printActions="Log performed actions"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logMacro="Log executed macros"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.logAction="Log performed actions"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose="Verbose logging"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Enable verbose logging"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Save window position and size"
|
||||
@@ -37,6 +40,7 @@ AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Disable UI hints"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.comboBoxFilterDisable="Disable filtering by typing in drop down menus"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailure="Display warning if plugins cannot be loaded"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailureMessage="<html><body>Loading of the following plugin libraries was unsuccessful, which could result in some Advanced Scene Switcher functions not being available:%1Check the OBS logs for details.<br>This message can be disabled on the General tab.</body></html>"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.warnCorruptedInstallMessage="The plugin installation seems to be corrupted and might crash!\nPlease make sure the plugin was installed correctly!"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.hideLegacyTabs="Hide tabs which can be represented via macros"
|
||||
AdvSceneSwitcher.generalTab.matchBehavior="Match behavior"
|
||||
AdvSceneSwitcher.generalTab.priority="Priority"
|
||||
@@ -69,7 +73,7 @@ AdvSceneSwitcher.generalTab.transitionOverride="Set transition overrides"
|
||||
AdvSceneSwitcher.generalTab.adjustActiveTransitionType="Change active transition type"
|
||||
AdvSceneSwitcher.generalTab.transitionBehaviorSelectionError="At least one option must be enabled:\n\n - Use transition overrides\n\n - Change active transition type"
|
||||
|
||||
; Variables Tab
|
||||
# Variables Tab
|
||||
AdvSceneSwitcher.variableTab.title="Variables"
|
||||
AdvSceneSwitcher.variableTab.help="Variables can be used in many places throughout the plugin.\n\nClick on the highlighted plus symbol to add a new variable."
|
||||
AdvSceneSwitcher.variableTab.variableAddButton.tooltip="Add new variable"
|
||||
@@ -81,14 +85,12 @@ AdvSceneSwitcher.variableTab.value.header="Value"
|
||||
AdvSceneSwitcher.variableTab.saveLoadBehavior.header="Save/Load behavior"
|
||||
AdvSceneSwitcher.variableTab.saveLoadBehavior.text.default="Default to \"%1\""
|
||||
AdvSceneSwitcher.variableTab.lastUsed.header="Last used"
|
||||
AdvSceneSwitcher.variableTab.lastUsed.text="%1 seconds ago"
|
||||
AdvSceneSwitcher.variableTab.lastUsed.text.never="Never"
|
||||
AdvSceneSwitcher.variableTab.lastChanged.header="Last changed"
|
||||
AdvSceneSwitcher.variableTab.lastChanged.text="%1 seconds ago"
|
||||
AdvSceneSwitcher.variableTab.lastChanged.text.none="No change since launch"
|
||||
AdvSceneSwitcher.variableTab.lastChanged.tooltip="Times changed: %1\n\nPrevious value: %2"
|
||||
|
||||
; Action Queue Tab
|
||||
# Action Queue Tab
|
||||
AdvSceneSwitcher.actionQueueTab.title="Action Queues"
|
||||
AdvSceneSwitcher.actionQueueTab.help="Action queues are executed sequentially but in parallel to the reset of the macro system.\nThe first action added to the queue will be the first one to be processed.\n\nClick on the highlighted plus symbol to add a new queue."
|
||||
AdvSceneSwitcher.actionQueueTab.queueAddButton.tooltip="Add new action queue"
|
||||
@@ -102,7 +104,7 @@ AdvSceneSwitcher.actionQueueTab.no="No"
|
||||
AdvSceneSwitcher.actionQueueTab.removeSingleQueuePopup.text="Are you sure you want to remove \"%1\"?"
|
||||
AdvSceneSwitcher.actionQueueTab.removeMultipleQueuesPopup.text="Are you sure you want to remove %1 action queues?"
|
||||
|
||||
; Websocket Connections Tab
|
||||
# Websocket Connections Tab
|
||||
AdvSceneSwitcher.websocketConnectionTab.title="Websocket Connections"
|
||||
AdvSceneSwitcher.websocketConnectionTab.help="Websocket connections can be used to communicate with other OBS instances or programs.\n\nClick on the highlighted plus symbol to add a new connection."
|
||||
AdvSceneSwitcher.websocketConnectionTab.websocketConnectionAddButton.tooltip="Add new webscoket connection"
|
||||
@@ -116,10 +118,10 @@ AdvSceneSwitcher.websocketConnectionTab.protocol.no="No"
|
||||
AdvSceneSwitcher.websocketConnectionTab.removeSingleConnectionPopup.text="Are you sure you want to remove \"%1\"?"
|
||||
AdvSceneSwitcher.websocketConnectionTab.removeMultipleConnectionsPopup.text="Are you sure you want to remove %1 connections?"
|
||||
|
||||
; Twitch Connections Tab
|
||||
# Twitch Connections Tab
|
||||
AdvSceneSwitcher.twitchConnectionTab.title="Twitch Connections"
|
||||
AdvSceneSwitcher.twitchConnectionTab.help="Twitch connections can be used to use Twitch events as triggers to execute actions or perform actions on the linked Twitch account.\n\nClick on the highlighted plus symbol to add a new connection."
|
||||
AdvSceneSwitcher.twitchConnectionTab.twitchConnectionAddButton.tooltip.tooltip="Add new Twitch connection"
|
||||
AdvSceneSwitcher.twitchConnectionTab.twitchConnectionAddButton.tooltip="Add new Twitch connection"
|
||||
AdvSceneSwitcher.twitchConnectionTab.twitchConnectionRemoveButton.tooltip="Remove selected Twitch connections"
|
||||
AdvSceneSwitcher.twitchConnectionTab.name.header="Name"
|
||||
AdvSceneSwitcher.twitchConnectionTab.isValid.header="Is valid?"
|
||||
@@ -129,7 +131,7 @@ AdvSceneSwitcher.twitchConnectionTab.no="No"
|
||||
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?"
|
||||
|
||||
; Macro Tab
|
||||
# Macro Tab
|
||||
AdvSceneSwitcher.macroTab.title="Macro"
|
||||
AdvSceneSwitcher.macroTab.macros="Macros"
|
||||
AdvSceneSwitcher.macroTab.priorityWarning="Note: It is recommended to configure macros to be the highest priority functionality.\nThis setting can be changed on the General tab."
|
||||
@@ -175,10 +177,14 @@ AdvSceneSwitcher.macroTab.collapseAll="Collapse all"
|
||||
AdvSceneSwitcher.macroTab.maximize="Maximize"
|
||||
AdvSceneSwitcher.macroTab.minimize="Minimize"
|
||||
AdvSceneSwitcher.macroTab.segment.useCustomLabel="Use custom label"
|
||||
AdvSceneSwitcher.macroTab.segment.customLabelRename="Rename custom label"
|
||||
AdvSceneSwitcher.macroTab.segment.defaultCustomLabel="My label"
|
||||
AdvSceneSwitcher.macroTab.segment.setCustomLabel="Set label ..."
|
||||
AdvSceneSwitcher.macroTab.segment.remove="Remove"
|
||||
AdvSceneSwitcher.macroTab.segment.copy="Copy"
|
||||
AdvSceneSwitcher.macroTab.segment.paste="Paste"
|
||||
AdvSceneSwitcher.macroTab.segment.pasteAction="Paste as action"
|
||||
AdvSceneSwitcher.macroTab.segment.pasteElseAction="Paste as else-action"
|
||||
AdvSceneSwitcher.macroTab.highlightSettings="Visual settings"
|
||||
AdvSceneSwitcher.macroTab.hotkeySettings="Hotkey settings"
|
||||
AdvSceneSwitcher.macroTab.generalSettings="General settings"
|
||||
@@ -191,9 +197,20 @@ AdvSceneSwitcher.macroTab.highlightExecutedMacros="Highlight recently executed m
|
||||
AdvSceneSwitcher.macroTab.highlightTrueConditions="Highlight conditions of currently selected macro that evaluated to true recently"
|
||||
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.currentDisableHotkeys="Register hotkeys to control the pause state of selected macro"
|
||||
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.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.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.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.currentUseCustomConditionCheckInterval="Check conditions of the currently selected macro at custom interval:"
|
||||
AdvSceneSwitcher.macroTab.currentUseCustomConditionCheckIntervalWarning="⚠️ The selected value is lower than the interval configured on the General tab.\nThe configured value not have any effect!"
|
||||
AdvSceneSwitcher.macroTab.currentSkipExecutionOnStartup="Skip execution of actions of current macro on startup"
|
||||
AdvSceneSwitcher.macroTab.currentStopActionsIfNotDone="Stop and rerun actions of the currently selected macro, if the actions are still running, when a new execution is triggered"
|
||||
AdvSceneSwitcher.macroTab.pauseStateSaveBehavior="On startup set the pause state of the current macro to:"
|
||||
AdvSceneSwitcher.macroTab.pauseStateSaveBehavior.persist="The state the macro was last in"
|
||||
AdvSceneSwitcher.macroTab.pauseStateSaveBehavior.pause="Paused"
|
||||
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.currentDockAddRunButton="Add button to run the macro"
|
||||
AdvSceneSwitcher.macroTab.currentDockAddPauseButton="Add button to pause or unpause the macro"
|
||||
@@ -238,11 +255,11 @@ AdvSceneSwitcher.macroDock.run="Run"
|
||||
AdvSceneSwitcher.macroDock.statusLabel.true="Conditions are true."
|
||||
AdvSceneSwitcher.macroDock.statusLabel.false="Conditions are false."
|
||||
|
||||
; Macro List
|
||||
# Macro List
|
||||
AdvSceneSwitcher.macroList.deleted="deleted"
|
||||
AdvSceneSwitcher.macroList.duplicate="\"%1\" is alreay selected!"
|
||||
|
||||
; Macro Logic
|
||||
# Macro Logic
|
||||
AdvSceneSwitcher.logic.none="Ignore entry"
|
||||
AdvSceneSwitcher.logic.and="And"
|
||||
AdvSceneSwitcher.logic.or="Or"
|
||||
@@ -251,7 +268,8 @@ AdvSceneSwitcher.logic.orNot="Or not"
|
||||
AdvSceneSwitcher.logic.rootNone="If"
|
||||
AdvSceneSwitcher.logic.not="If not"
|
||||
|
||||
; Macro Conditions
|
||||
# Macro Conditions
|
||||
AdvSceneSwitcher.condition.unknown="Unknown condition"
|
||||
AdvSceneSwitcher.condition.audio="Audio"
|
||||
AdvSceneSwitcher.condition.audio.state.below="below"
|
||||
AdvSceneSwitcher.condition.audio.state.exact="exactly"
|
||||
@@ -286,7 +304,7 @@ AdvSceneSwitcher.condition.scene.type.previousPattern="Previous scene matches"
|
||||
AdvSceneSwitcher.condition.scene.type.previewPattern="Preview scene matches"
|
||||
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.entry.line1="{{sceneType}}{{scenes}}{{pattern}}"
|
||||
AdvSceneSwitcher.condition.scene.entry.line1="{{sceneType}}{{scenes}}{{pattern}}{{regex}}"
|
||||
AdvSceneSwitcher.condition.scene.entry.line2="{{useTransitionTargetScene}}"
|
||||
AdvSceneSwitcher.condition.window="Window"
|
||||
AdvSceneSwitcher.condition.window.entry.window="{{checkTitle}}Window title matches{{windowRegex}}{{windows}}"
|
||||
@@ -307,11 +325,14 @@ AdvSceneSwitcher.condition.file.entry.line1="{{fileType}}{{filePath}}{{condition
|
||||
AdvSceneSwitcher.condition.file.entry.line2="{{matchText}}"
|
||||
AdvSceneSwitcher.condition.file.entry.line3="{{checkModificationDate}}{{checkFileContent}}"
|
||||
AdvSceneSwitcher.condition.media="Media"
|
||||
AdvSceneSwitcher.condition.media.checkType.state="State matches"
|
||||
AdvSceneSwitcher.condition.media.checkType.time="Time restriction matches"
|
||||
AdvSceneSwitcher.condition.media.source="Source"
|
||||
AdvSceneSwitcher.condition.media.anyOnScene="Any media source on"
|
||||
AdvSceneSwitcher.condition.media.allOnScene="All media sources on"
|
||||
AdvSceneSwitcher.condition.media.inconsistencyInfo="Unfortunately not all media source types behave the same (e.g. Media Source vs. VLC Video Source \"Stopped\" state).\nSo please experiment what works for your setup!"
|
||||
AdvSceneSwitcher.condition.media.entry="{{sourceTypes}}{{mediaSources}}{{scenes}}state is{{states}}and{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.media.layout="{{sourceTypes}}{{mediaSources}}{{scenes}}{{checkTypes}}{{states}}{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.media.layout.legacy="{{sourceTypes}}{{mediaSources}}{{scenes}}{{checkTypes}}state is{{states}}and{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.video="Video"
|
||||
AdvSceneSwitcher.condition.video.condition.match="exactly matches"
|
||||
AdvSceneSwitcher.condition.video.condition.differ="does not match"
|
||||
@@ -390,6 +411,7 @@ AdvSceneSwitcher.condition.video.selectArea="Select area"
|
||||
AdvSceneSwitcher.condition.video.selectArea.status="Only highlighted area will be checked"
|
||||
AdvSceneSwitcher.condition.video.width="Width"
|
||||
AdvSceneSwitcher.condition.video.height="Height"
|
||||
AdvSceneSwitcher.condition.video.screenshot.selectArea="Highlight the area of the screenshot you want to keep:"
|
||||
AdvSceneSwitcher.condition.stream="Streaming"
|
||||
AdvSceneSwitcher.condition.stream.state.start="Stream running"
|
||||
AdvSceneSwitcher.condition.stream.state.stop="Stream stopped"
|
||||
@@ -463,7 +485,7 @@ AdvSceneSwitcher.condition.source.sizeCompare.less="Smaller than"
|
||||
AdvSceneSwitcher.condition.source.sizeCompare.equal="Equals"
|
||||
AdvSceneSwitcher.condition.source.sizeCompare.more="Bigger than"
|
||||
AdvSceneSwitcher.condition.source.refresh="Refresh"
|
||||
AdvSceneSwitcher.condition.source.refreshTooltip="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.sceneVisibilityHint="Scene specific visibility can be checked using the \"Scene item visibility\" condition"
|
||||
AdvSceneSwitcher.condition.source.getSettings="Get current settings"
|
||||
AdvSceneSwitcher.condition.source.entry.line1="{{sources}}{{conditions}}{{settingSelection}}{{refresh}}{{sizeCompareMethods}}{{size}}"
|
||||
@@ -481,7 +503,7 @@ AdvSceneSwitcher.condition.filter.type.settingsChanged="Settings changed"
|
||||
AdvSceneSwitcher.condition.filter.type.individualSettingMatches="Settings value matches"
|
||||
AdvSceneSwitcher.condition.filter.type.individualSettingChanged="Settings value changed"
|
||||
AdvSceneSwitcher.condition.filter.refresh="Refresh"
|
||||
AdvSceneSwitcher.condition.filter.refreshTooltip="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.getSettings="Get current settings"
|
||||
AdvSceneSwitcher.condition.filter.entry.line1="On{{sources}}{{filters}}{{conditions}}{{settingSelection}}{{refresh}}"
|
||||
AdvSceneSwitcher.condition.filter.entry.line2="{{settings}}"
|
||||
@@ -531,16 +553,23 @@ AdvSceneSwitcher.condition.date.entry.nextMatchDate="Next match at: %1"
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}}On repeat update selected date to repeat date"
|
||||
AdvSceneSwitcher.condition.sceneTransform="Scene item transform"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="Get transform"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line1="On{{scenes}}{{sources}}{{types}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.type.matches="matches transform"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.type.changed="has changed"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line2="{{settings}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line3="{{regex}}{{getSettings}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getCurrentValue="Get current value"
|
||||
AdvSceneSwitcher.condition.sceneTransform.settingsType.all="All"
|
||||
AdvSceneSwitcher.condition.sceneTransform.settingsType.single="Single"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.match="matches"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.changed="has changed"
|
||||
AdvSceneSwitcher.condition.sceneTransform.compare.less="less"
|
||||
AdvSceneSwitcher.condition.sceneTransform.compare.equal="equal"
|
||||
AdvSceneSwitcher.condition.sceneTransform.compare.more="larger than"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry="On{{scenes}}{{settingsType}}transform setting of{{sources}}{{conditions}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.singleSettingCompare="{{setting}}{{compare}}{{singleSettingValue}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.options="{{regex}}{{getSettings}}{{getCurrentValue}}"
|
||||
AdvSceneSwitcher.condition.transition="Transition"
|
||||
AdvSceneSwitcher.condition.transition.type.current="Current transition type is"
|
||||
AdvSceneSwitcher.condition.transition.type.duration="Current transition duration is"
|
||||
AdvSceneSwitcher.condition.transition.type.started="Transition started"
|
||||
AdvSceneSwitcher.condition.transition.type.ended="Transition ended"
|
||||
AdvSceneSwitcher.condition.transition.type.videoEnded="Transition video ended"
|
||||
AdvSceneSwitcher.condition.transition.type.transitionSource="Transitioning from"
|
||||
AdvSceneSwitcher.condition.transition.type.transitionTarget="Transitioning to"
|
||||
AdvSceneSwitcher.condition.transition.durationSuffix="seconds"
|
||||
@@ -619,8 +648,8 @@ AdvSceneSwitcher.condition.slideshow="Slide Show"
|
||||
AdvSceneSwitcher.condition.slideshow.condition.slideChanged="Slide changed"
|
||||
AdvSceneSwitcher.condition.slideshow.condition.slideIndex="Current slide number is"
|
||||
AdvSceneSwitcher.condition.slideshow.condition.slidePath="Current slide path is"
|
||||
AdvSceneSwitcher.condition.slideshow.updateIntervalTooltip="Information about the slide show status will only be updated based on the configured time between slides"
|
||||
AdvSceneSwitcher.condition.slideshow.entry="{{sources}}{{conditions}}{{index}}{{path}}"
|
||||
AdvSceneSwitcher.condition.slideshow.updateInterval.tooltip="Information about the slide show status will only be updated based on the configured time between slides"
|
||||
AdvSceneSwitcher.condition.slideshow.entry="{{sources}}{{conditions}}{{index}}{{path}}{{regex}}"
|
||||
AdvSceneSwitcher.condition.twitch="Twitch"
|
||||
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.online="Stream went online"
|
||||
AdvSceneSwitcher.condition.twitch.type.event.channel.stream.offline="Stream went offline"
|
||||
@@ -672,6 +701,20 @@ 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.category="Current category is"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.message="Chat message received"
|
||||
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.firstMessage="Is first message"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.emoteOnly="Is only using emotes"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.mod="Is moderator"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.subscriber="Is subscriber"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.turbo="Is Turbo user"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.vip="Is VIP"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.color="Color matches"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.displayName="Display name matches"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.loginName="User name matches"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.properties.badge="User has badge"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.userJoined="User joined the chat"
|
||||
AdvSceneSwitcher.condition.twitch.type.chat.userLeft="User left the chat"
|
||||
AdvSceneSwitcher.condition.twitch.categorySelectionDisabled="Cannot select category without selecting a Twitch account first!"
|
||||
AdvSceneSwitcher.condition.twitch.entry="Channel{{channel}}{{conditions}}{{pointsReward}}{{streamTitle}}{{regex}}{{category}}"
|
||||
AdvSceneSwitcher.condition.twitch.entry.account="Check using account{{account}}"
|
||||
@@ -685,7 +728,7 @@ AdvSceneSwitcher.condition.queue.entry.startStop="Queue{{queues}}is{{conditions}
|
||||
AdvSceneSwitcher.condition.queue.entry.size="Queue{{queues}}{{conditions}}is less than{{size}}"
|
||||
AdvSceneSwitcher.condition.clipboard="Clipboard"
|
||||
AdvSceneSwitcher.condition.clipboard.placeholder="Clipboard text"
|
||||
AdvSceneSwitcher.condition.clipboard.urlTooltip="Depending on the OS files might be represented as URLs also!"
|
||||
AdvSceneSwitcher.condition.clipboard.url.tooltip="Depending on the OS files might be represented as URLs also!"
|
||||
AdvSceneSwitcher.condition.clipboard.condition.changed="Clipboard content changed"
|
||||
AdvSceneSwitcher.condition.clipboard.condition.isText="Clipboard contains text"
|
||||
AdvSceneSwitcher.condition.clipboard.condition.isImage="Clipboard contains an image"
|
||||
@@ -703,8 +746,28 @@ AdvSceneSwitcher.condition.folder.condition.folderRemove="A directory was remove
|
||||
AdvSceneSwitcher.condition.folder.entry="{{conditions}}in{{folder}}{{tooltip}}"
|
||||
AdvSceneSwitcher.condition.folder.enableFilter="Only evaluate to true, if the changed path matches a patern"
|
||||
AdvSceneSwitcher.condition.folder.entry.filter="{{filter}}{{regex}}"
|
||||
AdvSceneSwitcher.condition.usb="USB"
|
||||
AdvSceneSwitcher.condition.usb.description="A USB device matching the following properties is connected:"
|
||||
AdvSceneSwitcher.condition.usb.vendorID="Vendor ID:"
|
||||
AdvSceneSwitcher.condition.usb.productID="Product ID:"
|
||||
AdvSceneSwitcher.condition.usb.busNumber="Bus Number:"
|
||||
AdvSceneSwitcher.condition.usb.deviceAddress="Device Address:"
|
||||
AdvSceneSwitcher.condition.usb.vendorName="Vendor Name:"
|
||||
AdvSceneSwitcher.condition.usb.productName="Product Name:"
|
||||
AdvSceneSwitcher.condition.usb.serialNumber="Serial Number:"
|
||||
AdvSceneSwitcher.condition.noDevicesFoundWarning="No USB devices detected!\nThe plugin might not have the required permissions to check for USB devices."
|
||||
AdvSceneSwitcher.condition.streamDeck="Stream Deck"
|
||||
AdvSceneSwitcher.condition.streamDeck.checkKeyState="Check key state"
|
||||
AdvSceneSwitcher.condition.streamDeck.keyState.pressed="Pressed"
|
||||
AdvSceneSwitcher.condition.streamDeck.keyState.released="Released"
|
||||
AdvSceneSwitcher.condition.streamDeck.checkKeyPosition="Check key position"
|
||||
AdvSceneSwitcher.condition.streamDeck.checkData="Check data field"
|
||||
AdvSceneSwitcher.condition.streamDeck.startListen="Start listening"
|
||||
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>"
|
||||
|
||||
; Macro Actions
|
||||
# Macro Actions
|
||||
AdvSceneSwitcher.action.unknown="Unknown action"
|
||||
AdvSceneSwitcher.action.scene="Switch scene"
|
||||
AdvSceneSwitcher.action.scene.type.program="Program"
|
||||
AdvSceneSwitcher.action.scene.type.preview="Preview"
|
||||
@@ -748,10 +811,12 @@ AdvSceneSwitcher.action.recording.split.hint="Make sure to enable automatic file
|
||||
AdvSceneSwitcher.action.recording.entry="{{actions}}{{recordFolder}}{{recordFileFormat}}{{pauseHint}}{{splitHint}}"
|
||||
AdvSceneSwitcher.action.replay="Replay buffer"
|
||||
AdvSceneSwitcher.action.replay.saveWarn="Warning: Saving too frequently might result in the replay buffer not actually being saved!"
|
||||
AdvSceneSwitcher.action.replay.durationWarn="Warning: Changing the maximum replay time will only apply the next time the replay buffer is started!"
|
||||
AdvSceneSwitcher.action.replay.type.stop="Stop replay buffer"
|
||||
AdvSceneSwitcher.action.replay.type.start="Start replay buffer"
|
||||
AdvSceneSwitcher.action.replay.type.save="Save replay buffer"
|
||||
AdvSceneSwitcher.action.replay.entry="{{actions}}"
|
||||
AdvSceneSwitcher.action.replay.type.duration="Set maximum replay time"
|
||||
AdvSceneSwitcher.action.replay.entry="{{actions}}{{duration}}"
|
||||
AdvSceneSwitcher.action.streaming="Streaming"
|
||||
AdvSceneSwitcher.action.streaming.type.stop="Stop streaming"
|
||||
AdvSceneSwitcher.action.streaming.type.start="Start streaming"
|
||||
@@ -778,7 +843,7 @@ AdvSceneSwitcher.action.filter.type.toggle="Toggle"
|
||||
AdvSceneSwitcher.action.filter.type.settings="Set settings"
|
||||
AdvSceneSwitcher.action.filter.type.pressSettingsButton="Press settings button"
|
||||
AdvSceneSwitcher.action.filter.refresh="Refresh"
|
||||
AdvSceneSwitcher.action.filter.refreshTooltip="Repopulate the filter settings selection with the settings of the filter which's name matches the variable value."
|
||||
AdvSceneSwitcher.action.filter.refresh.tooltip="Repopulate the filter settings selection with the settings of the filter which's name matches the variable value."
|
||||
AdvSceneSwitcher.action.filter.entry="On{{sources}}{{actions}}{{filters}}{{refresh}}{{settingsButtons}}"
|
||||
AdvSceneSwitcher.action.filter.entry.settings="{{settings}}{{settingsInputMethod}}{{settingValue}}{{tempVar}}"
|
||||
AdvSceneSwitcher.action.filter.getSettings="Get current settings"
|
||||
@@ -816,7 +881,7 @@ AdvSceneSwitcher.action.source.inputMethod.individualManual="Set to fixed value"
|
||||
AdvSceneSwitcher.action.source.inputMethod.individualTempvar="Set to macro property"
|
||||
AdvSceneSwitcher.action.source.inputMethod.json="Set setting JSON string"
|
||||
AdvSceneSwitcher.action.source.refresh="Refresh"
|
||||
AdvSceneSwitcher.action.source.refreshTooltip="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.media="Media"
|
||||
AdvSceneSwitcher.action.media.type.play="Play"
|
||||
AdvSceneSwitcher.action.media.type.pause="Pause"
|
||||
@@ -826,6 +891,7 @@ AdvSceneSwitcher.action.media.type.next="Next"
|
||||
AdvSceneSwitcher.action.media.type.previous="Previous"
|
||||
AdvSceneSwitcher.action.media.type.seek.duration="Seek to duration"
|
||||
AdvSceneSwitcher.action.media.type.seek.percentage="Seek to percentage"
|
||||
AdvSceneSwitcher.action.media.type.waitForPlaybackStop="Wait for playback to stop"
|
||||
AdvSceneSwitcher.action.media.selectionType.source="Source"
|
||||
AdvSceneSwitcher.action.media.selectionType.sceneItem="Scene item"
|
||||
AdvSceneSwitcher.action.media.entry="{{actions}}{{seekDuration}}{{seekPercentage}}{{selectionTypes}}{{mediaSources}}{{scenes}}{{sceneItems}}"
|
||||
@@ -892,7 +958,8 @@ AdvSceneSwitcher.action.sceneOrder.type.moveBottom="Move to bottom"
|
||||
AdvSceneSwitcher.action.sceneOrder.type.movePosition="Move to position"
|
||||
AdvSceneSwitcher.action.sceneOrder.entry="On{{scenes}}{{actions}}{{sources}}{{position}}"
|
||||
AdvSceneSwitcher.action.sceneTransform="Scene item transform"
|
||||
AdvSceneSwitcher.action.sceneTransform.type.manual="Transform"
|
||||
AdvSceneSwitcher.action.sceneTransform.type.manual="Set transform string"
|
||||
AdvSceneSwitcher.action.sceneTransform.type.setSingleSetting="Set transform setting"
|
||||
AdvSceneSwitcher.action.sceneTransform.type.reset="Reset transform"
|
||||
AdvSceneSwitcher.action.sceneTransform.type.rotate="Rotate by"
|
||||
AdvSceneSwitcher.action.sceneTransform.type.flipHorizontal="Flip horizontally"
|
||||
@@ -903,7 +970,8 @@ AdvSceneSwitcher.action.sceneTransform.type.centerToScreen="Center to screen"
|
||||
AdvSceneSwitcher.action.sceneTransform.type.centerVertically="Center vertically"
|
||||
AdvSceneSwitcher.action.sceneTransform.type.centerHorizontally="Center horizontally"
|
||||
AdvSceneSwitcher.action.sceneTransform.getTransform="Get transform"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="On{{scenes}}{{action}}{{rotation}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneTransform.getCurrentValue="Get current value"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="On{{scenes}}{{action}}{{rotation}}{{sources}}{{settingSelection}}{{singleSettingValue}}"
|
||||
AdvSceneSwitcher.action.file="File"
|
||||
AdvSceneSwitcher.action.file.type.write="Write"
|
||||
AdvSceneSwitcher.action.file.type.append="Append"
|
||||
@@ -938,13 +1006,14 @@ AdvSceneSwitcher.action.systray.icon="Icon:"
|
||||
AdvSceneSwitcher.action.systray.iconHint="Leave blank to use the default icon"
|
||||
AdvSceneSwitcher.action.systray.disabled="System tray notifications seem to be disabled in the OBS settings!"
|
||||
AdvSceneSwitcher.action.screenshot="Screenshot"
|
||||
AdvSceneSwitcher.action.screenshot.save.default="Default"
|
||||
AdvSceneSwitcher.action.screenshot.save.custom="Custom"
|
||||
AdvSceneSwitcher.action.screenshot.save.default="Default OBS path"
|
||||
AdvSceneSwitcher.action.screenshot.save.custom="Custom file path"
|
||||
AdvSceneSwitcher.action.screenshot.save.variable="Variable (base64 encoded PNG)"
|
||||
AdvSceneSwitcher.action.screenshot.type.source="Source"
|
||||
AdvSceneSwitcher.action.screenshot.type.scene="Scene"
|
||||
AdvSceneSwitcher.action.screenshot.mainOutput="OBS's main output"
|
||||
AdvSceneSwitcher.action.screenshot.blackscreenNote="Sources or scenes, which are not always rendered, may result in some parts of screenshots to remain blank."
|
||||
AdvSceneSwitcher.action.screenshot.entry="Screenshot{{targetType}}{{sources}}{{scenes}}and save to{{saveType}}location"
|
||||
AdvSceneSwitcher.action.screenshot.entry="Screenshot{{targetType}}{{sources}}{{scenes}}and save to{{saveType}}{{variables}}"
|
||||
AdvSceneSwitcher.action.profile="Profile"
|
||||
AdvSceneSwitcher.action.profile.entry="Switch active profile to{{profiles}}"
|
||||
AdvSceneSwitcher.action.sceneCollection="Scene collection"
|
||||
@@ -1001,6 +1070,12 @@ AdvSceneSwitcher.action.variable.type.sceneItemName="Set to scene item name at i
|
||||
AdvSceneSwitcher.action.variable.type.padValue="Pad current value"
|
||||
AdvSceneSwitcher.action.variable.type.truncateValue="Truncate current value"
|
||||
AdvSceneSwitcher.action.variable.type.swapValues="Swap variable values"
|
||||
AdvSceneSwitcher.action.variable.type.trim="Trim whitespace"
|
||||
AdvSceneSwitcher.action.variable.type.changeCase="Change case"
|
||||
AdvSceneSwitcher.action.variable.case.type.lowerCase="lowercase"
|
||||
AdvSceneSwitcher.action.variable.case.type.upperCase="UPPERCASE"
|
||||
AdvSceneSwitcher.action.variable.case.type.capitalized="Capitalized"
|
||||
AdvSceneSwitcher.action.variable.case.type.startCase="Start Case"
|
||||
AdvSceneSwitcher.action.variable.truncateOrPadDirection.left="Left"
|
||||
AdvSceneSwitcher.action.variable.truncateOrPadDirection.right="Right"
|
||||
AdvSceneSwitcher.action.variable.askForValuePromptDefault="Assign value to variable \"%1\":"
|
||||
@@ -1008,13 +1083,14 @@ AdvSceneSwitcher.action.variable.askForValuePrompt="Assign value to variable:"
|
||||
AdvSceneSwitcher.action.variable.mathExpression.example="( 1 + 2 * 3 ) / 4"
|
||||
AdvSceneSwitcher.action.variable.findAndReplace.find="Text to find"
|
||||
AdvSceneSwitcher.action.variable.findAndReplace.replace="Text to replace with"
|
||||
AdvSceneSwitcher.action.variable.findAndReplace.replace.tooltip="Using \1, \2, etc. to represent first, second, etc. capture groups is supported."
|
||||
AdvSceneSwitcher.action.variable.subString.begin="Beginning"
|
||||
AdvSceneSwitcher.action.variable.subString.all="All"
|
||||
AdvSceneSwitcher.action.variable.invalidSelection="Invalid selection!"
|
||||
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.currentSegmentValue="Current value:"
|
||||
AdvSceneSwitcher.action.variable.entry.other="{{actions}}{{variables}}{{variables2}}{{strValue}}{{numValue}}{{segmentIndex}}{{mathExpression}}{{envVariableName}}{{scenes}}{{tempVars}}{{tempVarsHelp}}{{sceneItemIndex}}{{direction}}{{stringLength}}{{paddingCharSelection}}"
|
||||
AdvSceneSwitcher.action.variable.entry.other="{{actions}}{{variables}}{{variables2}}{{strValue}}{{numValue}}{{segmentIndex}}{{mathExpression}}{{envVariableName}}{{scenes}}{{tempVars}}{{tempVarsHelp}}{{sceneItemIndex}}{{direction}}{{stringLength}}{{paddingCharSelection}}{{caseType}}"
|
||||
AdvSceneSwitcher.action.variable.entry.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.entry.substringIndex="Substring start:{{subStringStart}}Substring size:{{subStringSize}}"
|
||||
@@ -1090,7 +1166,7 @@ AdvSceneSwitcher.action.log="Log"
|
||||
AdvSceneSwitcher.action.log.placeholder="My log message!"
|
||||
AdvSceneSwitcher.action.log.entry="Write to OBS log:{{logMessage}}"
|
||||
|
||||
; Hotkey
|
||||
# Hotkey
|
||||
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Start the Advanced Scene Switcher"
|
||||
AdvSceneSwitcher.hotkey.stopSwitcherHotkey="Stop the Advanced Scene Switcher"
|
||||
AdvSceneSwitcher.hotkey.startStopToggleSwitcherHotkey="Toggle Start/Stop for the Advanced Scene Switcher"
|
||||
@@ -1117,6 +1193,11 @@ AdvSceneSwitcher.item.emptyName="Empty name not allowed!"
|
||||
AdvSceneSwitcher.item.nameNotAvailable="Name not available!"
|
||||
AdvSceneSwitcher.item.nameReserved="Name reserved!"
|
||||
|
||||
AdvSceneSwitcher.listControls.add="Add"
|
||||
AdvSceneSwitcher.listControls.remove="Remove"
|
||||
AdvSceneSwitcher.listControls.up="Up"
|
||||
AdvSceneSwitcher.listControls.down="Down"
|
||||
|
||||
AdvSceneSwitcher.macroSegmentSelection.invalid="Invalid selection!"
|
||||
|
||||
AdvSceneSwitcher.validation.text.maxLength="Only %1 characters are allowed in this field!"
|
||||
@@ -1320,14 +1401,14 @@ AdvSceneSwitcher.twitch.selection.points.reward.tooltip.error="Can't select poin
|
||||
AdvSceneSwitcher.tempVar.select="--select value--"
|
||||
AdvSceneSwitcher.tempVar.selectionInfo.lastValues="Last values:"
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_id="Twitch broadcaster user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_id="Twitch broadcaster user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_id.description="The numerical Twitch user ID of the broadcaster."
|
||||
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_login="Twitch broadcaster user login"
|
||||
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_login.description="The Twitch user login of the broadcaster"
|
||||
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_name="Twitch broadcaster user name"
|
||||
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_name.description="The Twitch user name of the broadcaster"
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.follow="Follower Twitch user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.follow="Follower Twitch user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.follow.description="The user ID for the user now following the specified channel."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.follow="Follower Twitch user login"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.follow.description="The user login for the user now following the specified channel."
|
||||
@@ -1336,7 +1417,7 @@ AdvSceneSwitcher.tempVar.twitch.user_name.follow.description="The user display n
|
||||
AdvSceneSwitcher.tempVar.twitch.followed_at="Twitch follow timestamp"
|
||||
AdvSceneSwitcher.tempVar.twitch.followed_at.description="The timestamp of when the Twitch follow event occurred"
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.id.stream.online="Twitch stream id"
|
||||
AdvSceneSwitcher.tempVar.twitch.id.stream.online="Twitch stream ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.type.stream.online="Twitch stream type"
|
||||
AdvSceneSwitcher.tempVar.twitch.type.stream.online.description="The stream type. Valid values are: live, playlist, watch_party, premiere, rerun."
|
||||
AdvSceneSwitcher.tempVar.twitch.started_at.stream.online="Twitch stream start timestamp"
|
||||
@@ -1345,12 +1426,12 @@ AdvSceneSwitcher.tempVar.twitch.started_at.stream.online.description="The timest
|
||||
AdvSceneSwitcher.tempVar.twitch.title="Twitch stream title"
|
||||
AdvSceneSwitcher.tempVar.twitch.language="Twitch stream language code"
|
||||
AdvSceneSwitcher.tempVar.twitch.language.description="The broadcaster’s preferred language. The value is an ISO 639-1 two-letter language code (for example, en for English). The value is set to “other” if the language is not a Twitch supported language."
|
||||
AdvSceneSwitcher.tempVar.twitch.category_id="Twitch stream category id"
|
||||
AdvSceneSwitcher.tempVar.twitch.category_id.description="Numerical id identifying each Twitch streaming category"
|
||||
AdvSceneSwitcher.tempVar.twitch.category_id="Twitch stream category ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.category_id.description="Numerical ID identifying each Twitch streaming category"
|
||||
AdvSceneSwitcher.tempVar.twitch.category_name="Twitch stream category name"
|
||||
AdvSceneSwitcher.tempVar.twitch.content_classification_labels="Twitch stream classification labels"
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe="Subscriber Twitch user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe="Subscriber Twitch user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.description="The user ID for the user now subscribed to the specified channel."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe="Subscriber Twitch user login"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.description="The user login for the user now subscribed to the specified channel."
|
||||
@@ -1361,7 +1442,7 @@ AdvSceneSwitcher.tempVar.twitch.tier.subscribe.description="The tier of the subs
|
||||
AdvSceneSwitcher.tempVar.twitch.is_gift.subscribe="Is gifted Twitch subscription"
|
||||
AdvSceneSwitcher.tempVar.twitch.is_gift.subscribe.description="Valid values are true and false."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.end="Subscriber Twitch user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.end="Subscriber Twitch user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.end.description="The user ID for the user no longer subscribed to the specified channel."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.end="Subscriber Twitch user login"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.end.description="The user login for the user no longer subscribed to the specified channel."
|
||||
@@ -1370,7 +1451,7 @@ AdvSceneSwitcher.tempVar.twitch.user_name.subscribe.end.description="The user di
|
||||
AdvSceneSwitcher.tempVar.twitch.is_gift.subscribe="Was gifted Twitch subscription"
|
||||
AdvSceneSwitcher.tempVar.twitch.is_gift.subscribe.description="Valid values are true and false."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.gift="Subscriber Twitch user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.gift="Subscriber Twitch user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.gift.description="The user ID of the user who sent the subscription gift. Set to null if it was an anonymous subscription gift."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.gift="Subscriber Twitch user login"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.gift.description="The user login of the user who sent the gift. Set to null if it was an anonymous subscription gift."
|
||||
@@ -1383,7 +1464,7 @@ AdvSceneSwitcher.tempVar.twitch.cumulative_total.subscribe.description="The numb
|
||||
AdvSceneSwitcher.tempVar.twitch.is_anonymous.subscribe="Was anonymous Twitch subscription gift"
|
||||
AdvSceneSwitcher.tempVar.twitch.is_anonymous.subscribe.description="Valid values are true and false."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.message="Subscriber Twitch user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.message="Subscriber Twitch user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.message.description="The user ID of the user who sent a resubscription chat message."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.message="Subscriber Twitch user login"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.message.description="The user login of the user who sent a resubscription chat message."
|
||||
@@ -1398,7 +1479,7 @@ AdvSceneSwitcher.tempVar.twitch.streak_months.subscribe.description="The number
|
||||
AdvSceneSwitcher.tempVar.twitch.duration_months.subscribe="Subscription duration"
|
||||
AdvSceneSwitcher.tempVar.twitch.duration_months.subscribe.description="The month duration of the subscription."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.cheer="Cheerer Twitch user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.cheer="Cheerer Twitch user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.cheer.description="The user ID for the user who cheered on the specified channel. This is null if is_anonymous is true."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.cheer="Cheerer Twitch user login"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.cheer.description="The user login for the user who cheered on the specified channel. This is null if is_anonymous is true."
|
||||
@@ -1440,24 +1521,13 @@ AdvSceneSwitcher.tempVar.twitch.status.prediction.description="The status of the
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.id.goal="Goal ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.type.goal="Goal type"
|
||||
AdvSceneSwitcher.tempVar.twitch.type.goal.description="The type of goal. Possible values are:\n
|
||||
follow — The goal is to increase followers.\n
|
||||
subscription — The goal is to increase subscriptions. This type shows the net increase or decrease in tier points associated with the subscriptions.\n
|
||||
subscription_count — The goal is to increase subscriptions. This type shows the net increase or decrease in the number of subscriptions.\n
|
||||
new_subscription — The goal is to increase subscriptions. This type shows only the net increase in tier points associated with the subscriptions (it does not account for users that unsubscribed since the goal started).\n
|
||||
new_subscription_count — The goal is to increase subscriptions. This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started)."
|
||||
AdvSceneSwitcher.tempVar.twitch.type.goal.description="The type of goal. Possible values are:\n follow — The goal is to increase followers.\n subscription — The goal is to increase subscriptions. This type shows the net increase or decrease in tier points associated with the subscriptions.\n subscription_count — The goal is to increase subscriptions. This type shows the net increase or decrease in the number of subscriptions.\n new_subscription — The goal is to increase subscriptions. This type shows only the net increase in tier points associated with the subscriptions (it does not account for users that unsubscribed since the goal started).\n new_subscription_count — The goal is to increase subscriptions. This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started)."
|
||||
AdvSceneSwitcher.tempVar.twitch.description.goal="Goal description"
|
||||
AdvSceneSwitcher.tempVar.twitch.description.goal.description="A description of the goal, if specified. The description may contain a maximum of 40 characters."
|
||||
AdvSceneSwitcher.tempVar.twitch.is_achieved.goal="Goal is achieved"
|
||||
AdvSceneSwitcher.tempVar.twitch.is_achieved.goal.description="A Boolean value that indicates whether the broadcaster achieved their goal. Is true if the goal was achieved; otherwise, false."
|
||||
AdvSceneSwitcher.tempVar.twitch.current_amount.goal="Goal current amount"
|
||||
AdvSceneSwitcher.tempVar.twitch.current_amount.goal.description="The goal's current value.\n
|
||||
The goal's type determines how this value is increased or decreased.\n
|
||||
If type is follow, this field is set to the broadcaster's current number of followers. This number increases with new followers and decreases when users unfollow the broadcaster.\n
|
||||
If type is subscription, this field is increased and decreased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1.\n
|
||||
If type is subscription_count, this field is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes.\n
|
||||
If type is new_subscription, this field is increased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1.\n
|
||||
If type is new_subscription_count, this field is increased by 1 for each new subscription."
|
||||
AdvSceneSwitcher.tempVar.twitch.current_amount.goal.description="The goal's current value.\nThe goal's type determines how this value is increased or decreased.\n If type is follow, this field is set to the broadcaster's current number of followers. This number increases with new followers and decreases when users unfollow the broadcaster.\n If type is subscription, this field is increased and decreased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1.\n If type is subscription_count, this field is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes.\n If type is new_subscription, this field is increased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1.\n If type is new_subscription_count, this field is increased by 1 for each new subscription."
|
||||
AdvSceneSwitcher.tempVar.twitch.target_amount.goal="Goal target amount"
|
||||
AdvSceneSwitcher.tempVar.twitch.target_amount.goal.description="The goal's target value. For example, if the broadcaster has 200 followers before creating the goal, and their goal is to double that number, this field is set to 400."
|
||||
AdvSceneSwitcher.tempVar.twitch.started_at.goal="Goal start time"
|
||||
@@ -1513,8 +1583,8 @@ AdvSceneSwitcher.tempVar.twitch.viewer_count.shoutoutReceived.description="The n
|
||||
AdvSceneSwitcher.tempVar.twitch.started_at.shoutoutReceived="Shoutout time"
|
||||
AdvSceneSwitcher.tempVar.twitch.started_at.shoutoutReceived.description="The UTC timestamp (in RFC3339 format) of when the moderator sent the Shoutout."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.id.reward="Reward id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.reward="User id redeeming the reward"
|
||||
AdvSceneSwitcher.tempVar.twitch.id.reward="Reward ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.reward="User ID redeeming the reward"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.reward="User login redeeming the reward"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.reward="User name redeeming the reward"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_input.reward="User input for reward"
|
||||
@@ -1555,9 +1625,9 @@ AdvSceneSwitcher.tempVar.twitch.charity_name="Charity name"
|
||||
AdvSceneSwitcher.tempVar.twitch.charity_description="Charity description"
|
||||
AdvSceneSwitcher.tempVar.twitch.charity_logo="Charity logo"
|
||||
AdvSceneSwitcher.tempVar.twitch.charity_logo.description="A URL to an image of the charity’s logo. The image’s type is PNG and its size is 100px X 100px."
|
||||
AdvSceneSwitcher.tempVar.twitch.id.charity="Charity id"
|
||||
AdvSceneSwitcher.tempVar.twitch.id.charity="Charity ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.id.charity.description="An ID that identifies the donation. The ID is unique across campaigns."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.charity="Donor user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.charity="Donor user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.charity.description="An ID that identifies the user that donated to the campaign."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.charity="Donor login name"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.charity.description="The user login that identifies the user that donated to the campaign."
|
||||
@@ -1602,13 +1672,13 @@ AdvSceneSwitcher.tempVar.twitch.thumbnail_url.description="A URL to an image of
|
||||
AdvSceneSwitcher.tempVar.twitch.viewer_count.live="Viewer count"
|
||||
AdvSceneSwitcher.tempVar.twitch.viewer_count.live.description="The number of users watching the stream."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.ban="Banned user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.ban="Banned user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.ban.description="The user ID for the user who was banned on the specified channel."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.ban="Banned login name"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.ban.description="The user login for the user who was banned on the specified channel."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.ban="Banned user name"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.ban.description="The user display name for the user who was banned on the specified channel."
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.ban="Moderator user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.ban="Moderator user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.ban.description="The user ID of the issuer of the ban."
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.ban="Moderator login name"
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.ban.description="The user login of the issuer of the ban."
|
||||
@@ -1620,36 +1690,88 @@ AdvSceneSwitcher.tempVar.twitch.ends_at.ban.description="The UTC date and time (
|
||||
AdvSceneSwitcher.tempVar.twitch.is_permanent.ban="Is permanent ban"
|
||||
AdvSceneSwitcher.tempVar.twitch.is_permanent.ban.description="Indicates whether the ban is permanent (true) or a timeout (false). If true, ends_at will be null."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.unban="Banned user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.unban="Banned user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.unban.description="The user ID for the user who was unbanned on the specified channel."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.unban="Banned login name"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.unban.description="The user login for the user who was unbanned on the specified channel."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.unban="Banned user name"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.unban.description="The user display name for the user who was unbanned on the specified channel."
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.unban="Moderator user id"
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.unban="Moderator user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.unban.description="The user ID of the issuer of the unban."
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.unban="Moderator login name"
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.unban.description="The user login of the issuer of the unban."
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_name.unban="Moderator user name"
|
||||
AdvSceneSwitcher.tempVar.twitch.moderator_user_name.unban.description="The user name of the issuer of the unban."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.addMod="User id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.addMod="User ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.addMod.description="The user ID of the new moderator."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.addMod="Login name"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.addMod.description="The user login of the new moderator."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.addMod="User name"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.addMod.description="The display name of the new moderator."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.removeMod="User id"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.removeMod="User ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.removeMod.description="The user ID of the removed moderator."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.removeMod="Login name"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.removeMod.description="The user login of the removed moderator."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.removeMod="User name"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.removeMod.description="The display name of the removed moderator."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.chatter="User login"
|
||||
AdvSceneSwitcher.tempVar.twitch.chatter.description="The user login of the person who sent the chat message."
|
||||
AdvSceneSwitcher.tempVar.twitch.chat_message="Chat message"
|
||||
AdvSceneSwitcher.tempVar.twitch.id.chatReceive="Chat message ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.id.chatReceive.description="The ID of the message, formatted as UUID."
|
||||
AdvSceneSwitcher.tempVar.twitch.chat_message.chatReceive="Chat message body"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.chatReceive="User ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_id.chatReceive.description="The user ID of the person who sent the chat message."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.chatReceive="User login"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.chatReceive.description="The user login of the person who sent the chat message."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.chatReceive="User name"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_name.chatReceive.description="The display name of the person who sent the chat message."
|
||||
AdvSceneSwitcher.tempVar.twitch.user_type.chatReceive="User type"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_type.chatReceive.description="The type of the Twitch user - e.g. 'admin' for Twitch administrator, 'global_mod' for global moderator and 'staff' for Twitch staff."
|
||||
AdvSceneSwitcher.tempVar.twitch.reply_parent_id.chatReceive="Reply parent message ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.reply_parent_id.chatReceive.description="The ID of the closest parent message, formatted as UUID, if one exists."
|
||||
AdvSceneSwitcher.tempVar.twitch.reply_parent_message.chatReceive="Reply parent message body"
|
||||
AdvSceneSwitcher.tempVar.twitch.reply_parent_message.chatReceive.description="The body of the closest parent message, if one exists."
|
||||
AdvSceneSwitcher.tempVar.twitch.reply_parent_user_id.chatReceive="Reply parent user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.reply_parent_user_id.chatReceive.description="The ID of the author of the closest parent message, if one exists."
|
||||
AdvSceneSwitcher.tempVar.twitch.reply_parent_user_login.chatReceive="Reply parent user login"
|
||||
AdvSceneSwitcher.tempVar.twitch.reply_parent_user_login.chatReceive.description="The login of the author of the closest parent message, if one exists."
|
||||
AdvSceneSwitcher.tempVar.twitch.reply_parent_user_name.chatReceive="Reply parent user name"
|
||||
AdvSceneSwitcher.tempVar.twitch.reply_parent_user_name.chatReceive.description="The display name of the author of the closest parent message, if one exists."
|
||||
AdvSceneSwitcher.tempVar.twitch.root_parent_id.chatReceive="Root parent message ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.root_parent_id.chatReceive.description="The ID of the furthest parent message that started a discussion, formatted as UUID, if one exists."
|
||||
AdvSceneSwitcher.tempVar.twitch.root_parent_user_login.chatReceive="Root parent user login"
|
||||
AdvSceneSwitcher.tempVar.twitch.root_parent_user_login.chatReceive.description="The login of the author of the furthest parent message, if one exists."
|
||||
AdvSceneSwitcher.tempVar.twitch.badge_info.chatReceive="Chatter badges' info"
|
||||
AdvSceneSwitcher.tempVar.twitch.badge_info.chatReceive.description="A string describing the metadata of some of the badges available to this user.\nFor example, this means user has been subscribed for 8 months: subscriber/8"
|
||||
AdvSceneSwitcher.tempVar.twitch.badges.chatReceive="Chatter badges"
|
||||
AdvSceneSwitcher.tempVar.twitch.badges.chatReceive.description="A string describing all the badges of the user and their version.\nFor example: vip/1,subscriber/42,hype-train/1"
|
||||
AdvSceneSwitcher.tempVar.twitch.bits.chatReceive="Chat message bits"
|
||||
AdvSceneSwitcher.tempVar.twitch.bits.chatReceive.description="Number of bits that the user cheered along with the message."
|
||||
AdvSceneSwitcher.tempVar.twitch.color.chatReceive="Chatter color"
|
||||
AdvSceneSwitcher.tempVar.twitch.color.chatReceive.description="Hexadecimal color of user's display name, if they set one, otherwise empty string. Starts with #.\nFor example: #123456"
|
||||
AdvSceneSwitcher.tempVar.twitch.emotes.chatReceive="Chatter badges"
|
||||
AdvSceneSwitcher.tempVar.twitch.emotes.chatReceive.description="A string describing all the emotes in the message - the emote ID and comma-separated all positions of emotes with that ID.\nFor example: 25:0-4,12-16/1902:6-10"
|
||||
AdvSceneSwitcher.tempVar.twitch.timestamp.chatReceive="Chat message timestamp"
|
||||
AdvSceneSwitcher.tempVar.twitch.timestamp.chatReceive.description="The Unix timestamp representing when the chat message was sent, in milliseconds."
|
||||
AdvSceneSwitcher.tempVar.twitch.is_emotes_only.chatReceive="Is using only emotes"
|
||||
AdvSceneSwitcher.tempVar.twitch.is_emotes_only.chatReceive.description="'true' if the message consists only of emotes, 'false' otherwise."
|
||||
AdvSceneSwitcher.tempVar.twitch.is_first_message.chatReceive="Is chatter's first message"
|
||||
AdvSceneSwitcher.tempVar.twitch.is_first_message.chatReceive.description="'true' if the chatter has never sent messages in the channel before, 'false' otherwise."
|
||||
AdvSceneSwitcher.tempVar.twitch.is_mod.chatReceive="Is chatter a moderator"
|
||||
AdvSceneSwitcher.tempVar.twitch.is_mod.chatReceive.description="'true' if the chatter is a moderator of the channel, 'false' otherwise."
|
||||
AdvSceneSwitcher.tempVar.twitch.is_subscriber.chatReceive="Is chatter a subscriber"
|
||||
AdvSceneSwitcher.tempVar.twitch.is_subscriber.chatReceive.description="'true' if the chatter is a subscriber of the channel, 'false' otherwise."
|
||||
AdvSceneSwitcher.tempVar.twitch.is_turbo.chatReceive="Is chatter a Turbo user"
|
||||
AdvSceneSwitcher.tempVar.twitch.is_turbo.chatReceive.description="'true' if the chatter is a Twitch Turbo user, 'false' otherwise."
|
||||
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.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.chatLeave="User login"
|
||||
AdvSceneSwitcher.tempVar.twitch.user_login.chatLeave.description="The user login of the person who left the chat room."
|
||||
|
||||
AdvSceneSwitcher.tempVar.twitch.from_broadcaster_user_id.raid="Raid creator user ID"
|
||||
AdvSceneSwitcher.tempVar.twitch.from_broadcaster_user_id.raid.description="The broadcaster ID that created the raid."
|
||||
@@ -1723,6 +1845,9 @@ AdvSceneSwitcher.tempVar.run.process.stream.output="Process standard output stre
|
||||
AdvSceneSwitcher.tempVar.run.process.stream.output.description="Full standard output stream, usually numbered 1 and what you see in CLI after running the command."
|
||||
AdvSceneSwitcher.tempVar.run.process.stream.error="Process standard error stream"
|
||||
AdvSceneSwitcher.tempVar.run.process.stream.error.description="Full standard error stream, usually numbered 2."
|
||||
AdvSceneSwitcher.tempVar.run.process.none.description="Full standard error stream, usually numbered 2."
|
||||
AdvSceneSwitcher.tempVar.run.process.none="No variables available for the \"Run\" action!"
|
||||
AdvSceneSwitcher.tempVar.run.process.none.description="When not waiting for the action to finish no variables will be available.\nThe option to wait for the action to complete can be found in the advanced settings."
|
||||
|
||||
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."
|
||||
@@ -1775,6 +1900,64 @@ AdvSceneSwitcher.tempVar.source.settings="Settings string"
|
||||
AdvSceneSwitcher.tempVar.filter.setting="Setting value"
|
||||
AdvSceneSwitcher.tempVar.filter.settings="Settings string"
|
||||
|
||||
AdvSceneSwitcher.tempVar.slideShow.index="Slide index"
|
||||
AdvSceneSwitcher.tempVar.slideShow.index.description="The index of the slide currently being displayed.\nIf the index cannot be determined, -1 is returned."
|
||||
AdvSceneSwitcher.tempVar.slideShow.path="Slide path"
|
||||
AdvSceneSwitcher.tempVar.slideShow.path.description="The filesystem path of the slide currently being displayed."
|
||||
AdvSceneSwitcher.tempVar.slideShow.fileName="Slide file name"
|
||||
AdvSceneSwitcher.tempVar.slideShow.fileName.description="The name of file of the slide currently being displayed."
|
||||
|
||||
AdvSceneSwitcher.tempVar.usb.vendorID="Vendor ID"
|
||||
AdvSceneSwitcher.tempVar.usb.productID="Product ID"
|
||||
AdvSceneSwitcher.tempVar.usb.busNumber="Bus Number"
|
||||
AdvSceneSwitcher.tempVar.usb.deviceAddress="Device Address"
|
||||
AdvSceneSwitcher.tempVar.usb.vendorName="Vendor Name"
|
||||
AdvSceneSwitcher.tempVar.usb.productName="Product Name"
|
||||
AdvSceneSwitcher.tempVar.usb.serialNumber="Serial Number"
|
||||
|
||||
AdvSceneSwitcher.tempVar.transform.setting="Setting value"
|
||||
AdvSceneSwitcher.tempVar.transform.settings="Settings string"
|
||||
|
||||
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.time="Current time"
|
||||
AdvSceneSwitcher.tempVar.media.time.description="Elapsed time in milliseconds since media playback began.\nIf the source supports playlists, this time is respective to the current playlist item being played and not the overall playlist.\nNote that this value might not be exactly zero if the playback is stopped or ended."
|
||||
AdvSceneSwitcher.tempVar.media.duration="Duration"
|
||||
AdvSceneSwitcher.tempVar.media.duration.description="The duration of the media file being played in milliseconds.\nIf the source supports playlists, this time is respective to the current playlist item being played and not the overall playlist."
|
||||
AdvSceneSwitcher.tempVar.media.vlc.title="Title (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.artist="Artist (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.genre="Genre (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.copyright="Copyright (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.album="Album (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.track_number="Track number (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.description="Description (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.rating="Rating (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.date="Date (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.setting="Setting (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.url="URL (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.language="Language (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.now_playing="Now playing (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.publisher="Publisher (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.encoded_by="Encoded by (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.artwork_url="Artwork URL (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.track_id="Track id (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.director="Director (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.season="Season (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.episode="Episode (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.show_name="Show name (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.actors="Actors (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.album_artist="Album artist (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.disc_number="Disc number (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.disc_total="Disc total (VLC)"
|
||||
AdvSceneSwitcher.tempVar.media.vlc.metadata.description="This property is exposed by the VLC Source type.\nNot all of these might be applicable to every file.\nIn case the metadata is not available an empty string will be returned."
|
||||
|
||||
AdvSceneSwitcher.tempVar.streamDeck.keyPressed="Key pressed"
|
||||
AdvSceneSwitcher.tempVar.streamDeck.keyPressed.description="Will return \"0\" when the key is pressed, and \"1\" otherwise."
|
||||
AdvSceneSwitcher.tempVar.streamDeck.row="Key row"
|
||||
AdvSceneSwitcher.tempVar.streamDeck.column="Key column"
|
||||
AdvSceneSwitcher.tempVar.streamDeck.data="Data"
|
||||
AdvSceneSwitcher.tempVar.streamDeck.data.description="The value of the \"Data\" field configured in the action on the Stream Deck side."
|
||||
|
||||
AdvSceneSwitcher.selectScene="--select scene--"
|
||||
AdvSceneSwitcher.selectPreviousScene="Previous Scene"
|
||||
AdvSceneSwitcher.selectCurrentScene="Current Scene"
|
||||
@@ -1819,6 +2002,20 @@ AdvSceneSwitcher.settings.suffix.type.frameRate=" (Frame rate)"
|
||||
AdvSceneSwitcher.settings.suffix.type.group=" (Group)"
|
||||
AdvSceneSwitcher.settings.suffix.type.colorAlpha=" (Color alpha)"
|
||||
AdvSceneSwitcher.setting.select="--select setting--"
|
||||
AdvSceneSwitcher.setting.transform.alignment="Positional Alignment"
|
||||
AdvSceneSwitcher.setting.transform.cropBottom="[Crop]Bottom"
|
||||
AdvSceneSwitcher.setting.transform.cropLeft="[Crop]Left"
|
||||
AdvSceneSwitcher.setting.transform.cropRight="[Crop]Right"
|
||||
AdvSceneSwitcher.setting.transform.cropTop="[Crop]Top"
|
||||
AdvSceneSwitcher.setting.transform.boundingBoxType="Bounding Box Type"
|
||||
AdvSceneSwitcher.setting.transform.boundingBoxAlign="Alignment in Bounding Box"
|
||||
AdvSceneSwitcher.setting.transform.boundingBoxSize="Bounding Box Size"
|
||||
AdvSceneSwitcher.setting.transform.rotation="Rotation"
|
||||
AdvSceneSwitcher.setting.transform.scale="Scale"
|
||||
AdvSceneSwitcher.setting.transform.size="Size"
|
||||
AdvSceneSwitcher.setting.transform.position="Position"
|
||||
AdvSceneSwitcher.setting.transform.height="Height"
|
||||
AdvSceneSwitcher.setting.transform.width="Width"
|
||||
|
||||
|
||||
AdvSceneSwitcher.sceneItemSelection.configure="Configure scene item selection type"
|
||||
@@ -1828,8 +2025,10 @@ AdvSceneSwitcher.sceneItemSelection.type.sourceVariable="Variable name"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable.entry="{{nameConflictIndex}}{{variable}}"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern="Source name matches pattern"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern.entry="{{nameConflictIndex}}matching{{pattern}}{{regex}}"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup="Sources of type"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup.entry="Source type{{nameConflictIndex}}{{sourceGroups}}"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup="Sources in source group"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup.entry="Sources in{{sourceGroups}}"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType="Sources of type"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType.entry="Source type{{nameConflictIndex}}{{sourceTypes}}"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.index="Source with index"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.index.entry="{{index}}source"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.indexRange="Sources in index range"
|
||||
@@ -1851,23 +2050,67 @@ AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>This seems to be the fi
|
||||
AdvSceneSwitcher.deprecatedTabWarning="Development for this tab stopped!\nPlease consider transitioning to using Macros instead.\nThis hint can be disabled on the General tab."
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="milliseconds"
|
||||
AdvSceneSwitcher.unit.secends="seconds"
|
||||
AdvSceneSwitcher.unit.seconds="seconds"
|
||||
AdvSceneSwitcher.unit.minutes="minutes"
|
||||
AdvSceneSwitcher.unit.hours="hours"
|
||||
AdvSceneSwitcher.unit.days="days"
|
||||
AdvSceneSwitcher.unit.weeks="weeks"
|
||||
AdvSceneSwitcher.unit.months="months"
|
||||
AdvSceneSwitcher.unit.years="years"
|
||||
AdvSceneSwitcher.duration.condition.none="No duration modifier"
|
||||
AdvSceneSwitcher.duration.condition.more="For at least"
|
||||
AdvSceneSwitcher.duration.condition.equal="For exactly"
|
||||
AdvSceneSwitcher.duration.condition.less="For at most"
|
||||
AdvSceneSwitcher.duration.condition.within="Within the last"
|
||||
|
||||
AdvSceneSwitcher.time.relative="%1 %2 ago"
|
||||
|
||||
AdvSceneSwitcher.audio.monitor.none="Monitor Off"
|
||||
AdvSceneSwitcher.audio.monitor.monitorOnly="Monitor Only (mute output)"
|
||||
AdvSceneSwitcher.audio.monitor.both="Monitor and Output"
|
||||
|
||||
AdvSceneSwitcher.noSettingsButtons="No buttons found!"
|
||||
|
||||
; Legacy tabs below - please don't waste your time adding translations for these :)
|
||||
; Transition Tab
|
||||
AdvSceneSwitcher.clearBufferOnMatch="Clear message buffer when matching message was found"
|
||||
|
||||
AdvSceneSwitcher.script.settings="Settings"
|
||||
AdvSceneSwitcher.script.timeout="Script timeout:{{timeout}}"
|
||||
|
||||
# This secion is copied from the OBS locale files
|
||||
|
||||
# commonly shared locale
|
||||
Browse="Browse"
|
||||
Show="Show"
|
||||
Hide="Hide"
|
||||
|
||||
|
||||
# properties window
|
||||
Basic.PropertiesWindow="Properties for '%1'"
|
||||
Basic.PropertiesWindow.AutoSelectFormat="%1 (autoselect: %2)"
|
||||
Basic.PropertiesWindow.SelectColor="Select color"
|
||||
Basic.PropertiesWindow.SelectFont="Select font"
|
||||
Basic.PropertiesWindow.SelectFont.WindowTitle="Pick a Font"
|
||||
Basic.PropertiesWindow.ConfirmTitle="Settings Changed"
|
||||
Basic.PropertiesWindow.Confirm="There are unsaved changes. Do you want to keep them?"
|
||||
Basic.PropertiesWindow.NoProperties="No properties available"
|
||||
Basic.PropertiesWindow.AddFiles="Add Files"
|
||||
Basic.PropertiesWindow.AddDir="Add Directory"
|
||||
Basic.PropertiesWindow.AddURL="Add Path/URL"
|
||||
Basic.PropertiesWindow.AddEditableListDir="Add directory to '%1'"
|
||||
Basic.PropertiesWindow.AddEditableListFiles="Add files to '%1'"
|
||||
Basic.PropertiesWindow.AddEditableListEntry="Add entry to '%1'"
|
||||
Basic.PropertiesWindow.EditEditableListEntry="Edit entry from '%1'"
|
||||
|
||||
# properties view
|
||||
Basic.PropertiesView.FPS.Simple="Simple FPS Values"
|
||||
Basic.PropertiesView.FPS.Rational="Rational FPS Values"
|
||||
Basic.PropertiesView.FPS.ValidFPSRanges="Valid FPS Ranges:"
|
||||
Basic.PropertiesView.UrlButton.Text="Open this link in your default web browser?"
|
||||
Basic.PropertiesView.UrlButton.Text.Url="URL: %1"
|
||||
Basic.PropertiesView.UrlButton.OpenUrl="Open URL"
|
||||
|
||||
# Legacy tabs below - please don't waste your time adding translations for these :)
|
||||
# Transition Tab
|
||||
AdvSceneSwitcher.transitionTab.title="Transition"
|
||||
AdvSceneSwitcher.transitionTab.transitionForAToB="Use transition for automated scene switch from scene A to scene B"
|
||||
AdvSceneSwitcher.transitionTab.transitionsHelp="<html><head/><body><p>These settings <span style=\"font-style:italic;\">only</span> affect transitions caused by the scene switcher - Check out <a href=\"https://obsproject.com/forum/resources/transition-table.1174/\"><span style=\" text-decoration: underline; color:#268bd2;\">Transition Table</span></a> if you want to configure this for manual scene changes.<br/>Settings defined here take priority over transition settings configured elsewhere in the scene switcher.<br/><br/>Click the plus symbol below to add a new entry.</p></body></html>"
|
||||
@@ -1878,7 +2121,7 @@ AdvSceneSwitcher.transitionTab.defaultTransitionsHelp="Click on the plus symbol
|
||||
AdvSceneSwitcher.transitionTab.defaultTransition.delay="Switch transition{{defTransitionDelay}}after scene change."
|
||||
AdvSceneSwitcher.transitionTab.defaultTransition.delay.help="The delay is used to avoid cancelled scene switches, which can happen if the transition type is changed while a transition is still ongoing."
|
||||
|
||||
; Pause Scenes Tab
|
||||
# Pause Scenes Tab
|
||||
AdvSceneSwitcher.pauseTab.title="Pause"
|
||||
AdvSceneSwitcher.pauseTab.pauseOnScene="Pause the Scene Switcher on scene"
|
||||
AdvSceneSwitcher.pauseTab.pauseInFocus1="Pause the Scene Switcher when "
|
||||
@@ -1889,7 +2132,7 @@ AdvSceneSwitcher.pauseTab.pauseTargetAll="all"
|
||||
AdvSceneSwitcher.pauseTab.pauseEntry="Pause{{pauseTargets}}checks when{{pauseTypes}}{{scenes}}{{windows}}"
|
||||
AdvSceneSwitcher.pauseTab.help="On this tab you can configure to pause individual switching methods if a scene is active or window is in focus.\n\nClick on the highlighted plus symbol to continue."
|
||||
|
||||
; Window Title Tab
|
||||
# Window Title Tab
|
||||
AdvSceneSwitcher.windowTitleTab.title="Title"
|
||||
AdvSceneSwitcher.windowTitleTab.regexrDescription="<html><head/><body><p>Enter either direct window titles or valid regex. You can check syntax and matches for regular expressions using <a href=\"https://regexr.com\"><span style=\" text-decoration: underline; color:#268bd2;\">RegExr</span></a></p></body></html>"
|
||||
AdvSceneSwitcher.windowTitleTab.stayInFocus1="Ignore this window name"
|
||||
@@ -1901,14 +2144,14 @@ AdvSceneSwitcher.windowTitleTab.entry="{{windows}}{{scenes}}{{transitions}}{{ful
|
||||
AdvSceneSwitcher.windowTitleTab.windowsHelp="Switch scenes based on the window title of running applications.\nThe following additional conditions can be selected:\nThe window is Fullscreen\nThe window is maximized\nThe window is focused\n\nClick on the highlighted plus symbol to continue."
|
||||
AdvSceneSwitcher.windowTitleTab.ignoreWindowsHelp="If a window title is ignored the scene switcher will act as if the previously selected window is still in focus.\nThis will allow you to avoid scene switches, if you frequently switch to a different window, which shall not trigger a scene change.\n\nChoose a window or enter a window title above and click on the plus symbol below to add it to the list."
|
||||
|
||||
; Executable Tab
|
||||
# Executable Tab
|
||||
AdvSceneSwitcher.executableTab.title="Executable"
|
||||
AdvSceneSwitcher.executableTab.implemented="Implemented by dasOven"
|
||||
AdvSceneSwitcher.executableTab.requiresFocus="only if focused"
|
||||
AdvSceneSwitcher.executableTab.entry="When{{processes}}is running switch to{{scenes}}using{{transitions}}{{requiresFocus}}"
|
||||
AdvSceneSwitcher.executableTab.help="This tab will allow you to automatically switch scenes if a process is running.\nThis can be useful in situations where the window name could change or is not known.\n\nClick on the highlighted plus symbol to continue."
|
||||
|
||||
; Screen Region Tab
|
||||
# Screen Region Tab
|
||||
AdvSceneSwitcher.screenRegionTab.title="Region"
|
||||
AdvSceneSwitcher.screenRegionTab.currentPosition="Cursor is currently at:"
|
||||
AdvSceneSwitcher.screenRegionTab.showGuideFrames="Show guide frames"
|
||||
@@ -1917,7 +2160,7 @@ AdvSceneSwitcher.screenRegionTab.excludeScenes.None="No selection"
|
||||
AdvSceneSwitcher.screenRegionTab.entry="If cursor is in{{minX}}{{minY}}x{{maxX}}{{maxY}}switch to{{scenes}}using{{transitions}}unless in{{excludeScenes}}"
|
||||
AdvSceneSwitcher.screenRegionTab.help="This tab will allow you to automatically switch scenes based on the current position of your mouse cursor.\n\nClick on the highlighted plus symbol to continue."
|
||||
|
||||
; Media Tab
|
||||
# Media Tab
|
||||
AdvSceneSwitcher.mediaTab.title="Media"
|
||||
AdvSceneSwitcher.mediaTab.implemented="Implemented by Exeldro"
|
||||
AdvSceneSwitcher.mediaTab.states.none="None"
|
||||
@@ -1938,7 +2181,7 @@ AdvSceneSwitcher.mediaTab.timeRestriction.remainLonger="Time remaining longer"
|
||||
AdvSceneSwitcher.mediaTab.entry="When{{mediaSources}}state is{{states}}and{{timeRestrictions}}{{time}}switch to{{scenes}}using{{transitions}}"
|
||||
AdvSceneSwitcher.mediaTab.help="This tab will allow you to switch scenes based on the states of media sources.\nFor example, you can automatically switch back to the previous scene once the selected media sourced ended its playback.\n\nClick on the highlighted plus symbol to continue."
|
||||
|
||||
; File Tab
|
||||
# File Tab
|
||||
AdvSceneSwitcher.fileTab.title="File"
|
||||
AdvSceneSwitcher.fileTab.readWriteSceneFile="Read / write scene from / to file"
|
||||
AdvSceneSwitcher.fileTab.currentSceneOutputFile="Write the name of the current scene to this file:"
|
||||
@@ -1963,13 +2206,13 @@ AdvSceneSwitcher.fileTab.entry2="{{matchText}}"
|
||||
AdvSceneSwitcher.fileTab.entry3="{{useRegex}}{{checkModificationDate}}{{checkFileContent}}"
|
||||
AdvSceneSwitcher.fileTab.help="This tab will allow you to automatically switch scenes based on the content of remote or local files.\n\nClick on the highlighted plus symbol to continue."
|
||||
|
||||
; Random Tab
|
||||
# Random Tab
|
||||
AdvSceneSwitcher.randomTab.title="Random"
|
||||
AdvSceneSwitcher.randomTab.randomDisabledWarning="Functionality disabled - To activate select \"If no switch condition is met switch to any scene in Random tab\" on General tab"
|
||||
AdvSceneSwitcher.randomTab.entry="If no switch condition is met switch to{{scenes}}using{{transitions}}for{{delay}}"
|
||||
AdvSceneSwitcher.randomTab.help="The scene switcher will randomly choose an entry on this tab to switch to for the configured time.\nNote that the same entry will not be chosen twice in a row.\n\nClick on the highlighted plus symbol to continue."
|
||||
|
||||
; Time Tab
|
||||
# Time Tab
|
||||
AdvSceneSwitcher.timeTab.title="Time"
|
||||
AdvSceneSwitcher.timeTab.anyDay="On any day"
|
||||
AdvSceneSwitcher.timeTab.mondays="Mondays"
|
||||
@@ -1984,14 +2227,14 @@ AdvSceneSwitcher.timeTab.afterstart.tip="The time relative to the start of strea
|
||||
AdvSceneSwitcher.timeTab.entry="{{triggers}}at{{time}}switch to{{scenes}}using{{transitions}}"
|
||||
AdvSceneSwitcher.timeTab.help="This tab will allow you to automatically switch to a different scene based on the current local time.\n\nNote that the scene switcher will only switch scenes at the exact time you specified.\nMake sure you have configured the priority settings on the General tab to your liking so the selected time point will not be missed due to other switching methods having a higher priority.\n\nClick on the highlighted plus symbol to continue."
|
||||
|
||||
; Idle Tab
|
||||
# Idle Tab
|
||||
AdvSceneSwitcher.idleTab.title="Idle"
|
||||
AdvSceneSwitcher.idleTab.enable="Enable Idle Detection"
|
||||
AdvSceneSwitcher.idleTab.idleswitch="After{{duration}}of no keyboard or mouse inputs switch to scene{{scenes}}using the{{transitions}}"
|
||||
AdvSceneSwitcher.idleTab.dontSwitchIfFocus1="Do not switch if"
|
||||
AdvSceneSwitcher.idleTab.dontSwitchIfFocus2="is in focus"
|
||||
|
||||
; Scene Sequence Tab
|
||||
# Scene Sequence Tab
|
||||
AdvSceneSwitcher.sceneSequenceTab.title="Sequence"
|
||||
AdvSceneSwitcher.sceneSequenceTab.description="A sequence of automatic scene switches can be cancelled by either pausing/stopping the scene switcher or manually switching to a different scene"
|
||||
AdvSceneSwitcher.sceneSequenceTab.save="Save scene sequences to file"
|
||||
@@ -2008,7 +2251,7 @@ AdvSceneSwitcher.sceneSequenceTab.extendEdit="Extend Sequence"
|
||||
AdvSceneSwitcher.sceneSequenceTab.extendEntry="After{{delay}}switch to{{scenes}}using{{transitions}}"
|
||||
AdvSceneSwitcher.sceneSequenceTab.help="This tab will allow you to automatically switch to a different scene if a scene was active for a configured period of time.\nFor example, you could automatically cycle back and forth between two scenes automatically.\n\nClick on the highlighted plus symbol to continue."
|
||||
|
||||
; Audio Tab
|
||||
# Audio Tab
|
||||
AdvSceneSwitcher.audioTab.title="Audio"
|
||||
AdvSceneSwitcher.audioTab.condition.above="above"
|
||||
AdvSceneSwitcher.audioTab.condition.below="below"
|
||||
@@ -2018,7 +2261,7 @@ AdvSceneSwitcher.audioTab.multiMatchfallbackCondition="If multiple entries match
|
||||
AdvSceneSwitcher.audioTab.multiMatchfallback="... for{{duration}}seconds switch to{{scenes}}using{{transitions}}"
|
||||
AdvSceneSwitcher.audioTab.help="This tab will allow you to switch scenes based on the volume of sources.\nFor example, you could automatically switch to a different scene if the volume of your microphone reaches a certain threshold.\n\nClick on the highlighted plus symbol to continue."
|
||||
|
||||
; Video Tab
|
||||
# Video Tab
|
||||
AdvSceneSwitcher.videoTab.title="Video"
|
||||
AdvSceneSwitcher.videoTab.getScreenshot="Get screenshot for selected entry"
|
||||
AdvSceneSwitcher.videoTab.getScreenshotHelp="Get Screenshot of the currently selected entry's video source and automatically set it as the target image"
|
||||
@@ -2031,32 +2274,7 @@ AdvSceneSwitcher.videoTab.ignoreInactiveSource="unless source is inactive"
|
||||
AdvSceneSwitcher.videoTab.entry="When{{videoSources}}{{condition}}{{filePath}}{{browseButton}}for{{duration}}switch to{{scenes}}using{{transitions}}{{ignoreInactiveSource}}"
|
||||
AdvSceneSwitcher.videoTab.help="<html><head/><body><p>This tab will allow you to switch scenes based on the current video output of selected sources.<br/>Make sure to check out <a href=\"https://obsproject.com/forum/resources/pixel-match-switcher.1202/\"><span style=\" text-decoration: underline; color:#268bd2;\">Pixel Match Switcher</span></a> for an even better implementation of this functionality.<br/><br/> Click on the highlighted plus symbol to continue.</p></body></html>"
|
||||
|
||||
; Network Tab
|
||||
AdvSceneSwitcher.networkTab.title="Network"
|
||||
AdvSceneSwitcher.networkTab.description="This tab will allow you to remotely control the active scene of another OBS instance.\nPlease note that the scene names have to match exactly on all OBS instances."
|
||||
AdvSceneSwitcher.networkTab.warning="Running the server outside of a local network will allow third parties to read the active scene."
|
||||
AdvSceneSwitcher.networkTab.server="Start server (Sends scene switch messages to all connected clients)"
|
||||
AdvSceneSwitcher.networkTab.server.port="Port"
|
||||
AdvSceneSwitcher.networkTab.server.lockToIPv4="Lock server to only using IPv4"
|
||||
AdvSceneSwitcher.networkTab.server.sendSceneChange="Send messages for scene changes"
|
||||
AdvSceneSwitcher.networkTab.server.restrictSendToAutomatedSwitches="Only send messages for automated scene switches"
|
||||
AdvSceneSwitcher.networkTab.server.sendPreview="Send messages for preview scene change when running in Studio mode"
|
||||
AdvSceneSwitcher.networkTab.startFailed.message="The WebSockets server failed to start, maybe because:\n - TCP port %1 may currently be in use elsewhere on this system, possibly by another application. Try setting a different TCP port in the WebSocket server settings, or stop any application that could be using this port.\n - Error message: %2"
|
||||
AdvSceneSwitcher.networkTab.server.status.currentStatus="Current status"
|
||||
AdvSceneSwitcher.networkTab.server.status.notRunning="Not running"
|
||||
AdvSceneSwitcher.networkTab.server.status.starting="Starting"
|
||||
AdvSceneSwitcher.networkTab.server.status.running="Running"
|
||||
AdvSceneSwitcher.networkTab.server.restart="Restart server"
|
||||
AdvSceneSwitcher.networkTab.client="Start client (Receives scene switches messages)"
|
||||
AdvSceneSwitcher.networkTab.client.address="Hostname or IP address"
|
||||
AdvSceneSwitcher.networkTab.client.port="Port"
|
||||
AdvSceneSwitcher.networkTab.client.status.currentStatus="Current status"
|
||||
AdvSceneSwitcher.networkTab.client.status.disconnected="Disconnected"
|
||||
AdvSceneSwitcher.networkTab.client.status.connecting="Connecting"
|
||||
AdvSceneSwitcher.networkTab.client.status.connected="Connected"
|
||||
AdvSceneSwitcher.networkTab.client.reconnect="Force reconnect"
|
||||
|
||||
; Scene Group Tab
|
||||
# Scene Group Tab
|
||||
AdvSceneSwitcher.sceneGroupTab.title="Scene Group"
|
||||
AdvSceneSwitcher.sceneGroupTab.list="Scene Groups"
|
||||
AdvSceneSwitcher.sceneGroupTab.edit="Edit Scene Groups"
|
||||
@@ -2075,27 +2293,3 @@ AdvSceneSwitcher.sceneGroupTab.defaultname="Scene Group %1"
|
||||
AdvSceneSwitcher.sceneGroupTab.exists="Scene Group or Scene name exists already"
|
||||
AdvSceneSwitcher.sceneGroupTab.help="Scene Groups can be selected as a target just like a regular scene.\n\nAs the name suggests a scene group is a collection of multiple scenes.\nThe scene group will advance through the list of its assigned scenes depending on the configured settings, which can be found on the right side.\n\nYou can configure the scene group to advance to the next scene in the list:\nAfter a number of times the scene group is selected as a target.\nAfter a certain amount of time has passed.\nOr randomly.\n\nFor example, a scene group containing the scenes ...\nScene 1\nScene 2\nScene 3 \n... will activate \"Scene 1\" the first time it is selected as a target.\nThe second time it will activate \"Scene 2\".\nThe remaining times \"Scene 3\" will be activated.\n\nClick the highlighted plus symbol below to add a new scene group."
|
||||
AdvSceneSwitcher.sceneGroupTab.scenes.help="Select the scene group you want to modify on the left.\n\nSelect a scene to add to this scene group by selecting the scene above and clicking the plus symbol below.\n\nA scene can be added multiple times to the same scene group."
|
||||
|
||||
; Scene Trigger Tab
|
||||
AdvSceneSwitcher.sceneTriggerTab.title="Scene Triggers"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.none="--select trigger--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneActive="is active"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneInactive="is not active"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneLeave="switched away from"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.none="--select action--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startRecording="start recording"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.pauseRecording="pause recording"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unpauseRecording="unpause recording"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopRecording="stop recording"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopStreaming="stop streaming"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startStreaming="start streaming"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startReplayBuffer="start replay buffer"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopReplayBuffer="stop replay buffer"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.muteSource="mute source"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unmuteSource="unmute source"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startSwitcher="start the scene switcher"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopSwitcher="stop the scene switcher"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startVirtualCamera="start virtual camera"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopVirtualCamera="stop virtual camera"
|
||||
AdvSceneSwitcher.sceneTriggerTab.entry="When{{scenes}}{{triggers}}{{actions}}{{audioSources}}after{{duration}}"
|
||||
AdvSceneSwitcher.sceneTriggerTab.help="This tab allows you to trigger actions on scene changes, like stopping recording or streaming."
|
||||
|
||||
@@ -19,11 +19,11 @@ AdvSceneSwitcher.generalTab.status.autoStart.streaming="Emitiendo"
|
||||
AdvSceneSwitcher.generalTab.status.autoStart.recordingAndStreaming="Grabando o emitiendo"
|
||||
AdvSceneSwitcher.generalTab.status.checkInterval="Comprobar las condiciones de cambio cada"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior="Comportamiento general"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet="Si no se cumple ninguna condición por"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="Solo será tan preciso como el intervalo de comprobación configurado."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="No cambiar"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Cambiar a una escena aleatoria"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Cambiar a:"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch="Si no se cumple ninguna condición por"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatchDelay.tooltip="Solo será tan preciso como el intervalo de comprobación configurado."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch="No cambiar"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Cambiar a una escena aleatoria"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Cambiar a:"
|
||||
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"
|
||||
@@ -117,8 +117,6 @@ AdvSceneSwitcher.condition.scene.type.changed="Escena cambiada"
|
||||
AdvSceneSwitcher.condition.scene.type.notChanged="La escena no ha cambiado"
|
||||
AdvSceneSwitcher.condition.scene.currentSceneTransitionBehaviour="Durante la transición, verifique la escena de destino de la transición"
|
||||
AdvSceneSwitcher.condition.scene.previousSceneTransitionBehaviour="Durante la transición, verifique la escena de origen de la transición"
|
||||
AdvSceneSwitcher.condition.scene.entry.line1="{{sceneType}}{{scenes}}{{pattern}}"
|
||||
AdvSceneSwitcher.condition.scene.entry.line2="{{useTransitionTargetScene}}"
|
||||
AdvSceneSwitcher.condition.window="Ventana"
|
||||
AdvSceneSwitcher.condition.file="Archivo"
|
||||
AdvSceneSwitcher.condition.file.entry.line1="Contenido de{{fileType}}{{filePath}}{{conditions}}{{useRegex}}"
|
||||
@@ -128,7 +126,7 @@ AdvSceneSwitcher.condition.media="Medios"
|
||||
AdvSceneSwitcher.condition.media.anyOnScene="Cualquier fuente multimedia activada"
|
||||
AdvSceneSwitcher.condition.media.allOnScene="Todas las fuentes de medios activadas"
|
||||
AdvSceneSwitcher.condition.media.inconsistencyInfo="Desafortunadamente, no todos los tipos de fuentes de medios se comportan de la misma manera (p. ej., fuente de medios frente a estado \"Detenido\" de fuente de video VLC).\n¡Así que experimente lo que funciona para su configuración!"
|
||||
AdvSceneSwitcher.condition.media.entry="El estado de{{sourceTypes}}{{mediaSources}}{{scenes}}es{{states}}y{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.media.layout.legacy="El estado de{{sourceTypes}}{{mediaSources}}{{scenes}}{{checkTypes}}es{{states}}y{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.video="Video"
|
||||
AdvSceneSwitcher.condition.video.condition.match="coincide exactamente"
|
||||
AdvSceneSwitcher.condition.video.condition.differ="no coincide"
|
||||
@@ -269,10 +267,7 @@ AdvSceneSwitcher.condition.date.entry.nextMatchDate="Próxima coincidencia en: %
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}} Al repetir actualizar la fecha seleccionada para repetir la fecha"
|
||||
AdvSceneSwitcher.condition.sceneTransform="Transformar elemento de escena"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="Obtener transformación"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line1="En{{scenes}}{{sources}}{{types}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.type.matches="coincide con la transformación"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line2="{{settings}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line3="{{regex}} {{getSettings}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.match="coincide con la transformación"
|
||||
AdvSceneSwitcher.condition.transition="Transición"
|
||||
AdvSceneSwitcher.condition.transition.type.current="El tipo de transición actual es"
|
||||
AdvSceneSwitcher.condition.transition.type.duration="La duración de la transición actual es"
|
||||
@@ -348,7 +343,6 @@ AdvSceneSwitcher.action.replay.saveWarn="Advertencia: ¡Guardar con demasiada fr
|
||||
AdvSceneSwitcher.action.replay.type.stop="Detener el búfer de reproducción"
|
||||
AdvSceneSwitcher.action.replay.type.start="Iniciar búfer de reproducción"
|
||||
AdvSceneSwitcher.action.replay.type.save="Guardar búfer de reproducción"
|
||||
AdvSceneSwitcher.action.replay.entry="{{actions}}"
|
||||
AdvSceneSwitcher.action.streaming="Transmisión"
|
||||
AdvSceneSwitcher.action.streaming.type.stop="Detener transmisión"
|
||||
AdvSceneSwitcher.action.streaming.type.start="Iniciar transmisión"
|
||||
@@ -416,7 +410,7 @@ AdvSceneSwitcher.action.sceneOrder.type.movePosition="Mover a la posición"
|
||||
AdvSceneSwitcher.action.sceneOrder.entry="En{{scenes}}{{actions}}{{sources}}{{position}}"
|
||||
AdvSceneSwitcher.action.sceneTransform="Transformar elemento de escena"
|
||||
AdvSceneSwitcher.action.sceneTransform.getTransform="Obtener transformación"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="En{{scenes}}{{action}}{{rotation}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="En{{scenes}}{{action}}{{rotation}}{{sources}}{{settingSelection}}{{singleSettingValue}}"
|
||||
AdvSceneSwitcher.action.file="Archivo"
|
||||
AdvSceneSwitcher.action.file.type.write="Escribir"
|
||||
AdvSceneSwitcher.action.file.type.append="Agregar"
|
||||
@@ -622,31 +616,6 @@ AdvSceneSwitcher.videoTab.ignoreInactiveSource="a menos que la fuente esté inac
|
||||
AdvSceneSwitcher.videoTab.entry="Cuando {{videoSources}} {{condition}} {{filePath}} {{browseButton}} durante {{duration}} cambiar a {{scenes}} usando {{transitions}} {{ignoreInactiveSource}}"
|
||||
AdvSceneSwitcher.videoTab.help="<html><head/><body><p>Esta pestaña te permitirá cambiar escenas según la salida de vídeo actual de las fuentes seleccionadas.<br/>Asegúrate de revisar <a href=\"https://obsproject.com/forum/resources/pixel-match-switcher.1202\"><span style=\" text-decoration: underline; color:#268bd2;\">Pixel Match Switcher</span></a> para una implementación aún mejor de esta funcionalidad.<br/><br/> Haz clic en el símbolo más resaltado para continuar.</p></body></html>"
|
||||
|
||||
; Network Tab
|
||||
AdvSceneSwitcher.networkTab.title="Red"
|
||||
AdvSceneSwitcher.networkTab.description="Esta pestaña le permitirá controlar de forma remota la escena activa de otra instancia de OBS.\nTenga en cuenta que los nombres de las escenas deben coincidir exactamente en todas las instancias de OBS".
|
||||
AdvSceneSwitcher.networkTab.warning="Ejecutar el servidor fuera de una red local permitirá que terceros lean la escena activa".
|
||||
AdvSceneSwitcher.networkTab.server="Iniciar servidor (envía mensajes de cambio de escena a todos los clientes conectados)"
|
||||
AdvSceneSwitcher.networkTab.server.port="Puerto"
|
||||
AdvSceneSwitcher.networkTab.server.lockToIPv4="Bloquear servidor para usar solo IPv4"
|
||||
AdvSceneSwitcher.networkTab.server.sendSceneChange="Enviar mensajes para cambios de escena"
|
||||
AdvSceneSwitcher.networkTab.server.restrictSendToAutomatedSwitches="Solo enviar mensajes para cambios de escena automatizados"
|
||||
AdvSceneSwitcher.networkTab.server.sendPreview="Enviar mensajes para obtener una vista previa del cambio de escena cuando se ejecuta en Modo Estudio"
|
||||
AdvSceneSwitcher.networkTab.startFailed.message="El servidor WebSockets no pudo iniciarse, tal vez porque:\n - El puerto TCP %1 puede estar actualmente en uso en otro lugar de este sistema, posiblemente por otra aplicación. Intente configurar un puerto TCP diferente en el WebSocket configuración del servidor o detenga cualquier aplicación que pueda estar usando este puerto.\n - Mensaje de error: %2"
|
||||
AdvSceneSwitcher.networkTab.server.status.currentStatus="Estado actual"
|
||||
AdvSceneSwitcher.networkTab.server.status.notRunning="Desconectado"
|
||||
AdvSceneSwitcher.networkTab.server.status.starting="Iniciando"
|
||||
AdvSceneSwitcher.networkTab.server.status.running="En ejecución"
|
||||
AdvSceneSwitcher.networkTab.server.restart="Reiniciar servidor"
|
||||
AdvSceneSwitcher.networkTab.client="Iniciar cliente (Recibe mensajes de cambios de escena)"
|
||||
AdvSceneSwitcher.networkTab.client.address="Nombre de host o dirección IP"
|
||||
AdvSceneSwitcher.networkTab.client.port="Puerto"
|
||||
AdvSceneSwitcher.networkTab.client.status.currentStatus="Estado actual"
|
||||
AdvSceneSwitcher.networkTab.client.status.disconnected="Desconectado"
|
||||
AdvSceneSwitcher.networkTab.client.status.connecting="Conectando"
|
||||
AdvSceneSwitcher.networkTab.client.status.connected="Conectado"
|
||||
AdvSceneSwitcher.networkTab.client.reconnect="Forzar reconexión"
|
||||
|
||||
; Scene Group Tab
|
||||
AdvSceneSwitcher.sceneGroupTab.title="Grupo de escenas"
|
||||
AdvSceneSwitcher.sceneGroupTab.list="Grupos de escenas"
|
||||
@@ -667,30 +636,6 @@ AdvSceneSwitcher.sceneGroupTab.exists="El grupo de escenas o el nombre de la esc
|
||||
AdvSceneSwitcher.sceneGroupTab.help="Los grupos de escenas se pueden seleccionar como un objetivo al igual que una escena normal.\n\nComo sugiere el nombre, un grupo de escenas es una colección de varias escenas.\nEl grupo de escenas avanzará a través de la lista de sus escenas asignadas según los ajustes configurados, que se puede encontrar en el lado derecho.\n\nPuedes configurar el grupo de escenas para avanzar a la siguiente escena en la lista:\nDespués de varias veces, el grupo de escenas se selecciona como objetivo.\nDespués de que un cierto período de tiempo haya pasado.\nO al azar.\n\nPor ejemplo, un grupo de escenas que contiene las escenas ... \nEscena 1 \nEscena 2 \nEscena 3 \n ... activará la \"Escena 1 \" la primera vez que se seleccione como objetivo. \nLa segunda vez se activará \"Escena 2 \". \nLas veces restantes \"Escena 3 \" se activarán. \n\nHaz clic en el símbolo más resaltado a continuación para agregar un nuevo grupo de escenas."
|
||||
AdvSceneSwitcher.sceneGroupTab.scenes.help="Selecciona el grupo de escenas que deseas modificar a la izquierda. \n\nSelecciona una escena para agregar a este grupo de escenas seleccionando la escena de arriba y haciendo clic en el símbolo más a continuación. \n\nSe puede agregar una escena varias veces al mismo grupo de escenas."
|
||||
|
||||
; Scene Trigger Tab
|
||||
AdvSceneSwitcher.sceneTriggerTab.title="Activadores de escena"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.none="--selecciona el activador--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneActive="esté activo"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneInactive="no esté activo"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneLeave="cambie a otra escena"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.none="--Selecciona la acción--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startRecording="empezar a grabar"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.pauseRecording="pausar la grabación"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unpauseRecording="reanudar grabación"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopRecording="detener grabación"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopStreaming="detener transmisión"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startStreaming="iniciar transmisión"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startReplayBuffer="iniciar búfer de repetición"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopReplayBuffer="detener búfer de repetición"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.muteSource="silenciar fuente"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unmuteSource="dejar de silenciar fuente"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startSwitcher="iniciar el selector de escenas"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopSwitcher="detener el selector de escenas"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startVirtualCamera="Iniciar Camara Virtual"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopVirtualCamera="Detener Camara Virtual"
|
||||
AdvSceneSwitcher.sceneTriggerTab.entry="Cuando {{scenes}} {{triggers}} {{actions}} {{audioSources}} después de {{duration}}"
|
||||
AdvSceneSwitcher.sceneTriggerTab.help="Esta pestaña te permite activar acciones sobre cambios de escena, como detener la grabación o la transmisión."
|
||||
|
||||
; Hotkey
|
||||
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Iniciar Advanced Scene Switcher"
|
||||
AdvSceneSwitcher.hotkey.stopSwitcherHotkey="Detener Advanced Scene Switcher"
|
||||
@@ -744,7 +689,7 @@ AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>Esta parece ser la prim
|
||||
AdvSceneSwitcher.deprecatedTabWarning="¡Se detuvo el desarrollo de esta pestaña!\nConsidere cambiar a macros en su lugar.\nEsta sugerencia se puede desactivar en la pestaña General".
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="milisegundos"
|
||||
AdvSceneSwitcher.unit.secends="segundos"
|
||||
AdvSceneSwitcher.unit.seconds="segundos"
|
||||
AdvSceneSwitcher.unit.minutes="minutos"
|
||||
AdvSceneSwitcher.unit.hours="horas"
|
||||
AdvSceneSwitcher.duration.condition.none="Sin límite de tiempo"
|
||||
|
||||
@@ -19,11 +19,11 @@ AdvSceneSwitcher.generalTab.status.autoStart.streaming="Diffusion en continu"
|
||||
AdvSceneSwitcher.generalTab.status.autoStart.recordingAndStreaming="Enregistrement ou Diffusion en continu"
|
||||
AdvSceneSwitcher.generalTab.status.checkInterval="Vérifier les conditions toutes les"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior="Comportement général"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet="Si aucune action n'est effectuée pendant"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="Sera aussi précis que l'intervalle de vérification configuré."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Ne pas basculer"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Basculer vers n'importe quelle scène dans l'onglet Aléatoire"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Basculer vers :"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch="Si aucune action n'est effectuée pendant"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatchDelay.tooltip="Sera aussi précis que l'intervalle de vérification configuré."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch="Ne pas basculer"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Basculer vers n'importe quelle scène dans l'onglet Aléatoire"
|
||||
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.cooldownHint="Pendant cette période, les correspondances potentielles seront ignorées !"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Activer les journaux détaillés"
|
||||
@@ -109,7 +109,7 @@ AdvSceneSwitcher.macroTab.highlightExecutedMacros="Mettre en surbrillance les ma
|
||||
AdvSceneSwitcher.macroTab.highlightTrueConditions="Mettre en surbrillance les conditions de la macro actuellement sélectionnée qui ont évalué à vrai récemment"
|
||||
AdvSceneSwitcher.macroTab.highlightPerformedActions="Mettre en surbrillance les actions récemment effectuées de la macro actuellement sélectionnée"
|
||||
AdvSceneSwitcher.macroTab.newMacroRegisterHotkey="Enregistrer des raccourcis clavier pour contrôler l'état de pause des nouvelles macros"
|
||||
AdvSceneSwitcher.macroTab.currentDisableHotkeys="Enregistrer des raccourcis clavier pour contrôler l'état de pause de la macro sélectionnée"
|
||||
AdvSceneSwitcher.macroTab.currentRegisterHotkeys="Enregistrer des raccourcis clavier pour contrôler l'état de pause de la macro sélectionnée"
|
||||
AdvSceneSwitcher.macroTab.currentSkipExecutionOnStartup="Ignorer l'exécution des actions de la macro actuelle au démarrage"
|
||||
AdvSceneSwitcher.macroTab.currentRegisterDock="Enregistrer le widget du dock pour contrôler l'état de pause de la macro sélectionnée ou l'exécuter manuellement"
|
||||
AdvSceneSwitcher.macroTab.currentDockAddRunButton="Ajouter un bouton pour exécuter la macro"
|
||||
@@ -196,7 +196,7 @@ AdvSceneSwitcher.condition.media.source="Source"
|
||||
AdvSceneSwitcher.condition.media.anyOnScene="Toute source média sur la scène"
|
||||
AdvSceneSwitcher.condition.media.allOnScene="Toutes les sources média sur la scène"
|
||||
AdvSceneSwitcher.condition.media.inconsistencyInfo="Malheureusement, toutes les sources média ne se comportent pas de la même manière (par exemple, l'état \"Arrêté\" de la source Media par rapport à la source Vidéo VLC).\nPar conséquent, veuillez expérimenter ce qui fonctionne le mieux pour votre configuration !"
|
||||
AdvSceneSwitcher.condition.media.entry="{{sourceTypes}}{{mediaSources}}{{scenes}}l'état est{{states}}et{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.media.layout.legacy="{{sourceTypes}}{{mediaSources}}{{scenes}}{{checkTypes}}l'état est{{states}}et{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.video="Vidéo"
|
||||
AdvSceneSwitcher.condition.video.condition.match="correspond exactement à"
|
||||
AdvSceneSwitcher.condition.video.condition.differ="ne correspond pas à"
|
||||
@@ -382,8 +382,7 @@ AdvSceneSwitcher.condition.date.entry.nextMatchDate="Prochaine correspondance à
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}}À la répétition, mettre à jour la date sélectionnée pour la date de répétition"
|
||||
AdvSceneSwitcher.condition.sceneTransform="Transformation de l'élément de la scène"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="Obtenir la transformation"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line1="Sur{{scenes}}{{sources}}{{types}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.type.matches="correspond à la transformation"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.match="correspond à la transformation"
|
||||
AdvSceneSwitcher.condition.transition="Transition"
|
||||
AdvSceneSwitcher.condition.transition.type.current="Le type de transition actuel est"
|
||||
AdvSceneSwitcher.condition.transition.type.duration="La durée de la transition actuelle est"
|
||||
@@ -455,7 +454,7 @@ AdvSceneSwitcher.condition.slideshow="Diaporama"
|
||||
AdvSceneSwitcher.condition.slideshow.condition.slideChanged="Diapositive changée"
|
||||
AdvSceneSwitcher.condition.slideshow.condition.slideIndex="Le numéro de la diapositive actuelle est"
|
||||
AdvSceneSwitcher.condition.slideshow.condition.slidePath="Le chemin de la diapositive actuelle est"
|
||||
AdvSceneSwitcher.condition.slideshow.updateIntervalTooltip="Les informations sur l'état du diaporama ne seront mises à jour qu'en fonction du temps configuré entre les diapositives"
|
||||
AdvSceneSwitcher.condition.slideshow.updateInterval.tooltip="Les informations sur l'état du diaporama ne seront mises à jour qu'en fonction du temps configuré entre les diapositives"
|
||||
|
||||
; Macro Actions
|
||||
AdvSceneSwitcher.action.scene="Changer de scène"
|
||||
@@ -611,7 +610,7 @@ AdvSceneSwitcher.action.sceneTransform.type.centerToScreen="Centrer à l'écran"
|
||||
AdvSceneSwitcher.action.sceneTransform.type.centerVertically="Centrer verticalement"
|
||||
AdvSceneSwitcher.action.sceneTransform.type.centerHorizontally="Centrer horizontalement"
|
||||
AdvSceneSwitcher.action.sceneTransform.getTransform="Obtenir la transformation"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="Sur{{scenes}}{{action}}{{rotation}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="Sur{{scenes}}{{action}}{{rotation}}{{sources}}{{settingSelection}}{{singleSettingValue}}"
|
||||
AdvSceneSwitcher.action.file="Fichier"
|
||||
AdvSceneSwitcher.action.file.type.write="Écrire"
|
||||
AdvSceneSwitcher.action.file.type.append="Ajouter"
|
||||
@@ -650,7 +649,7 @@ AdvSceneSwitcher.action.screenshot.type.source="Source"
|
||||
AdvSceneSwitcher.action.screenshot.type.scene="Scène"
|
||||
AdvSceneSwitcher.action.screenshot.mainOutput="Sortie principale d'OBS"
|
||||
AdvSceneSwitcher.action.screenshot.blackscreenNote="Les sources ou les scènes qui ne sont pas toujours rendues peuvent entraîner des parties de captures d'écran vides."
|
||||
AdvSceneSwitcher.action.screenshot.entry="Capturer{{targetType}}{{sources}}{{scenes}}et enregistrer à l'emplacement{{saveType}}"
|
||||
AdvSceneSwitcher.action.screenshot.entry="Capturer{{targetType}}{{sources}}{{scenes}}et enregistrer à l'emplacement{{saveType}}{{variables}}"
|
||||
AdvSceneSwitcher.action.profile="Profil"
|
||||
AdvSceneSwitcher.action.profile.entry="Changer le profil actif vers{{profiles}}"
|
||||
AdvSceneSwitcher.action.sceneCollection="Collection de scènes"
|
||||
@@ -898,31 +897,6 @@ AdvSceneSwitcher.videoTab.ignoreInactiveSource="sauf si la source est inactive"
|
||||
AdvSceneSwitcher.videoTab.entry="Lorsque{{videoSources}}{{condition}}{{filePath}}{{browseButton}}pendant{{duration}}, passez à{{scenes}}en utilisant{{transitions}}{{ignoreInactiveSource}}"
|
||||
AdvSceneSwitcher.videoTab.help="<html><head/><body><p>Cet onglet vous permettra de basculer entre les scènes en fonction de la sortie vidéo actuelle des sources sélectionnées.<br/>Assurez-vous de consulter <a href=\"https://obsproject.com/forum/resources/pixel-match-switcher.1202/\"><span style=\" text-decoration: underline; color:#268bd2;\">Pixel Match Switcher</span></a> pour une implémentation encore meilleure de cette fonctionnalité.<br/><br/> Cliquez sur le symbole plus en surbrillance pour continuer.</p></body></html>"
|
||||
|
||||
; Network Tab
|
||||
AdvSceneSwitcher.networkTab.title="Réseau"
|
||||
AdvSceneSwitcher.networkTab.description="Cet onglet vous permettra de contrôler à distance la scène active d'une autre instance OBS.\nVeuillez noter que les noms de scènes doivent correspondre exactement sur toutes les instances OBS."
|
||||
AdvSceneSwitcher.networkTab.warning="Exécuter le serveur en dehors d'un réseau local permettra à des tiers de lire la scène active."
|
||||
AdvSceneSwitcher.networkTab.server="Démarrer le serveur (Envoie des messages de changement de scène à tous les clients connectés)"
|
||||
AdvSceneSwitcher.networkTab.server.port="Port"
|
||||
AdvSceneSwitcher.networkTab.server.lockToIPv4="Verrouiller le serveur pour n'utiliser que IPv4"
|
||||
AdvSceneSwitcher.networkTab.server.sendSceneChange="Envoyer des messages pour les changements de scène"
|
||||
AdvSceneSwitcher.networkTab.server.restrictSendToAutomatedSwitches="Envoyer uniquement des messages pour les changements de scène automatisés"
|
||||
AdvSceneSwitcher.networkTab.server.sendPreview="Envoyer des messages pour le changement de prévisualisation de scène lors de l'exécution en mode Studio"
|
||||
AdvSceneSwitcher.networkTab.startFailed.message="Le serveur WebSocket n'a pas pu démarrer, peut-être parce que :\n - Le port TCP %1 est peut-être déjà utilisé ailleurs sur ce système, éventuellement par une autre application. Essayez de définir un port TCP différent dans les paramètres du serveur WebSocket, ou arrêtez toute application qui pourrait utiliser ce port.\n - Message d'erreur : %2"
|
||||
AdvSceneSwitcher.networkTab.server.status.currentStatus="État actuel"
|
||||
AdvSceneSwitcher.networkTab.server.status.notRunning="Non démarré"
|
||||
AdvSceneSwitcher.networkTab.server.status.starting="Démarrage"
|
||||
AdvSceneSwitcher.networkTab.server.status.running="En cours d'exécution"
|
||||
AdvSceneSwitcher.networkTab.server.restart="Redémarrer le serveur"
|
||||
AdvSceneSwitcher.networkTab.client="Démarrer le client (Reçoit des messages de changement de scène)"
|
||||
AdvSceneSwitcher.networkTab.client.address="Nom d'hôte ou adresse IP"
|
||||
AdvSceneSwitcher.networkTab.client.port="Port"
|
||||
AdvSceneSwitcher.networkTab.client.status.currentStatus="État actuel"
|
||||
AdvSceneSwitcher.networkTab.client.status.disconnected="Déconnecté"
|
||||
AdvSceneSwitcher.networkTab.client.status.connecting="Connexion"
|
||||
AdvSceneSwitcher.networkTab.client.status.connected="Connecté"
|
||||
AdvSceneSwitcher.networkTab.client.reconnect="Forcer la reconnexion"
|
||||
|
||||
; Scene Group Tab
|
||||
AdvSceneSwitcher.sceneGroupTab.title="Groupe de Scènes"
|
||||
AdvSceneSwitcher.sceneGroupTab.list="Groupes de Scènes"
|
||||
@@ -943,30 +917,6 @@ AdvSceneSwitcher.sceneGroupTab.exists="Le nom du Groupe de Scènes ou de la Scè
|
||||
AdvSceneSwitcher.sceneGroupTab.help="Les Groupes de Scènes peuvent être sélectionnés comme une cible, tout comme une scène régulière.\n\nComme son nom l'indique, un Groupe de Scènes est une collection de plusieurs scènes.\nLe Groupe de Scènes avancera dans la liste de ses scènes attribuées en fonction des paramètres configurés, que vous pouvez trouver à droite.\n\nVous pouvez configurer le Groupe de Scènes pour passer à la scène suivante dans la liste :\nAprès un certain nombre de fois où le Groupe de Scènes est sélectionné comme cible.\nAprès qu'un certain laps de temps se soit écoulé.\nOu au hasard.\n\nPar exemple, un Groupe de Scènes contenant les scènes...\nScène 1\nScène 2\nScène 3\n... activera "Scène 1" la première fois qu'il est sélectionné comme cible.\nLa deuxième fois, il activera "Scène 2".\nLes fois suivantes, "Scène 3" sera activée.\n\nCliquez sur le symbole plus en surbrillance ci-dessous pour ajouter un nouveau Groupe de Scènes."
|
||||
AdvSceneSwitcher.sceneGroupTab.scenes.help="Sélectionnez le groupe de scènes que vous souhaitez modifier à gauche.\n\nSélectionnez une scène à ajouter à ce groupe de scènes en sélectionnant la scène ci-dessus et en cliquant sur le symbole plus ci-dessous.\n\nUne scène peut être ajoutée plusieurs fois au même groupe de scènes."
|
||||
|
||||
; Scene Trigger Tab
|
||||
AdvSceneSwitcher.sceneTriggerTab.title="Déclencheurs de Scène"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.none="--sélectionnez un déclencheur--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneActive="est active"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneInactive="n'est pas active"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneLeave="passé à autre chose"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.none="--sélectionnez une action--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startRecording="démarrer l'enregistrement"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.pauseRecording="mettre en pause l'enregistrement"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unpauseRecording="reprendre l'enregistrement"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopRecording="arrêter l'enregistrement"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopStreaming="arrêter la diffusion"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startStreaming="démarrer la diffusion"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startReplayBuffer="démarrer le tampon de répétition"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopReplayBuffer="arrêter le tampon de répétition"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.muteSource="mettre la source en sourdine"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unmuteSource="annuler la mise en sourdine de la source"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startSwitcher="démarrer le commutateur de scènes avancé"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopSwitcher="arrêter le commutateur de scènes avancé"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startVirtualCamera="démarrer la caméra virtuelle"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopVirtualCamera="arrêter la caméra virtuelle"
|
||||
AdvSceneSwitcher.sceneTriggerTab.entry="Lorsque{{scenes}}{{triggers}}{{actions}}{{audioSources}}après{{duration}}"
|
||||
AdvSceneSwitcher.sceneTriggerTab.help="Cet onglet vous permet de déclencher des actions lors des changements de scènes, comme l'arrêt de l'enregistrement ou de la diffusion."
|
||||
|
||||
; Hotkey
|
||||
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Démarrer le commutateur de scènes avancé"
|
||||
AdvSceneSwitcher.hotkey.stopSwitcherHotkey="Arrêter le commutateur de scènes avancé"
|
||||
@@ -1162,8 +1112,8 @@ AdvSceneSwitcher.sceneItemSelection.type.sourceName="Nom de la source"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceVariable="Nom de la variable"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern="Le nom de la source correspond au motif"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceNamePattern.entry="{{nameConflictIndex}}correspondant à{{pattern}}{{regex}}"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup="Sources de type"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceGroup.entry="{{nameConflictIndex}}Type de source{{sourceGroups}}"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType="Sources de type"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.sourceType.entry="{{nameConflictIndex}}Type de source{{sourceTypes}}"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.index="Source avec index"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.index.entry="{{index}}source"
|
||||
AdvSceneSwitcher.sceneItemSelection.type.indexRange="Sources dans la plage d'index"
|
||||
@@ -1183,7 +1133,7 @@ AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>Il semble que ce soit l
|
||||
AdvSceneSwitcher.deprecatedTabWarning="Le développement de cet onglet est terminé !\nVeuillez envisager de passer à l'utilisation des Macros à la place.\nCette astuce peut être désactivée dans l'onglet Général."
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="millisecondes"
|
||||
AdvSceneSwitcher.unit.secends="secondes"
|
||||
AdvSceneSwitcher.unit.seconds="secondes"
|
||||
AdvSceneSwitcher.unit.minutes="minutes"
|
||||
AdvSceneSwitcher.unit.hours="heures"
|
||||
AdvSceneSwitcher.duration.condition.none="Aucun modificateur de durée"
|
||||
|
||||
2157
data/locale/ja-JP.ini
Normal file
2157
data/locale/ja-JP.ini
Normal file
File diff suppressed because it is too large
Load Diff
2087
data/locale/pt-BR.ini
Normal file
2087
data/locale/pt-BR.ini
Normal file
File diff suppressed because it is too large
Load Diff
@@ -19,11 +19,11 @@ AdvSceneSwitcher.generalTab.status.autoStart.streaming="Вещание"
|
||||
AdvSceneSwitcher.generalTab.status.autoStart.recordingAndStreaming="Запись или потоковое вещание"
|
||||
AdvSceneSwitcher.generalTab.status.checkInterval="Проверять условия переключения каждый раз"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior="Общее поведение"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet="Если не выполняется условие переключения для"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="Будет только настолько точным, насколько настроен интервал проверки."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Не переключаться"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Переключиться на любую сцену на вкладке Random"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Переключиться на:"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch="Если не выполняется условие переключения для"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatchDelay.tooltip="Будет только настолько точным, насколько настроен интервал проверки."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch="Не переключаться"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Переключиться на любую сцену на вкладке Random"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="Переключиться на:"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="В течение этого времени потенциальные совпадения будут игнорироваться!"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Включить ведение подробного журнала"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Сохранять положение и размер окна"
|
||||
@@ -137,7 +137,6 @@ AdvSceneSwitcher.action.replay="Буфер воспроизведения"
|
||||
AdvSceneSwitcher.action.replay.type.stop="Остановить буфер воспроизведения"
|
||||
AdvSceneSwitcher.action.replay.type.start="Начать воспроизведение буфера"
|
||||
AdvSceneSwitcher.action.replay.type.save="Сохранить буфер воспроизведения"
|
||||
AdvSceneSwitcher.action.replay.entry="{{actions}}"
|
||||
AdvSceneSwitcher.action.streaming="Потоковое вещание"
|
||||
AdvSceneSwitcher.action.streaming.type.stop="Остановить потоковое вещание"
|
||||
AdvSceneSwitcher.action.streaming.type.start="Начать потоковое вещание"
|
||||
@@ -308,28 +307,6 @@ AdvSceneSwitcher.videoTab.ignoreInactiveSource="если источник неа
|
||||
AdvSceneSwitcher.videoTab.entry="Когда {{videoSources}} {{condition}} {{filePath}} {{browseButton}} для {{duration}} переключиться на {{scenes}} используя {{transitions}} {{ignoreInactiveSource}}"
|
||||
AdvSceneSwitcher.videoTab.help="<html><head/><body><p>Эта вкладка позволит вам переключать сцены на основе текущего видеовыхода выбранных источников.<br/>Обязательно проверьте <a href=\"https://obsproject.com/forum/resources/pixel-match-switcher.1202/\"><span style=\" text-decoration: underline; color:#268bd2;\">Pixel Match Switcher</span></a> для еще лучшей реализации этой функциональности.<br/><br/> Нажмите на выделенный символ плюса, чтобы продолжить.</p></body></html>"
|
||||
|
||||
; Network Tab
|
||||
AdvSceneSwitcher.networkTab.title="Сеть"
|
||||
AdvSceneSwitcher.networkTab.warning="Запуск сервера вне локальной сети позволит третьим лицам читать активную сцену."
|
||||
AdvSceneSwitcher.networkTab.server="Запустить сервер (отправляет сообщения о переключении сцены всем подключенным клиентам)"
|
||||
AdvSceneSwitcher.networkTab.server.port="Порт"
|
||||
AdvSceneSwitcher.networkTab.server.lockToIPv4="Заблокировать сервер на использование только IPv4"
|
||||
AdvSceneSwitcher.networkTab.server.restrictSendToAutomatedSwitches="Отправлять сообщения только для автоматических переключателей сцен"
|
||||
AdvSceneSwitcher.networkTab.startFailed.message="Сервер WebSockets не удалось запустить, возможно потому, что:\n - TCP порт %1 может в настоящее время использоваться в другом месте в этой системе, возможно, другим приложением. Попробуйте установить другой TCP порт в настройках сервера WebSocket, или остановите любое приложение, которое может использовать этот порт.\n - Сообщение об ошибке: %2"
|
||||
AdvSceneSwitcher.networkTab.server.status.currentStatus="Текущий статус"
|
||||
AdvSceneSwitcher.networkTab.server.status.notRunning="Не запущен"
|
||||
AdvSceneSwitcher.networkTab.server.status.starting="Запуск"
|
||||
AdvSceneSwitcher.networkTab.server.status.running="Работает"
|
||||
AdvSceneSwitcher.networkTab.server.restart="Перезапустить сервер"
|
||||
AdvSceneSwitcher.networkTab.client="Запустить клиент (Получает сообщения о переключении сцен)"
|
||||
AdvSceneSwitcher.networkTab.client.address="Имя хоста или IP-адрес"
|
||||
AdvSceneSwitcher.networkTab.client.port="Порт"
|
||||
AdvSceneSwitcher.networkTab.client.status.currentStatus="Текущий статус"
|
||||
AdvSceneSwitcher.networkTab.client.status.disconnected="Отключено"
|
||||
AdvSceneSwitcher.networkTab.client.status.connecting="Подключение"
|
||||
AdvSceneSwitcher.networkTab.client.status.connected="Подключено"
|
||||
AdvSceneSwitcher.networkTab.client.reconnect="Принудительное переподключение"
|
||||
|
||||
; Scene Group Tab
|
||||
AdvSceneSwitcher.sceneGroupTab.title="Группа сцен"
|
||||
AdvSceneSwitcher.sceneGroupTab.list="Группы сцен"
|
||||
@@ -350,28 +327,6 @@ AdvSceneSwitcher.sceneGroupTab.exists="Группа сцен или назван
|
||||
AdvSceneSwitcher.sceneGroupTab.help="Группы сцен могут быть выбраны в качестве цели так же, как и обычные сцены.\n\nКак следует из названия, группа сцен представляет собой набор из нескольких сцен.\nГруппа сцен будет продвигаться по списку назначенных ей сцен в зависимости от настроенных параметров, которые можно найти справа.\n\nВы можете настроить группу сцен на переход к следующей сцене в списке:\nПосле определенного количества раз, когда группа сцен выбрана в качестве цели.\nПо истечении определенного времени.\nИли случайным образом.\n\nНапример, группа сцен, содержащая сцены ...\nScene 1\nScene 2\nScene 3 \n... активирует \"Scene 1\" в первый раз, когда он выбран в качестве цели.\nВо второй раз он активируется \"Scene 2\".\nОставшееся время \"Scene 3\" будет активирован.\n\nНажмите на выделенный символ плюса ниже, чтобы добавить новую группу сцен."
|
||||
AdvSceneSwitcher.sceneGroupTab.scenes.help="Выберите группу сцен, которую вы хотите изменить слева.\n\nВыберите сцену для добавления в эту группу сцен, выбрав сцену выше и нажав на символ плюса ниже.\n\nСцена может быть добавлена несколько раз в одну и ту же группу сцен."
|
||||
|
||||
; Scene Trigger Tab
|
||||
AdvSceneSwitcher.sceneTriggerTab.title="Триггеры сцены"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.none="--выбрать триггер--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneActive="активен"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneInactive="не активен"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneLeave="переключился с"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.none="--выбрать действие--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startRecording="начать запись"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.pauseRecording="приостановить запись"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unpauseRecording="отменить паузу записи"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopRecording="остановить запись"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopStreaming="остановить потоковое вещание"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startStreaming="начать потоковое вещание"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startReplayBuffer="запустить буфер воспроизведения"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopReplayBuffer="остановить буфер воспроизведения"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.muteSource="отключить источник"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unmuteSource="включить источник"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startSwitcher="запустить переключатель сцены"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopSwitcher="остановить переключатель сцены"
|
||||
AdvSceneSwitcher.sceneTriggerTab.entry="Когда {{scenes}} {{triggers}} {{actions}} {{audioSources}} после {{duration}}"
|
||||
AdvSceneSwitcher.sceneTriggerTab.help="Эта вкладка позволяет запускать действия при изменении сцены, например, остановку записи или потоковой передачи."
|
||||
|
||||
; Hotkey
|
||||
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Запустить Advanced Scene Switcher"
|
||||
AdvSceneSwitcher.hotkey.stopSwitcherHotkey="становить Advanced Scene Switcher"
|
||||
@@ -400,6 +355,6 @@ AdvSceneSwitcher.status.active="Активный"
|
||||
AdvSceneSwitcher.status.inactive="Неактивен"
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="миллисекунды"
|
||||
AdvSceneSwitcher.unit.secends="секунды"
|
||||
AdvSceneSwitcher.unit.seconds="секунды"
|
||||
AdvSceneSwitcher.unit.minutes="минуты"
|
||||
AdvSceneSwitcher.unit.hours="часы"
|
||||
|
||||
@@ -19,11 +19,11 @@ AdvSceneSwitcher.generalTab.status.autoStart.streaming="Yayın"
|
||||
AdvSceneSwitcher.generalTab.status.autoStart.recordingAndStreaming="Kayıt veya Yayın"
|
||||
AdvSceneSwitcher.generalTab.status.checkInterval="Anahtar koşullarını her seferinde kontrol edin"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior="Genel davranış"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet="...için herhangi bir işlem yapılmazsa"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="Yalnızca yapılandırılmış kontrol aralığı kadar doğru olacaktır."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Geçiş Yapma"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Rastgele sekmesinde herhangi bir sahneye geçin"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Değiştirmek:"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch="...için herhangi bir işlem yapılmazsa"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatchDelay.tooltip="Yalnızca yapılandırılmış kontrol aralığı kadar doğru olacaktır."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch="Geçiş Yapma"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="Rastgele sekmesinde herhangi bir sahneye geçin"
|
||||
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.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"
|
||||
@@ -107,8 +107,6 @@ AdvSceneSwitcher.condition.scene.type.previous="Önceki Sahne"
|
||||
AdvSceneSwitcher.condition.scene.type.changed="Sahne değişti"
|
||||
AdvSceneSwitcher.condition.scene.type.notChanged="Sahne değişmedi"
|
||||
AdvSceneSwitcher.condition.scene.currentSceneTransitionBehaviour="Geçiş hedefi sahnesi için geçiş kontrolü sırasında"
|
||||
AdvSceneSwitcher.condition.scene.entry.line1="{{sceneType}}{{scenes}}{{pattern}}"
|
||||
AdvSceneSwitcher.condition.scene.entry.line2="{{useTransitionTargetScene}}"
|
||||
AdvSceneSwitcher.condition.window="Pencere"
|
||||
AdvSceneSwitcher.condition.file="Dosya"
|
||||
AdvSceneSwitcher.condition.file.entry.line1="İçerik{{fileType}}{{filePath}}{{conditions}}{{useRegex}}"
|
||||
@@ -117,7 +115,7 @@ AdvSceneSwitcher.condition.file.entry.line3="{{checkModificationDate}}{{checkFil
|
||||
AdvSceneSwitcher.condition.media="Medya"
|
||||
AdvSceneSwitcher.condition.media.anyOnScene="Herhangi bir medya kaynağı"
|
||||
AdvSceneSwitcher.condition.media.allOnScene="Tüm medya kaynakları "
|
||||
AdvSceneSwitcher.condition.media.entry="{{sourceTypes}}{{mediaSources}}{{scenes}}durumu{{states}}ve{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.media.layout.legacy="{{sourceTypes}}{{mediaSources}}{{scenes}}{{checkTypes}}durumu{{states}}ve{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.video="Video"
|
||||
AdvSceneSwitcher.condition.video.condition.match="Tam olarak eşleşir"
|
||||
AdvSceneSwitcher.condition.video.condition.differ="Eşleştirme"
|
||||
@@ -226,10 +224,7 @@ AdvSceneSwitcher.condition.date.state.before="Önce"
|
||||
AdvSceneSwitcher.condition.date.state.between="Arasında"
|
||||
AdvSceneSwitcher.condition.sceneTransform="Sahne öğesi dönüşümü"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="Dönüşümü al"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line1="Açık{{scenes}}{{sources}}{{types}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.type.matches="dönüşümle eşleşir"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line2="{{settings}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line3="{{regex}} {{getSettings}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.match="dönüşümle eşleşir"
|
||||
AdvSceneSwitcher.condition.transition="Geçiş"
|
||||
AdvSceneSwitcher.condition.transition.type.current="Geçerli geçiş türü"
|
||||
AdvSceneSwitcher.condition.transition.type.duration="Mevcut geçiş süresi"
|
||||
@@ -279,7 +274,6 @@ AdvSceneSwitcher.action.replay="Tekrar arabelleği"
|
||||
AdvSceneSwitcher.action.replay.type.stop="Tekrar arabelleğini durdur"
|
||||
AdvSceneSwitcher.action.replay.type.start="Tekrar arabelleğini başlat"
|
||||
AdvSceneSwitcher.action.replay.type.save="Tekrar arabelleğini kaydet"
|
||||
AdvSceneSwitcher.action.replay.entry="{{actions}}"
|
||||
AdvSceneSwitcher.action.streaming="Yayın"
|
||||
AdvSceneSwitcher.action.streaming.type.stop="Yayın durdur"
|
||||
AdvSceneSwitcher.action.streaming.type.start="Yayın başlat"
|
||||
@@ -345,7 +339,7 @@ AdvSceneSwitcher.action.sceneOrder.type.movePosition="Konuma taşı"
|
||||
AdvSceneSwitcher.action.sceneOrder.entry="Açık{{scenes}}{{actions}}{{sources}}{{position}}"
|
||||
AdvSceneSwitcher.action.sceneTransform="Sahne öğesi dönüşümü"
|
||||
AdvSceneSwitcher.action.sceneTransform.getTransform="Dönüşümü al"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="Açık{{scenes}}{{action}}{{rotation}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="Açık{{scenes}}{{action}}{{rotation}}{{sources}}{{settingSelection}}{{singleSettingValue}}"
|
||||
AdvSceneSwitcher.action.file="Dosya"
|
||||
AdvSceneSwitcher.action.file.type.write="Yaz"
|
||||
AdvSceneSwitcher.action.file.type.append="Ekle"
|
||||
@@ -533,31 +527,6 @@ AdvSceneSwitcher.videoTab.ignoreInactiveSource="Kaynak etkin olmadığı sürece
|
||||
AdvSceneSwitcher.videoTab.entry="Zaman {{videoSources}} {{condition}} {{filePath}} {{browseButton}} için {{duration}} şuna dönüştür {{scenes}} kullan {{transitions}} {{ignoreInactiveSource}}"
|
||||
AdvSceneSwitcher.videoTab.help="<html><head/><body><p>Bu sekme, seçilen kaynakların mevcut video çıkışına göre sahneler arasında geçiş yapmanızı sağlar.<br/><a href=\"https:// adresini kontrol ettiğinizden emin olun. obsproject.com/forum/resources/pixel-match-switcher.1202/\"><span style=\" text-decoration: underline; color:#268bd2;\">Pixel Match Switcher</span></a> bu işlevin daha da iyi bir şekilde uygulanması için.<br/><br/> Devam etmek için vurgulanan artı simgesini tıklayın.</p></body></html>"
|
||||
|
||||
; Network Tab
|
||||
AdvSceneSwitcher.networkTab.title="Ağ"
|
||||
AdvSceneSwitcher.networkTab.description="Bu sekme, başka bir OBS örneğinin etkin sahnesini uzaktan kontrol etmenizi sağlar.\nSahne adlarının tüm OBS örneklerinde tam olarak eşleşmesi gerektiğini lütfen unutmayın."
|
||||
AdvSceneSwitcher.networkTab.warning="Sunucuyu yerel bir ağın dışında çalıştırmak, üçüncü tarafların aktif sahneyi okumasına izin verecektir."
|
||||
AdvSceneSwitcher.networkTab.server="Sunucuyu başlat (Bağlı tüm istemcilere sahne değiştirme mesajları gönderir)"
|
||||
AdvSceneSwitcher.networkTab.server.port="Port"
|
||||
AdvSceneSwitcher.networkTab.server.lockToIPv4="Sunucuyu yalnızca IPv4 kullanacak şekilde kilitleyin"
|
||||
AdvSceneSwitcher.networkTab.server.sendSceneChange="Sahne değişiklikleri için mesaj gönder"
|
||||
AdvSceneSwitcher.networkTab.server.restrictSendToAutomatedSwitches="Yalnızca otomatik sahne anahtarları için mesaj gönder"
|
||||
AdvSceneSwitcher.networkTab.server.sendPreview="Stüdyo modunda çalışırken önizleme sahnesi değişikliği için mesajlar gönderin"
|
||||
AdvSceneSwitcher.networkTab.startFailed.message="WebSockets sunucusu başlatılamadı, bunun nedeni şunlar olabilir:\n - %1 TCP bağlantı noktası şu anda bu sistemde başka bir yerde, muhtemelen başka bir uygulama tarafından kullanılıyor olabilir. WebSocket sunucu ayarlarında farklı bir TCP bağlantı noktası ayarlamayı deneyin veya bu bağlantı noktasını kullanabilecek herhangi bir uygulamayı durdurun.\n - Hata mesajı: %2"
|
||||
AdvSceneSwitcher.networkTab.server.status.currentStatus="Şu anki durum"
|
||||
AdvSceneSwitcher.networkTab.server.status.notRunning="Çalışmıyor"
|
||||
AdvSceneSwitcher.networkTab.server.status.starting="Başlangıç"
|
||||
AdvSceneSwitcher.networkTab.server.status.running="Çalışıyor"
|
||||
AdvSceneSwitcher.networkTab.server.restart="Sunucuyu yeniden başlat"
|
||||
AdvSceneSwitcher.networkTab.client="İstemciyi başlat (Sahne değiştirme mesajlarını alır)"
|
||||
AdvSceneSwitcher.networkTab.client.address="Ana makine adı veya IP adresi"
|
||||
AdvSceneSwitcher.networkTab.client.port="Port"
|
||||
AdvSceneSwitcher.networkTab.client.status.currentStatus="Şu anki durum"
|
||||
AdvSceneSwitcher.networkTab.client.status.disconnected="Bağlantı kesildi"
|
||||
AdvSceneSwitcher.networkTab.client.status.connecting="Bağlanıyor"
|
||||
AdvSceneSwitcher.networkTab.client.status.connected="Bağlandı"
|
||||
AdvSceneSwitcher.networkTab.client.reconnect="Yeniden bağlanmaya zorla"
|
||||
|
||||
; Scene Group Tab
|
||||
AdvSceneSwitcher.sceneGroupTab.title="Sahne Grubu"
|
||||
AdvSceneSwitcher.sceneGroupTab.list="Sahne Grupları"
|
||||
@@ -578,30 +547,6 @@ AdvSceneSwitcher.sceneGroupTab.exists="Sahne Grubu veya Sahne adı zaten var"
|
||||
AdvSceneSwitcher.sceneGroupTab.help="Sahne Grupları, normal bir sahne gibi bir hedef olarak seçilebilir.\n\nAdından da anlaşılacağı gibi, bir sahne grubu birden fazla sahneden oluşan bir koleksiyondur.\nSahne grubu, yapılandırılmış ayarlara bağlı olarak kendisine atanan sahneler listesinde ilerleyecektir. sağ tarafta bulunabilir.\n\nSahne grubunu listedeki bir sonraki sahneye geçecek şekilde yapılandırabilirsiniz:\nSahne grubu birkaç kez hedef olarak seçildikten sonra.\nBelirli bir süre sonra geçti.\nVeya rastgele.\n\nÖrneğin, sahneleri içeren bir sahne grubu ...\nSahne 1\nSahne 2\nSahne 3 \n... ilk seçildiğinde \"Sahne 1\"i etkinleştirecek bir hedef olarak.\nİkinci kez \"Sahne 2\"yi etkinleştirecek.\nKalan zamanlar \"Scene 3\" etkinleştirilecek.\n\nYeni bir sahne grubu eklemek için aşağıdaki vurgulanan artı sembolüne tıklayın."
|
||||
AdvSceneSwitcher.sceneGroupTab.scenes.help="Soldan değiştirmek istediğiniz sahne grubunu seçin.\n\nYukarıdaki sahneyi seçip aşağıdaki artı simgesini tıklayarak bu sahne grubuna eklemek için bir sahne seçin.\n\nAynı sahneye birden fazla sahne eklenebilir grup."
|
||||
|
||||
; Scene Trigger Tab
|
||||
AdvSceneSwitcher.sceneTriggerTab.title="Sahne Tetikleyicileri"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.none="--tetikleyiciyi seçin--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneActive="aktif"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneInactive="aktif değil"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneLeave="uzaklaştı"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.none="--eylemi seç--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startRecording="Kayda başla"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.pauseRecording="Kaydı duraklat"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unpauseRecording="kaydı duraklatma"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopRecording="Kaydetmeyi bırak"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopStreaming="Akışı durdur"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startStreaming="Akışı başlat"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startReplayBuffer="Yeniden oynatma arabelleğini başlat"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopReplayBuffer="Tekrar arabelleğini durdur"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.muteSource="Kaynağı sessize al"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unmuteSource="Kaynağı sesi aç"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startSwitcher="Sahne değiştiriciyi başlat"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopSwitcher="Sahne değiştiriciyi durdur"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startVirtualCamera="Sanal kamerayı başlat"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopVirtualCamera="Sanal kamerayı durdur"
|
||||
AdvSceneSwitcher.sceneTriggerTab.entry="Şundan {{scenes}} {{triggers}} {{actions}} {{audioSources}} sonra {{duration}}"
|
||||
AdvSceneSwitcher.sceneTriggerTab.help="Bu sekme, kaydı veya akışı durdurma gibi sahne değişikliklerinde eylemleri tetiklemenize olanak tanır."
|
||||
|
||||
; Hotkey
|
||||
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Advanced Scene Switcher'ı başlatın"
|
||||
AdvSceneSwitcher.hotkey.stopSwitcherHotkey="Gelişmiş Sahne Değiştiriciyi Durdurun"
|
||||
@@ -649,7 +594,7 @@ AdvSceneSwitcher.stopped="Eklenti durdu"
|
||||
AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>Gelişmiş Sahne Değiştirici ilk kez başlatılıyor gibi görünüyor.<br>Lütfen <a href=\"https://github.com/ adresine bir göz atın. WarmUpTill/SceneSwitcher/wiki\"><span style=\" text-decoration: underline; color:#268bd2;\">Wiki</span></a> için kılavuzlar ve örnekler listesi.<br>Yapmayın. eklentinin <a href=\"https://obsproject.com/forum/threads/advanced-scene-switcher.48264\"><span style=\" text-decoration: underline; color:# sayfasında soru sormaktan çekinmeyin OBS forumlarında 268bd2;\">konu</span></a>!</p></body></html>"
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="millisaniye"
|
||||
AdvSceneSwitcher.unit.secends="saniye"
|
||||
AdvSceneSwitcher.unit.seconds="saniye"
|
||||
AdvSceneSwitcher.unit.minutes="dakika"
|
||||
AdvSceneSwitcher.unit.hours="saat"
|
||||
AdvSceneSwitcher.duration.condition.none="Zaman kısıtlaması yok"
|
||||
|
||||
@@ -19,11 +19,11 @@ AdvSceneSwitcher.generalTab.status.autoStart.streaming="推流"
|
||||
AdvSceneSwitcher.generalTab.status.autoStart.recordingAndStreaming="录制和推流"
|
||||
AdvSceneSwitcher.generalTab.status.checkInterval="检查切换条件时间间隔"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior="全局行为"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet="如果不符合任何切换条件"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="时间精度最高只能达到配置的轮询间隔"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="不切换"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="切换到随机场景列表中任意随机场景"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="切换到"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch="如果不符合任何切换条件"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatchDelay.tooltip="时间精度最高只能达到配置的轮询间隔"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.dontSwitch="不切换"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchToRandom="切换到随机场景列表中任意随机场景"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMatch.switchTo="切换到"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="执行完操作后,跳过执行操作,为"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="在此期间,可能的匹配项将被忽略!"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="详细日志输出"
|
||||
@@ -101,7 +101,7 @@ AdvSceneSwitcher.macroTab.highlightExecutedMacros="突出显示最近执行的
|
||||
AdvSceneSwitcher.macroTab.highlightTrueConditions="突出显示最近运算为 真 的当前选定宏的条件"
|
||||
AdvSceneSwitcher.macroTab.highlightPerformedActions="突出显示当前选定宏的最近执行的操作"
|
||||
AdvSceneSwitcher.macroTab.newMacroRegisterHotkey="使用快捷键控制新增宏的暂停状态"
|
||||
AdvSceneSwitcher.macroTab.currentDisableHotkeys="使用快捷键控制所选宏的暂停状态"
|
||||
AdvSceneSwitcher.macroTab.currentRegisterHotkeys="使用快捷键控制所选宏的暂停状态"
|
||||
AdvSceneSwitcher.macroTab.currentRegisterDock="注册停靠小部件以控制所选宏的暂停状态或手动运行它"
|
||||
AdvSceneSwitcher.macroTab.currentDockAddRunButton="添加按钮以运行宏"
|
||||
AdvSceneSwitcher.macroTab.currentDockAddPauseButton="添加按钮以暂停或取消暂停宏"
|
||||
@@ -159,8 +159,6 @@ AdvSceneSwitcher.condition.scene.type.currentPattern="当前场景匹配"
|
||||
AdvSceneSwitcher.condition.scene.type.previousPattern="上一个场景匹配"
|
||||
AdvSceneSwitcher.condition.scene.currentSceneTransitionBehaviour="在转场过程中检查转场源场景"
|
||||
AdvSceneSwitcher.condition.scene.previousSceneTransitionBehaviour="在转场过程中检查转场源场景"
|
||||
AdvSceneSwitcher.condition.scene.entry.line1="{{sceneType}}{{scenes}}{{pattern}}"
|
||||
AdvSceneSwitcher.condition.scene.entry.line2="{{useTransitionTargetScene}}"
|
||||
AdvSceneSwitcher.condition.window="窗口"
|
||||
AdvSceneSwitcher.condition.window.entry.window="{{checkTitle}}窗口标题匹配{{windowRegex}}{{windows}}"
|
||||
AdvSceneSwitcher.condition.window.entry.fullscreen="{{fullscreen}}窗口为全屏"
|
||||
@@ -184,7 +182,7 @@ AdvSceneSwitcher.condition.media.source="源"
|
||||
AdvSceneSwitcher.condition.media.anyOnScene="任何媒体源"
|
||||
AdvSceneSwitcher.condition.media.allOnScene="所有媒体源"
|
||||
AdvSceneSwitcher.condition.media.inconsistencyInfo="不幸的是,并非所有媒体源类型的行为都相同(例如,媒体源与VLC视频源“停止”状态)。\n所以,请尝试适合您的设置!"
|
||||
AdvSceneSwitcher.condition.media.entry="{{sourceTypes}}{{mediaSources}}{{scenes}} 的状态是 {{states}} 和 {{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.media.layout.legacy="{{sourceTypes}}{{mediaSources}}{{scenes}}{{checkTypes}}的状态是{{states}}和{{timeRestrictions}}{{time}}"
|
||||
AdvSceneSwitcher.condition.video="视频"
|
||||
AdvSceneSwitcher.condition.video.condition.match="完全匹配"
|
||||
AdvSceneSwitcher.condition.video.condition.differ="不匹配"
|
||||
@@ -365,10 +363,7 @@ AdvSceneSwitcher.condition.date.entry.nextMatchDate="下一次匹配 在: %1"
|
||||
AdvSceneSwitcher.condition.date.entry.updateOnRepeat="{{updateOnRepeat}} 重复时,将选定的日期更新为重复日期"
|
||||
AdvSceneSwitcher.condition.sceneTransform="场景项目被改变"
|
||||
AdvSceneSwitcher.condition.sceneTransform.getTransform="内容或者设置被改变了"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line1="在 {{scenes}} {{sources}} {{types}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.type.matches="匹配变换"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line2="{{settings}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.entry.line3="{{regex}} {{getSettings}}"
|
||||
AdvSceneSwitcher.condition.sceneTransform.condition.match="匹配变换"
|
||||
AdvSceneSwitcher.condition.transition="转场"
|
||||
AdvSceneSwitcher.condition.transition.type.current="当前转场特效类型为"
|
||||
AdvSceneSwitcher.condition.transition.type.duration="当前转场特效持续时间为"
|
||||
@@ -481,7 +476,6 @@ AdvSceneSwitcher.action.replay.saveWarn="警告:保存过于频繁可能会导
|
||||
AdvSceneSwitcher.action.replay.type.stop="停止回放缓存"
|
||||
AdvSceneSwitcher.action.replay.type.start="启动回放缓存"
|
||||
AdvSceneSwitcher.action.replay.type.save="保存回放缓存"
|
||||
AdvSceneSwitcher.action.replay.entry="{{actions}}"
|
||||
AdvSceneSwitcher.action.streaming="推流"
|
||||
AdvSceneSwitcher.action.streaming.type.stop="停止推流"
|
||||
AdvSceneSwitcher.action.streaming.type.start="开始推流"
|
||||
@@ -556,7 +550,7 @@ AdvSceneSwitcher.action.sceneOrder.type.movePosition="移动到数值位置"
|
||||
AdvSceneSwitcher.action.sceneOrder.entry="在 {{scenes}} {{actions}} {{sources}} {{position}}"
|
||||
AdvSceneSwitcher.action.sceneTransform="场景项目转换"
|
||||
AdvSceneSwitcher.action.sceneTransform.getTransform="获得转换"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="在 {{scenes}}{{action}}{{rotation}}{{sources}}"
|
||||
AdvSceneSwitcher.action.sceneTransform.entry="在{{scenes}}{{action}}{{rotation}}{{sources}}{{settingSelection}}{{singleSettingValue}}"
|
||||
AdvSceneSwitcher.action.file="文件"
|
||||
AdvSceneSwitcher.action.file.type.write="写入"
|
||||
AdvSceneSwitcher.action.file.type.append="追加写入"
|
||||
@@ -596,7 +590,7 @@ AdvSceneSwitcher.action.screenshot.type.source="来源"
|
||||
AdvSceneSwitcher.action.screenshot.type.scene="场景"
|
||||
AdvSceneSwitcher.action.screenshot.mainOutput="OBS 预览画面"
|
||||
AdvSceneSwitcher.action.screenshot.blackscreenNote="源和场景并不总是呈现,可能会导致屏幕截图的某些部分保持空白。"
|
||||
AdvSceneSwitcher.action.screenshot.entry="截图{{targetType}}{{sources}}{{scenes}}保存在{{saveType}}位置"
|
||||
AdvSceneSwitcher.action.screenshot.entry="截图{{targetType}}{{sources}}{{scenes}}保存在{{saveType}}{{variables}}位置"
|
||||
AdvSceneSwitcher.action.profile="配置文件"
|
||||
AdvSceneSwitcher.action.profile.entry="将活动配置文件切换到 {{profiles}}"
|
||||
AdvSceneSwitcher.action.sceneCollection="场景集合"
|
||||
@@ -824,31 +818,6 @@ AdvSceneSwitcher.videoTab.entry="当 {{videoSources}} {{condition}} {{filePath}}
|
||||
AdvSceneSwitcher.videoTab.ignoreInactiveSource="除非源处于非活动状态"
|
||||
AdvSceneSwitcher.videoTab.help="<html><head/><body><p>此选项卡将允许您根据选定源的当前视频输出切换场景。<br/>请确保退出 <a href=\"https://obsproject.com/forum/resources/pixel-match-switcher.1202/\"><span style=\" text-decoration: underline; color:#268bd2;\">Pixel Match Switcher</span></a> 以便更好地实现此功能.<br/><br/> 单击高亮显示的加号继续.</p></body></html>"
|
||||
|
||||
; Network Tab
|
||||
AdvSceneSwitcher.networkTab.title="网络"
|
||||
AdvSceneSwitcher.networkTab.description="此选项卡将允许您远程控制另一个OBS实例的活动场景。\n请注意,所有OBS实例上的场景名称必须完全匹配."
|
||||
AdvSceneSwitcher.networkTab.warning="在本地网络之外运行服务器将允许第三方读取活动场景."
|
||||
AdvSceneSwitcher.networkTab.server="启动服务器(向所有连接的客户端发送场景切换消息)"
|
||||
AdvSceneSwitcher.networkTab.server.port="端口"
|
||||
AdvSceneSwitcher.networkTab.server.lockToIPv4="锁定为仅使用IPv4将服务器"
|
||||
AdvSceneSwitcher.networkTab.server.sendSceneChange="发送更改场景的消息"
|
||||
AdvSceneSwitcher.networkTab.server.restrictSendToAutomatedSwitches="仅为自动场景切换发送消息"
|
||||
AdvSceneSwitcher.networkTab.server.sendPreview="在Studio模式下运行时发送预览场景更改消息"
|
||||
AdvSceneSwitcher.networkTab.startFailed.message="WebSockets服务器无法启动,可能是因为:\n-TCP端口%1当前可能正在该系统的其他位置使用,可能是由其他应用程序使用。请尝试在WebSocket服务器设置中设置其他TCP端口,或停止可能正在使用此端口的任何应用程序。\n-错误消息: %2"
|
||||
AdvSceneSwitcher.networkTab.server.status.currentStatus="状态"
|
||||
AdvSceneSwitcher.networkTab.server.status.notRunning="未运行"
|
||||
AdvSceneSwitcher.networkTab.server.status.starting="启动中"
|
||||
AdvSceneSwitcher.networkTab.server.status.running="运行中"
|
||||
AdvSceneSwitcher.networkTab.server.restart="重新启动服务"
|
||||
AdvSceneSwitcher.networkTab.client="启动客户端(接收场景切换消息)"
|
||||
AdvSceneSwitcher.networkTab.client.address="主机名或IP地址"
|
||||
AdvSceneSwitcher.networkTab.client.port="端口"
|
||||
AdvSceneSwitcher.networkTab.client.status.currentStatus="状态"
|
||||
AdvSceneSwitcher.networkTab.client.status.disconnected="未连接"
|
||||
AdvSceneSwitcher.networkTab.client.status.connecting="连接中"
|
||||
AdvSceneSwitcher.networkTab.client.status.connected="已连接"
|
||||
AdvSceneSwitcher.networkTab.client.reconnect="强制重新连接"
|
||||
|
||||
; Scene Group Tab
|
||||
AdvSceneSwitcher.sceneGroupTab.title="场景组"
|
||||
AdvSceneSwitcher.sceneGroupTab.list="场景组"
|
||||
@@ -869,30 +838,6 @@ AdvSceneSwitcher.sceneGroupTab.exists="场景组或场景名称已存在"
|
||||
AdvSceneSwitcher.sceneGroupTab.help="可以选择场景组作为目标,就像选择常规场景一样。\n\n名称表明场景组是多个场景的集合。\n场景组将根据配置的设置在其指定场景的列表中前进,可以在右侧找到。\n\n您可以将场景组配置为前进到列表中的下一个场景:\n在多次选择场景组作为目标后。\n在经过一定时间后。\n也可以是随机的。\n\n例如,包含场景的场景组…\n场景1\n场景2\n场景3\n。。。将在第一次选择“场景1”作为目标时激活它。\n第二次将激活“场景2”\n剩余时间将激活“场景3”。\n\n单击下面突出显示的加号以添加新的场景组."
|
||||
AdvSceneSwitcher.sceneGroupTab.scenes.help="在左侧选择要修改的场景组。\n\n通过选择上面的场景并单击下面的加号,选择要添加到此场景组的场景。\n\n可以多次将场景添加到同一场景组."
|
||||
|
||||
; Scene Trigger Tab
|
||||
AdvSceneSwitcher.sceneTriggerTab.title="场景触发器"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.none="--选择触发器--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneActive="已激活"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneInactive="未激活"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneLeave="离开"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.none="--选择动作--"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startRecording="开始录制"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.pauseRecording="暂停录制"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unpauseRecording="取消暂停录制"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopRecording="停止录制"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopStreaming="停止推流"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startStreaming="开始推流"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startReplayBuffer="启动重播缓冲区"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopReplayBuffer="停止重放缓冲区"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.muteSource="静音源"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unmuteSource="取消静音源"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startSwitcher="启动场景切换程序"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopSwitcher="停止场景切换"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startVirtualCamera="启动虚拟摄像机"
|
||||
AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopVirtualCamera="停止虚拟摄像机"
|
||||
AdvSceneSwitcher.sceneTriggerTab.entry="当 {{scenes}} {{triggers}} {{actions}} {{audioSources}} 在 {{duration}} 后"
|
||||
AdvSceneSwitcher.sceneTriggerTab.help="此选项卡允许您在场景更改时触发操作,如停止录制或流式处理."
|
||||
|
||||
; Hotkey
|
||||
AdvSceneSwitcher.hotkey.startSwitcherHotkey="启动高级场景切换器"
|
||||
AdvSceneSwitcher.hotkey.stopSwitcherHotkey="停止高级场景切换器"
|
||||
@@ -1052,7 +997,7 @@ AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>这似乎是第一次
|
||||
AdvSceneSwitcher.deprecatedTabWarning="此选项卡的开发已停止!请考虑转换为使用宏来代替。\n可以在“常规”选项卡上禁用此提示."
|
||||
|
||||
AdvSceneSwitcher.unit.milliseconds="毫秒"
|
||||
AdvSceneSwitcher.unit.secends="秒"
|
||||
AdvSceneSwitcher.unit.seconds="秒"
|
||||
AdvSceneSwitcher.unit.minutes="分钟"
|
||||
AdvSceneSwitcher.unit.hours="小时"
|
||||
AdvSceneSwitcher.duration.condition.none="没有时间限制"
|
||||
|
||||
1
deps/libusb
vendored
Submodule
1
deps/libusb
vendored
Submodule
Submodule deps/libusb added at d52e355daa
73
deps/obs-websocket/lib/obs-websocket-api.h
vendored
73
deps/obs-websocket/lib/obs-websocket-api.h
vendored
@@ -29,7 +29,8 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *obs_websocket_vendor;
|
||||
typedef void (*obs_websocket_request_callback_function)(obs_data_t *, obs_data_t *, void *);
|
||||
typedef void (*obs_websocket_request_callback_function)(obs_data_t *,
|
||||
obs_data_t *, void *);
|
||||
|
||||
struct obs_websocket_request_response {
|
||||
unsigned int status_code;
|
||||
@@ -44,7 +45,7 @@ struct obs_websocket_request_callback {
|
||||
void *priv_data;
|
||||
};
|
||||
|
||||
inline proc_handler_t *_ph;
|
||||
static proc_handler_t *_ph;
|
||||
|
||||
/* ==================== INTERNAL API FUNCTIONS ==================== */
|
||||
|
||||
@@ -53,9 +54,10 @@ static inline proc_handler_t *obs_websocket_get_ph(void)
|
||||
proc_handler_t *global_ph = obs_get_proc_handler();
|
||||
assert(global_ph != NULL);
|
||||
|
||||
calldata_t cd = {0};
|
||||
calldata_t cd = {0, 0, 0, 0};
|
||||
if (!proc_handler_call(global_ph, "obs_websocket_api_get_ph", &cd))
|
||||
blog(LOG_DEBUG, "Unable to fetch obs-websocket proc handler object. obs-websocket not installed?");
|
||||
blog(LOG_DEBUG,
|
||||
"Unable to fetch obs-websocket proc handler object. obs-websocket not installed?");
|
||||
proc_handler_t *ret = (proc_handler_t *)calldata_ptr(&cd, "ph");
|
||||
calldata_free(&cd);
|
||||
|
||||
@@ -69,7 +71,9 @@ static inline bool obs_websocket_ensure_ph(void)
|
||||
return _ph != NULL;
|
||||
}
|
||||
|
||||
static inline bool obs_websocket_vendor_run_simple_proc(obs_websocket_vendor vendor, const char *proc_name, calldata_t *cd)
|
||||
static inline bool
|
||||
obs_websocket_vendor_run_simple_proc(obs_websocket_vendor vendor,
|
||||
const char *proc_name, calldata_t *cd)
|
||||
{
|
||||
if (!obs_websocket_ensure_ph())
|
||||
return false;
|
||||
@@ -91,12 +95,12 @@ static inline unsigned int obs_websocket_get_api_version(void)
|
||||
if (!obs_websocket_ensure_ph())
|
||||
return 0;
|
||||
|
||||
calldata_t cd = {0};
|
||||
calldata_t cd = {0, 0, 0, 0};
|
||||
|
||||
if (!proc_handler_call(_ph, "get_api_version", &cd))
|
||||
return 1; // API v1 does not include get_api_version
|
||||
|
||||
unsigned int ret = calldata_int(&cd, "version");
|
||||
unsigned int ret = (unsigned int)calldata_int(&cd, "version");
|
||||
|
||||
calldata_free(&cd);
|
||||
|
||||
@@ -104,7 +108,12 @@ static inline unsigned int obs_websocket_get_api_version(void)
|
||||
}
|
||||
|
||||
// Calls an obs-websocket request. Free response with `obs_websocket_request_response_free()`
|
||||
static inline obs_websocket_request_response *obs_websocket_call_request(const char *request_type, obs_data_t *request_data = NULL)
|
||||
static inline struct obs_websocket_request_response *
|
||||
obs_websocket_call_request(const char *request_type, obs_data_t *request_data
|
||||
#ifdef __cplusplus
|
||||
= NULL
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (!obs_websocket_ensure_ph())
|
||||
return NULL;
|
||||
@@ -113,14 +122,16 @@ static inline obs_websocket_request_response *obs_websocket_call_request(const c
|
||||
if (request_data)
|
||||
request_data_string = obs_data_get_json(request_data);
|
||||
|
||||
calldata_t cd = {0};
|
||||
calldata_t cd = {0, 0, 0, 0};
|
||||
|
||||
calldata_set_string(&cd, "request_type", request_type);
|
||||
calldata_set_string(&cd, "request_data", request_data_string);
|
||||
|
||||
proc_handler_call(_ph, "call_request", &cd);
|
||||
|
||||
auto ret = (struct obs_websocket_request_response *)calldata_ptr(&cd, "response");
|
||||
struct obs_websocket_request_response *ret =
|
||||
(struct obs_websocket_request_response *)calldata_ptr(
|
||||
&cd, "response");
|
||||
|
||||
calldata_free(&cd);
|
||||
|
||||
@@ -128,7 +139,8 @@ static inline obs_websocket_request_response *obs_websocket_call_request(const c
|
||||
}
|
||||
|
||||
// Free a request response object returned by `obs_websocket_call_request()`
|
||||
static inline void obs_websocket_request_response_free(struct obs_websocket_request_response *response)
|
||||
static inline void obs_websocket_request_response_free(
|
||||
struct obs_websocket_request_response *response)
|
||||
{
|
||||
if (!response)
|
||||
return;
|
||||
@@ -144,12 +156,13 @@ static inline void obs_websocket_request_response_free(struct obs_websocket_requ
|
||||
|
||||
// ALWAYS CALL ONLY VIA `obs_module_post_load()` CALLBACK!
|
||||
// Registers a new "vendor" (Example: obs-ndi)
|
||||
static inline obs_websocket_vendor obs_websocket_register_vendor(const char *vendor_name)
|
||||
static inline obs_websocket_vendor
|
||||
obs_websocket_register_vendor(const char *vendor_name)
|
||||
{
|
||||
if (!obs_websocket_ensure_ph())
|
||||
return NULL;
|
||||
|
||||
calldata_t cd = {0};
|
||||
calldata_t cd = {0, 0, 0, 0};
|
||||
|
||||
calldata_set_string(&cd, "name", vendor_name);
|
||||
|
||||
@@ -161,32 +174,37 @@ static inline obs_websocket_vendor obs_websocket_register_vendor(const char *ven
|
||||
}
|
||||
|
||||
// Registers a new request for a vendor
|
||||
static inline bool obs_websocket_vendor_register_request(obs_websocket_vendor vendor, const char *request_type,
|
||||
obs_websocket_request_callback_function request_callback, void *priv_data)
|
||||
static inline bool obs_websocket_vendor_register_request(
|
||||
obs_websocket_vendor vendor, const char *request_type,
|
||||
obs_websocket_request_callback_function request_callback,
|
||||
void *priv_data)
|
||||
{
|
||||
calldata_t cd = {0};
|
||||
calldata_t cd = {0, 0, 0, 0};
|
||||
|
||||
struct obs_websocket_request_callback cb = {};
|
||||
cb.callback = request_callback;
|
||||
cb.priv_data = priv_data;
|
||||
struct obs_websocket_request_callback cb = {request_callback,
|
||||
priv_data};
|
||||
|
||||
calldata_set_string(&cd, "type", request_type);
|
||||
calldata_set_ptr(&cd, "callback", &cb);
|
||||
|
||||
bool success = obs_websocket_vendor_run_simple_proc(vendor, "vendor_request_register", &cd);
|
||||
bool success = obs_websocket_vendor_run_simple_proc(
|
||||
vendor, "vendor_request_register", &cd);
|
||||
calldata_free(&cd);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
// Unregisters an existing vendor request
|
||||
static inline bool obs_websocket_vendor_unregister_request(obs_websocket_vendor vendor, const char *request_type)
|
||||
static inline bool
|
||||
obs_websocket_vendor_unregister_request(obs_websocket_vendor vendor,
|
||||
const char *request_type)
|
||||
{
|
||||
calldata_t cd = {0};
|
||||
calldata_t cd = {0, 0, 0, 0};
|
||||
|
||||
calldata_set_string(&cd, "type", request_type);
|
||||
|
||||
bool success = obs_websocket_vendor_run_simple_proc(vendor, "vendor_request_unregister", &cd);
|
||||
bool success = obs_websocket_vendor_run_simple_proc(
|
||||
vendor, "vendor_request_unregister", &cd);
|
||||
calldata_free(&cd);
|
||||
|
||||
return success;
|
||||
@@ -194,14 +212,17 @@ static inline bool obs_websocket_vendor_unregister_request(obs_websocket_vendor
|
||||
|
||||
// Does not affect event_data refcount.
|
||||
// Emits an event under the vendor's name
|
||||
static inline bool obs_websocket_vendor_emit_event(obs_websocket_vendor vendor, const char *event_name, obs_data_t *event_data)
|
||||
static inline bool obs_websocket_vendor_emit_event(obs_websocket_vendor vendor,
|
||||
const char *event_name,
|
||||
obs_data_t *event_data)
|
||||
{
|
||||
calldata_t cd = {0};
|
||||
calldata_t cd = {0, 0, 0, 0};
|
||||
|
||||
calldata_set_string(&cd, "type", event_name);
|
||||
calldata_set_ptr(&cd, "data", (void *)event_data);
|
||||
|
||||
bool success = obs_websocket_vendor_run_simple_proc(vendor, "vendor_event_emit", &cd);
|
||||
bool success = obs_websocket_vendor_run_simple_proc(
|
||||
vendor, "vendor_event_emit", &cd);
|
||||
calldata_free(&cd);
|
||||
|
||||
return success;
|
||||
|
||||
2
deps/opencv
vendored
2
deps/opencv
vendored
Submodule deps/opencv updated: b0dc474160...71d3237a09
File diff suppressed because it is too large
Load Diff
@@ -14,8 +14,8 @@
|
||||
#include "tab-helpers.hpp"
|
||||
#include "utility.hpp"
|
||||
#include "version.h"
|
||||
#include "websocket-api.hpp"
|
||||
|
||||
#include <filesystem>
|
||||
#include <obs-frontend-api.h>
|
||||
#include <QAction>
|
||||
#include <QDirIterator>
|
||||
@@ -70,6 +70,9 @@ static void DisplayMissingDependencyWarning()
|
||||
QString warning(obs_module_text(
|
||||
"AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailureMessage"));
|
||||
DisplayMessage(warning.arg(failedLibsString));
|
||||
|
||||
// Only display the warning once per plugin load
|
||||
switcher->loadFailureLibs.clear();
|
||||
}
|
||||
|
||||
static void DisplayMissingDataDirWarning()
|
||||
@@ -82,18 +85,32 @@ static void DisplayMissingDataDirWarning()
|
||||
"Please check installation instructions!\n\n"
|
||||
"Data most likely expected at:\n\n";
|
||||
#ifdef _WIN32
|
||||
msg += QString::fromStdString(
|
||||
(std::filesystem::current_path().string()));
|
||||
|
||||
msg += QDir::currentPath();
|
||||
msg += "/";
|
||||
#endif
|
||||
msg += obs_get_module_data_path(obs_current_module());
|
||||
DisplayMessage(msg);
|
||||
}
|
||||
|
||||
bool CanCreateDefaultAction();
|
||||
bool CanCreateDefaultCondition();
|
||||
|
||||
static void DisplayCorruptedInstallWarning()
|
||||
{
|
||||
if (CanCreateDefaultAction() && CanCreateDefaultCondition()) {
|
||||
return;
|
||||
}
|
||||
|
||||
DisplayMessage(obs_module_text(
|
||||
"AdvSceneSwitcher.generalTab.generalBehavior.warnCorruptedInstallMessage"));
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::LoadUI()
|
||||
{
|
||||
DisplayMissingDataDirWarning();
|
||||
DisplayMissingDependencyWarning();
|
||||
DisplayCorruptedInstallWarning();
|
||||
|
||||
SetupGeneralTab();
|
||||
SetupTitleTab();
|
||||
@@ -109,9 +126,7 @@ void AdvSceneSwitcher::LoadUI()
|
||||
SetupTimeTab();
|
||||
SetupAudioTab();
|
||||
SetupVideoTab();
|
||||
SetupNetworkTab();
|
||||
SetupSceneGroupTab();
|
||||
SetupTriggerTab();
|
||||
SetupMacroTab();
|
||||
SetupOtherTabs(ui->tabWidget);
|
||||
|
||||
@@ -238,8 +253,8 @@ void SwitcherData::Thread()
|
||||
duration = std::chrono::milliseconds(interval) +
|
||||
std::chrono::milliseconds(linger) - runTime;
|
||||
if (duration.count() < 1) {
|
||||
blog(LOG_INFO,
|
||||
"detected busy loop - refusing to sleep less than 1ms");
|
||||
vblog(LOG_INFO,
|
||||
"detected busy loop - refusing to sleep less than 1ms");
|
||||
duration = std::chrono::milliseconds(10);
|
||||
}
|
||||
}
|
||||
@@ -440,15 +455,8 @@ void SwitcherData::Start()
|
||||
|
||||
// Will be overwritten quickly but might be useful
|
||||
writeToStatusFile("Advanced Scene Switcher running");
|
||||
}
|
||||
|
||||
if (networkConfig.ServerEnabled) {
|
||||
server.start(networkConfig.ServerPort,
|
||||
networkConfig.LockToIPv4);
|
||||
}
|
||||
|
||||
if (networkConfig.ClientEnabled) {
|
||||
client.connect(networkConfig.GetClientUri());
|
||||
SendWebsocketVendorEvent("AdvancedSceneSwitcherStarted",
|
||||
nullptr);
|
||||
}
|
||||
|
||||
if (showSystemTrayNotifications) {
|
||||
@@ -476,11 +484,12 @@ void SwitcherData::Stop()
|
||||
delete th;
|
||||
th = nullptr;
|
||||
writeToStatusFile("Advanced Scene Switcher stopped");
|
||||
if (!obsIsShuttingDown) {
|
||||
SendWebsocketVendorEvent("AdvancedSceneSwitcherStopped",
|
||||
nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
server.stop();
|
||||
client.disconnect();
|
||||
|
||||
if (showSystemTrayNotifications) {
|
||||
DisplayTrayMessage(
|
||||
obs_module_text("AdvSceneSwitcher.pluginName"),
|
||||
@@ -548,12 +557,7 @@ static void handleSceneChange()
|
||||
GetWeakSourceName(switcher->previousScene).c_str());
|
||||
}
|
||||
|
||||
switcher->checkTriggers();
|
||||
switcher->checkDefaultSceneTransitions();
|
||||
|
||||
if (switcher->networkConfig.ShouldSendFrontendSceneChange()) {
|
||||
switcher->server.sendMessage({ws.Get(), nullptr, 0});
|
||||
}
|
||||
}
|
||||
|
||||
static void setLiveTime()
|
||||
@@ -582,17 +586,6 @@ static void checkAutoStartStreaming()
|
||||
switcher->Start();
|
||||
}
|
||||
|
||||
static void handlePeviewSceneChange()
|
||||
{
|
||||
if (switcher->networkConfig.ShouldSendPrviewSceneChange()) {
|
||||
OBSSourceAutoRelease source =
|
||||
obs_frontend_get_current_preview_scene();
|
||||
OBSWeakSourceAutoRelease weak =
|
||||
obs_source_get_weak_source(source);
|
||||
switcher->server.sendMessage({weak.Get(), nullptr, 0}, true);
|
||||
}
|
||||
}
|
||||
|
||||
static void handleTransitionEnd()
|
||||
{
|
||||
GetMacroTransitionCV().notify_all();
|
||||
@@ -670,9 +663,6 @@ static void OBSEvent(enum obs_frontend_event event, void *switcher)
|
||||
case OBS_FRONTEND_EVENT_SCENE_CHANGED:
|
||||
handleSceneChange();
|
||||
break;
|
||||
case OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED:
|
||||
handlePeviewSceneChange();
|
||||
break;
|
||||
case OBS_FRONTEND_EVENT_RECORDING_STARTED:
|
||||
setLiveTime();
|
||||
checkAutoStartRecording();
|
||||
@@ -705,7 +695,7 @@ static void LoadPlugins()
|
||||
{
|
||||
QFileInfo libPath(
|
||||
QString(obs_get_module_binary_path(obs_current_module())));
|
||||
QString pluginDir(libPath.absolutePath() + "/adv-ss-plugins");
|
||||
QString pluginDir(libPath.absolutePath() + "/" ADVSS_PLUGIN_FOLDER);
|
||||
#ifdef _WIN32
|
||||
QString libPattern = "*.dll";
|
||||
SetDllDirectory(pluginDir.toStdWString().c_str());
|
||||
@@ -745,11 +735,6 @@ void OpenSettingsWindow()
|
||||
}
|
||||
}
|
||||
|
||||
QWidget *GetSettingsWindow()
|
||||
{
|
||||
return SettingsWindowIsOpened() ? AdvSceneSwitcher::window : nullptr;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::HighligthMacroSettingsButton(bool enable)
|
||||
{
|
||||
static QObject *highlight = nullptr;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "macro-segment-list.hpp"
|
||||
#include "condition-logic.hpp"
|
||||
#include "log-helper.hpp"
|
||||
|
||||
#include <ui_advanced-scene-switcher.h>
|
||||
@@ -12,7 +13,6 @@ class MacroActionEdit;
|
||||
class MacroConditionEdit;
|
||||
class Duration;
|
||||
class SequenceWidget;
|
||||
enum class LogicType;
|
||||
struct SceneGroup;
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -53,6 +53,7 @@ public slots:
|
||||
void on_noMatchRandomSwitch_clicked();
|
||||
void NoMatchDelayDurationChanged(const Duration &);
|
||||
void CooldownDurationChanged(const Duration &);
|
||||
void on_enableCooldown_stateChanged(int state);
|
||||
void on_startupBehavior_currentIndexChanged(int index);
|
||||
void on_logLevel_currentIndexChanged(int index);
|
||||
void on_autoStartEvent_currentIndexChanged(int index);
|
||||
@@ -173,7 +174,7 @@ public slots:
|
||||
void MacroConditionReorder(int to, int target);
|
||||
void AddMacroCondition(int idx);
|
||||
void AddMacroCondition(Macro *macro, int idx, const std::string &id,
|
||||
obs_data_t *data, LogicType logic);
|
||||
obs_data_t *data, Logic::Type logic);
|
||||
void RemoveMacroCondition(int idx);
|
||||
void MoveMacroConditionUp(int idx);
|
||||
void MoveMacroConditionDown(int idx);
|
||||
@@ -358,24 +359,6 @@ public slots:
|
||||
void on_videoDown_clicked();
|
||||
void on_getScreenshot_clicked();
|
||||
|
||||
// Scene group tab
|
||||
public:
|
||||
void SetupNetworkTab();
|
||||
public slots:
|
||||
void on_serverSettings_toggled(bool on);
|
||||
void on_serverPort_valueChanged(int value);
|
||||
void on_lockToIPv4_stateChanged(int state);
|
||||
void on_serverRestart_clicked();
|
||||
void UpdateServerStatus();
|
||||
void on_clientSettings_toggled(bool on);
|
||||
void on_clientHostname_textChanged(const QString &text);
|
||||
void on_clientPort_valueChanged(int value);
|
||||
void on_sendSceneChange_stateChanged(int state);
|
||||
void on_restrictSend_stateChanged(int state);
|
||||
void on_sendPreview_stateChanged(int state);
|
||||
void on_clientReconnect_clicked();
|
||||
void UpdateClientStatus();
|
||||
|
||||
// Scene group tab
|
||||
public:
|
||||
void SetupSceneGroupTab();
|
||||
@@ -397,20 +380,12 @@ signals:
|
||||
void SceneGroupRemoved(const QString &name);
|
||||
void SceneGroupRenamed(const QString &oldName, const QString newName);
|
||||
|
||||
// Trigger tab
|
||||
public:
|
||||
void SetupTriggerTab();
|
||||
public slots:
|
||||
void on_triggerAdd_clicked();
|
||||
void on_triggerRemove_clicked();
|
||||
void on_triggerUp_clicked();
|
||||
void on_triggerDown_clicked();
|
||||
|
||||
/* --- End of legacy tab section --- */
|
||||
private:
|
||||
void SetCheckIntervalTooLowVisibility() const;
|
||||
};
|
||||
|
||||
void OpenSettingsWindow();
|
||||
QWidget *GetSettingsWindow();
|
||||
void HighligthMacroSettingsButton(bool enable);
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -91,6 +91,17 @@ void AdvSceneSwitcher::CooldownDurationChanged(const Duration &dur)
|
||||
switcher->cooldown = dur;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_enableCooldown_stateChanged(int state)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->enableCooldown = state;
|
||||
ui->cooldownTime->setEnabled(state);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_startupBehavior_currentIndexChanged(int index)
|
||||
{
|
||||
if (loading) {
|
||||
@@ -139,6 +150,8 @@ void AdvSceneSwitcher::on_checkInterval_valueChanged(int value)
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->interval = value;
|
||||
|
||||
SetCheckIntervalTooLowVisibility();
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::closeEvent(QCloseEvent *)
|
||||
@@ -205,7 +218,6 @@ static bool isLegacyTab(const QString &name)
|
||||
{
|
||||
return name == obs_module_text(
|
||||
"AdvSceneSwitcher.sceneGroupTab.title") ||
|
||||
name == obs_module_text("AdvSceneSwitcher.networkTab.title") ||
|
||||
name == obs_module_text(
|
||||
"AdvSceneSwitcher.transitionTab.title") ||
|
||||
name == obs_module_text(
|
||||
@@ -223,9 +235,7 @@ static bool isLegacyTab(const QString &name)
|
||||
"AdvSceneSwitcher.sceneSequenceTab.title") ||
|
||||
name == obs_module_text("AdvSceneSwitcher.audioTab.title") ||
|
||||
name == obs_module_text("AdvSceneSwitcher.videoTab.title") ||
|
||||
name == obs_module_text("AdvSceneSwitcher.pauseTab.title") ||
|
||||
name == obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.title");
|
||||
name == obs_module_text("AdvSceneSwitcher.pauseTab.title");
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_hideLegacyTabs_stateChanged(int state)
|
||||
@@ -237,6 +247,10 @@ void AdvSceneSwitcher::on_hideLegacyTabs_stateChanged(int state)
|
||||
ui->tabWidget->setTabVisible(idx, !state);
|
||||
}
|
||||
}
|
||||
|
||||
// Changing priority of legacy tabs will very likely not be necessary if
|
||||
// the legacy tabs are hidden
|
||||
ui->priorityBox->setVisible(!switcher->hideLegacyTabs);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::SetDeprecationWarnings()
|
||||
@@ -445,8 +459,6 @@ void SwitcherData::LoadSettings(obs_data_t *obj)
|
||||
loadTimeSwitches(obj);
|
||||
loadAudioSwitches(obj);
|
||||
loadVideoSwitches(obj);
|
||||
loadNetworkSettings(obj);
|
||||
loadSceneTriggers(obj);
|
||||
LoadGeneralSettings(obj);
|
||||
LoadHotkeys(obj);
|
||||
LoadUISettings(obj);
|
||||
@@ -481,8 +493,6 @@ void SwitcherData::SaveSettings(obs_data_t *obj)
|
||||
saveTimeSwitches(obj);
|
||||
saveAudioSwitches(obj);
|
||||
saveVideoSwitches(obj);
|
||||
saveNetworkSwitches(obj);
|
||||
saveSceneTriggers(obj);
|
||||
SaveGeneralSettings(obj);
|
||||
SaveHotkeys(obj);
|
||||
SaveUISettings(obj);
|
||||
@@ -505,6 +515,7 @@ void SwitcherData::SaveGeneralSettings(obs_data_t *obj)
|
||||
noMatchDelay.Save(obj, "noMatchDelay");
|
||||
|
||||
cooldown.Save(obj, "cooldown");
|
||||
obs_data_set_bool(obj, "enableCooldown", enableCooldown);
|
||||
|
||||
obs_data_set_bool(obj, "active", sceneColletionStop ? true : !stop);
|
||||
sceneColletionStop = false;
|
||||
@@ -515,6 +526,7 @@ void SwitcherData::SaveGeneralSettings(obs_data_t *obj)
|
||||
static_cast<int>(autoStartEvent));
|
||||
|
||||
obs_data_set_int(obj, "logLevel", static_cast<int>(logLevel));
|
||||
obs_data_set_int(obj, "logLevelVersion", 1);
|
||||
obs_data_set_bool(obj, "showSystemTrayNotifications",
|
||||
showSystemTrayNotifications);
|
||||
obs_data_set_bool(obj, "disableHints", disableHints);
|
||||
@@ -550,6 +562,11 @@ void SwitcherData::LoadGeneralSettings(obs_data_t *obj)
|
||||
noMatchDelay.Load(obj, "noMatchDelay");
|
||||
|
||||
cooldown.Load(obj, "cooldown");
|
||||
if (!obs_data_has_user_value(obj, "enableCooldown")) {
|
||||
enableCooldown = cooldown.Seconds() != 0;
|
||||
} else {
|
||||
enableCooldown = obs_data_get_bool(obj, "enableCooldown");
|
||||
}
|
||||
|
||||
obs_data_set_default_bool(obj, "active", true);
|
||||
stop = !obs_data_get_bool(obj, "active");
|
||||
@@ -566,6 +583,25 @@ void SwitcherData::LoadGeneralSettings(obs_data_t *obj)
|
||||
static_cast<AutoStart>(obs_data_get_int(obj, "autoStartEvent"));
|
||||
|
||||
logLevel = static_cast<LogLevel>(obs_data_get_int(obj, "logLevel"));
|
||||
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 =
|
||||
obs_data_get_bool(obj, "showSystemTrayNotifications");
|
||||
disableHints = obs_data_get_bool(obj, "disableHints");
|
||||
@@ -653,7 +689,7 @@ void SwitcherData::CheckNoMatchSwitch(bool &match, OBSWeakSource &scene,
|
||||
|
||||
void SwitcherData::checkSwitchCooldown(bool &match)
|
||||
{
|
||||
if (!match) {
|
||||
if (!match || !enableCooldown) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -793,6 +829,28 @@ static void setupGeneralTabInactiveWarning(QTabWidget *tabs)
|
||||
inactiveTimer->start();
|
||||
}
|
||||
|
||||
void advss::AdvSceneSwitcher::SetCheckIntervalTooLowVisibility() const
|
||||
{
|
||||
auto macro = GetMacroWithInvalidConditionInterval();
|
||||
if (!macro) {
|
||||
ui->checkIntervalTooLowWarning->hide();
|
||||
return;
|
||||
}
|
||||
|
||||
const QString labelTextFormat(obs_module_text(
|
||||
"AdvSceneSwitcher.generalTab.status.checkIntervalTooLow"));
|
||||
const QString labelTooltipFormat(obs_module_text(
|
||||
"AdvSceneSwitcher.generalTab.status.checkIntervalTooLow.tooltip"));
|
||||
const QString name = QString::fromStdString(macro->Name());
|
||||
const QString duration = QString::fromStdString(
|
||||
macro->GetCustomConditionCheckInterval().ToString());
|
||||
|
||||
ui->checkIntervalTooLowWarning->setText(labelTextFormat.arg(name));
|
||||
ui->checkIntervalTooLowWarning->setToolTip(
|
||||
labelTooltipFormat.arg(name).arg(duration).arg(name));
|
||||
ui->checkIntervalTooLowWarning->show();
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::SetupGeneralTab()
|
||||
{
|
||||
PopulateSceneSelection(ui->noMatchSwitchScene, false);
|
||||
@@ -814,14 +872,17 @@ void AdvSceneSwitcher::SetupGeneralTab()
|
||||
DurationSelection *noMatchDelay = new DurationSelection();
|
||||
noMatchDelay->SetDuration(switcher->noMatchDelay);
|
||||
noMatchDelay->setToolTip(obs_module_text(
|
||||
"AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip"));
|
||||
"AdvSceneSwitcher.generalTab.generalBehavior.onNoMatchDelay.tooltip"));
|
||||
ui->noMatchLayout->addWidget(noMatchDelay);
|
||||
QWidget::connect(noMatchDelay,
|
||||
SIGNAL(DurationChanged(const Duration &)), this,
|
||||
SLOT(NoMatchDelayDurationChanged(const Duration &)));
|
||||
|
||||
ui->checkInterval->setValue(switcher->interval);
|
||||
SetCheckIntervalTooLowVisibility();
|
||||
|
||||
ui->enableCooldown->setChecked(switcher->enableCooldown);
|
||||
ui->cooldownTime->setEnabled(switcher->enableCooldown);
|
||||
ui->cooldownTime->SetDuration(switcher->cooldown);
|
||||
ui->cooldownTime->setToolTip(obs_module_text(
|
||||
"AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint"));
|
||||
|
||||
@@ -170,8 +170,10 @@ void AdvSceneSwitcher::on_sceneGroupAdd_clicked()
|
||||
item->setData(Qt::UserRole, text);
|
||||
ui->sceneGroups->setCurrentItem(item);
|
||||
|
||||
addPulse->deleteLater();
|
||||
addPulse = nullptr;
|
||||
if (addPulse) {
|
||||
addPulse->deleteLater();
|
||||
addPulse = nullptr;
|
||||
}
|
||||
ui->sceneGroupHelp->setVisible(false);
|
||||
|
||||
emit SceneGroupAdded(QString::fromStdString(name));
|
||||
|
||||
@@ -1,581 +0,0 @@
|
||||
#include "advanced-scene-switcher.hpp"
|
||||
#include "layout-helpers.hpp"
|
||||
#include "selection-helpers.hpp"
|
||||
#include "source-helpers.hpp"
|
||||
#include "switcher-data.hpp"
|
||||
#include "ui-helpers.hpp"
|
||||
#include "utility.hpp"
|
||||
|
||||
#include <obs-frontend-api.h>
|
||||
#include <thread>
|
||||
|
||||
namespace advss {
|
||||
|
||||
bool SceneTrigger::pause = false;
|
||||
static QObject *addPulse = nullptr;
|
||||
|
||||
void AdvSceneSwitcher::on_triggerAdd_clicked()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->sceneTriggers.emplace_back();
|
||||
|
||||
listAddClicked(ui->sceneTriggers,
|
||||
new SceneTriggerWidget(this,
|
||||
&switcher->sceneTriggers.back()),
|
||||
ui->triggerAdd, addPulse);
|
||||
|
||||
ui->triggerHelp->setVisible(false);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_triggerRemove_clicked()
|
||||
{
|
||||
QListWidgetItem *item = ui->sceneTriggers->currentItem();
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
int idx = ui->sceneTriggers->currentRow();
|
||||
auto &switches = switcher->sceneTriggers;
|
||||
switches.erase(switches.begin() + idx);
|
||||
}
|
||||
|
||||
delete item;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_triggerUp_clicked()
|
||||
{
|
||||
int index = ui->sceneTriggers->currentRow();
|
||||
if (!listMoveUp(ui->sceneTriggers)) {
|
||||
return;
|
||||
}
|
||||
|
||||
SceneTriggerWidget *s1 =
|
||||
(SceneTriggerWidget *)ui->sceneTriggers->itemWidget(
|
||||
ui->sceneTriggers->item(index));
|
||||
SceneTriggerWidget *s2 =
|
||||
(SceneTriggerWidget *)ui->sceneTriggers->itemWidget(
|
||||
ui->sceneTriggers->item(index - 1));
|
||||
SceneTriggerWidget::swapSwitchData(s1, s2);
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
|
||||
std::swap(switcher->sceneTriggers[index],
|
||||
switcher->sceneTriggers[index - 1]);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_triggerDown_clicked()
|
||||
{
|
||||
int index = ui->sceneTriggers->currentRow();
|
||||
|
||||
if (!listMoveDown(ui->sceneTriggers)) {
|
||||
return;
|
||||
}
|
||||
|
||||
SceneTriggerWidget *s1 =
|
||||
(SceneTriggerWidget *)ui->sceneTriggers->itemWidget(
|
||||
ui->sceneTriggers->item(index));
|
||||
SceneTriggerWidget *s2 =
|
||||
(SceneTriggerWidget *)ui->sceneTriggers->itemWidget(
|
||||
ui->sceneTriggers->item(index + 1));
|
||||
SceneTriggerWidget::swapSwitchData(s1, s2);
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
|
||||
std::swap(switcher->sceneTriggers[index],
|
||||
switcher->sceneTriggers[index + 1]);
|
||||
}
|
||||
|
||||
void SceneTrigger::logMatch()
|
||||
{
|
||||
std::string sceneName = "";
|
||||
std::string statusName = "";
|
||||
std::string actionName = "";
|
||||
|
||||
switch (triggerType) {
|
||||
case sceneTriggerType::NONE:
|
||||
statusName = "NONE";
|
||||
break;
|
||||
case sceneTriggerType::SCENE_ACTIVE:
|
||||
statusName = "SCENE ACTIVE";
|
||||
break;
|
||||
case sceneTriggerType::SCENE_INACTIVE:
|
||||
statusName = "SCENE INACTIVE";
|
||||
break;
|
||||
case sceneTriggerType::SCENE_LEAVE:
|
||||
statusName = "SCENE LEAVE";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (triggerAction) {
|
||||
case sceneTriggerAction::NONE:
|
||||
actionName = "NONE";
|
||||
break;
|
||||
case sceneTriggerAction::START_RECORDING:
|
||||
actionName = "START RECORDING";
|
||||
break;
|
||||
case sceneTriggerAction::PAUSE_RECORDING:
|
||||
actionName = "PAUSE RECORDING";
|
||||
break;
|
||||
case sceneTriggerAction::UNPAUSE_RECORDING:
|
||||
actionName = "UNPAUSE RECORDING";
|
||||
break;
|
||||
case sceneTriggerAction::STOP_RECORDING:
|
||||
actionName = "STOP RECORDING";
|
||||
break;
|
||||
case sceneTriggerAction::START_STREAMING:
|
||||
actionName = "START STREAMING";
|
||||
break;
|
||||
case sceneTriggerAction::STOP_STREAMING:
|
||||
actionName = "STOP STREAMING";
|
||||
break;
|
||||
case sceneTriggerAction::START_REPLAY_BUFFER:
|
||||
actionName = "START REPLAY BUFFER";
|
||||
break;
|
||||
case sceneTriggerAction::STOP_REPLAY_BUFFER:
|
||||
actionName = "STOP REPLAY BUFFER";
|
||||
break;
|
||||
case sceneTriggerAction::MUTE_SOURCE:
|
||||
actionName = "MUTE (" + GetWeakSourceName(audioSource) + ")";
|
||||
break;
|
||||
case sceneTriggerAction::UNMUTE_SOURCE:
|
||||
actionName = "UNMUTE (" + GetWeakSourceName(audioSource) + ")";
|
||||
break;
|
||||
case sceneTriggerAction::START_SWITCHER:
|
||||
actionName = "START SCENE SWITCHER";
|
||||
break;
|
||||
case sceneTriggerAction::STOP_SWITCHER:
|
||||
actionName = "STOP SCENE SWITCHER";
|
||||
break;
|
||||
case sceneTriggerAction::START_VCAM:
|
||||
actionName = "START VIRTUAL CAMERA";
|
||||
break;
|
||||
case sceneTriggerAction::STOP_VCAM:
|
||||
actionName = "STOP VIRTUAL CAMERA";
|
||||
break;
|
||||
default:
|
||||
actionName = "UNKNOWN";
|
||||
break;
|
||||
}
|
||||
|
||||
blog(LOG_INFO,
|
||||
"scene '%s' in status '%s' triggering action '%s' after %f seconds",
|
||||
GetWeakSourceName(scene).c_str(), statusName.c_str(),
|
||||
actionName.c_str(), duration.Seconds());
|
||||
}
|
||||
|
||||
void frontEndActionThread(sceneTriggerAction action, double delay)
|
||||
{
|
||||
long long mil = delay * 1000;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(mil));
|
||||
|
||||
switch (action) {
|
||||
case sceneTriggerAction::NONE:
|
||||
break;
|
||||
case sceneTriggerAction::START_RECORDING:
|
||||
obs_frontend_recording_start();
|
||||
break;
|
||||
case sceneTriggerAction::PAUSE_RECORDING:
|
||||
obs_frontend_recording_pause(true);
|
||||
break;
|
||||
case sceneTriggerAction::UNPAUSE_RECORDING:
|
||||
obs_frontend_recording_pause(false);
|
||||
break;
|
||||
case sceneTriggerAction::STOP_RECORDING:
|
||||
obs_frontend_recording_stop();
|
||||
break;
|
||||
case sceneTriggerAction::START_STREAMING:
|
||||
obs_frontend_streaming_start();
|
||||
break;
|
||||
case sceneTriggerAction::STOP_STREAMING:
|
||||
obs_frontend_streaming_stop();
|
||||
break;
|
||||
#if LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(26, 0, 0)
|
||||
case sceneTriggerAction::START_REPLAY_BUFFER:
|
||||
obs_frontend_replay_buffer_start();
|
||||
break;
|
||||
case sceneTriggerAction::STOP_REPLAY_BUFFER:
|
||||
obs_frontend_replay_buffer_stop();
|
||||
break;
|
||||
#endif
|
||||
#if LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(27, 0, 0)
|
||||
case sceneTriggerAction::START_VCAM:
|
||||
obs_frontend_start_virtualcam();
|
||||
break;
|
||||
case sceneTriggerAction::STOP_VCAM:
|
||||
obs_frontend_stop_virtualcam();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
blog(LOG_WARNING, "ignoring unexpected frontend action '%d'",
|
||||
static_cast<int>(action));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void muteThread(OBSWeakSource source, double delay, bool mute)
|
||||
{
|
||||
long long mil = delay * 1000;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(mil));
|
||||
|
||||
auto s = obs_weak_source_get_source(source);
|
||||
obs_source_set_muted(s, mute);
|
||||
obs_source_release(s);
|
||||
}
|
||||
|
||||
void statusThread(double delay, bool stop)
|
||||
{
|
||||
long long mil = delay * 1000;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(mil));
|
||||
|
||||
if (stop) {
|
||||
switcher->Stop();
|
||||
} else {
|
||||
switcher->Start();
|
||||
}
|
||||
}
|
||||
|
||||
bool isFrontendAction(sceneTriggerAction triggerAction)
|
||||
{
|
||||
return triggerAction == sceneTriggerAction::START_RECORDING ||
|
||||
triggerAction == sceneTriggerAction::PAUSE_RECORDING ||
|
||||
triggerAction == sceneTriggerAction::UNPAUSE_RECORDING ||
|
||||
triggerAction == sceneTriggerAction::STOP_RECORDING ||
|
||||
triggerAction == sceneTriggerAction::START_STREAMING ||
|
||||
triggerAction == sceneTriggerAction::STOP_STREAMING ||
|
||||
triggerAction == sceneTriggerAction::START_REPLAY_BUFFER ||
|
||||
triggerAction == sceneTriggerAction::STOP_REPLAY_BUFFER ||
|
||||
triggerAction == sceneTriggerAction::START_VCAM ||
|
||||
triggerAction == sceneTriggerAction::STOP_VCAM;
|
||||
}
|
||||
|
||||
bool isAudioAction(sceneTriggerAction t)
|
||||
{
|
||||
return t == sceneTriggerAction::MUTE_SOURCE ||
|
||||
t == sceneTriggerAction::UNMUTE_SOURCE;
|
||||
}
|
||||
|
||||
bool isSwitcherStatusAction(sceneTriggerAction t)
|
||||
{
|
||||
return t == sceneTriggerAction::START_SWITCHER ||
|
||||
t == sceneTriggerAction::STOP_SWITCHER;
|
||||
}
|
||||
|
||||
void SceneTrigger::performAction()
|
||||
{
|
||||
if (triggerAction == sceneTriggerAction::NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::thread t;
|
||||
|
||||
if (isFrontendAction(triggerAction)) {
|
||||
t = std::thread(frontEndActionThread, triggerAction,
|
||||
duration.Seconds());
|
||||
} else if (isAudioAction(triggerAction)) {
|
||||
bool mute = triggerAction == sceneTriggerAction::MUTE_SOURCE;
|
||||
t = std::thread(muteThread, audioSource, duration.Seconds(),
|
||||
mute);
|
||||
} else if (isSwitcherStatusAction(triggerAction)) {
|
||||
bool stop = triggerAction == sceneTriggerAction::STOP_SWITCHER;
|
||||
t = std::thread(statusThread, duration.Seconds(), stop);
|
||||
} else {
|
||||
blog(LOG_WARNING, "ignoring unknown action '%d'",
|
||||
static_cast<int>(triggerAction));
|
||||
}
|
||||
|
||||
t.detach();
|
||||
}
|
||||
|
||||
bool SceneTrigger::checkMatch(OBSWeakSource currentScene,
|
||||
OBSWeakSource previousScene)
|
||||
{
|
||||
switch (triggerType) {
|
||||
case sceneTriggerType::NONE:
|
||||
return false;
|
||||
case sceneTriggerType::SCENE_ACTIVE:
|
||||
return currentScene == scene;
|
||||
case sceneTriggerType::SCENE_INACTIVE:
|
||||
return currentScene != scene;
|
||||
case sceneTriggerType::SCENE_LEAVE:
|
||||
return previousScene == scene;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SwitcherData::checkTriggers()
|
||||
{
|
||||
if (SceneTrigger::pause) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto &t : sceneTriggers) {
|
||||
if (stop && !isSwitcherStatusAction(t.triggerAction)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (t.checkMatch(currentScene, previousScene)) {
|
||||
t.logMatch();
|
||||
t.performAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SwitcherData::saveSceneTriggers(obs_data_t *obj)
|
||||
{
|
||||
obs_data_array_t *triggerArray = obs_data_array_create();
|
||||
for (auto &s : sceneTriggers) {
|
||||
obs_data_t *array_obj = obs_data_create();
|
||||
|
||||
s.save(array_obj);
|
||||
obs_data_array_push_back(triggerArray, array_obj);
|
||||
|
||||
obs_data_release(array_obj);
|
||||
}
|
||||
obs_data_set_array(obj, "triggers", triggerArray);
|
||||
obs_data_array_release(triggerArray);
|
||||
}
|
||||
|
||||
void SwitcherData::loadSceneTriggers(obs_data_t *obj)
|
||||
{
|
||||
sceneTriggers.clear();
|
||||
|
||||
obs_data_array_t *triggerArray = obs_data_get_array(obj, "triggers");
|
||||
size_t count = obs_data_array_count(triggerArray);
|
||||
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
obs_data_t *array_obj = obs_data_array_item(triggerArray, i);
|
||||
|
||||
sceneTriggers.emplace_back();
|
||||
sceneTriggers.back().load(array_obj);
|
||||
|
||||
obs_data_release(array_obj);
|
||||
}
|
||||
obs_data_array_release(triggerArray);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::SetupTriggerTab()
|
||||
{
|
||||
for (auto &s : switcher->sceneTriggers) {
|
||||
QListWidgetItem *item;
|
||||
item = new QListWidgetItem(ui->sceneTriggers);
|
||||
ui->sceneTriggers->addItem(item);
|
||||
SceneTriggerWidget *sw = new SceneTriggerWidget(this, &s);
|
||||
item->setSizeHint(sw->minimumSizeHint());
|
||||
ui->sceneTriggers->setItemWidget(item, sw);
|
||||
}
|
||||
|
||||
if (switcher->sceneTriggers.size() == 0) {
|
||||
if (!switcher->disableHints) {
|
||||
addPulse = HighlightWidget(ui->triggerAdd,
|
||||
QColor(Qt::green));
|
||||
}
|
||||
ui->triggerHelp->setVisible(true);
|
||||
} else {
|
||||
ui->triggerHelp->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
void SceneTrigger::save(obs_data_t *obj)
|
||||
{
|
||||
obs_data_set_string(obj, "scene", GetWeakSourceName(scene).c_str());
|
||||
obs_data_set_int(obj, "triggerType", static_cast<int>(triggerType));
|
||||
obs_data_set_int(obj, "triggerAction", static_cast<int>(triggerAction));
|
||||
duration.Save(obj, "duration");
|
||||
obs_data_set_string(obj, "audioSource",
|
||||
GetWeakSourceName(audioSource).c_str());
|
||||
}
|
||||
|
||||
void SceneTrigger::load(obs_data_t *obj)
|
||||
{
|
||||
const char *sceneName = obs_data_get_string(obj, "scene");
|
||||
scene = GetWeakSourceByName(sceneName);
|
||||
|
||||
triggerType = static_cast<sceneTriggerType>(
|
||||
obs_data_get_int(obj, "triggerType"));
|
||||
triggerAction = static_cast<sceneTriggerAction>(
|
||||
obs_data_get_int(obj, "triggerAction"));
|
||||
duration.Load(obj, "duration");
|
||||
|
||||
const char *audioSourceName = obs_data_get_string(obj, "audioSource");
|
||||
audioSource = GetWeakSourceByName(audioSourceName);
|
||||
}
|
||||
|
||||
static inline void populateTriggers(QComboBox *list)
|
||||
{
|
||||
AddSelectionEntry(
|
||||
list,
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.none"));
|
||||
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneActive"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneInactive"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.sceneLeave"));
|
||||
}
|
||||
|
||||
inline void populateActions(QComboBox *list)
|
||||
{
|
||||
AddSelectionEntry(
|
||||
list,
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.none"));
|
||||
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startRecording"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.pauseRecording"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unpauseRecording"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopRecording"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startStreaming"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopStreaming"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startReplayBuffer"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopReplayBuffer"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.muteSource"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.unmuteSource"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startSwitcher"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopSwitcher"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.startVirtualCamera"));
|
||||
list->addItem(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.stopVirtualCamera"));
|
||||
}
|
||||
|
||||
SceneTriggerWidget::SceneTriggerWidget(QWidget *parent, SceneTrigger *s)
|
||||
: SwitchWidget(parent, s, false, false)
|
||||
{
|
||||
triggers = new QComboBox();
|
||||
actions = new QComboBox();
|
||||
duration = new DurationSelection();
|
||||
audioSources = new QComboBox();
|
||||
|
||||
QWidget::connect(triggers, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(TriggerTypeChanged(int)));
|
||||
QWidget::connect(actions, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(TriggerActionChanged(int)));
|
||||
QWidget::connect(duration, SIGNAL(DurationChanged(const Duration &)),
|
||||
this, SLOT(DurationChanged(const Duration &)));
|
||||
QWidget::connect(audioSources,
|
||||
SIGNAL(currentTextChanged(const QString &)), this,
|
||||
SLOT(AudioSourceChanged(const QString &)));
|
||||
|
||||
populateTriggers(triggers);
|
||||
populateActions(actions);
|
||||
PopulateAudioSelection(audioSources);
|
||||
|
||||
if (s) {
|
||||
triggers->setCurrentIndex(static_cast<int>(s->triggerType));
|
||||
actions->setCurrentIndex(static_cast<int>(s->triggerAction));
|
||||
duration->SetDuration(s->duration);
|
||||
|
||||
audioSources->setCurrentText(
|
||||
GetWeakSourceName(s->audioSource).c_str());
|
||||
|
||||
if (isAudioAction(s->triggerAction)) {
|
||||
audioSources->show();
|
||||
} else {
|
||||
audioSources->hide();
|
||||
}
|
||||
}
|
||||
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{triggers}}", triggers},
|
||||
{"{{actions}}", actions},
|
||||
{"{{audioSources}}", audioSources},
|
||||
{"{{duration}}", duration},
|
||||
{"{{scenes}}", scenes}};
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.sceneTriggerTab.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
switchData = s;
|
||||
|
||||
loading = false;
|
||||
}
|
||||
|
||||
SceneTrigger *SceneTriggerWidget::getSwitchData()
|
||||
{
|
||||
return switchData;
|
||||
}
|
||||
|
||||
void SceneTriggerWidget::setSwitchData(SceneTrigger *s)
|
||||
{
|
||||
switchData = s;
|
||||
}
|
||||
|
||||
void SceneTriggerWidget::swapSwitchData(SceneTriggerWidget *s1,
|
||||
SceneTriggerWidget *s2)
|
||||
{
|
||||
SwitchWidget::swapSwitchData(s1, s2);
|
||||
|
||||
SceneTrigger *t = s1->getSwitchData();
|
||||
s1->setSwitchData(s2->getSwitchData());
|
||||
s2->setSwitchData(t);
|
||||
}
|
||||
|
||||
void SceneTriggerWidget::TriggerTypeChanged(int index)
|
||||
{
|
||||
if (loading || !switchData) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switchData->triggerType = static_cast<sceneTriggerType>(index);
|
||||
}
|
||||
|
||||
void SceneTriggerWidget::TriggerActionChanged(int index)
|
||||
{
|
||||
if (loading || !switchData) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switchData->triggerAction =
|
||||
static_cast<sceneTriggerAction>(index);
|
||||
}
|
||||
|
||||
if (isAudioAction(switchData->triggerAction)) {
|
||||
audioSources->show();
|
||||
} else {
|
||||
audioSources->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void SceneTriggerWidget::DurationChanged(const Duration &duration)
|
||||
{
|
||||
if (loading || !switchData) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switchData->duration = duration;
|
||||
}
|
||||
|
||||
void SceneTriggerWidget::AudioSourceChanged(const QString &text)
|
||||
{
|
||||
if (loading || !switchData) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switchData->audioSource = GetWeakSourceByQString(text);
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
@@ -1,88 +0,0 @@
|
||||
/******************************************************************************
|
||||
Note: Long-term goal is to remove this tab / file.
|
||||
Most functionality shall be moved to the Macro tab instead.
|
||||
|
||||
So if you plan to make changes here, please consider applying them to the
|
||||
corresponding macro tab functionality instead.
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include "switch-generic.hpp"
|
||||
#include "duration-control.hpp"
|
||||
|
||||
namespace advss {
|
||||
|
||||
enum class sceneTriggerType {
|
||||
NONE = 0,
|
||||
SCENE_ACTIVE = 1,
|
||||
SCENE_INACTIVE = 2,
|
||||
SCENE_LEAVE = 3,
|
||||
};
|
||||
|
||||
enum class sceneTriggerAction {
|
||||
NONE = 0,
|
||||
START_RECORDING,
|
||||
PAUSE_RECORDING,
|
||||
UNPAUSE_RECORDING,
|
||||
STOP_RECORDING,
|
||||
|
||||
START_STREAMING,
|
||||
STOP_STREAMING,
|
||||
|
||||
START_REPLAY_BUFFER,
|
||||
STOP_REPLAY_BUFFER,
|
||||
|
||||
MUTE_SOURCE,
|
||||
UNMUTE_SOURCE,
|
||||
|
||||
START_SWITCHER,
|
||||
STOP_SWITCHER,
|
||||
|
||||
START_VCAM,
|
||||
STOP_VCAM,
|
||||
};
|
||||
|
||||
struct SceneTrigger : SceneSwitcherEntry {
|
||||
static bool pause;
|
||||
sceneTriggerType triggerType = sceneTriggerType::NONE;
|
||||
sceneTriggerAction triggerAction = sceneTriggerAction::NONE;
|
||||
Duration duration;
|
||||
OBSWeakSource audioSource = nullptr;
|
||||
|
||||
const char *getType() { return "trigger"; }
|
||||
void save(obs_data_t *obj);
|
||||
void load(obs_data_t *obj);
|
||||
|
||||
bool checkMatch(OBSWeakSource currentScene,
|
||||
OBSWeakSource previousScene);
|
||||
void performAction();
|
||||
void logMatch();
|
||||
};
|
||||
|
||||
class SceneTriggerWidget : public SwitchWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SceneTriggerWidget(QWidget *parent, SceneTrigger *s);
|
||||
SceneTrigger *getSwitchData();
|
||||
void setSwitchData(SceneTrigger *s);
|
||||
|
||||
static void swapSwitchData(SceneTriggerWidget *s1,
|
||||
SceneTriggerWidget *s2);
|
||||
|
||||
private slots:
|
||||
void TriggerTypeChanged(int index);
|
||||
void TriggerActionChanged(int index);
|
||||
void DurationChanged(const Duration &);
|
||||
void AudioSourceChanged(const QString &text);
|
||||
|
||||
private:
|
||||
QComboBox *triggers;
|
||||
QComboBox *actions;
|
||||
DurationSelection *duration;
|
||||
QComboBox *audioSources;
|
||||
|
||||
SceneTrigger *switchData;
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
@@ -22,7 +22,7 @@ void AdvSceneSwitcher::on_audioAdd_clicked()
|
||||
AudioSwitchWidget *sw =
|
||||
new AudioSwitchWidget(this, &switcher->audioSwitches.back());
|
||||
|
||||
listAddClicked(ui->audioSwitches, sw, ui->audioAdd, addPulse);
|
||||
listAddClicked(ui->audioSwitches, sw, &addPulse);
|
||||
|
||||
ui->audioHelp->setVisible(false);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ void AdvSceneSwitcher::on_executableAdd_clicked()
|
||||
listAddClicked(ui->executables,
|
||||
new ExecutableSwitchWidget(
|
||||
this, &switcher->executableSwitches.back()),
|
||||
ui->executableAdd, addPulse);
|
||||
&addPulse);
|
||||
|
||||
ui->exeHelp->setVisible(false);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ void AdvSceneSwitcher::on_fileAdd_clicked()
|
||||
listAddClicked(ui->fileSwitches,
|
||||
new FileSwitchWidget(this,
|
||||
&switcher->fileSwitches.back()),
|
||||
ui->fileAdd, addPulse);
|
||||
&addPulse);
|
||||
|
||||
ui->fileHelp->setVisible(false);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ void AdvSceneSwitcher::on_mediaAdd_clicked()
|
||||
listAddClicked(ui->mediaSwitches,
|
||||
new MediaSwitchWidget(this,
|
||||
&switcher->mediaSwitches.back()),
|
||||
ui->mediaAdd, addPulse);
|
||||
&addPulse);
|
||||
|
||||
ui->mediaHelp->setVisible(false);
|
||||
}
|
||||
|
||||
@@ -1,717 +0,0 @@
|
||||
/*
|
||||
Most of this code is based on https://github.com/Palakis/obs-websocket
|
||||
*/
|
||||
|
||||
#include "advanced-scene-switcher.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
#include "scene-switch-helpers.hpp"
|
||||
#include "source-helpers.hpp"
|
||||
#include "switcher-data.hpp"
|
||||
|
||||
#include <obs-frontend-api.h>
|
||||
#include <QMessageBox>
|
||||
#include <QTime>
|
||||
#include <QMainWindow>
|
||||
|
||||
namespace advss {
|
||||
|
||||
#define PARAM_SERVER_ENABLE "ServerEnabled"
|
||||
#define PARAM_SERVER_PORT "ServerPort"
|
||||
#define PARAM_LOCKTOIPV4 "LockToIPv4"
|
||||
|
||||
#define PARAM_CLIENT_ENABLE "ClientEnabled"
|
||||
#define PARAM_CLIENT_PORT "ClientPort"
|
||||
#define PARAM_ADDRESS "Address"
|
||||
#define PARAM_CLIENT_SEND_SCENE_CHANGE "SendSceneChange"
|
||||
#define PARAM_CLIENT_SEND_SCENE_CHANGE_ALL "SendSceneChangeAll"
|
||||
#define PARAM_CLIENT_SENDPREVIEW "SendPreview"
|
||||
|
||||
#define RECONNECT_DELAY 10
|
||||
|
||||
#define SCENE_ENTRY "scene"
|
||||
#define TRANSITION_ENTRY "transition"
|
||||
#define TRANSITION_DURATION "duration"
|
||||
#define SET_PREVIEW "preview"
|
||||
|
||||
using websocketpp::lib::placeholders::_1;
|
||||
using websocketpp::lib::placeholders::_2;
|
||||
using websocketpp::lib::bind;
|
||||
|
||||
NetworkConfig::NetworkConfig()
|
||||
: ServerEnabled(false),
|
||||
ServerPort(55555),
|
||||
LockToIPv4(false),
|
||||
ClientEnabled(false),
|
||||
Address(""),
|
||||
ClientPort(55555),
|
||||
SendSceneChange(true),
|
||||
SendSceneChangeAll(true),
|
||||
SendPreview(true)
|
||||
{
|
||||
}
|
||||
|
||||
void NetworkConfig::Load(obs_data_t *obj)
|
||||
{
|
||||
SetDefaults(obj);
|
||||
|
||||
ServerEnabled = obs_data_get_bool(obj, PARAM_SERVER_ENABLE);
|
||||
ServerPort = obs_data_get_int(obj, PARAM_SERVER_PORT);
|
||||
LockToIPv4 = obs_data_get_bool(obj, PARAM_LOCKTOIPV4);
|
||||
|
||||
ClientEnabled = obs_data_get_bool(obj, PARAM_CLIENT_ENABLE);
|
||||
Address = obs_data_get_string(obj, PARAM_ADDRESS);
|
||||
ClientPort = obs_data_get_int(obj, PARAM_CLIENT_PORT);
|
||||
SendSceneChange =
|
||||
obs_data_get_bool(obj, PARAM_CLIENT_SEND_SCENE_CHANGE);
|
||||
SendSceneChangeAll =
|
||||
obs_data_get_bool(obj, PARAM_CLIENT_SEND_SCENE_CHANGE_ALL);
|
||||
SendPreview = obs_data_get_bool(obj, PARAM_CLIENT_SENDPREVIEW);
|
||||
}
|
||||
|
||||
void NetworkConfig::Save(obs_data_t *obj)
|
||||
{
|
||||
obs_data_set_bool(obj, PARAM_SERVER_ENABLE, ServerEnabled);
|
||||
obs_data_set_int(obj, PARAM_SERVER_PORT, ServerPort);
|
||||
obs_data_set_bool(obj, PARAM_LOCKTOIPV4, LockToIPv4);
|
||||
|
||||
obs_data_set_bool(obj, PARAM_CLIENT_ENABLE, ClientEnabled);
|
||||
obs_data_set_string(obj, PARAM_ADDRESS, Address.c_str());
|
||||
obs_data_set_int(obj, PARAM_CLIENT_PORT, ClientPort);
|
||||
obs_data_set_bool(obj, PARAM_CLIENT_SEND_SCENE_CHANGE, SendSceneChange);
|
||||
obs_data_set_bool(obj, PARAM_CLIENT_SEND_SCENE_CHANGE_ALL,
|
||||
SendSceneChangeAll);
|
||||
obs_data_set_bool(obj, PARAM_CLIENT_SENDPREVIEW, SendPreview);
|
||||
}
|
||||
|
||||
void NetworkConfig::SetDefaults(obs_data_t *obj)
|
||||
{
|
||||
obs_data_set_default_bool(obj, PARAM_SERVER_ENABLE, false);
|
||||
obs_data_set_default_int(obj, PARAM_SERVER_PORT, ServerPort);
|
||||
obs_data_set_default_bool(obj, PARAM_LOCKTOIPV4, LockToIPv4);
|
||||
|
||||
obs_data_set_default_bool(obj, PARAM_CLIENT_ENABLE, false);
|
||||
obs_data_set_default_string(obj, PARAM_ADDRESS, Address.c_str());
|
||||
obs_data_set_default_int(obj, PARAM_CLIENT_PORT, ClientPort);
|
||||
obs_data_set_default_bool(obj, PARAM_CLIENT_SEND_SCENE_CHANGE,
|
||||
SendSceneChange);
|
||||
obs_data_set_default_bool(obj, PARAM_CLIENT_SEND_SCENE_CHANGE_ALL,
|
||||
SendSceneChangeAll);
|
||||
obs_data_set_default_bool(obj, PARAM_CLIENT_SENDPREVIEW, SendPreview);
|
||||
}
|
||||
|
||||
std::string NetworkConfig::GetClientUri()
|
||||
{
|
||||
return "ws://" + Address + ":" + std::to_string(ClientPort);
|
||||
}
|
||||
|
||||
bool NetworkConfig::ShouldSendSceneChange()
|
||||
{
|
||||
return ServerEnabled && SendSceneChange;
|
||||
}
|
||||
|
||||
bool NetworkConfig::ShouldSendFrontendSceneChange()
|
||||
{
|
||||
return ShouldSendSceneChange() && SendSceneChangeAll;
|
||||
}
|
||||
|
||||
bool NetworkConfig::ShouldSendPrviewSceneChange()
|
||||
{
|
||||
return ServerEnabled && SendPreview;
|
||||
}
|
||||
|
||||
WSServer::WSServer() : QObject(nullptr), _connections(), _clMutex()
|
||||
{
|
||||
_server.get_alog().clear_channels(
|
||||
websocketpp::log::alevel::frame_header |
|
||||
websocketpp::log::alevel::frame_payload |
|
||||
websocketpp::log::alevel::control);
|
||||
_server.init_asio();
|
||||
#ifndef _WIN32
|
||||
_server.set_reuse_addr(true);
|
||||
#endif
|
||||
|
||||
_server.set_open_handler(bind(&WSServer::onOpen, this, _1));
|
||||
_server.set_close_handler(bind(&WSServer::onClose, this, _1));
|
||||
_server.set_message_handler(bind(&WSServer::onMessage, this, _1, _2));
|
||||
}
|
||||
|
||||
WSServer::~WSServer()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
void WSServer::start(quint16 port, bool lockToIPv4)
|
||||
{
|
||||
if (_server.is_listening() &&
|
||||
(port == _serverPort && _lockToIPv4 == lockToIPv4)) {
|
||||
blog(LOG_INFO,
|
||||
"WSServer::start: server already on this port and protocol mode. no restart needed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_server.is_listening()) {
|
||||
stop();
|
||||
}
|
||||
|
||||
_server.reset();
|
||||
|
||||
_serverPort = port;
|
||||
_lockToIPv4 = lockToIPv4;
|
||||
|
||||
websocketpp::lib::error_code errorCode;
|
||||
if (lockToIPv4) {
|
||||
blog(LOG_INFO, "WSServer::start: Locked to IPv4 bindings");
|
||||
_server.listen(websocketpp::lib::asio::ip::tcp::v4(),
|
||||
_serverPort, errorCode);
|
||||
} else {
|
||||
blog(LOG_INFO, "WSServer::start: Not locked to IPv4 bindings");
|
||||
_server.listen(_serverPort, errorCode);
|
||||
}
|
||||
|
||||
if (errorCode) {
|
||||
std::string errorCodeMessage = errorCode.message();
|
||||
blog(LOG_INFO, "server: listen failed: %s",
|
||||
errorCodeMessage.c_str());
|
||||
|
||||
QString errorTitle =
|
||||
obs_module_text("AdvSceneSwitcher.windowTitle");
|
||||
QString errorMessage =
|
||||
QString(obs_module_text(
|
||||
"AdvSceneSwitcher.networkTab.startFailed.message"))
|
||||
.arg(_serverPort)
|
||||
.arg(errorCodeMessage.c_str());
|
||||
|
||||
QMainWindow *mainWindow = reinterpret_cast<QMainWindow *>(
|
||||
obs_frontend_get_main_window());
|
||||
QMessageBox::warning(mainWindow, errorTitle, errorMessage);
|
||||
|
||||
return;
|
||||
}
|
||||
switcher->serverStatus = ServerStatus::STARTING;
|
||||
|
||||
_server.start_accept();
|
||||
|
||||
_threadPool.start(Compatability::CreateFunctionRunnable([=]() {
|
||||
blog(LOG_INFO, "WSServer::start: io thread started");
|
||||
_server.run();
|
||||
blog(LOG_INFO, "WSServer::start: io thread exited");
|
||||
}));
|
||||
|
||||
switcher->serverStatus = ServerStatus::RUNNING;
|
||||
blog(LOG_INFO,
|
||||
"WSServer::start: server started successfully on port %d",
|
||||
_serverPort);
|
||||
}
|
||||
|
||||
void WSServer::stop()
|
||||
{
|
||||
if (!_server.is_listening()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_server.stop_listening();
|
||||
for (connection_hdl hdl : _connections) {
|
||||
websocketpp::lib::error_code ec;
|
||||
_server.close(hdl, websocketpp::close::status::going_away,
|
||||
"Server stopping", ec);
|
||||
}
|
||||
|
||||
_threadPool.waitForDone();
|
||||
|
||||
while (_connections.size() > 0) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
|
||||
switcher->serverStatus = ServerStatus::NOT_RUNNING;
|
||||
blog(LOG_INFO, "server stopped successfully");
|
||||
}
|
||||
|
||||
void WSServer::sendMessage(SceneSwitchInfo sceneSwitch, bool preview)
|
||||
{
|
||||
if (!sceneSwitch.scene) {
|
||||
return;
|
||||
}
|
||||
|
||||
OBSData data = obs_data_create();
|
||||
obs_data_set_string(data, SCENE_ENTRY,
|
||||
GetWeakSourceName(sceneSwitch.scene).c_str());
|
||||
obs_data_set_string(data, TRANSITION_ENTRY,
|
||||
GetWeakSourceName(sceneSwitch.transition).c_str());
|
||||
obs_data_set_int(data, TRANSITION_DURATION, sceneSwitch.duration);
|
||||
obs_data_set_bool(data, SET_PREVIEW, preview);
|
||||
std::string message = obs_data_get_json(data);
|
||||
obs_data_release(data);
|
||||
|
||||
for (connection_hdl hdl : _connections) {
|
||||
websocketpp::lib::error_code ec;
|
||||
_server.send(hdl, message, websocketpp::frame::opcode::text,
|
||||
ec);
|
||||
if (ec) {
|
||||
std::string errorCodeMessage = ec.message();
|
||||
blog(LOG_INFO, "server: send failed: %s",
|
||||
errorCodeMessage.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
if (VerboseLoggingEnabled()) {
|
||||
blog(LOG_INFO, "server sent message:\n%s", message.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void WSServer::onOpen(connection_hdl hdl)
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(_clMutex);
|
||||
_connections.insert(hdl);
|
||||
}
|
||||
|
||||
QString clientIp = getRemoteEndpoint(hdl);
|
||||
blog(LOG_INFO, "new client connection from %s",
|
||||
clientIp.toUtf8().constData());
|
||||
}
|
||||
|
||||
std::string processMessage(std::string payload)
|
||||
{
|
||||
auto config = switcher->networkConfig;
|
||||
std::string msgContainer(payload);
|
||||
const char *msg = msgContainer.c_str();
|
||||
|
||||
OBSData data = obs_data_create_from_json(msg);
|
||||
if (!data) {
|
||||
blog(LOG_ERROR, "invalid JSON payload received for '%s'", msg);
|
||||
return "invalid JSON payload";
|
||||
}
|
||||
|
||||
if (!obs_data_has_user_value(data, SCENE_ENTRY) ||
|
||||
!obs_data_has_user_value(data, TRANSITION_ENTRY) ||
|
||||
!obs_data_has_user_value(data, TRANSITION_DURATION) ||
|
||||
!obs_data_has_user_value(data, SET_PREVIEW)) {
|
||||
return "missing request parameters";
|
||||
}
|
||||
|
||||
std::string sceneName = obs_data_get_string(data, SCENE_ENTRY);
|
||||
std::string transitionName =
|
||||
obs_data_get_string(data, TRANSITION_ENTRY);
|
||||
int duration = obs_data_get_int(data, TRANSITION_DURATION);
|
||||
bool preview = obs_data_get_bool(data, SET_PREVIEW);
|
||||
|
||||
obs_data_release(data);
|
||||
|
||||
auto scene = GetWeakSourceByName(sceneName.c_str());
|
||||
if (!scene) {
|
||||
return "ignoring request - unknown scene '" + sceneName + "'";
|
||||
}
|
||||
|
||||
std::string ret = "message ok";
|
||||
|
||||
auto transition = GetWeakTransitionByName(transitionName.c_str());
|
||||
if (VerboseLoggingEnabled() && !transition) {
|
||||
ret += " - ignoring invalid transition: '" + transitionName +
|
||||
"'";
|
||||
}
|
||||
if (preview) {
|
||||
SwitchPreviewScene(scene);
|
||||
} else {
|
||||
SwitchScene({scene, transition, duration});
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void WSServer::onMessage(connection_hdl, server::message_ptr message)
|
||||
{
|
||||
auto opcode = message->get_opcode();
|
||||
if (opcode != websocketpp::frame::opcode::text) {
|
||||
return;
|
||||
}
|
||||
|
||||
_threadPool.start(Compatability::CreateFunctionRunnable([=]() {
|
||||
if (message->get_payload() != "message ok") {
|
||||
blog(LOG_WARNING, "received response: %s",
|
||||
message->get_payload().c_str());
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
void WSServer::onClose(connection_hdl hdl)
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(_clMutex);
|
||||
_connections.erase(hdl);
|
||||
}
|
||||
|
||||
auto conn = _server.get_con_from_hdl(hdl);
|
||||
auto localCloseCode = conn->get_local_close_code();
|
||||
|
||||
if (localCloseCode != websocketpp::close::status::going_away) {
|
||||
QString clientIp = getRemoteEndpoint(hdl);
|
||||
blog(LOG_INFO, "client %s disconnected",
|
||||
clientIp.toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
||||
QString WSServer::getRemoteEndpoint(connection_hdl hdl)
|
||||
{
|
||||
auto conn = _server.get_con_from_hdl(hdl);
|
||||
return QString::fromStdString(conn->get_remote_endpoint());
|
||||
}
|
||||
|
||||
WSClient::WSClient() : QObject(nullptr)
|
||||
{
|
||||
_client.get_alog().clear_channels(
|
||||
websocketpp::log::alevel::frame_header |
|
||||
websocketpp::log::alevel::frame_payload |
|
||||
websocketpp::log::alevel::control);
|
||||
_client.init_asio();
|
||||
#ifndef _WIN32
|
||||
_client.set_reuse_addr(true);
|
||||
#endif
|
||||
|
||||
_client.set_open_handler(bind(&WSClient::onOpen, this, _1));
|
||||
_client.set_fail_handler(bind(&WSClient::onFail, this, _1));
|
||||
_client.set_message_handler(bind(&WSClient::onMessage, this, _1, _2));
|
||||
_client.set_close_handler(bind(&WSClient::onClose, this, _1));
|
||||
}
|
||||
|
||||
WSClient::~WSClient()
|
||||
{
|
||||
disconnect();
|
||||
}
|
||||
|
||||
void WSClient::connectThread()
|
||||
{
|
||||
while (_retry) {
|
||||
_client.reset();
|
||||
switcher->clientStatus = ClientStatus::CONNECTING;
|
||||
// Create a connection to the given URI and queue it for connection once
|
||||
// the event loop starts
|
||||
websocketpp::lib::error_code ec;
|
||||
client::connection_ptr con = _client.get_connection(_uri, ec);
|
||||
if (ec) {
|
||||
_failMsg = ec.message();
|
||||
blog(LOG_INFO, "client: connect failed: %s",
|
||||
_failMsg.c_str());
|
||||
switcher->clientStatus = ClientStatus::FAIL;
|
||||
} else {
|
||||
_client.connect(con);
|
||||
_connection = connection_hdl(con);
|
||||
|
||||
// Start the ASIO io_service run loop
|
||||
blog(LOG_INFO, "WSClient::connect: io thread started");
|
||||
_connected = true;
|
||||
_client.run();
|
||||
_connected = false;
|
||||
blog(LOG_INFO, "WSClient::connect: io thread exited");
|
||||
}
|
||||
|
||||
if (_retry) {
|
||||
std::unique_lock<std::mutex> lck(_waitMtx);
|
||||
blog(LOG_INFO,
|
||||
"trying to reconnect to %s in %d seconds.",
|
||||
_uri.c_str(), RECONNECT_DELAY);
|
||||
_cv.wait_for(lck,
|
||||
std::chrono::seconds(RECONNECT_DELAY));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WSClient::connect(std::string uri)
|
||||
{
|
||||
disconnect();
|
||||
_uri = uri;
|
||||
_retry = true;
|
||||
|
||||
_thread = std::thread(&WSClient::connectThread, this);
|
||||
|
||||
switcher->clientStatus = ClientStatus::DISCONNECTED;
|
||||
blog(LOG_INFO, "WSClient::connect: exited");
|
||||
}
|
||||
|
||||
void WSClient::disconnect()
|
||||
{
|
||||
_retry = false;
|
||||
websocketpp::lib::error_code ec;
|
||||
_client.close(_connection, websocketpp::close::status::normal,
|
||||
"Client stopping", ec);
|
||||
|
||||
{
|
||||
std::unique_lock<std::mutex> waitLck(_waitMtx);
|
||||
blog(LOG_INFO, "trying to reconnect to %s in %d seconds.",
|
||||
_uri.c_str(), RECONNECT_DELAY);
|
||||
_cv.notify_all();
|
||||
}
|
||||
|
||||
while (_connected) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
_client.close(_connection, websocketpp::close::status::normal,
|
||||
"Client stopping", ec);
|
||||
}
|
||||
|
||||
if (_thread.joinable()) {
|
||||
_thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
void WSClient::onOpen(connection_hdl)
|
||||
{
|
||||
blog(LOG_INFO, "connection to %s opened", _uri.c_str());
|
||||
switcher->clientStatus = ClientStatus::CONNECTED;
|
||||
}
|
||||
|
||||
void WSClient::onFail(connection_hdl)
|
||||
{
|
||||
blog(LOG_INFO, "connection to %s failed", _uri.c_str());
|
||||
}
|
||||
|
||||
void WSClient::onMessage(connection_hdl hdl, client::message_ptr message)
|
||||
{
|
||||
auto opcode = message->get_opcode();
|
||||
if (opcode != websocketpp::frame::opcode::text) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string payload = message->get_payload();
|
||||
std::string response = processMessage(payload);
|
||||
websocketpp::lib::error_code errorCode;
|
||||
_client.send(hdl, response, websocketpp::frame::opcode::text,
|
||||
errorCode);
|
||||
|
||||
if (errorCode) {
|
||||
std::string errorCodeMessage = errorCode.message();
|
||||
blog(LOG_INFO, "client(response): send failed: %s",
|
||||
errorCodeMessage.c_str());
|
||||
}
|
||||
|
||||
if (VerboseLoggingEnabled()) {
|
||||
blog(LOG_INFO, "client sent message:\n%s", response.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void WSClient::onClose(connection_hdl)
|
||||
{
|
||||
blog(LOG_INFO, "client-connection to %s closed.", _uri.c_str());
|
||||
switcher->clientStatus = ClientStatus::DISCONNECTED;
|
||||
}
|
||||
|
||||
void SwitcherData::loadNetworkSettings(obs_data_t *obj)
|
||||
{
|
||||
networkConfig.Load(obj);
|
||||
}
|
||||
|
||||
void SwitcherData::saveNetworkSwitches(obs_data_t *obj)
|
||||
{
|
||||
networkConfig.Save(obj);
|
||||
if (!networkConfig.ServerEnabled) {
|
||||
server.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::SetupNetworkTab()
|
||||
{
|
||||
ui->serverSettings->setChecked(switcher->networkConfig.ServerEnabled);
|
||||
ui->serverPort->setValue(switcher->networkConfig.ServerPort);
|
||||
ui->lockToIPv4->setChecked(switcher->networkConfig.LockToIPv4);
|
||||
|
||||
ui->clientSettings->setChecked(switcher->networkConfig.ClientEnabled);
|
||||
ui->clientHostname->setText(switcher->networkConfig.Address.c_str());
|
||||
ui->clientPort->setValue(switcher->networkConfig.ClientPort);
|
||||
ui->sendSceneChange->setChecked(
|
||||
switcher->networkConfig.SendSceneChange);
|
||||
ui->restrictSend->setChecked(
|
||||
!switcher->networkConfig.SendSceneChangeAll);
|
||||
ui->sendPreview->setChecked(switcher->networkConfig.SendPreview);
|
||||
ui->restrictSend->setDisabled(!switcher->networkConfig.SendSceneChange);
|
||||
|
||||
QTimer *statusTimer = new QTimer(this);
|
||||
connect(statusTimer, SIGNAL(timeout()), this,
|
||||
SLOT(UpdateClientStatus()));
|
||||
connect(statusTimer, SIGNAL(timeout()), this,
|
||||
SLOT(UpdateServerStatus()));
|
||||
statusTimer->start(500);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_serverSettings_toggled(bool on)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->networkConfig.ServerEnabled = on;
|
||||
if (on) {
|
||||
switcher->server.start(switcher->networkConfig.ServerPort,
|
||||
switcher->networkConfig.LockToIPv4);
|
||||
} else {
|
||||
switcher->server.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_serverPort_valueChanged(int value)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->networkConfig.ServerPort = value;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_lockToIPv4_stateChanged(int state)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->networkConfig.LockToIPv4 = state;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_serverRestart_clicked()
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->server.start(switcher->networkConfig.ServerPort,
|
||||
switcher->networkConfig.LockToIPv4);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::UpdateServerStatus()
|
||||
{
|
||||
switch (switcher->serverStatus) {
|
||||
case ServerStatus::NOT_RUNNING:
|
||||
ui->serverStatus->setText(obs_module_text(
|
||||
"AdvSceneSwitcher.networkTab.server.status.notRunning"));
|
||||
break;
|
||||
case ServerStatus::STARTING:
|
||||
ui->serverStatus->setText(obs_module_text(
|
||||
"AdvSceneSwitcher.networkTab.server.status.starting"));
|
||||
break;
|
||||
case ServerStatus::RUNNING:
|
||||
ui->serverStatus->setText(obs_module_text(
|
||||
"AdvSceneSwitcher.networkTab.server.status.running"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_clientSettings_toggled(bool on)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->networkConfig.ClientEnabled = on;
|
||||
|
||||
if (on) {
|
||||
switcher->client.connect(
|
||||
switcher->networkConfig.GetClientUri());
|
||||
} else {
|
||||
switcher->client.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_clientHostname_textChanged(const QString &text)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->networkConfig.Address = text.toUtf8().constData();
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_clientPort_valueChanged(int value)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->networkConfig.ClientPort = value;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_sendSceneChange_stateChanged(int state)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->networkConfig.SendSceneChange = state;
|
||||
ui->restrictSend->setDisabled(!state);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_restrictSend_stateChanged(int state)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->networkConfig.SendSceneChangeAll = !state;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_sendPreview_stateChanged(int state)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->networkConfig.SendPreview = state;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_clientReconnect_clicked()
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
switcher->client.connect(switcher->networkConfig.GetClientUri());
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::UpdateClientStatus()
|
||||
{
|
||||
switch (switcher->clientStatus) {
|
||||
case ClientStatus::DISCONNECTED:
|
||||
ui->clientStatus->setText(obs_module_text(
|
||||
"AdvSceneSwitcher.networkTab.client.status.disconnected"));
|
||||
break;
|
||||
case ClientStatus::CONNECTING:
|
||||
ui->clientStatus->setText(obs_module_text(
|
||||
"AdvSceneSwitcher.networkTab.client.status.connecting"));
|
||||
break;
|
||||
case ClientStatus::CONNECTED:
|
||||
ui->clientStatus->setText(obs_module_text(
|
||||
"AdvSceneSwitcher.networkTab.client.status.connected"));
|
||||
break;
|
||||
case ClientStatus::FAIL:
|
||||
ui->clientStatus->setText(QString("Error: ") +
|
||||
switcher->client.getFail().c_str());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Compatability::StdFunctionRunnable::run()
|
||||
{
|
||||
cb();
|
||||
}
|
||||
|
||||
QRunnable *Compatability::CreateFunctionRunnable(std::function<void()> func)
|
||||
{
|
||||
return new Compatability::StdFunctionRunnable(std::move(func));
|
||||
}
|
||||
|
||||
Compatability::StdFunctionRunnable::StdFunctionRunnable(
|
||||
std::function<void()> func)
|
||||
: cb(std::move(func))
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
@@ -1,137 +0,0 @@
|
||||
/*
|
||||
Most of this code is based on https://github.com/Palakis/obs-websocket
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <set>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QVariantHash>
|
||||
#include <QtCore/QThreadPool>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <functional>
|
||||
#include <QRunnable>
|
||||
|
||||
#include <websocketpp/config/asio_no_tls_client.hpp>
|
||||
#include <websocketpp/config/asio_no_tls.hpp>
|
||||
#include <websocketpp/server.hpp>
|
||||
#include <websocketpp/client.hpp>
|
||||
|
||||
namespace advss {
|
||||
|
||||
using websocketpp::connection_hdl;
|
||||
typedef websocketpp::server<websocketpp::config::asio> server;
|
||||
typedef websocketpp::client<websocketpp::config::asio_client> client;
|
||||
|
||||
struct SceneSwitchInfo;
|
||||
|
||||
class NetworkConfig {
|
||||
public:
|
||||
NetworkConfig();
|
||||
void Load(obs_data_t *obj);
|
||||
void Save(obs_data_t *obj);
|
||||
void SetDefaults(obs_data_t *obj);
|
||||
|
||||
std::string GetClientUri();
|
||||
|
||||
bool ShouldSendSceneChange();
|
||||
bool ShouldSendFrontendSceneChange();
|
||||
bool ShouldSendPrviewSceneChange();
|
||||
|
||||
// Server
|
||||
bool ServerEnabled;
|
||||
uint64_t ServerPort;
|
||||
bool LockToIPv4;
|
||||
|
||||
// Client
|
||||
bool ClientEnabled;
|
||||
std::string Address;
|
||||
uint64_t ClientPort;
|
||||
bool SendSceneChange;
|
||||
bool SendSceneChangeAll;
|
||||
bool SendPreview;
|
||||
};
|
||||
|
||||
class WSServer : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit WSServer();
|
||||
virtual ~WSServer();
|
||||
void start(quint16 port, bool lockToIPv4);
|
||||
void stop();
|
||||
void sendMessage(SceneSwitchInfo sceneSwitch, bool preview = false);
|
||||
QThreadPool *threadPool() { return &_threadPool; }
|
||||
|
||||
private:
|
||||
void onOpen(connection_hdl hdl);
|
||||
void onMessage(connection_hdl hdl, server::message_ptr message);
|
||||
void onClose(connection_hdl hdl);
|
||||
|
||||
QString getRemoteEndpoint(connection_hdl hdl);
|
||||
|
||||
server _server;
|
||||
quint16 _serverPort = 55555;
|
||||
bool _lockToIPv4 = false;
|
||||
std::set<connection_hdl, std::owner_less<connection_hdl>> _connections;
|
||||
std::recursive_mutex _clMutex;
|
||||
QThreadPool _threadPool;
|
||||
};
|
||||
|
||||
enum class ServerStatus {
|
||||
NOT_RUNNING,
|
||||
STARTING,
|
||||
RUNNING,
|
||||
};
|
||||
|
||||
class WSClient : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit WSClient();
|
||||
virtual ~WSClient();
|
||||
void connect(std::string uri);
|
||||
void disconnect();
|
||||
std::string getFail() { return _failMsg; }
|
||||
|
||||
private:
|
||||
void onOpen(connection_hdl hdl);
|
||||
void onFail(connection_hdl hdl);
|
||||
void onMessage(connection_hdl hdl, client::message_ptr message);
|
||||
void onClose(connection_hdl hdl);
|
||||
void connectThread();
|
||||
|
||||
client _client;
|
||||
std::string _uri;
|
||||
connection_hdl _connection;
|
||||
std::thread _thread;
|
||||
bool _retry = false;
|
||||
std::atomic_bool _connected = {false};
|
||||
std::mutex _waitMtx;
|
||||
std::condition_variable _cv;
|
||||
std::string _failMsg;
|
||||
};
|
||||
|
||||
enum class ClientStatus {
|
||||
DISCONNECTED,
|
||||
CONNECTING,
|
||||
CONNECTED,
|
||||
FAIL,
|
||||
};
|
||||
|
||||
namespace Compatability {
|
||||
// Reimplement QRunnable for std::function. Retrocompatability for Qt < 5.15
|
||||
class StdFunctionRunnable : public QRunnable {
|
||||
std::function<void()> cb;
|
||||
|
||||
public:
|
||||
StdFunctionRunnable(std::function<void()> func);
|
||||
void run() override;
|
||||
};
|
||||
|
||||
QRunnable *CreateFunctionRunnable(std::function<void()> func);
|
||||
} // namespace Compatability
|
||||
|
||||
} // namespace advss
|
||||
@@ -20,7 +20,7 @@ void AdvSceneSwitcher::on_pauseAdd_clicked()
|
||||
listAddClicked(ui->pauseEntries,
|
||||
new PauseEntryWidget(this,
|
||||
&switcher->pauseEntries.back()),
|
||||
ui->pauseAdd, addPulse);
|
||||
&addPulse);
|
||||
|
||||
ui->pauseHelp->setVisible(false);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ void AdvSceneSwitcher::on_randomAdd_clicked()
|
||||
listAddClicked(ui->randomSwitches,
|
||||
new RandomSwitchWidget(this,
|
||||
&switcher->randomSwitches.back()),
|
||||
ui->randomAdd, addPulse);
|
||||
&addPulse);
|
||||
|
||||
ui->randomHelp->setVisible(false);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ void AdvSceneSwitcher::SetupRandomTab()
|
||||
border-style: outset; \
|
||||
border-width: 2px; \
|
||||
border-radius: 7px; \
|
||||
border-color: rgb(0,0,0,0) \
|
||||
border-color: rgb(0,0,0) \
|
||||
}");
|
||||
if (switcher->switchIfNotMatching != NoMatchBehavior::RANDOM_SWITCH) {
|
||||
if (!switcher->disableHints) {
|
||||
|
||||
@@ -79,7 +79,7 @@ void AdvSceneSwitcher::on_screenRegionAdd_clicked()
|
||||
listAddClicked(ui->screenRegionSwitches,
|
||||
new ScreenRegionWidget(
|
||||
this, &switcher->screenRegionSwitches.back()),
|
||||
ui->screenRegionAdd, addPulse);
|
||||
&addPulse);
|
||||
|
||||
ui->regionHelp->setVisible(false);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void AdvSceneSwitcher::on_sceneSequenceAdd_clicked()
|
||||
listAddClicked(ui->sceneSequenceSwitches,
|
||||
new SequenceWidget(
|
||||
this, &switcher->sceneSequenceSwitches.back()),
|
||||
ui->sceneSequenceAdd, addPulse);
|
||||
&addPulse);
|
||||
|
||||
ui->sequenceHelp->setVisible(false);
|
||||
}
|
||||
@@ -585,6 +585,8 @@ SequenceWidget::SequenceWidget(QWidget *parent, SceneSequenceSwitch *s,
|
||||
QVariant(QStringLiteral("addIconSmall")));
|
||||
reduce->setProperty("themeID",
|
||||
QVariant(QStringLiteral("removeIconSmall")));
|
||||
extend->setProperty("class", QVariant(QStringLiteral("icon-plus")));
|
||||
reduce->setProperty("class", QVariant(QStringLiteral("icon-trash")));
|
||||
|
||||
extend->setMaximumSize(22, 22);
|
||||
reduce->setMaximumSize(22, 22);
|
||||
|
||||
@@ -17,7 +17,7 @@ void AdvSceneSwitcher::on_timeAdd_clicked()
|
||||
listAddClicked(ui->timeSwitches,
|
||||
new TimeSwitchWidget(this,
|
||||
&switcher->timeSwitches.back()),
|
||||
ui->timeAdd, addPulse);
|
||||
&addPulse);
|
||||
|
||||
ui->timeHelp->setVisible(false);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ void AdvSceneSwitcher::on_videoAdd_clicked()
|
||||
VideoSwitchWidget *sw =
|
||||
new VideoSwitchWidget(this, &switcher->videoSwitches.back());
|
||||
|
||||
listAddClicked(ui->videoSwitches, sw, ui->videoAdd, addPulse);
|
||||
listAddClicked(ui->videoSwitches, sw, &addPulse);
|
||||
|
||||
ui->videoHelp->setVisible(false);
|
||||
}
|
||||
@@ -105,7 +105,7 @@ void AdvSceneSwitcher::on_getScreenshot_clicked()
|
||||
}
|
||||
|
||||
auto source = obs_weak_source_get_source(s->videoSource);
|
||||
auto screenshotData = std::make_unique<ScreenshotHelper>(source);
|
||||
auto screenshotData = std::make_unique<Screenshot>(source);
|
||||
obs_source_release(source);
|
||||
|
||||
QString filePath = QFileDialog::getSaveFileName(this);
|
||||
@@ -121,16 +121,16 @@ void AdvSceneSwitcher::on_getScreenshot_clicked()
|
||||
// During selection of the save path enough time should usually have
|
||||
// passed already
|
||||
// Add this just in case ...
|
||||
if (!screenshotData->done) {
|
||||
if (!screenshotData->IsDone()) {
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
}
|
||||
|
||||
if (!screenshotData->done) {
|
||||
if (!screenshotData->IsDone()) {
|
||||
DisplayMessage("Failed to get screenshot of source!");
|
||||
return;
|
||||
}
|
||||
|
||||
screenshotData->image.save(file.fileName());
|
||||
screenshotData->GetImage().save(file.fileName());
|
||||
sw->SetFilePath(file.fileName());
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ void VideoSwitch::load(obs_data_t *obj)
|
||||
void VideoSwitch::getScreenshot()
|
||||
{
|
||||
auto source = obs_weak_source_get_source(videoSource);
|
||||
screenshotData = std::make_unique<ScreenshotHelper>(source);
|
||||
screenshotData = std::make_unique<Screenshot>(source);
|
||||
obs_source_release(source);
|
||||
}
|
||||
|
||||
@@ -293,56 +293,55 @@ bool VideoSwitch::checkMatch()
|
||||
|
||||
bool match = false;
|
||||
|
||||
if (screenshotData) {
|
||||
if (screenshotData->done) {
|
||||
bool conditionMatch = false;
|
||||
|
||||
switch (condition) {
|
||||
case videoSwitchType::MATCH:
|
||||
conditionMatch = screenshotData->image ==
|
||||
matchImage;
|
||||
break;
|
||||
case videoSwitchType::DIFFER:
|
||||
conditionMatch = screenshotData->image !=
|
||||
matchImage;
|
||||
break;
|
||||
case videoSwitchType::HAS_NOT_CHANGED:
|
||||
conditionMatch = screenshotData->image ==
|
||||
matchImage;
|
||||
break;
|
||||
case videoSwitchType::HAS_CHANGED:
|
||||
conditionMatch = screenshotData->image !=
|
||||
matchImage;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (conditionMatch) {
|
||||
currentMatchDuration +=
|
||||
std::chrono::duration_cast<
|
||||
std::chrono::milliseconds>(
|
||||
screenshotData->time -
|
||||
previousTime);
|
||||
} else {
|
||||
currentMatchDuration = {};
|
||||
}
|
||||
|
||||
bool durationMatch = currentMatchDuration.count() >=
|
||||
duration * 1000;
|
||||
|
||||
if (conditionMatch && durationMatch) {
|
||||
match = true;
|
||||
}
|
||||
|
||||
if (!requiresFileInput(condition)) {
|
||||
matchImage = std::move(screenshotData->image);
|
||||
}
|
||||
previousTime = std::move(screenshotData->time);
|
||||
|
||||
screenshotData.reset(nullptr);
|
||||
}
|
||||
if (!screenshotData) {
|
||||
getScreenshot();
|
||||
return match;
|
||||
}
|
||||
if (!screenshotData->IsDone()) {
|
||||
getScreenshot();
|
||||
return match;
|
||||
}
|
||||
|
||||
bool conditionMatch = false;
|
||||
|
||||
switch (condition) {
|
||||
case videoSwitchType::MATCH:
|
||||
conditionMatch = screenshotData->GetImage() == matchImage;
|
||||
break;
|
||||
case videoSwitchType::DIFFER:
|
||||
conditionMatch = screenshotData->GetImage() != matchImage;
|
||||
break;
|
||||
case videoSwitchType::HAS_NOT_CHANGED:
|
||||
conditionMatch = screenshotData->GetImage() == matchImage;
|
||||
break;
|
||||
case videoSwitchType::HAS_CHANGED:
|
||||
conditionMatch = screenshotData->GetImage() != matchImage;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (conditionMatch) {
|
||||
currentMatchDuration +=
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
screenshotData->GetScreenshotTime() -
|
||||
previousTime);
|
||||
} else {
|
||||
currentMatchDuration = {};
|
||||
}
|
||||
|
||||
bool durationMatch = currentMatchDuration.count() >= duration * 1000;
|
||||
|
||||
if (conditionMatch && durationMatch) {
|
||||
match = true;
|
||||
}
|
||||
|
||||
if (!requiresFileInput(condition)) {
|
||||
matchImage = screenshotData->GetImage();
|
||||
}
|
||||
previousTime = screenshotData->GetScreenshotTime();
|
||||
|
||||
screenshotData.reset(nullptr);
|
||||
|
||||
getScreenshot();
|
||||
return match;
|
||||
|
||||
@@ -32,7 +32,7 @@ struct VideoSwitch : virtual SceneSwitcherEntry {
|
||||
double duration = 0;
|
||||
bool ignoreInactiveSource = false;
|
||||
|
||||
std::unique_ptr<ScreenshotHelper> screenshotData = nullptr;
|
||||
std::unique_ptr<Screenshot> screenshotData = nullptr;
|
||||
std::chrono::high_resolution_clock::time_point previousTime{};
|
||||
QImage matchImage;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ void AdvSceneSwitcher::on_windowAdd_clicked()
|
||||
listAddClicked(ui->windowSwitches,
|
||||
new WindowSwitchWidget(this,
|
||||
&switcher->windowSwitches.back()),
|
||||
ui->windowAdd, addPulse);
|
||||
&addPulse);
|
||||
|
||||
ui->windowHelp->setVisible(false);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,28 @@
|
||||
#include "macro-action-factory.hpp"
|
||||
|
||||
#include <mutex>
|
||||
|
||||
namespace advss {
|
||||
|
||||
namespace {
|
||||
|
||||
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;
|
||||
|
||||
std::map<std::string, MacroActionInfo> &MacroActionFactory::GetMap()
|
||||
{
|
||||
static std::map<std::string, MacroActionInfo> _methods;
|
||||
@@ -10,6 +31,7 @@ std::map<std::string, MacroActionInfo> &MacroActionFactory::GetMap()
|
||||
|
||||
bool MacroActionFactory::Register(const std::string &id, MacroActionInfo info)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (auto it = GetMap().find(id); it == GetMap().end()) {
|
||||
GetMap()[id] = info;
|
||||
return true;
|
||||
@@ -17,35 +39,61 @@ bool MacroActionFactory::Register(const std::string &id, MacroActionInfo info)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MacroActionFactory::Deregister(const std::string &id)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (GetMap().count(id) == 0) {
|
||||
return false;
|
||||
}
|
||||
GetMap().erase(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
static std::shared_ptr<MacroAction> createUnknownAction(Macro *m)
|
||||
{
|
||||
return std::make_shared<MacroActionUnknown>(m);
|
||||
}
|
||||
|
||||
std::shared_ptr<MacroAction> MacroActionFactory::Create(const std::string &id,
|
||||
Macro *m)
|
||||
{
|
||||
if (auto it = GetMap().find(id); it != GetMap().end())
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
||||
return it->second._create(m);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return createUnknownAction(m);
|
||||
}
|
||||
|
||||
static QWidget *createUnknownActionWidget()
|
||||
{
|
||||
return new QLabel(obs_module_text("AdvSceneSwitcher.action.unknown"));
|
||||
}
|
||||
|
||||
QWidget *MacroActionFactory::CreateWidget(const std::string &id,
|
||||
QWidget *parent,
|
||||
std::shared_ptr<MacroAction> action)
|
||||
{
|
||||
if (auto it = GetMap().find(id); it != GetMap().end())
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
||||
return it->second._createWidget(parent, action);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return createUnknownActionWidget();
|
||||
}
|
||||
|
||||
std::string MacroActionFactory::GetActionName(const std::string &id)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
||||
return it->second._name;
|
||||
}
|
||||
return "unknown action";
|
||||
return obs_module_text("AdvSceneSwitcher.action.unknown");
|
||||
}
|
||||
|
||||
std::string MacroActionFactory::GetIdByName(const QString &name)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
for (auto it : GetMap()) {
|
||||
if (name == obs_module_text(it.second._name.c_str())) {
|
||||
return it.first;
|
||||
@@ -54,4 +102,14 @@ std::string MacroActionFactory::GetIdByName(const QString &name)
|
||||
return "";
|
||||
}
|
||||
|
||||
bool CanCreateDefaultAction()
|
||||
{
|
||||
const auto action = MacroActionFactory::Create(
|
||||
MacroAction::GetDefaultID().data(), nullptr);
|
||||
if (!action) {
|
||||
return false;
|
||||
}
|
||||
return action->GetId() == MacroAction::GetDefaultID().data();
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
namespace advss {
|
||||
|
||||
struct MacroActionInfo {
|
||||
using CreateAction = std::shared_ptr<MacroAction> (*)(Macro *m);
|
||||
using CreateActionWidget = QWidget *(*)(QWidget *parent,
|
||||
std::shared_ptr<MacroAction>);
|
||||
CreateAction _create = nullptr;
|
||||
|
||||
std::function<std::shared_ptr<MacroAction>(Macro *m)> _create = nullptr;
|
||||
CreateActionWidget _createWidget = nullptr;
|
||||
std::string _name;
|
||||
};
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
MacroActionFactory() = delete;
|
||||
|
||||
EXPORT static bool Register(const std::string &id, MacroActionInfo);
|
||||
static bool Deregister(const std::string &id);
|
||||
static std::shared_ptr<MacroAction> Create(const std::string &id,
|
||||
Macro *m);
|
||||
static QWidget *CreateWidget(const std::string &id, QWidget *parent,
|
||||
@@ -31,4 +32,6 @@ private:
|
||||
static std::map<std::string, MacroActionInfo> &GetMap();
|
||||
};
|
||||
|
||||
bool CanCreateDefaultAction();
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -196,13 +196,13 @@ void MacroActionMacro::RunActions(Macro *actionMacro) const
|
||||
}
|
||||
|
||||
if (_runOptions.reevaluateConditionState) {
|
||||
conditionMacro->CeckMatch(true);
|
||||
conditionMacro->CheckConditions(true);
|
||||
}
|
||||
|
||||
if ((_runOptions.logic == RunOptions::Logic::CONDITIONS &&
|
||||
conditionMacro->Matched()) ||
|
||||
conditionMacro->ConditionsMatched()) ||
|
||||
(_runOptions.logic == RunOptions::Logic::INVERT_CONDITIONS &&
|
||||
!conditionMacro->Matched())) {
|
||||
!conditionMacro->ConditionsMatched())) {
|
||||
runActionsHelper(actionMacro, _runOptions.runElseActions,
|
||||
_runOptions.setInputs, _runOptions.inputs);
|
||||
}
|
||||
|
||||
92
lib/macro/macro-action-script.cpp
Normal file
92
lib/macro/macro-action-script.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
#include "macro-action-script.hpp"
|
||||
#include "layout-helpers.hpp"
|
||||
#include "macro-helpers.hpp"
|
||||
#include "properties-view.hpp"
|
||||
#include "sync-helpers.hpp"
|
||||
|
||||
namespace advss {
|
||||
|
||||
MacroActionScript::MacroActionScript(Macro *m, const std::string &id,
|
||||
const OBSData &defaultSettings,
|
||||
const std::string &propertiesSignalName,
|
||||
const std::string &triggerSignal,
|
||||
const std::string &completionSignal)
|
||||
: MacroAction(m),
|
||||
MacroSegmentScript(defaultSettings, propertiesSignalName,
|
||||
triggerSignal, completionSignal),
|
||||
_id(id)
|
||||
{
|
||||
}
|
||||
|
||||
MacroActionScript::MacroActionScript(const advss::MacroActionScript &other)
|
||||
: MacroAction(other.GetMacro()),
|
||||
MacroSegmentScript(other),
|
||||
_id(other._id)
|
||||
{
|
||||
}
|
||||
|
||||
bool MacroActionScript::PerformAction()
|
||||
{
|
||||
if (!ScriptHandler::ActionIdIsValid(_id)) {
|
||||
blog(LOG_WARNING, "skipping unknown script action \"%s\"",
|
||||
_id.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
(void)SendTriggerSignal();
|
||||
return true;
|
||||
}
|
||||
|
||||
void MacroActionScript::LogAction() const
|
||||
{
|
||||
ablog(LOG_INFO, "performing script action \"%s\"", GetId().c_str());
|
||||
}
|
||||
|
||||
bool MacroActionScript::Save(obs_data_t *obj) const
|
||||
{
|
||||
MacroAction::Save(obj);
|
||||
MacroSegmentScript::Save(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MacroActionScript::Load(obs_data_t *obj)
|
||||
{
|
||||
MacroAction::Load(obj);
|
||||
MacroSegmentScript::Load(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<MacroAction> MacroActionScript::Copy() const
|
||||
{
|
||||
return std::make_shared<MacroActionScript>(*this);
|
||||
}
|
||||
|
||||
void MacroActionScript::WaitForCompletion() const
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
auto timePassed = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
start - start);
|
||||
const auto timeoutMs = GetTimeoutSeconds() * 1000.0;
|
||||
|
||||
std::unique_lock<std::mutex> lock(*GetMutex());
|
||||
while (!TriggerIsCompleted()) {
|
||||
if (MacroWaitShouldAbort() || MacroIsStopped(GetMacro())) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((double)timePassed.count() > timeoutMs) {
|
||||
blog(LOG_INFO, "script action timeout (%s)",
|
||||
_id.c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
GetMacroWaitCV().wait_for(lock, 10ms);
|
||||
const auto now = std::chrono::high_resolution_clock::now();
|
||||
timePassed =
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
now - start);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
29
lib/macro/macro-action-script.hpp
Normal file
29
lib/macro/macro-action-script.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
#include "macro-action-edit.hpp"
|
||||
#include "macro-script-handler.hpp"
|
||||
#include "macro-segment-script.hpp"
|
||||
|
||||
namespace advss {
|
||||
|
||||
class MacroActionScript : public MacroAction, public MacroSegmentScript {
|
||||
public:
|
||||
MacroActionScript(Macro *m, const std::string &id,
|
||||
const OBSData &defaultSettings,
|
||||
const std::string &propertiesSignalName,
|
||||
const std::string &triggerSignal,
|
||||
const std::string &signalComplete);
|
||||
MacroActionScript(const advss::MacroActionScript &);
|
||||
bool PerformAction();
|
||||
void LogAction() const;
|
||||
bool Save(obs_data_t *obj) const;
|
||||
bool Load(obs_data_t *obj);
|
||||
std::string GetId() const { return _id; };
|
||||
std::shared_ptr<MacroAction> Copy() const;
|
||||
|
||||
private:
|
||||
void WaitForCompletion() const;
|
||||
|
||||
std::string _id = "";
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
@@ -60,6 +60,21 @@ const static std::map<MacroActionVariable::Type, std::string> actionTypes = {
|
||||
"AdvSceneSwitcher.action.variable.type.truncateValue"},
|
||||
{MacroActionVariable::Type::SWAP_VALUES,
|
||||
"AdvSceneSwitcher.action.variable.type.swapValues"},
|
||||
{MacroActionVariable::Type::TRIM,
|
||||
"AdvSceneSwitcher.action.variable.type.trim"},
|
||||
{MacroActionVariable::Type::CHANGE_CASE,
|
||||
"AdvSceneSwitcher.action.variable.type.changeCase"},
|
||||
};
|
||||
|
||||
const static std::map<MacroActionVariable::CaseType, std::string> caseTypes = {
|
||||
{MacroActionVariable::CaseType::LOWER_CASE,
|
||||
"AdvSceneSwitcher.action.variable.case.type.lowerCase"},
|
||||
{MacroActionVariable::CaseType::UPPER_CASE,
|
||||
"AdvSceneSwitcher.action.variable.case.type.upperCase"},
|
||||
{MacroActionVariable::CaseType::CAPITALIZED,
|
||||
"AdvSceneSwitcher.action.variable.case.type.capitalized"},
|
||||
{MacroActionVariable::CaseType::START_CASE,
|
||||
"AdvSceneSwitcher.action.variable.case.type.startCase"},
|
||||
};
|
||||
|
||||
static void apppend(Variable &var, const std::string &value)
|
||||
@@ -135,18 +150,12 @@ void MacroActionVariable::HandleFindAndReplace(Variable *var)
|
||||
var->SetValue(value);
|
||||
return;
|
||||
}
|
||||
QString resultString = QString::fromStdString(value);
|
||||
|
||||
QString replacement = QString::fromStdString(_replaceStr);
|
||||
auto regex = _findRegex.GetRegularExpression(_findStr);
|
||||
auto matchIterator = regex.globalMatch(QString::fromStdString(value));
|
||||
int offset = 0;
|
||||
while (matchIterator.hasNext()) {
|
||||
QRegularExpressionMatch match = matchIterator.next();
|
||||
resultString.replace(match.capturedStart() + offset,
|
||||
match.capturedLength(), replacement);
|
||||
offset += replacement.length() - match.capturedLength();
|
||||
}
|
||||
var->SetValue(resultString.toStdString());
|
||||
auto result = QString::fromStdString(value);
|
||||
result = result.replace(regex, replacement);
|
||||
var->SetValue(result.toStdString());
|
||||
}
|
||||
|
||||
void MacroActionVariable::HandleMathExpression(Variable *var)
|
||||
@@ -159,6 +168,43 @@ void MacroActionVariable::HandleMathExpression(Variable *var)
|
||||
var->SetValue(std::get<double>(result));
|
||||
}
|
||||
|
||||
void MacroActionVariable::HandleCaseChange(Variable *var)
|
||||
{
|
||||
auto value = QString::fromStdString(var->Value());
|
||||
|
||||
switch (_caseType) {
|
||||
case CaseType::LOWER_CASE:
|
||||
var->SetValue(value.toLower().toStdString());
|
||||
break;
|
||||
case CaseType::UPPER_CASE:
|
||||
var->SetValue(value.toUpper().toStdString());
|
||||
break;
|
||||
case CaseType::CAPITALIZED: {
|
||||
if (value.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
value[0] = value[0].toUpper();
|
||||
var->SetValue(value.toStdString());
|
||||
break;
|
||||
}
|
||||
case CaseType::START_CASE: {
|
||||
auto partList = value.split(QRegularExpression("\\b"));
|
||||
|
||||
for (auto &part : partList) {
|
||||
if (part.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
part[0] = part[0].toUpper();
|
||||
}
|
||||
|
||||
var->SetValue(partList.join("").toStdString());
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
struct GetSceneItemNameHelper {
|
||||
int curIdx = 0;
|
||||
int targetIdx = 0;
|
||||
@@ -405,6 +451,15 @@ bool MacroActionVariable::PerformAction()
|
||||
var2->SetValue(tempValue);
|
||||
return true;
|
||||
}
|
||||
case Type::TRIM: {
|
||||
var->SetValue(QString::fromStdString(var->Value())
|
||||
.trimmed()
|
||||
.toStdString());
|
||||
return true;
|
||||
}
|
||||
case Type::CHANGE_CASE:
|
||||
HandleCaseChange(var.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -441,6 +496,8 @@ bool MacroActionVariable::Save(obs_data_t *obj) const
|
||||
obs_data_set_int(obj, "direction", static_cast<int>(_direction));
|
||||
_stringLength.Save(obj, "stringLength");
|
||||
obs_data_set_int(obj, "paddingChar", _paddingChar);
|
||||
obs_data_set_int(obj, "caseType", static_cast<int>(_caseType));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -479,6 +536,8 @@ bool MacroActionVariable::Load(obs_data_t *obj)
|
||||
} else {
|
||||
_paddingChar = ' ';
|
||||
}
|
||||
_caseType = static_cast<CaseType>(obs_data_get_int(obj, "caseType"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -597,6 +656,14 @@ static inline void populateTypeSelection(QComboBox *list)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void populateCaseTypeSelection(QComboBox *list)
|
||||
{
|
||||
for (const auto &[type, name] : caseTypes) {
|
||||
list->addItem(obs_module_text(name.c_str()),
|
||||
static_cast<int>(type));
|
||||
}
|
||||
}
|
||||
|
||||
static inline void populateDirectionSelection(QComboBox *list)
|
||||
{
|
||||
list->addItems(
|
||||
@@ -649,6 +716,7 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
||||
_direction(new QComboBox()),
|
||||
_stringLength(new VariableSpinBox()),
|
||||
_paddingCharSelection(new SingleCharSelection()),
|
||||
_caseType(new FilterComboBox(this)),
|
||||
_entryLayout(new QHBoxLayout())
|
||||
{
|
||||
_numValue->setMinimum(-9999999999);
|
||||
@@ -665,12 +733,15 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
||||
_regexMatchIdx->setMinimum(1);
|
||||
_regexMatchIdx->setMaximum(999);
|
||||
_regexMatchIdx->setSuffix(".");
|
||||
_replaceStr->setToolTip(obs_module_text(
|
||||
"AdvSceneSwitcher.action.variable.findAndReplace.replace.tooltip"));
|
||||
_inputPrompt->setSizePolicy(QSizePolicy::MinimumExpanding,
|
||||
QSizePolicy::Preferred);
|
||||
_sceneItemIndex->setMinimum(1);
|
||||
_stringLength->setMaximum(999);
|
||||
populateTypeSelection(_actions);
|
||||
populateDirectionSelection(_direction);
|
||||
populateCaseTypeSelection(_caseType);
|
||||
|
||||
QWidget::connect(_variables, SIGNAL(SelectionChanged(const QString &)),
|
||||
this, SLOT(VariableChanged(const QString &)));
|
||||
@@ -735,6 +806,8 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
||||
QWidget::connect(_paddingCharSelection,
|
||||
SIGNAL(CharChanged(const QString &)), this,
|
||||
SLOT(CharSelectionChanged(const QString &)));
|
||||
QWidget::connect(_caseType, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(CaseTypeChanged(int)));
|
||||
|
||||
const std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{variables}}", _variables},
|
||||
@@ -762,6 +835,7 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
||||
{"{{direction}}", _direction},
|
||||
{"{{stringLength}}", _stringLength},
|
||||
{"{{paddingCharSelection}}", _paddingCharSelection},
|
||||
{"{{caseType}}", _caseType},
|
||||
};
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.variable.entry.other"),
|
||||
@@ -862,6 +936,9 @@ void MacroActionVariableEdit::UpdateEntryData()
|
||||
_stringLength->SetValue(_entryData->_stringLength);
|
||||
_paddingCharSelection->setText(
|
||||
QChar::fromLatin1(_entryData->_paddingChar));
|
||||
_caseType->setCurrentIndex(
|
||||
_caseType->findData(static_cast<int>(_entryData->_caseType)));
|
||||
|
||||
SetWidgetVisibility();
|
||||
}
|
||||
|
||||
@@ -1268,6 +1345,17 @@ void MacroActionVariableEdit::CharSelectionChanged(const QString &character)
|
||||
}
|
||||
}
|
||||
|
||||
void MacroActionVariableEdit::CaseTypeChanged(int index)
|
||||
{
|
||||
if (_loading || !_entryData) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
_entryData->_caseType = static_cast<MacroActionVariable::CaseType>(
|
||||
_caseType->itemData(index).toInt());
|
||||
}
|
||||
|
||||
void MacroActionVariableEdit::SetWidgetVisibility()
|
||||
{
|
||||
if (!_entryData) {
|
||||
@@ -1290,6 +1378,7 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
||||
{"{{direction}}", _direction},
|
||||
{"{{stringLength}}", _stringLength},
|
||||
{"{{paddingCharSelection}}", _paddingCharSelection},
|
||||
{"{{caseType}}", _caseType},
|
||||
};
|
||||
|
||||
const char *layoutString = "";
|
||||
@@ -1414,6 +1503,9 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
||||
_entryData->_type == MacroActionVariable::Type::TRUNCATE);
|
||||
_paddingCharSelection->setVisible(_entryData->_type ==
|
||||
MacroActionVariable::Type::PAD);
|
||||
_caseType->setVisible(_entryData->_type ==
|
||||
MacroActionVariable::Type::CHANGE_CASE);
|
||||
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
@@ -50,6 +50,8 @@ public:
|
||||
PAD,
|
||||
TRUNCATE,
|
||||
SWAP_VALUES,
|
||||
TRIM,
|
||||
CHANGE_CASE,
|
||||
};
|
||||
|
||||
Type _type = Type::SET_FIXED_VALUE;
|
||||
@@ -89,12 +91,22 @@ public:
|
||||
IntVariable _stringLength = 1;
|
||||
char _paddingChar = '0';
|
||||
|
||||
enum class CaseType {
|
||||
LOWER_CASE,
|
||||
UPPER_CASE,
|
||||
CAPITALIZED,
|
||||
START_CASE,
|
||||
};
|
||||
|
||||
CaseType _caseType = CaseType::LOWER_CASE;
|
||||
|
||||
private:
|
||||
void DecrementCurrentSegmentVariableRef();
|
||||
void HandleIndexSubString(Variable *);
|
||||
void HandleRegexSubString(Variable *);
|
||||
void HandleFindAndReplace(Variable *);
|
||||
void HandleMathExpression(Variable *);
|
||||
void HandleCaseChange(Variable *);
|
||||
void SetToSceneItemName(Variable *);
|
||||
|
||||
std::weak_ptr<MacroSegment> _macroSegment;
|
||||
@@ -148,6 +160,7 @@ private slots:
|
||||
void DirectionChanged(int);
|
||||
void StringLengthChanged(const NumberVariable<int> &);
|
||||
void CharSelectionChanged(const QString &);
|
||||
void CaseTypeChanged(int index);
|
||||
|
||||
signals:
|
||||
void HeaderInfoChanged(const QString &);
|
||||
@@ -192,6 +205,7 @@ private:
|
||||
QComboBox *_direction;
|
||||
VariableSpinBox *_stringLength;
|
||||
SingleCharSelection *_paddingCharSelection;
|
||||
FilterComboBox *_caseType;
|
||||
QHBoxLayout *_entryLayout;
|
||||
|
||||
std::shared_ptr<MacroActionVariable> _entryData;
|
||||
|
||||
@@ -10,26 +10,6 @@
|
||||
|
||||
namespace advss {
|
||||
|
||||
static inline void populateLogicSelection(QComboBox *list, bool root = false)
|
||||
{
|
||||
if (root) {
|
||||
for (const auto &entry : MacroCondition::logicTypes) {
|
||||
if (static_cast<int>(entry.first) < logic_root_offset) {
|
||||
list->addItem(obs_module_text(
|
||||
entry.second._name.c_str()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (const auto &entry : MacroCondition::logicTypes) {
|
||||
if (static_cast<int>(entry.first) >=
|
||||
logic_root_offset) {
|
||||
list->addItem(obs_module_text(
|
||||
entry.second._name.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void populateConditionSelection(QComboBox *list)
|
||||
{
|
||||
for (const auto &[_, condition] :
|
||||
@@ -120,13 +100,13 @@ void DurationModifierEdit::Collapse(bool collapse)
|
||||
|
||||
MacroConditionEdit::MacroConditionEdit(
|
||||
QWidget *parent, std::shared_ptr<MacroCondition> *entryData,
|
||||
const std::string &id, bool root)
|
||||
const std::string &id, bool isRootCondition)
|
||||
: MacroSegmentEdit(parent),
|
||||
_logicSelection(new QComboBox()),
|
||||
_conditionSelection(new FilterComboBox()),
|
||||
_dur(new DurationModifierEdit()),
|
||||
_entryData(entryData),
|
||||
_isRoot(root)
|
||||
_isRoot(isRootCondition)
|
||||
{
|
||||
QWidget::connect(_logicSelection, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(LogicSelectionChanged(int)));
|
||||
@@ -139,7 +119,7 @@ MacroConditionEdit::MacroConditionEdit(
|
||||
this,
|
||||
SLOT(DurationModifierChanged(DurationModifier::Type)));
|
||||
|
||||
populateLogicSelection(_logicSelection, root);
|
||||
Logic::PopulateLogicTypeSelection(_logicSelection, isRootCondition);
|
||||
populateConditionSelection(_conditionSelection);
|
||||
|
||||
_section->AddHeaderWidget(_logicSelection);
|
||||
@@ -168,15 +148,10 @@ void MacroConditionEdit::LogicSelectionChanged(int idx)
|
||||
return;
|
||||
}
|
||||
|
||||
LogicType type;
|
||||
if (IsRootNode()) {
|
||||
type = static_cast<LogicType>(idx);
|
||||
} else {
|
||||
type = static_cast<LogicType>(idx + logic_root_offset);
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
(*_entryData)->SetLogicType(type);
|
||||
const auto logic = static_cast<Logic::Type>(
|
||||
_logicSelection->itemData(idx).toInt());
|
||||
(*_entryData)->SetLogicType(logic);
|
||||
}
|
||||
|
||||
bool MacroConditionEdit::IsRootNode()
|
||||
@@ -186,13 +161,9 @@ bool MacroConditionEdit::IsRootNode()
|
||||
|
||||
void MacroConditionEdit::SetLogicSelection()
|
||||
{
|
||||
auto logic = (*_entryData)->GetLogicType();
|
||||
if (IsRootNode()) {
|
||||
_logicSelection->setCurrentIndex(static_cast<int>(logic));
|
||||
} else {
|
||||
_logicSelection->setCurrentIndex(static_cast<int>(logic) -
|
||||
logic_root_offset);
|
||||
}
|
||||
const auto logic = (*_entryData)->GetLogicType();
|
||||
_logicSelection->setCurrentIndex(
|
||||
_logicSelection->findData(static_cast<int>(logic)));
|
||||
}
|
||||
|
||||
void MacroConditionEdit::SetRootNode(bool root)
|
||||
@@ -200,7 +171,7 @@ void MacroConditionEdit::SetRootNode(bool root)
|
||||
_isRoot = root;
|
||||
const QSignalBlocker blocker(_logicSelection);
|
||||
_logicSelection->clear();
|
||||
populateLogicSelection(_logicSelection, root);
|
||||
Logic::PopulateLogicTypeSelection(_logicSelection, root);
|
||||
SetLogicSelection();
|
||||
}
|
||||
|
||||
@@ -301,17 +272,17 @@ void AdvSceneSwitcher::AddMacroCondition(int idx)
|
||||
}
|
||||
|
||||
std::string id;
|
||||
LogicType logic;
|
||||
Logic::Type logic;
|
||||
if (idx >= 1) {
|
||||
id = macro->Conditions().at(idx - 1)->GetId();
|
||||
if (idx == 1) {
|
||||
logic = LogicType::OR;
|
||||
logic = Logic::Type::OR;
|
||||
} else {
|
||||
logic = macro->Conditions().at(idx - 1)->GetLogicType();
|
||||
}
|
||||
} else {
|
||||
id = MacroCondition::GetDefaultID();
|
||||
logic = LogicType::ROOT_NONE;
|
||||
logic = Logic::Type::ROOT_NONE;
|
||||
}
|
||||
|
||||
OBSDataAutoRelease data;
|
||||
@@ -324,7 +295,7 @@ void AdvSceneSwitcher::AddMacroCondition(int idx)
|
||||
|
||||
void AdvSceneSwitcher::AddMacroCondition(Macro *macro, int idx,
|
||||
const std::string &id,
|
||||
obs_data_t *data, LogicType logic)
|
||||
obs_data_t *data, Logic::Type logic)
|
||||
{
|
||||
if (idx < 0 || idx > (int)macro->Conditions().size()) {
|
||||
assert(false);
|
||||
@@ -389,7 +360,7 @@ void AdvSceneSwitcher::RemoveMacroCondition(int idx)
|
||||
macro->UpdateConditionIndices();
|
||||
if (idx == 0 && macro->Conditions().size() > 0) {
|
||||
auto newRoot = macro->Conditions().at(0);
|
||||
newRoot->SetLogicType(LogicType::ROOT_NONE);
|
||||
newRoot->SetLogicType(Logic::Type::ROOT_NONE);
|
||||
static_cast<MacroConditionEdit *>(
|
||||
ui->conditionsList->WidgetAt(0))
|
||||
->SetRootNode(true);
|
||||
@@ -540,22 +511,23 @@ void AdvSceneSwitcher::MacroConditionReorder(int to, int from)
|
||||
auto lock = LockContext();
|
||||
auto condition = macro->Conditions().at(from);
|
||||
if (to == 0) {
|
||||
condition->SetLogicType(LogicType::ROOT_NONE);
|
||||
condition->SetLogicType(Logic::Type::ROOT_NONE);
|
||||
static_cast<MacroConditionEdit *>(
|
||||
ui->conditionsList->WidgetAt(from))
|
||||
->SetRootNode(true);
|
||||
macro->Conditions().at(0)->SetLogicType(LogicType::AND);
|
||||
macro->Conditions().at(0)->SetLogicType(
|
||||
Logic::Type::AND);
|
||||
static_cast<MacroConditionEdit *>(
|
||||
ui->conditionsList->WidgetAt(0))
|
||||
->SetRootNode(false);
|
||||
}
|
||||
if (from == 0) {
|
||||
condition->SetLogicType(LogicType::AND);
|
||||
condition->SetLogicType(Logic::Type::AND);
|
||||
static_cast<MacroConditionEdit *>(
|
||||
ui->conditionsList->WidgetAt(from))
|
||||
->SetRootNode(false);
|
||||
macro->Conditions().at(1)->SetLogicType(
|
||||
LogicType::ROOT_NONE);
|
||||
Logic::Type::ROOT_NONE);
|
||||
static_cast<MacroConditionEdit *>(
|
||||
ui->conditionsList->WidgetAt(1))
|
||||
->SetRootNode(true);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "macro-condition.hpp"
|
||||
#include "macro-condition-factory.hpp"
|
||||
#include "filter-combo-box.hpp"
|
||||
#include "duration-control.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
#include "macro-condition-factory.hpp"
|
||||
|
||||
#include <mutex>
|
||||
|
||||
namespace advss {
|
||||
|
||||
namespace {
|
||||
|
||||
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;
|
||||
|
||||
std::map<std::string, MacroConditionInfo> &MacroConditionFactory::GetMap()
|
||||
{
|
||||
static std::map<std::string, MacroConditionInfo> _methods;
|
||||
@@ -11,6 +28,7 @@ std::map<std::string, MacroConditionInfo> &MacroConditionFactory::GetMap()
|
||||
bool MacroConditionFactory::Register(const std::string &id,
|
||||
MacroConditionInfo info)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (auto it = GetMap().find(id); it == GetMap().end()) {
|
||||
GetMap()[id] = info;
|
||||
return true;
|
||||
@@ -18,35 +36,60 @@ bool MacroConditionFactory::Register(const std::string &id,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MacroConditionFactory::Deregister(const std::string &id)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (GetMap().count(id) == 0) {
|
||||
return false;
|
||||
}
|
||||
GetMap().erase(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
static std::shared_ptr<MacroCondition> createUnknownCondition(Macro *m)
|
||||
{
|
||||
return std::make_shared<MacroConditionUnknown>(m);
|
||||
}
|
||||
|
||||
std::shared_ptr<MacroCondition>
|
||||
MacroConditionFactory::Create(const std::string &id, Macro *m)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
||||
return it->second._create(m);
|
||||
}
|
||||
return nullptr;
|
||||
return createUnknownCondition(m);
|
||||
}
|
||||
|
||||
static QWidget *createUnknownConditionWidget()
|
||||
{
|
||||
return new QLabel(
|
||||
obs_module_text("AdvSceneSwitcher.condition.unknown"));
|
||||
}
|
||||
|
||||
QWidget *
|
||||
MacroConditionFactory::CreateWidget(const std::string &id, QWidget *parent,
|
||||
std::shared_ptr<MacroCondition> cond)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
||||
return it->second._createWidget(parent, cond);
|
||||
}
|
||||
return nullptr;
|
||||
return createUnknownConditionWidget();
|
||||
}
|
||||
|
||||
std::string MacroConditionFactory::GetConditionName(const std::string &id)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
||||
return it->second._name;
|
||||
}
|
||||
return "unknown condition";
|
||||
return obs_module_text("AdvSceneSwitcher.condition.unknown");
|
||||
}
|
||||
|
||||
std::string MacroConditionFactory::GetIdByName(const QString &name)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
for (auto it : GetMap()) {
|
||||
if (name == obs_module_text(it.second._name.c_str())) {
|
||||
return it.first;
|
||||
@@ -57,10 +100,21 @@ std::string MacroConditionFactory::GetIdByName(const QString &name)
|
||||
|
||||
bool MacroConditionFactory::UsesDurationModifier(const std::string &id)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||
if (auto it = GetMap().find(id); it != GetMap().end()) {
|
||||
return it->second._useDurationModifier;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CanCreateDefaultCondition()
|
||||
{
|
||||
const auto condition = MacroConditionFactory::Create(
|
||||
MacroCondition::GetDefaultID().data(), nullptr);
|
||||
if (!condition) {
|
||||
return false;
|
||||
}
|
||||
return condition->GetId() == MacroCondition::GetDefaultID().data();
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
namespace advss {
|
||||
|
||||
struct MacroConditionInfo {
|
||||
using CreateCondition = std::shared_ptr<MacroCondition> (*)(Macro *m);
|
||||
using CreateConditionWidget =
|
||||
QWidget *(*)(QWidget *parent, std::shared_ptr<MacroCondition>);
|
||||
CreateCondition _create = nullptr;
|
||||
|
||||
std::function<std::shared_ptr<MacroCondition>(Macro *m)> _create =
|
||||
nullptr;
|
||||
CreateConditionWidget _createWidget = nullptr;
|
||||
std::string _name;
|
||||
bool _useDurationModifier = true;
|
||||
@@ -19,6 +20,7 @@ class MacroConditionFactory {
|
||||
public:
|
||||
MacroConditionFactory() = delete;
|
||||
EXPORT static bool Register(const std::string &, MacroConditionInfo);
|
||||
static bool Deregister(const std::string &);
|
||||
static std::shared_ptr<MacroCondition> Create(const std::string &,
|
||||
Macro *m);
|
||||
static QWidget *CreateWidget(const std::string &id, QWidget *parent,
|
||||
@@ -32,4 +34,6 @@ private:
|
||||
static std::map<std::string, MacroConditionInfo> &GetMap();
|
||||
};
|
||||
|
||||
bool CanCreateDefaultCondition();
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -58,7 +58,7 @@ bool MacroConditionMacro::CheckStateCondition()
|
||||
return false;
|
||||
}
|
||||
|
||||
return macro->Matched();
|
||||
return macro->ConditionsMatched();
|
||||
}
|
||||
|
||||
bool MacroConditionMacro::CheckMultiStateCondition()
|
||||
@@ -72,7 +72,7 @@ bool MacroConditionMacro::CheckMultiStateCondition()
|
||||
if (!macro) {
|
||||
continue;
|
||||
}
|
||||
if (macro->Matched()) {
|
||||
if (macro->ConditionsMatched()) {
|
||||
matchedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
79
lib/macro/macro-condition-script.cpp
Normal file
79
lib/macro/macro-condition-script.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
#include "macro-condition-script.hpp"
|
||||
#include "layout-helpers.hpp"
|
||||
#include "macro-helpers.hpp"
|
||||
#include "sync-helpers.hpp"
|
||||
|
||||
namespace advss {
|
||||
|
||||
MacroConditionScript::MacroConditionScript(
|
||||
Macro *m, const std::string &id, const OBSData &defaultSettings,
|
||||
const std::string &propertiesSignalName,
|
||||
const std::string &triggerSignal, const std::string &completionSignal)
|
||||
: MacroCondition(m),
|
||||
MacroSegmentScript(defaultSettings, propertiesSignalName,
|
||||
triggerSignal, completionSignal),
|
||||
_id(id)
|
||||
{
|
||||
}
|
||||
|
||||
MacroConditionScript::MacroConditionScript(
|
||||
const advss::MacroConditionScript &other)
|
||||
: MacroCondition(other.GetMacro()),
|
||||
MacroSegmentScript(other),
|
||||
_id(other._id)
|
||||
{
|
||||
}
|
||||
|
||||
bool MacroConditionScript::CheckCondition()
|
||||
{
|
||||
if (!ScriptHandler::ConditionIdIsValid(_id)) {
|
||||
blog(LOG_WARNING, "skipping unknown script condition \"%s\"",
|
||||
_id.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
return SendTriggerSignal();
|
||||
}
|
||||
|
||||
bool MacroConditionScript::Save(obs_data_t *obj) const
|
||||
{
|
||||
MacroCondition::Save(obj);
|
||||
MacroSegmentScript::Save(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MacroConditionScript::Load(obs_data_t *obj)
|
||||
{
|
||||
MacroCondition::Load(obj);
|
||||
MacroSegmentScript::Load(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
void MacroConditionScript::WaitForCompletion() const
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
auto timePassed = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
start - start);
|
||||
const auto timeoutMs = GetTimeoutSeconds() * 1000.0;
|
||||
|
||||
while (!TriggerIsCompleted()) {
|
||||
if (MacroWaitShouldAbort() || MacroIsStopped(GetMacro())) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((double)timePassed.count() > timeoutMs) {
|
||||
blog(LOG_INFO, "script condition timeout (%s)",
|
||||
_id.c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(10ms);
|
||||
const auto now = std::chrono::high_resolution_clock::now();
|
||||
timePassed =
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
now - start);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
27
lib/macro/macro-condition-script.hpp
Normal file
27
lib/macro/macro-condition-script.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#include "macro-condition-edit.hpp"
|
||||
#include "macro-script-handler.hpp"
|
||||
#include "macro-segment-script.hpp"
|
||||
|
||||
namespace advss {
|
||||
|
||||
class MacroConditionScript : public MacroCondition, public MacroSegmentScript {
|
||||
public:
|
||||
MacroConditionScript(Macro *m, const std::string &id,
|
||||
const OBSData &defaultSettings,
|
||||
const std::string &propertiesSignalName,
|
||||
const std::string &triggerSignal,
|
||||
const std::string &signalComplete);
|
||||
MacroConditionScript(const advss::MacroConditionScript &);
|
||||
bool CheckCondition();
|
||||
bool Save(obs_data_t *obj) const;
|
||||
bool Load(obs_data_t *obj);
|
||||
std::string GetId() const { return _id; };
|
||||
|
||||
private:
|
||||
void WaitForCompletion() const;
|
||||
|
||||
std::string _id = "";
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
@@ -2,79 +2,6 @@
|
||||
|
||||
namespace advss {
|
||||
|
||||
const std::map<LogicType, LogicTypeInfo> MacroCondition::logicTypes = {
|
||||
{LogicType::NONE, {"AdvSceneSwitcher.logic.none"}},
|
||||
{LogicType::AND, {"AdvSceneSwitcher.logic.and"}},
|
||||
{LogicType::OR, {"AdvSceneSwitcher.logic.or"}},
|
||||
{LogicType::AND_NOT, {"AdvSceneSwitcher.logic.andNot"}},
|
||||
{LogicType::OR_NOT, {"AdvSceneSwitcher.logic.orNot"}},
|
||||
{LogicType::ROOT_NONE, {"AdvSceneSwitcher.logic.rootNone"}},
|
||||
{LogicType::ROOT_NOT, {"AdvSceneSwitcher.logic.not"}},
|
||||
};
|
||||
|
||||
void DurationModifier::Save(obs_data_t *obj, const char *condName,
|
||||
const char *duration) const
|
||||
{
|
||||
obs_data_set_int(obj, condName, static_cast<int>(_type));
|
||||
_dur.Save(obj, duration);
|
||||
}
|
||||
|
||||
void DurationModifier::Load(obs_data_t *obj, const char *condName,
|
||||
const char *duration)
|
||||
{
|
||||
// For backwards compatibility check if duration value exist without
|
||||
// time constraint condition - if so assume DurationCondition::MORE
|
||||
if (!obs_data_has_user_value(obj, condName) &&
|
||||
obs_data_has_user_value(obj, duration)) {
|
||||
obs_data_set_int(obj, condName, static_cast<int>(Type::MORE));
|
||||
}
|
||||
|
||||
_type = static_cast<Type>(obs_data_get_int(obj, condName));
|
||||
_dur.Load(obj, duration);
|
||||
|
||||
// TODO: remove this fallback
|
||||
if (obs_data_has_user_value(obj, "displayUnit")) {
|
||||
_dur.SetUnit(static_cast<Duration::Unit>(
|
||||
obs_data_get_int(obj, "displayUnit")));
|
||||
}
|
||||
}
|
||||
|
||||
bool DurationModifier::DurationReached()
|
||||
{
|
||||
switch (_type) {
|
||||
case DurationModifier::Type::NONE:
|
||||
return true;
|
||||
break;
|
||||
case DurationModifier::Type::MORE:
|
||||
return _dur.DurationReached();
|
||||
break;
|
||||
case DurationModifier::Type::EQUAL:
|
||||
if (_dur.DurationReached() && !_timeReached) {
|
||||
_timeReached = true;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case DurationModifier::Type::LESS:
|
||||
return !_dur.DurationReached();
|
||||
break;
|
||||
case DurationModifier::Type::WITHIN:
|
||||
if (_dur.IsReset()) {
|
||||
return false;
|
||||
}
|
||||
return !_dur.DurationReached();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DurationModifier::Reset()
|
||||
{
|
||||
_timeReached = false;
|
||||
_dur.Reset();
|
||||
}
|
||||
|
||||
MacroCondition::MacroCondition(Macro *m, bool supportsVariableValue)
|
||||
: MacroSegment(m, supportsVariableValue)
|
||||
{
|
||||
@@ -84,73 +11,64 @@ bool MacroCondition::Save(obs_data_t *obj) const
|
||||
{
|
||||
MacroSegment::Save(obj);
|
||||
obs_data_set_string(obj, "id", GetId().c_str());
|
||||
obs_data_set_int(obj, "logic", static_cast<int>(_logic));
|
||||
|
||||
// To avoid conflicts with conditions which also use the Duration class
|
||||
// save the duration modifier in a separate obj
|
||||
auto durObj = obs_data_create();
|
||||
_duration.Save(durObj);
|
||||
obs_data_set_obj(obj, "durationModifier", durObj);
|
||||
obs_data_release(durObj);
|
||||
|
||||
_logic.Save(obj, "logic");
|
||||
_durationModifier.Save(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MacroCondition::Load(obs_data_t *obj)
|
||||
{
|
||||
MacroSegment::Load(obj);
|
||||
_logic = static_cast<LogicType>(obs_data_get_int(obj, "logic"));
|
||||
if (obs_data_has_user_value(obj, "durationModifier")) {
|
||||
auto durObj = obs_data_get_obj(obj, "durationModifier");
|
||||
_duration.Load(durObj);
|
||||
obs_data_release(durObj);
|
||||
} else {
|
||||
// For backwards compatibility
|
||||
_duration.Load(obj);
|
||||
}
|
||||
_logic.Load(obj, "logic");
|
||||
_durationModifier.Load(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
void MacroCondition::ValidateLogicSelection(bool isRootCondition,
|
||||
const char *context)
|
||||
{
|
||||
if (_logic.IsValidSelection(isRootCondition)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_logic.IsRootType()) {
|
||||
_logic.SetType(Logic::Type::ROOT_NONE);
|
||||
blog(LOG_WARNING,
|
||||
"setting invalid logic selection to 'if' for macro %s",
|
||||
context);
|
||||
return;
|
||||
}
|
||||
|
||||
_logic.SetType(Logic::Type::NONE);
|
||||
blog(LOG_WARNING,
|
||||
"setting invalid logic selection to 'ignore' for macro %s",
|
||||
context);
|
||||
}
|
||||
|
||||
void MacroCondition::ResetDuration()
|
||||
{
|
||||
_duration.Reset();
|
||||
_durationModifier.ResetDuration();
|
||||
}
|
||||
|
||||
void MacroCondition::CheckDurationModifier(bool &val)
|
||||
bool MacroCondition::CheckDurationModifier(bool conditionValue)
|
||||
{
|
||||
if (_duration.GetType() != DurationModifier::Type::WITHIN && !val) {
|
||||
_duration.Reset();
|
||||
}
|
||||
if (_duration.GetType() == DurationModifier::Type::WITHIN && val) {
|
||||
_duration.Reset();
|
||||
}
|
||||
switch (_duration.GetType()) {
|
||||
case DurationModifier::Type::NONE:
|
||||
case DurationModifier::Type::MORE:
|
||||
case DurationModifier::Type::EQUAL:
|
||||
case DurationModifier::Type::LESS:
|
||||
val = val && _duration.DurationReached();
|
||||
return;
|
||||
case DurationModifier::Type::WITHIN:
|
||||
if (val) {
|
||||
_duration.SetTimeRemaining(
|
||||
_duration.GetDuration().Seconds());
|
||||
}
|
||||
val = val || _duration.DurationReached();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return _durationModifier.CheckConditionWithDurationModifier(
|
||||
conditionValue);
|
||||
}
|
||||
|
||||
DurationModifier MacroCondition::GetDurationModifier() const
|
||||
{
|
||||
return _durationModifier;
|
||||
}
|
||||
|
||||
void MacroCondition::SetDurationModifier(DurationModifier::Type m)
|
||||
{
|
||||
_duration.SetModifier(m);
|
||||
_durationModifier.SetModifier(m);
|
||||
}
|
||||
|
||||
void MacroCondition::SetDuration(const Duration &duration)
|
||||
{
|
||||
_duration.SetValue(duration);
|
||||
_durationModifier.SetDuration(duration);
|
||||
}
|
||||
|
||||
std::string_view MacroCondition::GetDefaultID()
|
||||
|
||||
@@ -1,63 +1,11 @@
|
||||
#pragma once
|
||||
#include "macro-segment.hpp"
|
||||
#include "condition-logic.hpp"
|
||||
#include "duration-modifier.hpp"
|
||||
#include "macro-ref.hpp"
|
||||
#include <duration-control.hpp>
|
||||
|
||||
namespace advss {
|
||||
|
||||
constexpr auto logic_root_offset = 100;
|
||||
|
||||
enum class LogicType {
|
||||
ROOT_NONE = 0,
|
||||
ROOT_NOT,
|
||||
ROOT_LAST,
|
||||
// leave some space for potential expansion
|
||||
NONE = 100,
|
||||
AND,
|
||||
OR,
|
||||
AND_NOT,
|
||||
OR_NOT,
|
||||
LAST,
|
||||
};
|
||||
|
||||
static inline bool isRootLogicType(LogicType l)
|
||||
{
|
||||
return static_cast<int>(l) < logic_root_offset;
|
||||
}
|
||||
|
||||
struct LogicTypeInfo {
|
||||
std::string _name;
|
||||
};
|
||||
|
||||
class DurationModifier {
|
||||
public:
|
||||
enum class Type {
|
||||
NONE,
|
||||
MORE,
|
||||
EQUAL,
|
||||
LESS,
|
||||
WITHIN, // Condition will remain true for a set a amount of time
|
||||
// regardless of current state
|
||||
};
|
||||
|
||||
void Save(obs_data_t *obj, const char *condName = "time_constraint",
|
||||
const char *duration = "seconds") const;
|
||||
void Load(obs_data_t *obj, const char *condName = "time_constraint",
|
||||
const char *duration = "seconds");
|
||||
void SetModifier(Type cond) { _type = cond; }
|
||||
void SetTimeRemaining(const double &val) { _dur.SetTimeRemaining(val); }
|
||||
void SetValue(const Duration &value) { _dur = value; }
|
||||
Type GetType() { return _type; }
|
||||
Duration GetDuration() { return _dur; }
|
||||
bool DurationReached();
|
||||
void Reset();
|
||||
|
||||
private:
|
||||
Type _type = Type::NONE;
|
||||
Duration _dur;
|
||||
bool _timeReached = false;
|
||||
};
|
||||
|
||||
class EXPORT MacroCondition : public MacroSegment {
|
||||
public:
|
||||
MacroCondition(Macro *m, bool supportsVariableValue = false);
|
||||
@@ -65,20 +13,24 @@ public:
|
||||
virtual bool CheckCondition() = 0;
|
||||
virtual bool Save(obs_data_t *obj) const = 0;
|
||||
virtual bool Load(obs_data_t *obj) = 0;
|
||||
LogicType GetLogicType() { return _logic; }
|
||||
void SetLogicType(LogicType logic) { _logic = logic; }
|
||||
static const std::map<LogicType, LogicTypeInfo> logicTypes;
|
||||
void ResetDuration();
|
||||
void CheckDurationModifier(bool &val);
|
||||
DurationModifier GetDurationModifier() { return _duration; }
|
||||
|
||||
Logic::Type GetLogicType() const { return _logic.GetType(); }
|
||||
void SetLogicType(const Logic::Type &logic) { _logic.SetType(logic); }
|
||||
|
||||
void ValidateLogicSelection(bool isRootCondition, const char *context);
|
||||
|
||||
DurationModifier GetDurationModifier() const;
|
||||
void SetDurationModifier(DurationModifier::Type m);
|
||||
void SetDuration(const Duration &duration);
|
||||
|
||||
void ResetDuration();
|
||||
bool CheckDurationModifier(bool conditionValue);
|
||||
|
||||
static std::string_view GetDefaultID();
|
||||
|
||||
private:
|
||||
LogicType _logic = LogicType::ROOT_NONE;
|
||||
DurationModifier _duration;
|
||||
Logic _logic = Logic(Logic::Type::ROOT_NONE);
|
||||
DurationModifier _durationModifier;
|
||||
};
|
||||
|
||||
class EXPORT MacroRefCondition : virtual public MacroCondition {
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
namespace advss {
|
||||
|
||||
MacroDock::MacroDock(std::weak_ptr<Macro> m, QWidget *parent,
|
||||
MacroDock::MacroDock(std::weak_ptr<Macro> m,
|
||||
const StringVariable &runButtonText,
|
||||
const StringVariable &pauseButtonText,
|
||||
const StringVariable &unpauseButtonText,
|
||||
const StringVariable &conditionsTrueText,
|
||||
const StringVariable &conditionsFalseText,
|
||||
bool enableHighlight)
|
||||
: OBSDock(parent),
|
||||
: QFrame(),
|
||||
_runButtonText(runButtonText),
|
||||
_pauseButtonText(pauseButtonText),
|
||||
_unpauseButtonText(unpauseButtonText),
|
||||
@@ -25,19 +25,16 @@ MacroDock::MacroDock(std::weak_ptr<Macro> m, QWidget *parent,
|
||||
_statusText(new QLabel(conditionsFalseText.c_str())),
|
||||
_macro(m)
|
||||
{
|
||||
setFrameShape(QFrame::StyledPanel);
|
||||
setFrameShadow(QFrame::Sunken);
|
||||
|
||||
auto macro = _macro.lock();
|
||||
if (macro) {
|
||||
setWindowTitle(QString::fromStdString(macro->Name()));
|
||||
_run->setVisible(macro->DockHasRunButton());
|
||||
_pauseToggle->setVisible(macro->DockHasPauseButton());
|
||||
_statusText->setVisible(macro->DockHasStatusLabel());
|
||||
} else {
|
||||
setWindowTitle("<deleted macro>");
|
||||
}
|
||||
|
||||
setFeatures(DockWidgetClosable | DockWidgetMovable |
|
||||
DockWidgetFloatable);
|
||||
|
||||
QWidget::connect(_run, SIGNAL(clicked()), this, SLOT(RunClicked()));
|
||||
QWidget::connect(_pauseToggle, SIGNAL(clicked()), this,
|
||||
SLOT(PauseToggleClicked()));
|
||||
@@ -52,21 +49,7 @@ MacroDock::MacroDock(std::weak_ptr<Macro> m, QWidget *parent,
|
||||
QWidget::connect(&_timer, SIGNAL(timeout()), this, SLOT(Highlight()));
|
||||
_timer.start(500);
|
||||
|
||||
// QFrame wrapper is necessary to avoid dock being partially
|
||||
// transparent
|
||||
QFrame *wrapper = new QFrame;
|
||||
wrapper->setFrameShape(QFrame::StyledPanel);
|
||||
wrapper->setFrameShadow(QFrame::Sunken);
|
||||
wrapper->setLayout(layout);
|
||||
setWidget(wrapper);
|
||||
|
||||
setFloating(true);
|
||||
hide();
|
||||
}
|
||||
|
||||
void MacroDock::SetName(const QString &name)
|
||||
{
|
||||
setWindowTitle(name);
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
void MacroDock::ShowRunButton(bool value)
|
||||
@@ -155,8 +138,9 @@ void MacroDock::UpdateText()
|
||||
|
||||
_pauseToggle->setText(macro->Paused() ? _unpauseButtonText.c_str()
|
||||
: _pauseButtonText.c_str());
|
||||
_statusText->setText(macro->Matched() ? _conditionsTrueText.c_str()
|
||||
: _conditionsFalseText.c_str());
|
||||
_statusText->setText(macro->ConditionsMatched()
|
||||
? _conditionsTrueText.c_str()
|
||||
: _conditionsFalseText.c_str());
|
||||
}
|
||||
|
||||
void MacroDock::Highlight()
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#pragma once
|
||||
#include "obs-dock.hpp"
|
||||
#include "variable-string.hpp"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include <memory>
|
||||
#include <chrono>
|
||||
|
||||
@@ -12,18 +11,16 @@ namespace advss {
|
||||
|
||||
class Macro;
|
||||
|
||||
class MacroDock : public OBSDock {
|
||||
class MacroDock : public QFrame {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MacroDock(std::weak_ptr<Macro>, QWidget *parent,
|
||||
const StringVariable &runButtonText,
|
||||
MacroDock(std::weak_ptr<Macro>, const StringVariable &runButtonText,
|
||||
const StringVariable &pauseButtonText,
|
||||
const StringVariable &unpauseButtonText,
|
||||
const StringVariable &conditionsTrueText,
|
||||
const StringVariable &conditionsFalseText,
|
||||
bool enableHighlight);
|
||||
void SetName(const QString &);
|
||||
void ShowRunButton(bool);
|
||||
void SetRunButtonText(const StringVariable &);
|
||||
void ShowPauseButton(bool);
|
||||
|
||||
@@ -85,9 +85,11 @@ std::string GetMacroName(Macro *macro)
|
||||
return macro ? macro->Name() : "";
|
||||
}
|
||||
|
||||
int64_t MillisecondsSinceMacroConditionCheck(Macro *macro)
|
||||
std::chrono::high_resolution_clock::time_point
|
||||
LastMacroConditionCheckTime(Macro *macro)
|
||||
{
|
||||
return macro ? macro->MsSinceLastCheck() : 0;
|
||||
return macro ? macro->LastConditionCheckTime()
|
||||
: std::chrono::high_resolution_clock::time_point{};
|
||||
}
|
||||
|
||||
bool MacroIsStopped(Macro *macro)
|
||||
|
||||
@@ -43,7 +43,8 @@ EXPORT bool MacroSwitchedScene();
|
||||
|
||||
EXPORT std::string GetMacroName(Macro *);
|
||||
|
||||
EXPORT int64_t MillisecondsSinceMacroConditionCheck(Macro *);
|
||||
EXPORT std::chrono::high_resolution_clock::time_point
|
||||
LastMacroConditionCheckTime(Macro *);
|
||||
|
||||
EXPORT bool MacroIsStopped(Macro *);
|
||||
EXPORT bool MacroIsPaused(Macro *);
|
||||
|
||||
@@ -49,15 +49,9 @@ void MacroInputVariables::Load(obs_data_t *obj)
|
||||
void MacroInputVariables::SetValues(const StringList &values)
|
||||
{
|
||||
if (_inputVariables.size() != (size_t)values.size()) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
blog(LOG_WARNING,
|
||||
"%s - sizes do not match (variables: %ld, values %d)",
|
||||
__func__, _inputVariables.size(), values.size());
|
||||
#else
|
||||
blog(LOG_WARNING,
|
||||
"%s - sizes do not match (variables: %ld, values %lld)",
|
||||
__func__, _inputVariables.size(), values.size());
|
||||
#endif
|
||||
"%s - sizes do not match (variables: %d, values %d)",
|
||||
__func__, (int)_inputVariables.size(), (int)values.size());
|
||||
}
|
||||
|
||||
for (size_t index = 0;
|
||||
@@ -98,7 +92,7 @@ void MacroInputSelection::SetInputs(const MacroInputVariables &inputs)
|
||||
void MacroInputSelection::Add()
|
||||
{
|
||||
std::string varName;
|
||||
bool accepted = VariableSelectionDialog::AskForVariable(this, varName);
|
||||
bool accepted = VariableSelectionDialog::AskForVariable(varName);
|
||||
|
||||
if (!accepted || varName.empty()) {
|
||||
return;
|
||||
@@ -161,7 +155,7 @@ void MacroInputSelection::Down()
|
||||
void MacroInputSelection::Clicked(QListWidgetItem *item)
|
||||
{
|
||||
std::string varName;
|
||||
bool accepted = VariableSelectionDialog::AskForVariable(this, varName);
|
||||
bool accepted = VariableSelectionDialog::AskForVariable(varName);
|
||||
|
||||
if (!accepted || varName.empty()) {
|
||||
return;
|
||||
|
||||
@@ -40,9 +40,12 @@ void MacroList::SetContent(const std::vector<MacroRef> ¯os)
|
||||
UpdateListSize();
|
||||
}
|
||||
|
||||
void MacroList::AddControl(QWidget *widget)
|
||||
QAction *MacroList::AddControl(QWidget *widget, bool addSeperator)
|
||||
{
|
||||
_controlsLayout->insertWidget(_controlsLayout->count() - 1, widget);
|
||||
if (addSeperator) {
|
||||
_controls->addSeparator();
|
||||
}
|
||||
return _controls->addWidget(widget);
|
||||
}
|
||||
|
||||
int MacroList::CurrentRow()
|
||||
@@ -76,7 +79,7 @@ void MacroList::MacroRemove(const QString &name)
|
||||
void MacroList::Add()
|
||||
{
|
||||
std::string macroName;
|
||||
bool accepted = MacroSelectionDialog::AskForMacro(this, macroName);
|
||||
bool accepted = MacroSelectionDialog::AskForMacro(macroName);
|
||||
|
||||
if (!accepted || macroName.empty()) {
|
||||
return;
|
||||
@@ -129,7 +132,7 @@ void MacroList::Down()
|
||||
void MacroList::Clicked(QListWidgetItem *item)
|
||||
{
|
||||
std::string macroName;
|
||||
bool accepted = MacroSelectionDialog::AskForMacro(this, macroName);
|
||||
bool accepted = MacroSelectionDialog::AskForMacro(macroName);
|
||||
|
||||
if (!accepted || macroName.empty()) {
|
||||
return;
|
||||
|
||||
@@ -9,7 +9,7 @@ class ADVSS_EXPORT MacroList final : public ListEditor {
|
||||
public:
|
||||
MacroList(QWidget *parent, bool allowDuplicates, bool reorder);
|
||||
void SetContent(const std::vector<MacroRef> &);
|
||||
void AddControl(QWidget *);
|
||||
QAction *AddControl(QWidget *, bool addSeperator = true);
|
||||
int CurrentRow();
|
||||
|
||||
private slots:
|
||||
|
||||
447
lib/macro/macro-script-handler.cpp
Normal file
447
lib/macro/macro-script-handler.cpp
Normal file
@@ -0,0 +1,447 @@
|
||||
#include "macro-script-handler.hpp"
|
||||
#include "macro-action-script.hpp"
|
||||
#include "macro-condition-script.hpp"
|
||||
#include "plugin-state-helpers.hpp"
|
||||
#include "log-helper.hpp"
|
||||
#include "variable.hpp"
|
||||
|
||||
#include <obs-properties.h>
|
||||
|
||||
namespace advss {
|
||||
|
||||
std::mutex ScriptHandler::_mutex = {};
|
||||
std::unordered_map<std::string, ScriptSegmentType> ScriptHandler::_actions = {};
|
||||
std::unordered_map<std::string, ScriptSegmentType> ScriptHandler::_conditions =
|
||||
{};
|
||||
|
||||
/* Procedure handler helpers */
|
||||
|
||||
#define RETURN_STATUS(status) \
|
||||
{ \
|
||||
calldata_set_bool(data, "success", status); \
|
||||
return; \
|
||||
}
|
||||
#define RETURN_SUCCESS() RETURN_STATUS(true);
|
||||
#define RETURN_FAILURE() RETURN_STATUS(false);
|
||||
|
||||
static constexpr std::string_view nameParam = "name";
|
||||
static constexpr std::string_view defaultSettingsParam = "default_settings";
|
||||
static constexpr std::string_view propertiesSignalParam =
|
||||
"properties_signal_name";
|
||||
static constexpr std::string_view triggerSignalParam = "trigger_signal_name";
|
||||
|
||||
static std::string getRegisterScriptSegmentDeclString(const char *funcName)
|
||||
{
|
||||
return std::string("bool ") + funcName + "(in string " +
|
||||
nameParam.data() + ", in ptr " + defaultSettingsParam.data() +
|
||||
", out string " + propertiesSignalParam.data() +
|
||||
", out string " + triggerSignalParam.data() + ")";
|
||||
}
|
||||
|
||||
static std::string getDeregisterScriptSegmentDeclString(const char *funcName)
|
||||
{
|
||||
return std::string("bool ") + funcName + "(in string " +
|
||||
nameParam.data() + ")";
|
||||
}
|
||||
|
||||
/* Script actions */
|
||||
|
||||
static constexpr std::string_view registerActionFuncName =
|
||||
"advss_register_script_action";
|
||||
static constexpr std::string_view deregisterActionFuncName =
|
||||
"advss_deregister_script_action";
|
||||
|
||||
static const std::string registerScriptActionDeclString =
|
||||
getRegisterScriptSegmentDeclString(registerActionFuncName.data());
|
||||
static const std::string deregisterScriptActionDeclString =
|
||||
getDeregisterScriptSegmentDeclString(deregisterActionFuncName.data());
|
||||
|
||||
/* Script conditions */
|
||||
|
||||
static constexpr std::string_view registerConditionFuncName =
|
||||
"advss_register_script_condition";
|
||||
static constexpr std::string_view deregisterConditionFuncName =
|
||||
"advss_deregister_script_condition";
|
||||
|
||||
static const std::string registerScriptConditionDeclString =
|
||||
getRegisterScriptSegmentDeclString(registerConditionFuncName.data());
|
||||
static const std::string deregisterScriptConditionDeclString =
|
||||
getDeregisterScriptSegmentDeclString(
|
||||
deregisterConditionFuncName.data());
|
||||
|
||||
/* Script variables */
|
||||
|
||||
static constexpr std::string_view valueParam = "value";
|
||||
static constexpr std::string_view getVariableValueFuncName =
|
||||
"advss_get_variable_value";
|
||||
static constexpr std::string_view setVariableValueFuncName =
|
||||
"advss_set_variable_value";
|
||||
static const std::string getVariableValueDeclString =
|
||||
std::string("bool ") + getVariableValueFuncName.data() + "(in string " +
|
||||
nameParam.data() + ", out string " + valueParam.data() + ")";
|
||||
static const std::string setVariableValueDeclString =
|
||||
std::string("bool ") + setVariableValueFuncName.data() + "(in string " +
|
||||
nameParam.data() + ", in string " + valueParam.data() + ")";
|
||||
|
||||
static bool setup();
|
||||
static bool setupDone = setup();
|
||||
|
||||
static bool setup()
|
||||
{
|
||||
proc_handler_t *ph = obs_get_proc_handler();
|
||||
assert(ph != NULL);
|
||||
|
||||
proc_handler_add(ph, registerScriptActionDeclString.c_str(),
|
||||
&ScriptHandler::RegisterScriptAction, nullptr);
|
||||
proc_handler_add(ph, deregisterScriptActionDeclString.c_str(),
|
||||
&ScriptHandler::DeregisterScriptAction, nullptr);
|
||||
proc_handler_add(ph, registerScriptConditionDeclString.c_str(),
|
||||
&ScriptHandler::RegisterScriptCondition, nullptr);
|
||||
proc_handler_add(ph, deregisterScriptConditionDeclString.c_str(),
|
||||
&ScriptHandler::DeregisterScriptCondition, nullptr);
|
||||
proc_handler_add(ph, getVariableValueDeclString.c_str(),
|
||||
&ScriptHandler::GetVariableValue, nullptr);
|
||||
proc_handler_add(ph, setVariableValueDeclString.c_str(),
|
||||
&ScriptHandler::SetVariableValue, nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void replaceWhitespace(std::string &string)
|
||||
{
|
||||
std::transform(string.begin(), string.end(), string.begin(), [](char c) {
|
||||
return std::isspace(static_cast<unsigned char>(c)) ? '_' : c;
|
||||
});
|
||||
}
|
||||
|
||||
static std::string nameToScriptID(const std::string &name)
|
||||
{
|
||||
return std::string("script_") + name;
|
||||
}
|
||||
|
||||
static std::string getTriggerSignal(const std::string &name,
|
||||
const bool isAction)
|
||||
{
|
||||
std::string signal = name;
|
||||
replaceWhitespace(signal);
|
||||
signal += "_run";
|
||||
signal += isAction ? "_action" : "_condition";
|
||||
return signal;
|
||||
}
|
||||
|
||||
static std::string getCompletionSignal(const std::string &name,
|
||||
const bool isAction)
|
||||
{
|
||||
auto signal = getTriggerSignal(name, isAction);
|
||||
signal += "_complete";
|
||||
return signal;
|
||||
}
|
||||
|
||||
static std::string getPropertiesSignal(const std::string &name,
|
||||
const bool isAction)
|
||||
{
|
||||
std::string signal = name;
|
||||
replaceWhitespace(signal);
|
||||
signal += isAction ? "_action" : "_condition";
|
||||
signal += "_get_properties";
|
||||
return signal;
|
||||
}
|
||||
|
||||
void ScriptHandler::RegisterScriptAction(void *, calldata_t *data)
|
||||
{
|
||||
const char *actionName;
|
||||
if (!calldata_get_string(data, nameParam.data(), &actionName) ||
|
||||
strlen(actionName) == 0) {
|
||||
blog(LOG_WARNING, "[%s] failed! \"%s\" parameter missing!",
|
||||
registerScriptActionDeclString.data(), nameParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
obs_data_t *defaultSettingsPtr = nullptr;
|
||||
if (!calldata_get_ptr(data, defaultSettingsParam.data(),
|
||||
&defaultSettingsPtr)) {
|
||||
blog(LOG_WARNING, "[%s] failed! \"%s\" parameter missing!",
|
||||
registerActionFuncName.data(),
|
||||
defaultSettingsParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
OBSData defaultSettings(defaultSettingsPtr);
|
||||
obs_data_release(defaultSettingsPtr);
|
||||
|
||||
if (_actions.count(actionName) > 0) {
|
||||
blog(LOG_WARNING, "[%s] failed! Action \"%s\" already exists!",
|
||||
registerActionFuncName.data(), actionName);
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
const std::string id = nameToScriptID(actionName);
|
||||
auto triggerSignalName = getTriggerSignal(actionName, true);
|
||||
auto completionSignalName = getCompletionSignal(actionName, true);
|
||||
auto propertiesSignalName = getPropertiesSignal(actionName, true);
|
||||
|
||||
const auto createScriptAction =
|
||||
[id, defaultSettings, propertiesSignalName, triggerSignalName,
|
||||
completionSignalName](
|
||||
Macro *m) -> std::shared_ptr<MacroAction> {
|
||||
return std::make_shared<MacroActionScript>(
|
||||
m, id, defaultSettings, propertiesSignalName,
|
||||
triggerSignalName, completionSignalName);
|
||||
};
|
||||
if (!MacroActionFactory::Register(id, {createScriptAction,
|
||||
MacroSegmentScriptEdit::Create,
|
||||
actionName})) {
|
||||
blog(LOG_WARNING,
|
||||
"[%s] failed! Action id \"%s\" already exists!",
|
||||
registerActionFuncName.data(), id.c_str());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
blog(LOG_INFO, "[%s] successful for \"%s\"",
|
||||
registerActionFuncName.data(), actionName);
|
||||
|
||||
calldata_set_string(data, triggerSignalParam.data(),
|
||||
triggerSignalName.c_str());
|
||||
calldata_set_string(data, propertiesSignalParam.data(),
|
||||
propertiesSignalName.c_str());
|
||||
_actions.emplace(id, ScriptSegmentType(id, propertiesSignalName,
|
||||
triggerSignalName,
|
||||
completionSignalName));
|
||||
|
||||
RETURN_SUCCESS();
|
||||
}
|
||||
|
||||
void ScriptHandler::DeregisterScriptAction(void *, calldata_t *data)
|
||||
{
|
||||
const char *actionName;
|
||||
if (!calldata_get_string(data, nameParam.data(), &actionName) ||
|
||||
strlen(actionName) == 0) {
|
||||
blog(LOG_WARNING, "[%s] failed! \"%s\" parameter missing!",
|
||||
deregisterActionFuncName.data(), nameParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
const std::string id = nameToScriptID(actionName);
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
|
||||
if (_actions.count(id) == 0) {
|
||||
blog(LOG_WARNING,
|
||||
"[%s] failed! Action \"%s\" was never registered!",
|
||||
deregisterActionFuncName.data(), id.c_str());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
if (!MacroActionFactory::Deregister(id)) {
|
||||
blog(LOG_WARNING,
|
||||
"[%s] failed! Action id \"%s\" does not exist!",
|
||||
deregisterActionFuncName.data(), id.c_str());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
auto it = _actions.find(id);
|
||||
if (it != _actions.end()) {
|
||||
_actions.erase(it);
|
||||
}
|
||||
|
||||
RETURN_SUCCESS();
|
||||
}
|
||||
|
||||
void ScriptHandler::RegisterScriptCondition(void *, calldata_t *data)
|
||||
{
|
||||
const char *conditionName;
|
||||
if (!calldata_get_string(data, nameParam.data(), &conditionName) ||
|
||||
strlen(conditionName) == 0) {
|
||||
blog(LOG_WARNING, "[%s] failed! \"%s\" parameter missing!",
|
||||
registerScriptConditionDeclString.data(),
|
||||
nameParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
obs_data_t *defaultSettingsPtr = nullptr;
|
||||
if (!calldata_get_ptr(data, defaultSettingsParam.data(),
|
||||
&defaultSettingsPtr)) {
|
||||
blog(LOG_WARNING, "[%s] failed! \"%s\" parameter missing!",
|
||||
registerScriptConditionDeclString.data(),
|
||||
defaultSettingsParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
OBSData defaultSettings(defaultSettingsPtr);
|
||||
obs_data_release(defaultSettingsPtr);
|
||||
|
||||
if (_conditions.count(conditionName) > 0) {
|
||||
blog(LOG_WARNING,
|
||||
"[%s] failed! Condition \"%s\" already exists!",
|
||||
registerConditionFuncName.data(), conditionName);
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
const std::string id = nameToScriptID(conditionName);
|
||||
auto triggerSignalName = getTriggerSignal(conditionName, false);
|
||||
auto completionSignalName = getCompletionSignal(conditionName, false);
|
||||
auto propertiesSignalName = getPropertiesSignal(conditionName, false);
|
||||
|
||||
const auto createScriptCondition =
|
||||
[id, defaultSettings, propertiesSignalName, triggerSignalName,
|
||||
completionSignalName](
|
||||
Macro *m) -> std::shared_ptr<MacroCondition> {
|
||||
return std::make_shared<MacroConditionScript>(
|
||||
m, id, defaultSettings, propertiesSignalName,
|
||||
triggerSignalName, completionSignalName);
|
||||
};
|
||||
if (!MacroConditionFactory::Register(
|
||||
id, {createScriptCondition, MacroSegmentScriptEdit::Create,
|
||||
conditionName})) {
|
||||
blog(LOG_WARNING,
|
||||
"[%s] failed! Condition id \"%s\" already exists!",
|
||||
registerConditionFuncName.data(), id.c_str());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
blog(LOG_INFO, "[%s] successful for \"%s\"",
|
||||
registerConditionFuncName.data(), conditionName);
|
||||
|
||||
calldata_set_string(data, triggerSignalParam.data(),
|
||||
triggerSignalName.c_str());
|
||||
calldata_set_string(data, propertiesSignalParam.data(),
|
||||
propertiesSignalName.c_str());
|
||||
_conditions.emplace(id, ScriptSegmentType(id, propertiesSignalName,
|
||||
triggerSignalName,
|
||||
completionSignalName));
|
||||
|
||||
RETURN_SUCCESS();
|
||||
}
|
||||
|
||||
void ScriptHandler::DeregisterScriptCondition(void *, calldata_t *data)
|
||||
{
|
||||
const char *conditionName;
|
||||
if (!calldata_get_string(data, nameParam.data(), &conditionName) ||
|
||||
strlen(conditionName) == 0) {
|
||||
blog(LOG_WARNING, "[%s] failed! \"%s\" parameter missing!",
|
||||
deregisterConditionFuncName.data(), nameParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
const std::string id = nameToScriptID(conditionName);
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
|
||||
if (_conditions.count(id) == 0) {
|
||||
blog(LOG_WARNING,
|
||||
"[%s] failed! Condition \"%s\" was never registered!",
|
||||
deregisterConditionFuncName.data(), id.c_str());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
if (!MacroConditionFactory::Deregister(id)) {
|
||||
blog(LOG_WARNING,
|
||||
"[%s] failed! Condition id \"%s\" does not exist!",
|
||||
deregisterConditionFuncName.data(), id.c_str());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
auto it = _conditions.find(id);
|
||||
if (it != _conditions.end()) {
|
||||
_conditions.erase(it);
|
||||
}
|
||||
|
||||
RETURN_SUCCESS();
|
||||
}
|
||||
|
||||
void ScriptHandler::GetVariableValue(void *, calldata_t *data)
|
||||
{
|
||||
const char *variableName;
|
||||
if (!calldata_get_string(data, nameParam.data(), &variableName) ||
|
||||
strlen(variableName) == 0) {
|
||||
blog(LOG_WARNING, "[%s] failed! \"%s\" parameter missing!",
|
||||
getVariableValueFuncName.data(), nameParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
auto weakVariable = GetWeakVariableByName(variableName);
|
||||
auto variable = weakVariable.lock();
|
||||
if (!variable) {
|
||||
blog(LOG_WARNING,
|
||||
"[%s] failed! \"%s\" variable does not exist!",
|
||||
getVariableValueFuncName.data(), nameParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
calldata_set_string(data, valueParam.data(), variable->Value().c_str());
|
||||
RETURN_SUCCESS();
|
||||
}
|
||||
|
||||
void ScriptHandler::SetVariableValue(void *, calldata_t *data)
|
||||
{
|
||||
const char *variableName;
|
||||
if (!calldata_get_string(data, nameParam.data(), &variableName) ||
|
||||
strlen(variableName) == 0) {
|
||||
blog(LOG_WARNING, "[%s] failed! \"%s\" parameter missing!",
|
||||
getVariableValueFuncName.data(), nameParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
const char *variableValue;
|
||||
if (!calldata_get_string(data, valueParam.data(), &variableValue) ||
|
||||
strlen(variableValue) == 0) {
|
||||
blog(LOG_WARNING, "[%s] failed! \"%s\" parameter missing!",
|
||||
getVariableValueFuncName.data(), valueParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
auto weakVariable = GetWeakVariableByName(variableName);
|
||||
auto variable = weakVariable.lock();
|
||||
if (!variable) {
|
||||
blog(LOG_WARNING,
|
||||
"[%s] failed! \"%s\" variable does not exist!",
|
||||
getVariableValueFuncName.data(), nameParam.data());
|
||||
RETURN_FAILURE();
|
||||
}
|
||||
|
||||
variable->SetValue(variableValue);
|
||||
RETURN_SUCCESS();
|
||||
}
|
||||
|
||||
bool ScriptHandler::ActionIdIsValid(const std::string &id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
return _actions.count(id) > 0;
|
||||
}
|
||||
|
||||
bool ScriptHandler::ConditionIdIsValid(const std::string &id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
return _conditions.count(id) > 0;
|
||||
}
|
||||
|
||||
static std::string signalNameToTriggerSignalDecl(const std::string &name)
|
||||
{
|
||||
return std::string("void ") + name + "()";
|
||||
}
|
||||
|
||||
static std::string signalNameToPropertiesSignalDecl(const std::string &name)
|
||||
{
|
||||
return std::string("void ") + name + "(in ptr " +
|
||||
GetPropertiesSignalParamName().data() + ")";
|
||||
}
|
||||
static std::string signalNameToCompletionSignalDecl(const std::string &name)
|
||||
{
|
||||
return std::string("bool ") + name + "(in int " +
|
||||
GeCompletionIdParamName().data() + ")";
|
||||
}
|
||||
|
||||
ScriptSegmentType::ScriptSegmentType(const std::string &id,
|
||||
const std::string &propertiesSignal,
|
||||
const std::string &triggerSignal,
|
||||
const std::string &completionSignal)
|
||||
: _id(id)
|
||||
{
|
||||
signal_handler_add(
|
||||
obs_get_signal_handler(),
|
||||
signalNameToPropertiesSignalDecl(propertiesSignal).c_str());
|
||||
signal_handler_add(
|
||||
obs_get_signal_handler(),
|
||||
signalNameToTriggerSignalDecl(triggerSignal).c_str());
|
||||
signal_handler_add(
|
||||
obs_get_signal_handler(),
|
||||
signalNameToCompletionSignalDecl(completionSignal).c_str());
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
59
lib/macro/macro-script-handler.hpp
Normal file
59
lib/macro/macro-script-handler.hpp
Normal file
@@ -0,0 +1,59 @@
|
||||
#pragma once
|
||||
#include <obs.hpp>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace advss {
|
||||
|
||||
class ScriptSegmentType {
|
||||
public:
|
||||
ScriptSegmentType() = delete;
|
||||
ScriptSegmentType(const std::string &id,
|
||||
const std::string &propertiesSignal,
|
||||
const std::string &triggerSignal,
|
||||
const std::string &completionSignal);
|
||||
|
||||
private:
|
||||
std::string _id;
|
||||
};
|
||||
|
||||
class ScriptHandler {
|
||||
public:
|
||||
ScriptHandler() = delete;
|
||||
static void RegisterScriptAction(void *ctx, calldata_t *data);
|
||||
static void DeregisterScriptAction(void *ctx, calldata_t *data);
|
||||
static void RegisterScriptCondition(void *ctx, calldata_t *data);
|
||||
static void DeregisterScriptCondition(void *ctx, calldata_t *data);
|
||||
static void GetVariableValue(void *ctx, calldata_t *data);
|
||||
static void SetVariableValue(void *ctx, calldata_t *data);
|
||||
static bool ActionIdIsValid(const std::string &id);
|
||||
static bool ConditionIdIsValid(const std::string &id);
|
||||
|
||||
private:
|
||||
static std::mutex _mutex;
|
||||
static std::unordered_map<std::string, ScriptSegmentType> _actions;
|
||||
static std::unordered_map<std::string, ScriptSegmentType> _conditions;
|
||||
};
|
||||
|
||||
static constexpr std::string_view GetPropertiesSignalParamName()
|
||||
{
|
||||
return "properties";
|
||||
}
|
||||
|
||||
static constexpr std::string_view GetActionCompletionSignalParamName()
|
||||
{
|
||||
return "completion_signal_name";
|
||||
}
|
||||
|
||||
static constexpr std::string_view GeCompletionIdParamName()
|
||||
{
|
||||
return "completion_id";
|
||||
}
|
||||
|
||||
static constexpr std::string_view GeResultSignalParamName()
|
||||
{
|
||||
return "result";
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "macro-segment-copy-paste.hpp"
|
||||
#include "advanced-scene-switcher.hpp"
|
||||
#include "macro.hpp"
|
||||
|
||||
@@ -61,13 +62,13 @@ void AdvSceneSwitcher::PasteMacroSegment()
|
||||
const auto condition = std::static_pointer_cast<MacroCondition>(
|
||||
copyInfo.segment);
|
||||
auto logic = condition->GetLogicType();
|
||||
if (logic > LogicType::ROOT_LAST &&
|
||||
if (logic > Logic::Type::ROOT_LAST &&
|
||||
macro->Conditions().empty()) {
|
||||
logic = LogicType::ROOT_NONE;
|
||||
logic = Logic::Type::ROOT_NONE;
|
||||
}
|
||||
if (logic < LogicType::ROOT_LAST &&
|
||||
if (logic < Logic::Type::ROOT_LAST &&
|
||||
!macro->Conditions().empty()) {
|
||||
logic = LogicType::OR;
|
||||
logic = Logic::Type::OR;
|
||||
}
|
||||
AddMacroCondition(macro.get(), macro->Conditions().size(),
|
||||
copyInfo.segment->GetId(), data.Get(), logic);
|
||||
@@ -91,6 +92,27 @@ bool MacroSegmentIsInClipboard()
|
||||
return copyInfo.type != MacroSegmentCopyInfo::Type::NONE;
|
||||
}
|
||||
|
||||
bool MacroActionIsInClipboard()
|
||||
{
|
||||
return copyInfo.type == MacroSegmentCopyInfo::Type::ACTION ||
|
||||
copyInfo.type == MacroSegmentCopyInfo::Type::ELSE;
|
||||
}
|
||||
|
||||
void SetCopySegmentTargetActionType(bool setToElseAction)
|
||||
{
|
||||
if (copyInfo.type == MacroSegmentCopyInfo::Type::ACTION &&
|
||||
setToElseAction) {
|
||||
copyInfo.type = MacroSegmentCopyInfo::Type::ELSE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (copyInfo.type == MacroSegmentCopyInfo::Type::ELSE &&
|
||||
!setToElseAction) {
|
||||
copyInfo.type = MacroSegmentCopyInfo::Type::ACTION;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void SetupSegmentCopyPasteShortcutHandlers(AdvSceneSwitcher *window)
|
||||
{
|
||||
auto copyShortcut = new QShortcut(QKeySequence("Ctrl+C"), window);
|
||||
|
||||
@@ -3,6 +3,8 @@ namespace advss {
|
||||
class AdvSceneSwitcher;
|
||||
|
||||
bool MacroSegmentIsInClipboard();
|
||||
bool MacroActionIsInClipboard();
|
||||
void SetCopySegmentTargetActionType(bool setToElseAction);
|
||||
void SetupSegmentCopyPasteShortcutHandlers(AdvSceneSwitcher *window);
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -59,7 +59,7 @@ static bool posIsInScrollbar(const QScrollBar *scrollbar, const QPoint &pos)
|
||||
return globalGeo.contains(pos);
|
||||
}
|
||||
|
||||
int MacroSegmentList::GetDragIndex(const QPoint &pos)
|
||||
int MacroSegmentList::GetDragIndex(const QPoint &pos) const
|
||||
{
|
||||
// Don't drag widget when interacting with the scrollbars
|
||||
if (posIsInScrollbar(horizontalScrollBar(), mapTo(this, pos)) ||
|
||||
@@ -88,12 +88,12 @@ int MacroSegmentList::GetDragIndex(const QPoint &pos)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void MacroSegmentList::SetHelpMsg(const QString &msg)
|
||||
void MacroSegmentList::SetHelpMsg(const QString &msg) const
|
||||
{
|
||||
_helpMsg->setText(msg);
|
||||
}
|
||||
|
||||
void MacroSegmentList::SetHelpMsgVisible(bool visible)
|
||||
void MacroSegmentList::SetHelpMsgVisible(bool visible) const
|
||||
{
|
||||
_helpMsg->setVisible(visible);
|
||||
}
|
||||
@@ -110,12 +110,12 @@ void MacroSegmentList::Add(QWidget *widget)
|
||||
_contentLayout->addWidget(widget);
|
||||
}
|
||||
|
||||
void MacroSegmentList::Remove(int idx)
|
||||
void MacroSegmentList::Remove(int idx) const
|
||||
{
|
||||
DeleteLayoutItemWidget(_contentLayout->takeAt(idx));
|
||||
}
|
||||
|
||||
void MacroSegmentList::Clear(int idx)
|
||||
void MacroSegmentList::Clear(int idx) const
|
||||
{
|
||||
ClearLayout(_contentLayout, idx);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ void MacroSegmentList::Highlight(int idx, QColor color)
|
||||
HighlightWidget(widget, color, QColor(0, 0, 0, 0), true);
|
||||
}
|
||||
|
||||
void MacroSegmentList::SetCollapsed(bool collapse)
|
||||
void MacroSegmentList::SetCollapsed(bool collapse) const
|
||||
{
|
||||
QLayoutItem *item = nullptr;
|
||||
for (int i = 0; i < _contentLayout->count(); i++) {
|
||||
@@ -145,7 +145,7 @@ void MacroSegmentList::SetCollapsed(bool collapse)
|
||||
}
|
||||
}
|
||||
|
||||
void MacroSegmentList::SetSelection(int idx)
|
||||
void MacroSegmentList::SetSelection(int idx) const
|
||||
{
|
||||
for (int i = 0; i < _contentLayout->count(); ++i) {
|
||||
auto widget = static_cast<MacroSegmentEdit *>(
|
||||
@@ -235,7 +235,7 @@ void MacroSegmentList::dragEnterEvent(QDragEnterEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
MacroSegmentEdit *MacroSegmentList::WidgetAt(int idx)
|
||||
MacroSegmentEdit *MacroSegmentList::WidgetAt(int idx) const
|
||||
{
|
||||
if (idx < 0 || idx >= _contentLayout->count()) {
|
||||
return nullptr;
|
||||
@@ -247,11 +247,16 @@ MacroSegmentEdit *MacroSegmentList::WidgetAt(int idx)
|
||||
return static_cast<MacroSegmentEdit *>(item->widget());
|
||||
}
|
||||
|
||||
MacroSegmentEdit *MacroSegmentList::WidgetAt(const QPoint &pos)
|
||||
MacroSegmentEdit *MacroSegmentList::WidgetAt(const QPoint &pos) const
|
||||
{
|
||||
return WidgetAt(GetSegmentIndexFromPos(mapToGlobal(pos)));
|
||||
}
|
||||
|
||||
int MacroSegmentList::IndexAt(const QPoint &pos) const
|
||||
{
|
||||
return GetSegmentIndexFromPos(mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void MacroSegmentList::HideLastDropLine()
|
||||
{
|
||||
if (_dropLineIdx >= 0 && _dropLineIdx < _contentLayout->count()) {
|
||||
@@ -303,7 +308,7 @@ void MacroSegmentList::dragMoveEvent(QDragMoveEvent *event)
|
||||
CheckDropLine(_dragCursorPos);
|
||||
}
|
||||
|
||||
QRect MacroSegmentList::GetContentItemRectWithPadding(int idx)
|
||||
QRect MacroSegmentList::GetContentItemRectWithPadding(int idx) const
|
||||
{
|
||||
auto item = _contentLayout->itemAt(idx);
|
||||
if (!item) {
|
||||
@@ -325,7 +330,7 @@ QRect MacroSegmentList::GetContentItemRectWithPadding(int idx)
|
||||
return rect;
|
||||
}
|
||||
|
||||
int MacroSegmentList::GetSegmentIndexFromPos(const QPoint &pos)
|
||||
int MacroSegmentList::GetSegmentIndexFromPos(const QPoint &pos) const
|
||||
{
|
||||
int idx = -1;
|
||||
for (int i = 0; i < _contentLayout->count(); ++i) {
|
||||
@@ -337,7 +342,7 @@ int MacroSegmentList::GetSegmentIndexFromPos(const QPoint &pos)
|
||||
return idx;
|
||||
}
|
||||
|
||||
void MacroSegmentList::CheckScroll()
|
||||
void MacroSegmentList::CheckScroll() const
|
||||
{
|
||||
while (_autoScroll) {
|
||||
const int scrollTrigger = 15;
|
||||
@@ -407,14 +412,14 @@ void MacroSegmentList::CheckDropLine(const QPoint &pos)
|
||||
}
|
||||
}
|
||||
|
||||
bool MacroSegmentList::IsInListArea(const QPoint &pos)
|
||||
bool MacroSegmentList::IsInListArea(const QPoint &pos) const
|
||||
{
|
||||
const QRect layoutRect(mapToGlobal(_layout->contentsRect().topLeft()),
|
||||
_layout->contentsRect().size());
|
||||
return layoutRect.contains(pos);
|
||||
}
|
||||
|
||||
int MacroSegmentList::GetDropIndex(const QPoint &pos)
|
||||
int MacroSegmentList::GetDropIndex(const QPoint &pos) const
|
||||
{
|
||||
int idx = GetSegmentIndexFromPos(pos);
|
||||
if (idx == _dragPosition) {
|
||||
|
||||
@@ -15,18 +15,19 @@ class MacroSegmentList : public QScrollArea {
|
||||
public:
|
||||
MacroSegmentList(QWidget *parent = nullptr);
|
||||
virtual ~MacroSegmentList();
|
||||
void SetHelpMsg(const QString &msg);
|
||||
void SetHelpMsgVisible(bool visible);
|
||||
MacroSegmentEdit *WidgetAt(int idx);
|
||||
MacroSegmentEdit *WidgetAt(const QPoint &);
|
||||
void SetHelpMsg(const QString &msg) const;
|
||||
void SetHelpMsgVisible(bool visible) const;
|
||||
MacroSegmentEdit *WidgetAt(int idx) const;
|
||||
MacroSegmentEdit *WidgetAt(const QPoint &) const;
|
||||
int IndexAt(const QPoint &) const;
|
||||
void Insert(int idx, MacroSegmentEdit *widget);
|
||||
void Add(QWidget *widget);
|
||||
void Remove(int idx);
|
||||
void Clear(int idx = 0); // Clear all elements >= idx
|
||||
void Remove(int idx) const;
|
||||
void Clear(int idx = 0) const; // Clear all elements >= idx
|
||||
void Highlight(int idx, QColor color = QColor(Qt::green));
|
||||
void SetCollapsed(bool);
|
||||
void SetSelection(int idx);
|
||||
QVBoxLayout *ContentLayout() { return _contentLayout; }
|
||||
void SetCollapsed(bool) const;
|
||||
void SetSelection(int idx) const;
|
||||
QVBoxLayout *ContentLayout() const { return _contentLayout; }
|
||||
|
||||
signals:
|
||||
void SelectionChanged(int idx);
|
||||
@@ -43,13 +44,13 @@ protected:
|
||||
void dropEvent(QDropEvent *event);
|
||||
|
||||
private:
|
||||
int GetDragIndex(const QPoint &);
|
||||
int GetDropIndex(const QPoint &);
|
||||
int GetSegmentIndexFromPos(const QPoint &);
|
||||
void CheckScroll();
|
||||
int GetSegmentIndexFromPos(const QPoint &) const;
|
||||
int GetDragIndex(const QPoint &) const;
|
||||
int GetDropIndex(const QPoint &) const;
|
||||
void CheckScroll() const;
|
||||
void CheckDropLine(const QPoint &);
|
||||
bool IsInListArea(const QPoint &);
|
||||
QRect GetContentItemRectWithPadding(int idx);
|
||||
bool IsInListArea(const QPoint &) const;
|
||||
QRect GetContentItemRectWithPadding(int idx) const;
|
||||
void HideLastDropLine();
|
||||
|
||||
int _dragPosition = -1;
|
||||
|
||||
219
lib/macro/macro-segment-script.cpp
Normal file
219
lib/macro/macro-segment-script.cpp
Normal file
@@ -0,0 +1,219 @@
|
||||
#include "macro-segment-script.hpp"
|
||||
#include "layout-helpers.hpp"
|
||||
#include "macro-action.hpp"
|
||||
#include "macro-condition.hpp"
|
||||
#include "macro-helpers.hpp"
|
||||
#include "macro-script-handler.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
#include "properties-view.hpp"
|
||||
#include "sync-helpers.hpp"
|
||||
|
||||
namespace advss {
|
||||
|
||||
static std::atomic_int completionIdCounter = 0;
|
||||
|
||||
MacroSegmentScript::MacroSegmentScript(obs_data_t *defaultSettings,
|
||||
const std::string &propertiesSignalName,
|
||||
const std::string &triggerSignal,
|
||||
const std::string &completionSignal)
|
||||
: _settings(obs_data_get_defaults(defaultSettings)),
|
||||
_propertiesSignal(propertiesSignalName),
|
||||
_triggerSignal(triggerSignal),
|
||||
_completionSignal(completionSignal)
|
||||
{
|
||||
signal_handler_connect(obs_get_signal_handler(),
|
||||
completionSignal.c_str(),
|
||||
&MacroSegmentScript::CompletionSignalReceived,
|
||||
this);
|
||||
}
|
||||
|
||||
MacroSegmentScript::MacroSegmentScript(const MacroSegmentScript &other)
|
||||
: _settings(obs_data_create()),
|
||||
_propertiesSignal(other._propertiesSignal),
|
||||
_triggerSignal(other._triggerSignal),
|
||||
_completionSignal(other._completionSignal)
|
||||
{
|
||||
signal_handler_connect(obs_get_signal_handler(),
|
||||
_completionSignal.c_str(),
|
||||
&MacroSegmentScript::CompletionSignalReceived,
|
||||
this);
|
||||
obs_data_apply(_settings.Get(), other._settings.Get());
|
||||
}
|
||||
|
||||
bool MacroSegmentScript::Save(obs_data_t *obj) const
|
||||
{
|
||||
obs_data_set_obj(obj, "settings", _settings.Get());
|
||||
_timeout.Save(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MacroSegmentScript::Load(obs_data_t *obj)
|
||||
{
|
||||
OBSDataAutoRelease settings = obs_data_get_obj(obj, "settings");
|
||||
obs_data_apply(_settings.Get(), settings);
|
||||
_timeout.Load(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
obs_properties_t *MacroSegmentScript::GetProperties() const
|
||||
{
|
||||
auto data = calldata_create();
|
||||
signal_handler_signal(obs_get_signal_handler(),
|
||||
_propertiesSignal.c_str(), data);
|
||||
obs_properties_t *properties = nullptr;
|
||||
if (!calldata_get_ptr(data, GetPropertiesSignalParamName().data(),
|
||||
&properties)) {
|
||||
calldata_destroy(data);
|
||||
return nullptr;
|
||||
}
|
||||
calldata_destroy(data);
|
||||
return properties;
|
||||
}
|
||||
|
||||
void MacroSegmentScript::UpdateSettings(obs_data_t *newSettings) const
|
||||
{
|
||||
obs_data_clear(_settings.Get());
|
||||
obs_data_apply(_settings.Get(), newSettings);
|
||||
}
|
||||
|
||||
bool MacroSegmentScript::SendTriggerSignal()
|
||||
{
|
||||
_completionId = ++completionIdCounter;
|
||||
_triggerIsComplete = false;
|
||||
_triggerResult = false;
|
||||
|
||||
auto data = calldata_create();
|
||||
calldata_set_string(data, GetActionCompletionSignalParamName().data(),
|
||||
_completionSignal.c_str());
|
||||
calldata_set_int(data, GeCompletionIdParamName().data(), _completionId);
|
||||
calldata_set_string(data, "settings", obs_data_get_json(GetSettings()));
|
||||
signal_handler_signal(obs_get_signal_handler(), _triggerSignal.c_str(),
|
||||
data);
|
||||
calldata_destroy(data);
|
||||
|
||||
SetMacroAbortWait(false);
|
||||
WaitForCompletion();
|
||||
|
||||
return _triggerResult;
|
||||
}
|
||||
|
||||
void MacroSegmentScript::CompletionSignalReceived(void *param, calldata_t *data)
|
||||
{
|
||||
auto segment = static_cast<MacroSegmentScript *>(param);
|
||||
long long int id;
|
||||
if (!calldata_get_int(data, GeCompletionIdParamName().data(), &id)) {
|
||||
blog(LOG_WARNING,
|
||||
"received completion signal without \"%s\" parameter",
|
||||
GeCompletionIdParamName().data());
|
||||
return;
|
||||
}
|
||||
bool result;
|
||||
if (!calldata_get_bool(data, GeResultSignalParamName().data(),
|
||||
&result)) {
|
||||
blog(LOG_WARNING,
|
||||
"received completion signal without \"%s\" parameter",
|
||||
GeResultSignalParamName().data());
|
||||
return;
|
||||
}
|
||||
if (id != segment->_completionId) {
|
||||
return;
|
||||
}
|
||||
segment->_triggerIsComplete = true;
|
||||
segment->_triggerResult = result;
|
||||
}
|
||||
|
||||
obs_properties_t *MacroSegmentScriptEdit::GetProperties(void *obj)
|
||||
{
|
||||
auto segmentEdit = reinterpret_cast<MacroSegmentScriptEdit *>(obj);
|
||||
if (!segmentEdit) {
|
||||
return nullptr;
|
||||
}
|
||||
return segmentEdit->_entryData->GetProperties();
|
||||
}
|
||||
|
||||
void MacroSegmentScriptEdit::UpdateSettings(void *obj, obs_data_t *settings)
|
||||
{
|
||||
auto segmentEdit = reinterpret_cast<MacroSegmentScriptEdit *>(obj);
|
||||
if (!segmentEdit || segmentEdit->_loading || !segmentEdit->_entryData) {
|
||||
return;
|
||||
}
|
||||
auto lock = LockContext();
|
||||
segmentEdit->_entryData->UpdateSettings(settings);
|
||||
}
|
||||
|
||||
MacroSegmentScriptEdit::MacroSegmentScriptEdit(
|
||||
QWidget *parent, std::shared_ptr<MacroSegmentScript> entryData)
|
||||
: QWidget(parent),
|
||||
_timeout(new DurationSelection(this))
|
||||
{
|
||||
QWidget::connect(_timeout, &DurationSelection::DurationChanged, this,
|
||||
&MacroSegmentScriptEdit::TimeoutChanged);
|
||||
|
||||
auto timeoutLayout = new QHBoxLayout();
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.script.timeout"),
|
||||
timeoutLayout, {{"{{timeout}}", _timeout}});
|
||||
|
||||
auto layout = new QVBoxLayout();
|
||||
|
||||
auto properties = entryData->GetProperties();
|
||||
if (!!properties) {
|
||||
obs_properties_destroy(properties);
|
||||
|
||||
// We need a separate OBSData object here as we can't risk
|
||||
// entryData->_settings being modified while it is currently used
|
||||
OBSDataAutoRelease data = obs_data_create();
|
||||
obs_data_apply(data, entryData->GetSettings());
|
||||
|
||||
#if LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(30, 0, 0)
|
||||
auto propertiesView =
|
||||
new OBSPropertiesView(data.Get(), this, GetProperties,
|
||||
nullptr, UpdateSettings);
|
||||
layout->addWidget(propertiesView);
|
||||
connect(propertiesView, &OBSPropertiesView::PropertiesResized,
|
||||
this, [this]() {
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
});
|
||||
#else
|
||||
layout->addWidget(new QLabel(
|
||||
"Displaying script properties not supported when compiled for OBS 29!"));
|
||||
#endif
|
||||
}
|
||||
|
||||
layout->addLayout(timeoutLayout);
|
||||
setLayout(layout);
|
||||
|
||||
_entryData = entryData;
|
||||
UpdateEntryData();
|
||||
_loading = false;
|
||||
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
void MacroSegmentScriptEdit::UpdateEntryData()
|
||||
{
|
||||
_timeout->SetDuration(_entryData->_timeout);
|
||||
}
|
||||
|
||||
QWidget *MacroSegmentScriptEdit::Create(QWidget *parent,
|
||||
std::shared_ptr<MacroAction> segment)
|
||||
{
|
||||
return new MacroSegmentScriptEdit(
|
||||
parent, std::dynamic_pointer_cast<MacroSegmentScript>(segment));
|
||||
}
|
||||
|
||||
QWidget *MacroSegmentScriptEdit::Create(QWidget *parent,
|
||||
std::shared_ptr<MacroCondition> segment)
|
||||
{
|
||||
return new MacroSegmentScriptEdit(
|
||||
parent, std::dynamic_pointer_cast<MacroSegmentScript>(segment));
|
||||
}
|
||||
|
||||
void MacroSegmentScriptEdit::TimeoutChanged(const Duration &timeout)
|
||||
{
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_timeout = timeout;
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
78
lib/macro/macro-segment-script.hpp
Normal file
78
lib/macro/macro-segment-script.hpp
Normal file
@@ -0,0 +1,78 @@
|
||||
#pragma once
|
||||
#include "duration-control.hpp"
|
||||
#include "macro-script-handler.hpp"
|
||||
|
||||
#include <atomic>
|
||||
#include <obs-data.h>
|
||||
|
||||
namespace advss {
|
||||
|
||||
class Macro;
|
||||
class MacroAction;
|
||||
class MacroCondition;
|
||||
|
||||
class MacroSegmentScript {
|
||||
public:
|
||||
MacroSegmentScript(obs_data_t *defaultSettings,
|
||||
const std::string &propertiesSignalName,
|
||||
const std::string &triggerSignal,
|
||||
const std::string &completionSignal);
|
||||
MacroSegmentScript(const advss::MacroSegmentScript &);
|
||||
|
||||
protected:
|
||||
bool Save(obs_data_t *obj) const;
|
||||
bool Load(obs_data_t *obj);
|
||||
|
||||
obs_properties_t *GetProperties() const;
|
||||
OBSData GetSettings() const { return _settings.Get(); }
|
||||
void UpdateSettings(obs_data_t *newSettings) const;
|
||||
|
||||
bool SendTriggerSignal();
|
||||
double GetTimeoutSeconds() const { return _timeout.Seconds(); };
|
||||
bool TriggerIsCompleted() const { return _triggerIsComplete; }
|
||||
|
||||
private:
|
||||
virtual void WaitForCompletion() const = 0;
|
||||
static void CompletionSignalReceived(void *param, calldata_t *data);
|
||||
|
||||
OBSDataAutoRelease _settings;
|
||||
std::string _propertiesSignal = "";
|
||||
|
||||
std::string _triggerSignal = "";
|
||||
std::string _completionSignal = "";
|
||||
std::atomic_bool _triggerIsComplete = {false};
|
||||
bool _triggerResult = false;
|
||||
int64_t _completionId = 0;
|
||||
|
||||
Duration _timeout = Duration(10.0);
|
||||
|
||||
friend class MacroSegmentScriptEdit;
|
||||
};
|
||||
|
||||
class MacroSegmentScriptEdit : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MacroSegmentScriptEdit(
|
||||
QWidget *parent,
|
||||
std::shared_ptr<MacroSegmentScript> entryData = nullptr);
|
||||
void UpdateEntryData();
|
||||
static QWidget *Create(QWidget *parent,
|
||||
std::shared_ptr<MacroAction> segment);
|
||||
static QWidget *Create(QWidget *parent,
|
||||
std::shared_ptr<MacroCondition> segment);
|
||||
|
||||
private slots:
|
||||
void TimeoutChanged(const Duration &);
|
||||
|
||||
private:
|
||||
static obs_properties_t *GetProperties(void *obj);
|
||||
static void UpdateSettings(void *obj, obs_data_t *settings);
|
||||
|
||||
DurationSelection *_timeout;
|
||||
|
||||
std::shared_ptr<MacroSegmentScript> _entryData;
|
||||
bool _loading = true;
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
@@ -70,7 +70,8 @@ void MacroSegmentSelection::MacroSegmentOrderChanged()
|
||||
SetupDescription();
|
||||
}
|
||||
|
||||
QString GetMacroSegmentDescription(Macro *macro, int idx, bool isCondition)
|
||||
static QString GetMacroSegmentDescription(Macro *macro, int idx,
|
||||
bool isCondition)
|
||||
{
|
||||
if (!macro) {
|
||||
return "";
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "advanced-scene-switcher.hpp"
|
||||
#include "layout-helpers.hpp"
|
||||
#include "macro.hpp"
|
||||
#include "ui-helpers.hpp"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QStandardItemModel>
|
||||
@@ -19,11 +20,13 @@ MacroSelection::MacroSelection(QWidget *parent)
|
||||
addItem(QString::fromStdString(m->Name()));
|
||||
}
|
||||
|
||||
QWidget::connect(parent, SIGNAL(MacroAdded(const QString &)), this,
|
||||
QWidget::connect(GetSettingsWindow(),
|
||||
SIGNAL(MacroAdded(const QString &)), this,
|
||||
SLOT(MacroAdd(const QString &)));
|
||||
QWidget::connect(parent, SIGNAL(MacroRemoved(const QString &)), this,
|
||||
QWidget::connect(GetSettingsWindow(),
|
||||
SIGNAL(MacroRemoved(const QString &)), this,
|
||||
SLOT(MacroRemove(const QString &)));
|
||||
QWidget::connect(parent,
|
||||
QWidget::connect(GetSettingsWindow(),
|
||||
SIGNAL(MacroRenamed(const QString &, const QString &)),
|
||||
this,
|
||||
SLOT(MacroRename(const QString &, const QString &)));
|
||||
@@ -66,7 +69,7 @@ void MacroSelection::HideSelectedMacro()
|
||||
void MacroSelection::ShowAllMacros()
|
||||
{
|
||||
auto v = qobject_cast<QListView *>(view());
|
||||
for (int i = count(); i > 0; i--) {
|
||||
for (int i = count() - 1; i >= 0; i--) {
|
||||
v->setRowHidden(i, false);
|
||||
}
|
||||
}
|
||||
@@ -124,7 +127,7 @@ MacroSelectionDialog::MacroSelectionDialog(QWidget *parent)
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
bool MacroSelectionDialog::AskForMacro(QWidget *parent, std::string ¯oName)
|
||||
bool MacroSelectionDialog::AskForMacro(std::string ¯oName)
|
||||
{
|
||||
MacroSelectionDialog dialog(GetSettingsWindow());
|
||||
dialog.setWindowTitle(obs_module_text("AdvSceneSwitcher.windowTitle"));
|
||||
|
||||
@@ -28,7 +28,7 @@ class MacroSelectionDialog : public QDialog {
|
||||
|
||||
public:
|
||||
MacroSelectionDialog(QWidget *parent);
|
||||
static bool AskForMacro(QWidget *parent, std::string ¯oName);
|
||||
static bool AskForMacro(std::string ¯oName);
|
||||
|
||||
private:
|
||||
MacroSelection *_macroSelection;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include "macro-settings.hpp"
|
||||
#include "layout-helpers.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
#include "macro.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
#include "plugin-state-helpers.hpp"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QScrollArea>
|
||||
@@ -20,6 +21,10 @@ void GlobalMacroSettings::Save(obs_data_t *obj) const
|
||||
obs_data_set_bool(data, "highlightActions", _highlightActions);
|
||||
obs_data_set_bool(data, "newMacroRegisterHotkey",
|
||||
_newMacroRegisterHotkeys);
|
||||
obs_data_set_bool(data, "newMacroUseShortCircuitEvaluation",
|
||||
_newMacroUseShortCircuitEvaluation);
|
||||
obs_data_set_bool(data, "saveSettingsOnMacroChange",
|
||||
_saveSettingsOnMacroChange);
|
||||
obs_data_set_obj(obj, "macroSettings", data);
|
||||
obs_data_release(data);
|
||||
}
|
||||
@@ -38,6 +43,12 @@ void GlobalMacroSettings::Load(obs_data_t *obj)
|
||||
_highlightActions = obs_data_get_bool(data, "highlightActions");
|
||||
_newMacroRegisterHotkeys =
|
||||
obs_data_get_bool(data, "newMacroRegisterHotkey");
|
||||
_newMacroUseShortCircuitEvaluation =
|
||||
obs_data_get_bool(data, "newMacroUseShortCircuitEvaluation");
|
||||
_saveSettingsOnMacroChange =
|
||||
obs_data_has_user_value(data, "saveSettingsOnMacroChange")
|
||||
? obs_data_get_bool(data, "saveSettingsOnMacroChange")
|
||||
: true;
|
||||
obs_data_release(data);
|
||||
}
|
||||
|
||||
@@ -45,16 +56,29 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
||||
const GlobalMacroSettings &settings,
|
||||
Macro *macro)
|
||||
: QDialog(parent),
|
||||
_executed(new QCheckBox(obs_module_text(
|
||||
_highlightExecutedMacros(new QCheckBox(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.highlightExecutedMacros"))),
|
||||
_conditions(new QCheckBox(obs_module_text(
|
||||
_highlightConditions(new QCheckBox(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.highlightTrueConditions"))),
|
||||
_actions(new QCheckBox(obs_module_text(
|
||||
_highlightActions(new QCheckBox(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.highlightPerformedActions"))),
|
||||
_newMacroRegisterHotkeys(new QCheckBox(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.newMacroRegisterHotkey"))),
|
||||
_newMacroUseShortCircuitEvaluation(new QCheckBox(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.newMacroUseShortCircuitEvaluation"))),
|
||||
_saveSettingsOnMacroChange(new QCheckBox(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.saveSettingsOnMacroChange"))),
|
||||
_currentMacroRegisterHotkeys(new QCheckBox(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.currentDisableHotkeys"))),
|
||||
"AdvSceneSwitcher.macroTab.currentRegisterHotkeys"))),
|
||||
_currentUseShortCircuitEvaluation(new QCheckBox(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.currentUseShortCircuitEvaluation"))),
|
||||
_currentUseCustomConditionCheckInterval(new QCheckBox(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.currentUseCustomConditionCheckInterval"))),
|
||||
_currentCustomConditionCheckInterval(
|
||||
new DurationSelection(this, true, 0.01)),
|
||||
_currentCustomConditionCheckIntervalWarning(new QLabel(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.currentUseCustomConditionCheckIntervalWarning"))),
|
||||
_currentPauseSaveBehavior(new QComboBox(this)),
|
||||
_currentSkipOnStartup(new QCheckBox(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.currentSkipExecutionOnStartup"))),
|
||||
_currentStopActionsIfNotDone(new QCheckBox(obs_module_text(
|
||||
@@ -83,12 +107,32 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
||||
setWindowModality(Qt::WindowModality::WindowModal);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
_newMacroUseShortCircuitEvaluation->setToolTip(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.shortCircuit.tooltip"));
|
||||
_saveSettingsOnMacroChange->setToolTip(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.saveSettingsOnMacroChange.tooltip"));
|
||||
_currentUseShortCircuitEvaluation->setToolTip(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.shortCircuit.tooltip"));
|
||||
|
||||
_currentPauseSaveBehavior->addItem(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.pauseStateSaveBehavior.persist"),
|
||||
static_cast<int>(Macro::PauseStateSaveBehavior::PERSIST));
|
||||
_currentPauseSaveBehavior->addItem(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.pauseStateSaveBehavior.pause"),
|
||||
static_cast<int>(Macro::PauseStateSaveBehavior::PAUSE));
|
||||
_currentPauseSaveBehavior->addItem(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.pauseStateSaveBehavior.unpause"),
|
||||
static_cast<int>(Macro::PauseStateSaveBehavior::UNPAUSE));
|
||||
|
||||
auto highlightOptions = new QGroupBox(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.highlightSettings"));
|
||||
auto highlightLayout = new QVBoxLayout;
|
||||
highlightLayout->addWidget(_executed);
|
||||
highlightLayout->addWidget(_conditions);
|
||||
highlightLayout->addWidget(_actions);
|
||||
highlightLayout->addWidget(_highlightExecutedMacros);
|
||||
highlightLayout->addWidget(_highlightConditions);
|
||||
highlightLayout->addWidget(_highlightActions);
|
||||
highlightOptions->setLayout(highlightLayout);
|
||||
|
||||
auto hotkeyOptions = new QGroupBox(
|
||||
@@ -101,8 +145,29 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
||||
auto generalOptions = new QGroupBox(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.generalSettings"));
|
||||
auto generalLayout = new QVBoxLayout;
|
||||
generalLayout->addWidget(_saveSettingsOnMacroChange);
|
||||
generalLayout->addWidget(_currentSkipOnStartup);
|
||||
generalLayout->addWidget(_currentStopActionsIfNotDone);
|
||||
generalLayout->addWidget(_currentUseShortCircuitEvaluation);
|
||||
generalLayout->addWidget(_newMacroUseShortCircuitEvaluation);
|
||||
|
||||
auto durationLayout = new QHBoxLayout();
|
||||
durationLayout->addWidget(_currentUseCustomConditionCheckInterval);
|
||||
durationLayout->addWidget(_currentCustomConditionCheckInterval);
|
||||
durationLayout->addStretch();
|
||||
auto customConditionIntervalLayout = new QVBoxLayout();
|
||||
customConditionIntervalLayout->addLayout(durationLayout);
|
||||
customConditionIntervalLayout->addWidget(
|
||||
_currentCustomConditionCheckIntervalWarning);
|
||||
generalLayout->addLayout(customConditionIntervalLayout);
|
||||
|
||||
auto pauseStateSaveBehavorLayout = new QHBoxLayout();
|
||||
pauseStateSaveBehavorLayout->addWidget(new QLabel(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.pauseStateSaveBehavior")));
|
||||
pauseStateSaveBehavorLayout->addWidget(_currentPauseSaveBehavior);
|
||||
pauseStateSaveBehavorLayout->addStretch();
|
||||
generalLayout->addLayout(pauseStateSaveBehavorLayout);
|
||||
|
||||
generalOptions->setLayout(generalLayout);
|
||||
|
||||
auto inputOptions = new QGroupBox(
|
||||
@@ -178,6 +243,13 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
||||
&MacroSettingsDialog::PauseButtonEnableChanged);
|
||||
connect(_currentMacroDockAddStatusLabel, &QCheckBox::stateChanged, this,
|
||||
&MacroSettingsDialog::StatusLabelEnableChanged);
|
||||
connect(_currentUseCustomConditionCheckInterval,
|
||||
&QCheckBox::stateChanged, this, [this](int state) {
|
||||
_currentCustomConditionCheckInterval->setEnabled(state);
|
||||
});
|
||||
connect(_currentCustomConditionCheckInterval,
|
||||
&DurationSelection::DurationChanged, this,
|
||||
[this]() { SetCustomConditionIntervalWarningVisibility(); });
|
||||
|
||||
auto scrollArea = new QScrollArea(this);
|
||||
scrollArea->setWidgetResizable(true);
|
||||
@@ -198,20 +270,43 @@ MacroSettingsDialog::MacroSettingsDialog(QWidget *parent,
|
||||
dialogLayout->addWidget(buttonbox);
|
||||
setLayout(dialogLayout);
|
||||
|
||||
_executed->setChecked(settings._highlightExecuted);
|
||||
_conditions->setChecked(settings._highlightConditions);
|
||||
_actions->setChecked(settings._highlightActions);
|
||||
_highlightExecutedMacros->setChecked(settings._highlightExecuted);
|
||||
_highlightConditions->setChecked(settings._highlightConditions);
|
||||
_highlightActions->setChecked(settings._highlightActions);
|
||||
_newMacroRegisterHotkeys->setChecked(settings._newMacroRegisterHotkeys);
|
||||
_newMacroUseShortCircuitEvaluation->setChecked(
|
||||
settings._newMacroUseShortCircuitEvaluation);
|
||||
_saveSettingsOnMacroChange->setChecked(
|
||||
settings._saveSettingsOnMacroChange);
|
||||
|
||||
if (!macro || macro->IsGroup()) {
|
||||
hotkeyOptions->hide();
|
||||
generalOptions->hide();
|
||||
|
||||
// General group
|
||||
_currentSkipOnStartup->hide();
|
||||
_currentStopActionsIfNotDone->hide();
|
||||
_currentUseShortCircuitEvaluation->hide();
|
||||
SetLayoutVisible(customConditionIntervalLayout, false);
|
||||
SetLayoutVisible(pauseStateSaveBehavorLayout, false);
|
||||
|
||||
inputOptions->hide();
|
||||
_dockOptions->hide();
|
||||
return;
|
||||
}
|
||||
|
||||
_currentMacroRegisterHotkeys->setChecked(macro->PauseHotkeysEnabled());
|
||||
_currentUseShortCircuitEvaluation->setChecked(
|
||||
macro->ShortCircuitEvaluationEnabled());
|
||||
_currentUseCustomConditionCheckInterval->setChecked(
|
||||
macro->CustomConditionCheckIntervalEnabled());
|
||||
_currentCustomConditionCheckInterval->SetDuration(
|
||||
macro->GetCustomConditionCheckInterval());
|
||||
_currentCustomConditionCheckInterval->setEnabled(
|
||||
macro->CustomConditionCheckIntervalEnabled());
|
||||
SetCustomConditionIntervalWarningVisibility();
|
||||
_currentPauseSaveBehavior->setCurrentIndex(
|
||||
_currentPauseSaveBehavior->findData(
|
||||
static_cast<int>(macro->GetPauseStateSaveBehavior())));
|
||||
_currentSkipOnStartup->setChecked(macro->SkipExecOnStart());
|
||||
_currentStopActionsIfNotDone->setChecked(macro->StopActionsIfNotDone());
|
||||
_currentInputs->SetInputs(macro->GetInputVariables());
|
||||
@@ -313,6 +408,15 @@ void MacroSettingsDialog::Resize()
|
||||
_dockOptions->updateGeometry();
|
||||
}
|
||||
|
||||
void MacroSettingsDialog::SetCustomConditionIntervalWarningVisibility() const
|
||||
{
|
||||
_currentCustomConditionCheckIntervalWarning->setVisible(
|
||||
_currentUseCustomConditionCheckInterval->isChecked() &&
|
||||
GetIntervalValue() >
|
||||
_currentCustomConditionCheckInterval->GetDuration()
|
||||
.Milliseconds());
|
||||
}
|
||||
|
||||
bool MacroSettingsDialog::AskForSettings(QWidget *parent,
|
||||
GlobalMacroSettings &userInput,
|
||||
Macro *macro)
|
||||
@@ -322,17 +426,33 @@ bool MacroSettingsDialog::AskForSettings(QWidget *parent,
|
||||
if (dialog.exec() != DialogCode::Accepted) {
|
||||
return false;
|
||||
}
|
||||
userInput._highlightExecuted = dialog._executed->isChecked();
|
||||
userInput._highlightConditions = dialog._conditions->isChecked();
|
||||
userInput._highlightActions = dialog._actions->isChecked();
|
||||
userInput._highlightExecuted =
|
||||
dialog._highlightExecutedMacros->isChecked();
|
||||
userInput._highlightConditions =
|
||||
dialog._highlightConditions->isChecked();
|
||||
userInput._highlightActions = dialog._highlightActions->isChecked();
|
||||
userInput._newMacroRegisterHotkeys =
|
||||
dialog._newMacroRegisterHotkeys->isChecked();
|
||||
userInput._newMacroUseShortCircuitEvaluation =
|
||||
dialog._newMacroUseShortCircuitEvaluation->isChecked();
|
||||
userInput._saveSettingsOnMacroChange =
|
||||
dialog._saveSettingsOnMacroChange->isChecked();
|
||||
if (!macro) {
|
||||
return true;
|
||||
}
|
||||
|
||||
macro->EnablePauseHotkeys(
|
||||
dialog._currentMacroRegisterHotkeys->isChecked());
|
||||
macro->SetShortCircuitEvaluation(
|
||||
dialog._currentUseShortCircuitEvaluation->isChecked());
|
||||
macro->SetCustomConditionCheckIntervalEnabled(
|
||||
dialog._currentUseCustomConditionCheckInterval->isChecked());
|
||||
macro->SetCustomConditionCheckInterval(
|
||||
dialog._currentCustomConditionCheckInterval->GetDuration());
|
||||
macro->SetPauseStateSaveBehavior(
|
||||
static_cast<Macro::PauseStateSaveBehavior>(
|
||||
dialog._currentPauseSaveBehavior->currentData()
|
||||
.toInt()));
|
||||
macro->SetSkipExecOnStart(dialog._currentSkipOnStartup->isChecked());
|
||||
macro->SetStopActionsIfNotDone(
|
||||
dialog._currentStopActionsIfNotDone->isChecked());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "variable-line-edit.hpp"
|
||||
#include "duration-control.hpp"
|
||||
#include "macro-input.hpp"
|
||||
|
||||
#include <QWidget>
|
||||
@@ -23,6 +24,8 @@ public:
|
||||
bool _highlightConditions = false;
|
||||
bool _highlightActions = false;
|
||||
bool _newMacroRegisterHotkeys = true;
|
||||
bool _newMacroUseShortCircuitEvaluation = false;
|
||||
bool _saveSettingsOnMacroChange = true;
|
||||
};
|
||||
|
||||
// Dialog for configuring global and individual macro specific settings
|
||||
@@ -43,13 +46,22 @@ private slots:
|
||||
|
||||
private:
|
||||
void Resize();
|
||||
void SetCustomConditionIntervalWarningVisibility() const;
|
||||
|
||||
QCheckBox *_executed;
|
||||
QCheckBox *_conditions;
|
||||
QCheckBox *_actions;
|
||||
// Global macro settings
|
||||
QCheckBox *_highlightExecutedMacros;
|
||||
QCheckBox *_highlightConditions;
|
||||
QCheckBox *_highlightActions;
|
||||
QCheckBox *_newMacroRegisterHotkeys;
|
||||
QCheckBox *_newMacroUseShortCircuitEvaluation;
|
||||
QCheckBox *_saveSettingsOnMacroChange;
|
||||
// Current macro specific settings
|
||||
QCheckBox *_currentMacroRegisterHotkeys;
|
||||
QCheckBox *_currentUseShortCircuitEvaluation;
|
||||
QCheckBox *_currentUseCustomConditionCheckInterval;
|
||||
DurationSelection *_currentCustomConditionCheckInterval;
|
||||
QLabel *_currentCustomConditionCheckIntervalWarning;
|
||||
QComboBox *_currentPauseSaveBehavior;
|
||||
QCheckBox *_currentSkipOnStartup;
|
||||
QCheckBox *_currentStopActionsIfNotDone;
|
||||
MacroInputSelection *_currentInputs;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "advanced-scene-switcher.hpp"
|
||||
#include "action-queue.hpp"
|
||||
#include "cursor-shape-changer.hpp"
|
||||
#include "macro-action-edit.hpp"
|
||||
#include "macro-condition-edit.hpp"
|
||||
#include "macro-export-import-dialog.hpp"
|
||||
@@ -86,7 +87,8 @@ bool AdvSceneSwitcher::AddNewMacro(std::shared_ptr<Macro> &res,
|
||||
}
|
||||
|
||||
res = std::make_shared<Macro>(
|
||||
name, GetGlobalMacroSettings()._newMacroRegisterHotkeys);
|
||||
name, GetGlobalMacroSettings()._newMacroRegisterHotkeys,
|
||||
GetGlobalMacroSettings()._newMacroUseShortCircuitEvaluation);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -98,9 +100,33 @@ void AdvSceneSwitcher::on_macroAdd_clicked()
|
||||
return;
|
||||
}
|
||||
|
||||
ui->macros->Add(newMacro);
|
||||
addPulse->deleteLater();
|
||||
addPulse = nullptr;
|
||||
if (addPulse) {
|
||||
addPulse->deleteLater();
|
||||
addPulse = nullptr;
|
||||
}
|
||||
|
||||
auto selectedMacro = GetSelectedMacro();
|
||||
if (!selectedMacro) {
|
||||
ui->macros->Add(newMacro);
|
||||
emit MacroAdded(QString::fromStdString(name));
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedMacro->IsGroup()) {
|
||||
ui->macros->Add(newMacro, selectedMacro);
|
||||
emit MacroAdded(QString::fromStdString(name));
|
||||
return;
|
||||
}
|
||||
|
||||
auto selectedMacroGroup = selectedMacro->Parent();
|
||||
if (!selectedMacroGroup) {
|
||||
ui->macros->Add(newMacro, selectedMacro);
|
||||
emit MacroAdded(QString::fromStdString(name));
|
||||
return;
|
||||
}
|
||||
|
||||
Macro::PrepareMoveToGroup(selectedMacroGroup, newMacro);
|
||||
ui->macros->Add(newMacro, selectedMacro);
|
||||
emit MacroAdded(QString::fromStdString(name));
|
||||
}
|
||||
|
||||
@@ -738,7 +764,10 @@ void AdvSceneSwitcher::MacroSelectionChanged()
|
||||
return;
|
||||
}
|
||||
SetEditMacro(*macro);
|
||||
obs_frontend_save();
|
||||
|
||||
if (GetGlobalMacroSettings()._saveSettingsOnMacroChange) {
|
||||
obs_frontend_save();
|
||||
}
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::HighlightOnChange()
|
||||
@@ -759,6 +788,16 @@ void AdvSceneSwitcher::HighlightOnChange()
|
||||
}
|
||||
}
|
||||
|
||||
static void resetSegmentHighlights(MacroSegmentList *list)
|
||||
{
|
||||
MacroSegmentEdit *widget = nullptr;
|
||||
for (int i = 0; (widget = list->WidgetAt(i)); i++) {
|
||||
if (widget && widget->Data()) {
|
||||
(void)widget->Data()->GetHighlightAndReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_macroSettings_clicked()
|
||||
{
|
||||
GlobalMacroSettings prop = GetGlobalMacroSettings();
|
||||
@@ -767,17 +806,33 @@ void AdvSceneSwitcher::on_macroSettings_clicked()
|
||||
if (!accepted) {
|
||||
return;
|
||||
}
|
||||
|
||||
GetGlobalMacroSettings() = prop;
|
||||
emit HighlightMacrosChanged(prop._highlightExecuted);
|
||||
|
||||
// Reset highlights to avoid all macro segments being highlighted, which
|
||||
// would have been highlighted at least once since the moment the
|
||||
// highlighting was disabled
|
||||
if (prop._highlightConditions) {
|
||||
resetSegmentHighlights(ui->conditionsList);
|
||||
}
|
||||
if (prop._highlightActions) {
|
||||
resetSegmentHighlights(ui->actionsList);
|
||||
resetSegmentHighlights(ui->elseActionsList);
|
||||
}
|
||||
|
||||
SetCheckIntervalTooLowVisibility();
|
||||
}
|
||||
|
||||
static void moveControlsToSplitter(QSplitter *splitter, int idx,
|
||||
QLayoutItem *item)
|
||||
{
|
||||
static int splitterHandleWidth = 38;
|
||||
static int splitterHandleWidth = 32;
|
||||
auto handle = splitter->handle(idx);
|
||||
auto layout = item->layout();
|
||||
layout->setContentsMargins(7, 7, 7, 7);
|
||||
int leftMargin, rightMargin;
|
||||
layout->getContentsMargins(&leftMargin, nullptr, &rightMargin, nullptr);
|
||||
layout->setContentsMargins(leftMargin, 0, rightMargin, 0);
|
||||
handle->setLayout(layout);
|
||||
splitter->setHandleWidth(splitterHandleWidth);
|
||||
splitter->setStyleSheet("QSplitter::handle {background: transparent;}");
|
||||
@@ -827,6 +882,32 @@ static void runSegmentHighligtChecks(AdvSceneSwitcher *ss)
|
||||
}
|
||||
}
|
||||
|
||||
static QToolBar *
|
||||
setupToolBar(const std::initializer_list<std::initializer_list<QWidget *>>
|
||||
&widgetGroups)
|
||||
{
|
||||
auto toolbar = new QToolBar();
|
||||
toolbar->setIconSize({16, 16});
|
||||
|
||||
QAction *lastSeperator = nullptr;
|
||||
|
||||
for (const auto &widgetGroup : widgetGroups) {
|
||||
for (const auto &widget : widgetGroup) {
|
||||
toolbar->addWidget(widget);
|
||||
}
|
||||
lastSeperator = toolbar->addSeparator();
|
||||
}
|
||||
|
||||
if (lastSeperator) {
|
||||
toolbar->removeAction(lastSeperator);
|
||||
}
|
||||
|
||||
// Prevent "extension" button from showing up
|
||||
toolbar->setSizePolicy(QSizePolicy::MinimumExpanding,
|
||||
QSizePolicy::Preferred);
|
||||
return toolbar;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::SetupMacroTab()
|
||||
{
|
||||
ui->macroElseActions->installEventFilter(this);
|
||||
@@ -835,6 +916,11 @@ void AdvSceneSwitcher::SetupMacroTab()
|
||||
if (GetMacros().size() == 0 && !switcher->disableHints) {
|
||||
addPulse = HighlightWidget(ui->macroAdd, QColor(Qt::green));
|
||||
}
|
||||
|
||||
auto macroControls = setupToolBar({{ui->macroAdd, ui->macroRemove},
|
||||
{ui->macroUp, ui->macroDown}});
|
||||
ui->macroControlLayout->addWidget(macroControls);
|
||||
|
||||
ui->macros->Reset(GetMacros(),
|
||||
GetGlobalMacroSettings()._highlightExecuted);
|
||||
connect(ui->macros, SIGNAL(MacroSelectionAboutToChange()), this,
|
||||
@@ -886,13 +972,7 @@ void AdvSceneSwitcher::SetupMacroTab()
|
||||
SLOT(HighlightOnChange()));
|
||||
onChangeHighlightTimer.start();
|
||||
|
||||
// Move condition controls into splitter handle layout
|
||||
moveControlsToSplitter(ui->macroActionConditionSplitter, 1,
|
||||
ui->macroConditionsLayout->takeAt(1));
|
||||
moveControlsToSplitter(ui->macroElseActionSplitter, 1,
|
||||
ui->macroActionsLayout->takeAt(1));
|
||||
|
||||
// Set action and condition control icons
|
||||
// Set action and condition toolbars
|
||||
const std::string pathPrefix =
|
||||
GetDataFilePath("res/images/" + GetThemeTypeName());
|
||||
SetButtonIcon(ui->actionTop, (pathPrefix + "DoubleUp.svg").c_str());
|
||||
@@ -907,6 +987,44 @@ void AdvSceneSwitcher::SetupMacroTab()
|
||||
SetButtonIcon(ui->toggleElseActions,
|
||||
(pathPrefix + "NotEqual.svg").c_str());
|
||||
|
||||
auto conditionToolbar =
|
||||
setupToolBar({{ui->conditionAdd, ui->conditionRemove},
|
||||
{ui->conditionTop, ui->conditionUp,
|
||||
ui->conditionDown, ui->conditionBottom}});
|
||||
auto actionToolbar = setupToolBar({{ui->actionAdd, ui->actionRemove},
|
||||
{ui->actionTop, ui->actionUp,
|
||||
ui->actionDown, ui->actionBottom}});
|
||||
auto elseActionToolbar =
|
||||
setupToolBar({{ui->elseActionAdd, ui->elseActionRemove},
|
||||
{ui->elseActionTop, ui->elseActionUp,
|
||||
ui->elseActionDown, ui->elseActionBottom}});
|
||||
|
||||
ui->conditionControlsLayout->addWidget(conditionToolbar);
|
||||
ui->actionControlsLayout->insertWidget(0, actionToolbar);
|
||||
ui->elseActionControlsLayout->addWidget(elseActionToolbar);
|
||||
|
||||
// Move condition controls into splitter handle layout
|
||||
moveControlsToSplitter(ui->macroActionConditionSplitter, 1,
|
||||
ui->macroConditionsLayout->takeAt(1));
|
||||
moveControlsToSplitter(ui->macroElseActionSplitter, 1,
|
||||
ui->macroActionsLayout->takeAt(1));
|
||||
|
||||
// Override splitter cursor icon when hovering over controls in splitter
|
||||
SetCursorOnWidgetHover(ui->conditionAdd, Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->conditionRemove,
|
||||
Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->conditionTop, Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->conditionUp, Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->conditionDown, Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->conditionBottom,
|
||||
Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->actionAdd, Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->actionRemove, Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->actionTop, Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->actionUp, Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->actionDown, Qt::CursorShape::ArrowCursor);
|
||||
SetCursorOnWidgetHover(ui->actionBottom, Qt::CursorShape::ArrowCursor);
|
||||
|
||||
// Reserve more space for macro edit area than for the macro list
|
||||
ui->macroListMacroEditSplitter->setStretchFactor(0, 1);
|
||||
ui->macroListMacroEditSplitter->setStretchFactor(1, 4);
|
||||
@@ -981,8 +1099,30 @@ void AdvSceneSwitcher::ShowMacroContextMenu(const QPoint &pos)
|
||||
menu.exec(globalPos);
|
||||
}
|
||||
|
||||
static void handleCustomLabelChange(MacroSegmentEdit *segmentEdit,
|
||||
QAction *contextMenuOption)
|
||||
static bool handleCustomLabelRename(MacroSegmentEdit *segmentEdit)
|
||||
{
|
||||
std::string label;
|
||||
auto segment = segmentEdit->Data();
|
||||
if (!segment) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool accepted = NameDialog::AskForName(
|
||||
GetSettingsWindow(),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.segment.setCustomLabel"),
|
||||
"", label, QString::fromStdString(segment->GetCustomLabel()));
|
||||
if (!accepted) {
|
||||
return false;
|
||||
}
|
||||
|
||||
segment->SetCustomLabel(label);
|
||||
segmentEdit->HeaderInfoChanged("");
|
||||
return true;
|
||||
}
|
||||
|
||||
static void handleCustomLabelEnableChange(MacroSegmentEdit *segmentEdit,
|
||||
QAction *contextMenuOption)
|
||||
{
|
||||
bool enable = contextMenuOption->isChecked();
|
||||
auto segment = segmentEdit->Data();
|
||||
@@ -993,22 +1133,93 @@ static void handleCustomLabelChange(MacroSegmentEdit *segmentEdit,
|
||||
return;
|
||||
}
|
||||
|
||||
std::string label;
|
||||
bool accepted = NameDialog::AskForName(
|
||||
GetSettingsWindow(),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.segment.setCustomLabel"),
|
||||
"", label, QString::fromStdString(segment->GetCustomLabel()));
|
||||
if (!accepted) {
|
||||
if (!handleCustomLabelRename(segmentEdit)) {
|
||||
segment->SetUseCustomLabel(false);
|
||||
}
|
||||
}
|
||||
|
||||
static void setupSegmentLabelContextMenuEntries(MacroSegmentEdit *segmentEdit,
|
||||
QMenu &menu)
|
||||
{
|
||||
if (!segmentEdit) {
|
||||
return;
|
||||
}
|
||||
|
||||
segment->SetCustomLabel(label);
|
||||
segmentEdit->HeaderInfoChanged("");
|
||||
auto segment = segmentEdit ? segmentEdit->Data() : nullptr;
|
||||
const bool customLabelIsEnabled = segment &&
|
||||
segment->GetUseCustomLabel();
|
||||
|
||||
auto enableCustomLabel = menu.addAction(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.segment.useCustomLabel"));
|
||||
enableCustomLabel->setCheckable(true);
|
||||
enableCustomLabel->setChecked(customLabelIsEnabled);
|
||||
QWidget::connect(enableCustomLabel, &QAction::triggered,
|
||||
[segmentEdit, enableCustomLabel]() {
|
||||
handleCustomLabelEnableChange(
|
||||
segmentEdit, enableCustomLabel);
|
||||
});
|
||||
|
||||
if (!customLabelIsEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto customLabelRename = menu.addAction(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.segment.customLabelRename"));
|
||||
QWidget::connect(customLabelRename, &QAction::triggered,
|
||||
[segmentEdit]() {
|
||||
handleCustomLabelRename(segmentEdit);
|
||||
});
|
||||
}
|
||||
|
||||
static void setupCopyPasteContextMenuEnry(AdvSceneSwitcher *ss,
|
||||
MacroSegmentEdit *segmentEdit,
|
||||
QMenu &menu)
|
||||
{
|
||||
auto copy = menu.addAction(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.segment.copy"), ss,
|
||||
[ss]() { ss->CopyMacroSegment(); });
|
||||
copy->setEnabled(!!segmentEdit);
|
||||
|
||||
bool pasteAsElseAction = true;
|
||||
const char *pasteText = "AdvSceneSwitcher.macroTab.segment.paste";
|
||||
if (MacroActionIsInClipboard()) {
|
||||
if (IsCursorInWidgetArea(ss->ui->macroActions)) {
|
||||
pasteAsElseAction = false;
|
||||
pasteText =
|
||||
"AdvSceneSwitcher.macroTab.segment.pasteAction";
|
||||
} else if (IsCursorInWidgetArea(ss->ui->macroElseActions)) {
|
||||
pasteAsElseAction = true;
|
||||
pasteText =
|
||||
"AdvSceneSwitcher.macroTab.segment.pasteElseAction";
|
||||
}
|
||||
}
|
||||
auto paste = menu.addAction(
|
||||
obs_module_text(pasteText), ss, [ss, pasteAsElseAction]() {
|
||||
SetCopySegmentTargetActionType(pasteAsElseAction);
|
||||
ss->PasteMacroSegment();
|
||||
});
|
||||
paste->setEnabled(MacroSegmentIsInClipboard());
|
||||
}
|
||||
|
||||
static void setupRemoveContextMenuEnry(
|
||||
AdvSceneSwitcher *ss,
|
||||
const std::function<void(AdvSceneSwitcher *, int)> &remove,
|
||||
const QPoint &pos, MacroSegmentList *list, QMenu &menu)
|
||||
{
|
||||
const auto segmentEditIndex = list->IndexAt(pos);
|
||||
if (segmentEditIndex == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
menu.addAction(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.segment.remove"), ss,
|
||||
[ss, remove, segmentEditIndex]() {
|
||||
remove(ss, segmentEditIndex);
|
||||
});
|
||||
}
|
||||
|
||||
static void setupConextMenu(AdvSceneSwitcher *ss, const QPoint &pos,
|
||||
std::function<void(AdvSceneSwitcher *, int)> remove,
|
||||
std::function<void(AdvSceneSwitcher *)> expand,
|
||||
std::function<void(AdvSceneSwitcher *)> collapse,
|
||||
std::function<void(AdvSceneSwitcher *)> maximize,
|
||||
@@ -1018,49 +1229,28 @@ static void setupConextMenu(AdvSceneSwitcher *ss, const QPoint &pos,
|
||||
QMenu menu;
|
||||
auto segmentEdit = list->WidgetAt(pos);
|
||||
|
||||
auto copy = menu.addAction(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.segment.copy"), ss,
|
||||
[ss]() { ss->CopyMacroSegment(); });
|
||||
copy->setEnabled(!!segmentEdit);
|
||||
auto paste = menu.addAction(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.segment.paste"), ss,
|
||||
[ss]() { ss->PasteMacroSegment(); });
|
||||
paste->setEnabled(MacroSegmentIsInClipboard());
|
||||
|
||||
setupCopyPasteContextMenuEnry(ss, segmentEdit, menu);
|
||||
menu.addSeparator();
|
||||
|
||||
if (segmentEdit) {
|
||||
auto customLabel = menu.addAction(obs_module_text(
|
||||
"AdvSceneSwitcher.macroTab.segment.useCustomLabel"));
|
||||
customLabel->setCheckable(true);
|
||||
auto segment = segmentEdit ? segmentEdit->Data() : nullptr;
|
||||
customLabel->setChecked(segment &&
|
||||
segment->GetUseCustomLabel());
|
||||
QWidget::connect(customLabel, &QAction::triggered,
|
||||
std::bind(handleCustomLabelChange, segmentEdit,
|
||||
customLabel));
|
||||
}
|
||||
|
||||
setupRemoveContextMenuEnry(ss, remove, pos, list, menu);
|
||||
menu.addSeparator();
|
||||
setupSegmentLabelContextMenuEntries(segmentEdit, menu);
|
||||
menu.addSeparator();
|
||||
|
||||
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.expandAll"),
|
||||
ss, [ss, expand]() { expand(ss); });
|
||||
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.collapseAll"),
|
||||
ss, [ss, collapse]() { collapse(ss); });
|
||||
|
||||
menu.addSeparator();
|
||||
|
||||
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.maximize"),
|
||||
ss, [ss, maximize]() { maximize(ss); });
|
||||
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.minimize"),
|
||||
ss, [ss, minimize]() { minimize(ss); });
|
||||
|
||||
menu.exec(list->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::ShowMacroActionsContextMenu(const QPoint &pos)
|
||||
{
|
||||
setupConextMenu(this, pos, &AdvSceneSwitcher::ExpandAllActions,
|
||||
setupConextMenu(this, pos, &AdvSceneSwitcher::RemoveMacroAction,
|
||||
&AdvSceneSwitcher::ExpandAllActions,
|
||||
&AdvSceneSwitcher::CollapseAllActions,
|
||||
&AdvSceneSwitcher::MaximizeActions,
|
||||
&AdvSceneSwitcher::MinimizeActions, ui->actionsList);
|
||||
@@ -1068,7 +1258,8 @@ void AdvSceneSwitcher::ShowMacroActionsContextMenu(const QPoint &pos)
|
||||
|
||||
void AdvSceneSwitcher::ShowMacroElseActionsContextMenu(const QPoint &pos)
|
||||
{
|
||||
setupConextMenu(this, pos, &AdvSceneSwitcher::ExpandAllElseActions,
|
||||
setupConextMenu(this, pos, &AdvSceneSwitcher::RemoveMacroElseAction,
|
||||
&AdvSceneSwitcher::ExpandAllElseActions,
|
||||
&AdvSceneSwitcher::CollapseAllElseActions,
|
||||
&AdvSceneSwitcher::MaximizeElseActions,
|
||||
&AdvSceneSwitcher::MinimizeElseActions,
|
||||
@@ -1077,7 +1268,8 @@ void AdvSceneSwitcher::ShowMacroElseActionsContextMenu(const QPoint &pos)
|
||||
|
||||
void AdvSceneSwitcher::ShowMacroConditionsContextMenu(const QPoint &pos)
|
||||
{
|
||||
setupConextMenu(this, pos, &AdvSceneSwitcher::ExpandAllConditions,
|
||||
setupConextMenu(this, pos, &AdvSceneSwitcher::RemoveMacroCondition,
|
||||
&AdvSceneSwitcher::ExpandAllConditions,
|
||||
&AdvSceneSwitcher::CollapseAllConditions,
|
||||
&AdvSceneSwitcher::MaximizeConditions,
|
||||
&AdvSceneSwitcher::MinimizeConditions,
|
||||
@@ -1099,7 +1291,7 @@ void AdvSceneSwitcher::CopyMacro()
|
||||
}
|
||||
|
||||
OBSDataAutoRelease data = obs_data_create();
|
||||
macro->Save(data);
|
||||
macro->Save(data, true);
|
||||
newMacro->Load(data);
|
||||
newMacro->PostLoad();
|
||||
newMacro->SetName(name);
|
||||
@@ -1107,8 +1299,10 @@ void AdvSceneSwitcher::CopyMacro()
|
||||
Macro::PrepareMoveToGroup(macro->Parent(), newMacro);
|
||||
|
||||
ui->macros->Add(newMacro, macro);
|
||||
addPulse->deleteLater();
|
||||
addPulse = nullptr;
|
||||
if (addPulse) {
|
||||
addPulse->deleteLater();
|
||||
addPulse = nullptr;
|
||||
}
|
||||
emit MacroAdded(QString::fromStdString(name));
|
||||
}
|
||||
|
||||
@@ -1400,7 +1594,7 @@ static void fade(QWidget *widget, bool fadeOut)
|
||||
animation->start(QPropertyAnimation::DeleteWhenStopped);
|
||||
}
|
||||
|
||||
void fadeWidgets(const std::vector<QWidget *> &widgets, bool fadeOut)
|
||||
static void fadeWidgets(const std::vector<QWidget *> &widgets, bool fadeOut)
|
||||
{
|
||||
for (const auto &widget : widgets) {
|
||||
fade(widget, fadeOut);
|
||||
|
||||
@@ -160,7 +160,7 @@ void MacroTreeItem::Update(bool force)
|
||||
_spacer = nullptr;
|
||||
}
|
||||
|
||||
if (_type == Type::Group) {
|
||||
if (_type == Type::Group && _expand) {
|
||||
_boxLayout->removeWidget(_expand);
|
||||
_expand->deleteLater();
|
||||
_expand = nullptr;
|
||||
|
||||
@@ -14,19 +14,77 @@
|
||||
#include <QAction>
|
||||
#include <QMainWindow>
|
||||
#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 {
|
||||
|
||||
static constexpr int perfLogThreshold = 300;
|
||||
static std::deque<std::shared_ptr<Macro>> macros;
|
||||
|
||||
Macro::Macro(const std::string &name, const bool addHotkey)
|
||||
Macro::Macro(const std::string &name, const bool addHotkey,
|
||||
const bool shortCircuitEvaluation)
|
||||
{
|
||||
SetName(name);
|
||||
if (addHotkey) {
|
||||
SetupHotkeys();
|
||||
}
|
||||
_registerHotkeys = addHotkey;
|
||||
_useShortCircuitEvaluation = shortCircuitEvaluation;
|
||||
}
|
||||
|
||||
Macro::~Macro()
|
||||
@@ -101,84 +159,101 @@ void Macro::PrepareMoveToGroup(std::shared_ptr<Macro> group,
|
||||
}
|
||||
}
|
||||
|
||||
bool Macro::CeckMatch(bool ignorePause)
|
||||
static bool checkCondition(const std::shared_ptr<MacroCondition> &condition)
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
static constexpr auto perfLogThreshold = 300ms;
|
||||
|
||||
const auto startTime = std::chrono::high_resolution_clock::now();
|
||||
const bool conditionMatched = condition->CheckCondition();
|
||||
const auto endTime = std::chrono::high_resolution_clock::now();
|
||||
const auto timeSpent = endTime - startTime;
|
||||
|
||||
if (timeSpent >= perfLogThreshold) {
|
||||
const long int ms =
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
timeSpent)
|
||||
.count();
|
||||
blog(LOG_WARNING,
|
||||
"spent %ld ms in %s condition check of macro '%s'!", ms,
|
||||
condition->GetId().c_str(),
|
||||
condition->GetMacro()->Name().c_str());
|
||||
}
|
||||
|
||||
return conditionMatched;
|
||||
}
|
||||
|
||||
bool Macro::CheckConditionHelper(
|
||||
const std::shared_ptr<MacroCondition> &condition) const
|
||||
{
|
||||
bool conditionMatched = false;
|
||||
bool wasEvaluated = false;
|
||||
|
||||
const auto evaluateCondition = [&condition, &conditionMatched,
|
||||
&wasEvaluated]() -> bool {
|
||||
conditionMatched = checkCondition(condition);
|
||||
conditionMatched =
|
||||
condition->CheckDurationModifier(conditionMatched);
|
||||
wasEvaluated = true;
|
||||
return conditionMatched;
|
||||
};
|
||||
|
||||
const auto logicType = condition->GetLogicType();
|
||||
if (logicType == Logic::Type::NONE) {
|
||||
vblog(LOG_INFO, "ignoring condition '%s' for '%s'",
|
||||
condition->GetId().c_str(), _name.c_str());
|
||||
if (!_useShortCircuitEvaluation) {
|
||||
(void)evaluateCondition();
|
||||
}
|
||||
return _matched;
|
||||
}
|
||||
|
||||
bool result = _useShortCircuitEvaluation
|
||||
// Evaluate the condition result if needed
|
||||
? Logic::ApplyConditionLogic(logicType, _matched,
|
||||
evaluateCondition,
|
||||
_name.c_str())
|
||||
// Evaluate the condition result right away
|
||||
: Logic::ApplyConditionLogic(logicType, _matched,
|
||||
evaluateCondition(),
|
||||
_name.c_str());
|
||||
|
||||
const bool isNegativeLogicType = Logic::IsNegationType(logicType);
|
||||
if (wasEvaluated && ((conditionMatched && !isNegativeLogicType) ||
|
||||
(!conditionMatched && isNegativeLogicType))) {
|
||||
condition->EnableHighlight();
|
||||
}
|
||||
|
||||
if (VerboseLoggingEnabled()) {
|
||||
if (wasEvaluated) {
|
||||
blog(LOG_INFO, "condition %s returned %d",
|
||||
condition->GetId().c_str(), conditionMatched);
|
||||
} else {
|
||||
blog(LOG_INFO,
|
||||
"condition %s evaluation skipped (short circuit)",
|
||||
condition->GetId().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Macro::CheckConditions(bool ignorePause)
|
||||
{
|
||||
if (_isGroup) {
|
||||
return false;
|
||||
}
|
||||
|
||||
_matched = false;
|
||||
for (auto &c : _conditions) {
|
||||
for (auto &condition : _conditions) {
|
||||
if (_paused && !ignorePause) {
|
||||
vblog(LOG_INFO, "Macro %s is paused", _name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
auto startTime = std::chrono::high_resolution_clock::now();
|
||||
bool cond = c->CheckCondition();
|
||||
auto endTime = std::chrono::high_resolution_clock::now();
|
||||
auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
endTime - startTime);
|
||||
if (ms.count() >= perfLogThreshold) {
|
||||
blog(LOG_WARNING,
|
||||
"spent %ld ms in %s condition check of macro '%s'!",
|
||||
(long int)ms.count(), c->GetId().c_str(),
|
||||
Name().c_str());
|
||||
}
|
||||
|
||||
c->CheckDurationModifier(cond);
|
||||
|
||||
switch (c->GetLogicType()) {
|
||||
case LogicType::NONE:
|
||||
vblog(LOG_INFO,
|
||||
"ignoring condition check 'none' for '%s'",
|
||||
_name.c_str());
|
||||
continue;
|
||||
case LogicType::AND:
|
||||
_matched = _matched && cond;
|
||||
if (cond) {
|
||||
c->EnableHighlight();
|
||||
}
|
||||
break;
|
||||
case LogicType::OR:
|
||||
_matched = _matched || cond;
|
||||
if (cond) {
|
||||
c->EnableHighlight();
|
||||
}
|
||||
break;
|
||||
case LogicType::AND_NOT:
|
||||
_matched = _matched && !cond;
|
||||
if (!cond) {
|
||||
c->EnableHighlight();
|
||||
}
|
||||
break;
|
||||
case LogicType::OR_NOT:
|
||||
_matched = _matched || !cond;
|
||||
if (!cond) {
|
||||
c->EnableHighlight();
|
||||
}
|
||||
break;
|
||||
case LogicType::ROOT_NONE:
|
||||
_matched = cond;
|
||||
if (cond) {
|
||||
c->EnableHighlight();
|
||||
}
|
||||
break;
|
||||
case LogicType::ROOT_NOT:
|
||||
_matched = !cond;
|
||||
if (!cond) {
|
||||
c->EnableHighlight();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
blog(LOG_WARNING,
|
||||
"ignoring unknown condition check for '%s'",
|
||||
_name.c_str());
|
||||
break;
|
||||
}
|
||||
vblog(LOG_INFO, "condition %s returned %d", c->GetId().c_str(),
|
||||
cond);
|
||||
_matched = CheckConditionHelper(condition);
|
||||
}
|
||||
|
||||
vblog(LOG_INFO, "Macro %s returned %d", _name.c_str(), _matched);
|
||||
|
||||
_conditionSateChanged = _lastMatched != _matched;
|
||||
@@ -234,12 +309,26 @@ bool Macro::PerformActions(bool match, bool forceParallel, bool ignorePause)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool Macro::WasExecutedSince(
|
||||
const std::chrono::high_resolution_clock::time_point &time) const
|
||||
bool Macro::WasExecutedSince(const TimePoint &time) const
|
||||
{
|
||||
return _lastExecutionTime > time;
|
||||
}
|
||||
|
||||
bool Macro::ConditionsShouldBeChecked() const
|
||||
{
|
||||
if (!_useCustomConditionCheckInterval) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const auto timePassed = std::chrono::high_resolution_clock::now() -
|
||||
LastConditionCheckTime();
|
||||
const auto timePassedMs =
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
timePassed);
|
||||
return timePassedMs.count() >=
|
||||
_customConditionCheckInterval.Milliseconds();
|
||||
}
|
||||
|
||||
bool Macro::ShouldRunActions() const
|
||||
{
|
||||
const bool hasActionsToExecute =
|
||||
@@ -262,23 +351,17 @@ bool Macro::ShouldRunActions() const
|
||||
return hasActionsToExecute;
|
||||
}
|
||||
|
||||
int64_t Macro::MsSinceLastCheck() const
|
||||
{
|
||||
if (_lastCheckTime.time_since_epoch().count() == 0) {
|
||||
return 0;
|
||||
}
|
||||
const auto timePassed =
|
||||
std::chrono::high_resolution_clock::now() - _lastCheckTime;
|
||||
return std::chrono::duration_cast<std::chrono::milliseconds>(timePassed)
|
||||
.count() +
|
||||
1;
|
||||
}
|
||||
|
||||
void Macro::SetName(const std::string &name)
|
||||
{
|
||||
const bool nameChanged = _name == name;
|
||||
_name = name;
|
||||
|
||||
SetHotkeysDesc();
|
||||
SetDockWidgetName();
|
||||
|
||||
if (nameChanged) {
|
||||
_dockId = GenerateDockId();
|
||||
}
|
||||
EnableDock(_registerDock);
|
||||
}
|
||||
|
||||
void Macro::ResetTimers()
|
||||
@@ -323,23 +406,17 @@ bool Macro::RunActionsHelper(
|
||||
|
||||
bool Macro::RunActions(bool ignorePause)
|
||||
{
|
||||
vblog(LOG_INFO, "running actions of %s", _name.c_str());
|
||||
mblog(LOG_INFO, "running actions of %s", _name.c_str());
|
||||
return RunActionsHelper(_actions, ignorePause);
|
||||
}
|
||||
|
||||
bool Macro::RunElseActions(bool ignorePause)
|
||||
{
|
||||
vblog(LOG_INFO, "running else actions of %s", _name.c_str());
|
||||
mblog(LOG_INFO, "running else actions of %s", _name.c_str());
|
||||
return RunActionsHelper(_elseActions, ignorePause);
|
||||
}
|
||||
|
||||
bool Macro::DockIsVisible() const
|
||||
{
|
||||
return _dock && _dockAction && _dock->isVisible();
|
||||
}
|
||||
|
||||
bool Macro::WasPausedSince(
|
||||
const std::chrono::high_resolution_clock::time_point &time) const
|
||||
bool Macro::WasPausedSince(const TimePoint &time) const
|
||||
{
|
||||
return _lastUnpauseTime > time;
|
||||
}
|
||||
@@ -354,6 +431,36 @@ void Macro::SetStopActionsIfNotDone(bool stopActionsIfNotDone)
|
||||
_stopActionsIfNotDone = stopActionsIfNotDone;
|
||||
}
|
||||
|
||||
void Macro::SetShortCircuitEvaluation(bool useShortCircuitEvaluation)
|
||||
{
|
||||
_useShortCircuitEvaluation = useShortCircuitEvaluation;
|
||||
}
|
||||
|
||||
bool Macro::ShortCircuitEvaluationEnabled() const
|
||||
{
|
||||
return _useShortCircuitEvaluation;
|
||||
}
|
||||
|
||||
void Macro::SetCustomConditionCheckIntervalEnabled(bool enable)
|
||||
{
|
||||
_useCustomConditionCheckInterval = enable;
|
||||
}
|
||||
|
||||
bool Macro::CustomConditionCheckIntervalEnabled() const
|
||||
{
|
||||
return _useCustomConditionCheckInterval;
|
||||
}
|
||||
|
||||
void Macro::SetCustomConditionCheckInterval(const Duration &duration)
|
||||
{
|
||||
_customConditionCheckInterval = duration;
|
||||
}
|
||||
|
||||
Duration Macro::GetCustomConditionCheckInterval() const
|
||||
{
|
||||
return _customConditionCheckInterval;
|
||||
}
|
||||
|
||||
void Macro::SetPaused(bool pause)
|
||||
{
|
||||
if (_paused && !pause) {
|
||||
@@ -374,6 +481,16 @@ void Macro::AddHelperThread(std::thread &&newThread)
|
||||
_helperThreads.push_back(std::move(newThread));
|
||||
}
|
||||
|
||||
void Macro::SetPauseStateSaveBehavior(PauseStateSaveBehavior behavior)
|
||||
{
|
||||
_pauseSaveBehavior = behavior;
|
||||
}
|
||||
|
||||
Macro::PauseStateSaveBehavior Macro::GetPauseStateSaveBehavior() const
|
||||
{
|
||||
return _pauseSaveBehavior;
|
||||
}
|
||||
|
||||
void Macro::Stop()
|
||||
{
|
||||
_stop = true;
|
||||
@@ -568,14 +685,11 @@ std::shared_ptr<Macro> Macro::Parent() const
|
||||
return _parent.lock();
|
||||
}
|
||||
|
||||
bool Macro::Save(obs_data_t *obj) const
|
||||
bool Macro::Save(obs_data_t *obj, bool saveForCopy) const
|
||||
{
|
||||
obs_data_set_string(obj, "name", _name.c_str());
|
||||
obs_data_set_bool(obj, "pause", _paused);
|
||||
obs_data_set_bool(obj, "parallel", _runInParallel);
|
||||
obs_data_set_bool(obj, "onChange", _performActionsOnChange);
|
||||
obs_data_set_bool(obj, "skipExecOnStart", _skipExecOnStart);
|
||||
obs_data_set_bool(obj, "stopActionsIfNotDone", _stopActionsIfNotDone);
|
||||
if (!saveForCopy) {
|
||||
obs_data_set_string(obj, "name", _name.c_str());
|
||||
}
|
||||
|
||||
obs_data_set_bool(obj, "group", _isGroup);
|
||||
if (_isGroup) {
|
||||
@@ -586,7 +700,20 @@ bool Macro::Save(obs_data_t *obj) const
|
||||
return true;
|
||||
}
|
||||
|
||||
SaveDockSettings(obj);
|
||||
obs_data_set_int(obj, "pauseSaveBehavior",
|
||||
static_cast<int>(_pauseSaveBehavior));
|
||||
obs_data_set_bool(obj, "pause", _paused);
|
||||
obs_data_set_bool(obj, "parallel", _runInParallel);
|
||||
obs_data_set_bool(obj, "onChange", _performActionsOnChange);
|
||||
obs_data_set_bool(obj, "skipExecOnStart", _skipExecOnStart);
|
||||
obs_data_set_bool(obj, "stopActionsIfNotDone", _stopActionsIfNotDone);
|
||||
obs_data_set_bool(obj, "useShortCircuitEvaluation",
|
||||
_useShortCircuitEvaluation);
|
||||
obs_data_set_bool(obj, "useCustomConditionCheckInterval",
|
||||
_useCustomConditionCheckInterval);
|
||||
_customConditionCheckInterval.Save(obj, "customConditionCheckInterval");
|
||||
|
||||
SaveDockSettings(obj, saveForCopy);
|
||||
|
||||
SaveSplitterPos(_actionConditionSplitterPosition, obj,
|
||||
"macroActionConditionSplitterPosition");
|
||||
@@ -631,48 +758,9 @@ bool Macro::Save(obs_data_t *obj) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isValidLogic(LogicType t, bool root)
|
||||
{
|
||||
bool isRoot = isRootLogicType(t);
|
||||
if (!isRoot == root) {
|
||||
return false;
|
||||
}
|
||||
if (isRoot) {
|
||||
if (t >= LogicType::ROOT_LAST) {
|
||||
return false;
|
||||
}
|
||||
} else if (t >= LogicType::LAST) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void setValidLogic(MacroCondition *c, bool root, std::string name)
|
||||
{
|
||||
if (isValidLogic(c->GetLogicType(), root)) {
|
||||
return;
|
||||
}
|
||||
if (root) {
|
||||
c->SetLogicType(LogicType::ROOT_NONE);
|
||||
blog(LOG_WARNING,
|
||||
"setting invalid logic selection to 'if' for macro %s",
|
||||
name.c_str());
|
||||
} else {
|
||||
c->SetLogicType(LogicType::NONE);
|
||||
blog(LOG_WARNING,
|
||||
"setting invalid logic selection to 'ignore' for macro %s",
|
||||
name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Macro::Load(obs_data_t *obj)
|
||||
{
|
||||
_name = obs_data_get_string(obj, "name");
|
||||
_paused = obs_data_get_bool(obj, "pause");
|
||||
_runInParallel = obs_data_get_bool(obj, "parallel");
|
||||
_performActionsOnChange = obs_data_get_bool(obj, "onChange");
|
||||
_skipExecOnStart = obs_data_get_bool(obj, "skipExecOnStart");
|
||||
_stopActionsIfNotDone = obs_data_get_bool(obj, "stopActionsIfNotDone");
|
||||
|
||||
_isGroup = obs_data_get_bool(obj, "group");
|
||||
if (_isGroup) {
|
||||
@@ -684,6 +772,32 @@ bool Macro::Load(obs_data_t *obj)
|
||||
return true;
|
||||
}
|
||||
|
||||
_pauseSaveBehavior = static_cast<PauseStateSaveBehavior>(
|
||||
obs_data_get_int(obj, "pauseSaveBehavior"));
|
||||
switch (_pauseSaveBehavior) {
|
||||
case PauseStateSaveBehavior::PERSIST:
|
||||
_paused = obs_data_get_bool(obj, "pause");
|
||||
break;
|
||||
case PauseStateSaveBehavior::PAUSE:
|
||||
_paused = true;
|
||||
break;
|
||||
case PauseStateSaveBehavior::UNPAUSE:
|
||||
_paused = false;
|
||||
break;
|
||||
default:
|
||||
_paused = obs_data_get_bool(obj, "pause");
|
||||
break;
|
||||
}
|
||||
_runInParallel = obs_data_get_bool(obj, "parallel");
|
||||
_performActionsOnChange = obs_data_get_bool(obj, "onChange");
|
||||
_skipExecOnStart = obs_data_get_bool(obj, "skipExecOnStart");
|
||||
_stopActionsIfNotDone = obs_data_get_bool(obj, "stopActionsIfNotDone");
|
||||
_useShortCircuitEvaluation =
|
||||
obs_data_get_bool(obj, "useShortCircuitEvaluation");
|
||||
_useCustomConditionCheckInterval =
|
||||
obs_data_get_bool(obj, "useCustomConditionCheckInterval");
|
||||
_customConditionCheckInterval.Load(obj, "customConditionCheckInterval");
|
||||
|
||||
LoadDockSettings(obj);
|
||||
|
||||
LoadSplitterPos(_actionConditionSplitterPosition, obj,
|
||||
@@ -720,7 +834,7 @@ bool Macro::Load(obs_data_t *obj)
|
||||
_conditions.emplace_back(newEntry);
|
||||
auto c = _conditions.back().get();
|
||||
c->Load(arrayObj);
|
||||
setValidLogic(c, root, _name);
|
||||
c->ValidateLogicSelection(root, Name().c_str());
|
||||
} else {
|
||||
blog(LOG_WARNING,
|
||||
"discarding condition entry with unknown id (%s) for macro %s",
|
||||
@@ -865,14 +979,10 @@ bool Macro::PauseHotkeysEnabled() const
|
||||
return _registerHotkeys;
|
||||
}
|
||||
|
||||
void Macro::SaveDockSettings(obs_data_t *obj) const
|
||||
void Macro::SaveDockSettings(obs_data_t *obj, bool saveForCopy) const
|
||||
{
|
||||
auto dockSettings = obs_data_create();
|
||||
obs_data_set_bool(dockSettings, "register", _registerDock);
|
||||
// The object name is used to restore the position of the dock
|
||||
if (_registerDock) {
|
||||
SetDockWidgetName();
|
||||
}
|
||||
obs_data_set_bool(dockSettings, "hasRunButton", _dockHasRunButton);
|
||||
obs_data_set_bool(dockSettings, "hasPauseButton", _dockHasPauseButton);
|
||||
obs_data_set_bool(dockSettings, "hasStatusLabel", _dockHasStatusLabel);
|
||||
@@ -885,18 +995,14 @@ void Macro::SaveDockSettings(obs_data_t *obj) const
|
||||
"conditionsTrueStatusText");
|
||||
_conditionsFalseStatusText.Save(dockSettings,
|
||||
"conditionsFalseStatusText");
|
||||
if (_dock) {
|
||||
auto window = static_cast<QMainWindow *>(
|
||||
obs_frontend_get_main_window());
|
||||
obs_data_set_bool(dockSettings, "isFloating",
|
||||
_dock->isFloating());
|
||||
obs_data_set_bool(dockSettings, "isVisible", DockIsVisible());
|
||||
obs_data_set_int(dockSettings, "area",
|
||||
window->dockWidgetArea(_dock));
|
||||
obs_data_set_string(
|
||||
dockSettings, "geometry",
|
||||
_dock->saveGeometry().toBase64().constData());
|
||||
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);
|
||||
}
|
||||
@@ -913,8 +1019,13 @@ void Macro::LoadDockSettings(obs_data_t *obj)
|
||||
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");
|
||||
_dockIsVisible = obs_data_get_bool(dockSettings, "isVisible");
|
||||
|
||||
// TODO: remove these default settings in a future version
|
||||
obs_data_set_default_string(
|
||||
@@ -942,15 +1053,6 @@ void Macro::LoadDockSettings(obs_data_t *obj)
|
||||
obs_data_get_bool(dockSettings, "hasStatusLabel");
|
||||
_dockHighlight = obs_data_get_bool(dockSettings,
|
||||
"highlightIfConditionsTrue");
|
||||
_dockIsFloating = obs_data_get_bool(dockSettings, "isFloating");
|
||||
_dockArea = static_cast<Qt::DockWidgetArea>(
|
||||
obs_data_get_int(dockSettings, "area"));
|
||||
auto geometryStr =
|
||||
obs_data_get_string(dockSettings, "geometry");
|
||||
if (geometryStr && strlen(geometryStr)) {
|
||||
_dockGeo =
|
||||
QByteArray::fromBase64(QByteArray(geometryStr));
|
||||
}
|
||||
}
|
||||
EnableDock(dockEnabled);
|
||||
obs_data_release(dockSettings);
|
||||
@@ -958,47 +1060,29 @@ void Macro::LoadDockSettings(obs_data_t *obj)
|
||||
|
||||
void Macro::EnableDock(bool value)
|
||||
{
|
||||
if (_registerDock == value) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset dock regardless
|
||||
RemoveDock();
|
||||
|
||||
// Unregister dock
|
||||
if (_registerDock) {
|
||||
_dockIsFloating = true;
|
||||
_dockGeo = QByteArray();
|
||||
if (!value) {
|
||||
_registerDock = value;
|
||||
return;
|
||||
}
|
||||
|
||||
// Create new dock widget
|
||||
auto window =
|
||||
static_cast<QMainWindow *>(obs_frontend_get_main_window());
|
||||
_dock = new MacroDock(GetWeakMacroByName(_name.c_str()), window,
|
||||
_runButtonText, _pauseButtonText,
|
||||
_unpauseButtonText, _conditionsTrueStatusText,
|
||||
_dock = new MacroDock(GetWeakMacroByName(_name.c_str()), _runButtonText,
|
||||
_pauseButtonText, _unpauseButtonText,
|
||||
_conditionsTrueStatusText,
|
||||
_conditionsFalseStatusText, _dockHighlight);
|
||||
SetDockWidgetName(); // Used by OBS to restore position
|
||||
|
||||
// Register new dock
|
||||
_dockAction = static_cast<QAction *>(obs_frontend_add_dock(_dock));
|
||||
|
||||
// Note that OBSBasic::OBSInit() has precedence over the visibility and
|
||||
// geometry set here.
|
||||
// The function calls here are only intended to attempt to restore the
|
||||
// dock status when switching scene collections.
|
||||
if (InitialLoadIsComplete()) {
|
||||
_dock->setVisible(_dockIsVisible);
|
||||
if (window->dockWidgetArea(_dock) != _dockArea) {
|
||||
window->addDockWidget(_dockArea, _dock);
|
||||
}
|
||||
if (_dock->isFloating() != _dockIsFloating) {
|
||||
_dock->setFloating(_dockIsFloating);
|
||||
}
|
||||
_dock->restoreGeometry(_dockGeo);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1095,28 +1179,22 @@ StringVariable Macro::ConditionsFalseStatusText() const
|
||||
|
||||
void Macro::RemoveDock()
|
||||
{
|
||||
if (_dock) {
|
||||
_dock->close();
|
||||
_dock->deleteLater();
|
||||
_dockAction->deleteLater();
|
||||
_dock = nullptr;
|
||||
_dockAction = nullptr;
|
||||
}
|
||||
obs_frontend_remove_dock(_dockId.c_str());
|
||||
_dock = nullptr;
|
||||
}
|
||||
|
||||
void Macro::SetDockWidgetName() const
|
||||
std::string Macro::GenerateDockId()
|
||||
{
|
||||
if (!_dock) {
|
||||
return;
|
||||
}
|
||||
// Set prefix to avoid dock name conflict
|
||||
_dock->setObjectName("ADVSS-" + QString::fromStdString(_name));
|
||||
_dock->SetName(QString::fromStdString(_name));
|
||||
#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;
|
||||
|
||||
if (!_dockAction) {
|
||||
return;
|
||||
}
|
||||
_dockAction->setText(QString::fromStdString(_name));
|
||||
#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)
|
||||
@@ -1281,7 +1359,15 @@ bool CheckMacros()
|
||||
{
|
||||
bool matchFound = false;
|
||||
for (const auto &m : macros) {
|
||||
if (m->CeckMatch() || m->ElseActions().size() > 0) {
|
||||
if (!m->ConditionsShouldBeChecked()) {
|
||||
vblog(LOG_INFO,
|
||||
"skipping condition check for macro \"%s\" "
|
||||
"(custom check interval)",
|
||||
m->Name().c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m->CheckConditions() || m->ElseActions().size() > 0) {
|
||||
matchFound = true;
|
||||
// This has to be performed here for now as actions are
|
||||
// not performed immediately after checking conditions.
|
||||
@@ -1327,7 +1413,7 @@ bool RunMacros()
|
||||
continue;
|
||||
}
|
||||
vblog(LOG_INFO, "running macro: %s", m->Name().c_str());
|
||||
if (!m->PerformActions(m->Matched())) {
|
||||
if (!m->PerformActions(m->ConditionsMatched())) {
|
||||
blog(LOG_WARNING, "abort macro: %s", m->Name().c_str());
|
||||
}
|
||||
}
|
||||
@@ -1378,4 +1464,27 @@ void InvalidateMacroTempVarValues()
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<Macro> GetMacroWithInvalidConditionInterval()
|
||||
{
|
||||
if (macros.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
for (const auto ¯o : macros) {
|
||||
if (!macro) {
|
||||
continue;
|
||||
}
|
||||
if (!macro->CustomConditionCheckIntervalEnabled()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (macro->GetCustomConditionCheckInterval().Milliseconds() <
|
||||
GetIntervalValue()) {
|
||||
return macro;
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -22,24 +22,33 @@ namespace advss {
|
||||
class MacroDock;
|
||||
|
||||
class Macro {
|
||||
using TimePoint = std::chrono::high_resolution_clock::time_point;
|
||||
|
||||
public:
|
||||
Macro(const std::string &name = "", const bool addHotkey = false);
|
||||
virtual ~Macro();
|
||||
enum class PauseStateSaveBehavior { PERSIST, PAUSE, UNPAUSE };
|
||||
|
||||
Macro(const std::string &name = "", const bool addHotkey = false,
|
||||
const bool shortCircuitEvaluation = false);
|
||||
~Macro();
|
||||
|
||||
std::string Name() const { return _name; }
|
||||
void SetName(const std::string &name);
|
||||
|
||||
bool CeckMatch(bool ignorePause = false);
|
||||
bool Matched() const { return _matched; }
|
||||
int64_t MsSinceLastCheck() const;
|
||||
bool CheckConditions(bool ignorePause = false);
|
||||
bool ConditionsMatched() const { return _matched; }
|
||||
TimePoint LastConditionCheckTime() const { return _lastCheckTime; }
|
||||
bool ConditionsShouldBeChecked() const;
|
||||
|
||||
bool ShouldRunActions() const;
|
||||
bool PerformActions(bool match, bool forceParallel = false,
|
||||
bool ignorePause = false);
|
||||
|
||||
void SetPaused(bool pause = true);
|
||||
bool Paused() const { return _paused; }
|
||||
bool WasPausedSince(
|
||||
const std::chrono::high_resolution_clock::time_point &) const;
|
||||
bool WasPausedSince(const TimePoint &) const;
|
||||
|
||||
void SetPauseStateSaveBehavior(PauseStateSaveBehavior);
|
||||
PauseStateSaveBehavior GetPauseStateSaveBehavior() const;
|
||||
|
||||
void Stop();
|
||||
bool GetStop() const { return _stop; }
|
||||
@@ -54,6 +63,14 @@ public:
|
||||
void SetStopActionsIfNotDone(bool stopActionsIfNotDone);
|
||||
bool StopActionsIfNotDone() const { return _stopActionsIfNotDone; }
|
||||
|
||||
void SetShortCircuitEvaluation(bool useShortCircuitEvaluation);
|
||||
bool ShortCircuitEvaluationEnabled() const;
|
||||
|
||||
void SetCustomConditionCheckIntervalEnabled(bool enable);
|
||||
bool CustomConditionCheckIntervalEnabled() const;
|
||||
void SetCustomConditionCheckInterval(const Duration &);
|
||||
Duration GetCustomConditionCheckInterval() const;
|
||||
|
||||
int RunCount() const { return _runCount; };
|
||||
void ResetRunCount() { _runCount = 0; };
|
||||
|
||||
@@ -98,7 +115,7 @@ public:
|
||||
std::shared_ptr<Macro> Parent() const;
|
||||
|
||||
// Saving and loading
|
||||
bool Save(obs_data_t *obj) const;
|
||||
bool Save(obs_data_t *obj, bool saveForCopy = false) const;
|
||||
bool Load(obs_data_t *obj);
|
||||
// Some macros can refer to other macros, which are not yet loaded.
|
||||
// Use this function to set these references after loading is complete.
|
||||
@@ -113,8 +130,7 @@ public:
|
||||
void SetElseActionSplitterPosition(const QList<int>);
|
||||
const QList<int> &GetElseActionSplitterPosition() const;
|
||||
bool HasValidSplitterPositions() const;
|
||||
bool WasExecutedSince(
|
||||
const std::chrono::high_resolution_clock::time_point &) const;
|
||||
bool WasExecutedSince(const TimePoint &) const;
|
||||
bool OnChangePreventedActionsRecently();
|
||||
void ResetUIHelpers();
|
||||
|
||||
@@ -149,25 +165,27 @@ private:
|
||||
void ClearHotkeys() const;
|
||||
void SetHotkeysDesc() const;
|
||||
|
||||
bool
|
||||
CheckConditionHelper(const std::shared_ptr<MacroCondition> &) const;
|
||||
|
||||
bool RunActionsHelper(
|
||||
const std::deque<std::shared_ptr<MacroAction>> &actions,
|
||||
bool ignorePause);
|
||||
bool RunActions(bool ignorePause);
|
||||
bool RunElseActions(bool ignorePause);
|
||||
|
||||
bool DockIsVisible() const;
|
||||
void SetDockWidgetName() const;
|
||||
void SaveDockSettings(obs_data_t *obj) const;
|
||||
void SaveDockSettings(obs_data_t *obj, bool saveForCopy) const;
|
||||
void LoadDockSettings(obs_data_t *obj);
|
||||
void RemoveDock();
|
||||
static std::string GenerateDockId();
|
||||
|
||||
std::string _name = "";
|
||||
bool _die = false;
|
||||
bool _stop = false;
|
||||
bool _done = true;
|
||||
std::chrono::high_resolution_clock::time_point _lastCheckTime{};
|
||||
std::chrono::high_resolution_clock::time_point _lastUnpauseTime{};
|
||||
std::chrono::high_resolution_clock::time_point _lastExecutionTime{};
|
||||
TimePoint _lastCheckTime{};
|
||||
TimePoint _lastUnpauseTime{};
|
||||
TimePoint _lastExecutionTime{};
|
||||
std::thread _backgroundThread;
|
||||
std::vector<std::thread> _helperThreads;
|
||||
|
||||
@@ -180,10 +198,14 @@ private:
|
||||
bool _isGroup = false;
|
||||
bool _isCollapsed = false;
|
||||
|
||||
bool _useShortCircuitEvaluation = false;
|
||||
bool _useCustomConditionCheckInterval = false;
|
||||
Duration _customConditionCheckInterval = 0.3;
|
||||
bool _conditionSateChanged = false;
|
||||
|
||||
bool _runInParallel = false;
|
||||
bool _matched = false;
|
||||
bool _lastMatched = false;
|
||||
bool _conditionSateChanged = false;
|
||||
bool _performActionsOnChange = true;
|
||||
bool _skipExecOnStart = false;
|
||||
bool _stopActionsIfNotDone = false;
|
||||
@@ -194,6 +216,9 @@ private:
|
||||
obs_hotkey_id _unpauseHotkey = OBS_INVALID_HOTKEY_ID;
|
||||
obs_hotkey_id _togglePauseHotkey = OBS_INVALID_HOTKEY_ID;
|
||||
|
||||
PauseStateSaveBehavior _pauseSaveBehavior =
|
||||
PauseStateSaveBehavior::PERSIST;
|
||||
|
||||
MacroInputVariables _inputVariables;
|
||||
|
||||
// UI helpers
|
||||
@@ -217,12 +242,8 @@ private:
|
||||
obs_module_text("AdvSceneSwitcher.macroDock.statusLabel.true");
|
||||
StringVariable _conditionsFalseStatusText =
|
||||
obs_module_text("AdvSceneSwitcher.macroDock.statusLabel.false");
|
||||
bool _dockIsFloating = true;
|
||||
bool _dockIsVisible = false;
|
||||
Qt::DockWidgetArea _dockArea;
|
||||
QByteArray _dockGeo;
|
||||
MacroDock *_dock = nullptr;
|
||||
QAction *_dockAction = nullptr;
|
||||
std::string _dockId = GenerateDockId();
|
||||
};
|
||||
|
||||
void LoadMacros(obs_data_t *obj);
|
||||
@@ -235,5 +256,6 @@ Macro *GetMacroByName(const char *name);
|
||||
Macro *GetMacroByQString(const QString &name);
|
||||
std::weak_ptr<Macro> GetWeakMacroByName(const char *name);
|
||||
void InvalidateMacroTempVarValues();
|
||||
std::shared_ptr<Macro> GetMacroWithInvalidConditionInterval();
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include "scene-group.hpp"
|
||||
#include "scene-trigger.hpp"
|
||||
#include "switch-audio.hpp"
|
||||
#include "switch-executable.hpp"
|
||||
#include "switch-file.hpp"
|
||||
@@ -14,7 +13,6 @@
|
||||
#include "switch-window.hpp"
|
||||
#include "switch-sequence.hpp"
|
||||
#include "switch-video.hpp"
|
||||
#include "switch-network.hpp"
|
||||
|
||||
#include "macro-settings.hpp"
|
||||
#include "duration-control.hpp"
|
||||
@@ -131,12 +129,13 @@ public:
|
||||
RECORINDG_OR_STREAMING
|
||||
};
|
||||
AutoStart autoStartEvent = AutoStart::NEVER;
|
||||
bool enableCooldown = false;
|
||||
Duration cooldown;
|
||||
bool showSystemTrayNotifications = false;
|
||||
bool transitionOverrideOverride = false;
|
||||
bool adjustActiveTransitionType = true;
|
||||
|
||||
enum class LogLevel { DEFAULT, PRINT_ACTION, VERBOSE };
|
||||
enum class LogLevel { DEFAULT, LOG_MACRO, LOG_ACTION, VERBOSE };
|
||||
LogLevel logLevel = LogLevel::DEFAULT;
|
||||
|
||||
/* --- End of General tab section --- */
|
||||
@@ -193,9 +192,7 @@ public:
|
||||
void saveTimeSwitches(obs_data_t *obj);
|
||||
void saveAudioSwitches(obs_data_t *obj);
|
||||
void saveSceneGroups(obs_data_t *obj);
|
||||
void saveSceneTriggers(obs_data_t *obj);
|
||||
void saveVideoSwitches(obs_data_t *obj);
|
||||
void saveNetworkSwitches(obs_data_t *obj);
|
||||
|
||||
void loadWindowTitleSwitches(obs_data_t *obj);
|
||||
void loadScreenRegionSwitches(obs_data_t *obj);
|
||||
@@ -210,9 +207,7 @@ public:
|
||||
void loadTimeSwitches(obs_data_t *obj);
|
||||
void loadAudioSwitches(obs_data_t *obj);
|
||||
void loadSceneGroups(obs_data_t *obj);
|
||||
void loadSceneTriggers(obs_data_t *obj);
|
||||
void loadVideoSwitches(obs_data_t *obj);
|
||||
void loadNetworkSettings(obs_data_t *obj);
|
||||
|
||||
void Prune();
|
||||
|
||||
@@ -235,7 +230,6 @@ public:
|
||||
void checkAudioSwitchFallback(OBSWeakSource &scene,
|
||||
OBSWeakSource &transition);
|
||||
bool checkVideoSwitch(OBSWeakSource &scene, OBSWeakSource &transition);
|
||||
void checkTriggers();
|
||||
bool checkPause();
|
||||
void checkDefaultSceneTransitions();
|
||||
void writeSceneInfoToFile();
|
||||
@@ -255,7 +249,6 @@ public:
|
||||
FileIOData fileIO;
|
||||
std::deque<FileSwitch> fileSwitches;
|
||||
std::deque<ExecutableSwitch> executableSwitches;
|
||||
std::deque<SceneTrigger> sceneTriggers;
|
||||
std::deque<SceneTransition> sceneTransitions;
|
||||
std::deque<DefaultSceneTransition> defaultSceneTransitions;
|
||||
std::deque<MediaSwitch> mediaSwitches;
|
||||
@@ -264,11 +257,6 @@ public:
|
||||
QDateTime liveTime;
|
||||
std::deque<AudioSwitch> audioSwitches;
|
||||
AudioSwitchFallback audioFallback;
|
||||
WSServer server;
|
||||
ServerStatus serverStatus = ServerStatus::NOT_RUNNING;
|
||||
WSClient client;
|
||||
ClientStatus clientStatus = ClientStatus::DISCONNECTED;
|
||||
NetworkConfig networkConfig;
|
||||
std::deque<VideoSwitch> videoSwitches;
|
||||
std::deque<SceneGroup> sceneGroups;
|
||||
SceneGroup *lastRandomSceneGroup = nullptr;
|
||||
|
||||
118
lib/utils/condition-logic.cpp
Normal file
118
lib/utils/condition-logic.cpp
Normal file
@@ -0,0 +1,118 @@
|
||||
#include "condition-logic.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
#include "log-helper.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <QComboBox>
|
||||
|
||||
namespace advss {
|
||||
|
||||
const std::map<Logic::Type, const char *> Logic::localeMap = {
|
||||
{Logic::Type::NONE, {"AdvSceneSwitcher.logic.none"}},
|
||||
{Logic::Type::AND, {"AdvSceneSwitcher.logic.and"}},
|
||||
{Logic::Type::OR, {"AdvSceneSwitcher.logic.or"}},
|
||||
{Logic::Type::AND_NOT, {"AdvSceneSwitcher.logic.andNot"}},
|
||||
{Logic::Type::OR_NOT, {"AdvSceneSwitcher.logic.orNot"}},
|
||||
{Logic::Type::ROOT_NONE, {"AdvSceneSwitcher.logic.rootNone"}},
|
||||
{Logic::Type::ROOT_NOT, {"AdvSceneSwitcher.logic.not"}},
|
||||
};
|
||||
|
||||
bool Logic::ApplyConditionLogic(Type type, bool currentMatchResult,
|
||||
bool conditionMatched, const char *context)
|
||||
{
|
||||
return ApplyConditionLogic(
|
||||
type, currentMatchResult,
|
||||
[conditionMatched]() { return conditionMatched; }, context);
|
||||
}
|
||||
|
||||
bool Logic::ApplyConditionLogic(Type type, bool currentMatchResult,
|
||||
const std::function<bool()> &evaluateCondition,
|
||||
const char *context)
|
||||
{
|
||||
if (!context) {
|
||||
context = "";
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case Type::ROOT_NONE:
|
||||
return evaluateCondition();
|
||||
case Type::ROOT_NOT:
|
||||
return !evaluateCondition();
|
||||
case Type::ROOT_LAST:
|
||||
break;
|
||||
case Type::NONE:
|
||||
vblog(LOG_INFO, "skipping condition check for '%s'", context);
|
||||
return currentMatchResult;
|
||||
case Type::AND:
|
||||
return currentMatchResult && evaluateCondition();
|
||||
case Type::OR:
|
||||
return currentMatchResult || evaluateCondition();
|
||||
case Type::AND_NOT:
|
||||
return currentMatchResult && !evaluateCondition();
|
||||
case Type::OR_NOT:
|
||||
return currentMatchResult || !evaluateCondition();
|
||||
case Type::LAST:
|
||||
default:
|
||||
blog(LOG_WARNING, "ignoring invalid logic check (%s)", context);
|
||||
return currentMatchResult;
|
||||
}
|
||||
|
||||
return currentMatchResult;
|
||||
}
|
||||
|
||||
void Logic::PopulateLogicTypeSelection(QComboBox *list, bool isRootCondition)
|
||||
{
|
||||
auto compare = isRootCondition
|
||||
? std::function<bool(int)>{[](int typeValue) {
|
||||
return typeValue < rootOffset;
|
||||
}}
|
||||
: std::function<bool(int)>{[](int typeValue) {
|
||||
return typeValue >= rootOffset;
|
||||
}};
|
||||
for (const auto &[type, name] : localeMap) {
|
||||
const int typeValue = static_cast<int>(type);
|
||||
if (compare(typeValue)) {
|
||||
list->addItem(obs_module_text(name), typeValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Logic::Save(obs_data_t *obj, const char *name) const
|
||||
{
|
||||
obs_data_set_int(obj, name, static_cast<int>(_type));
|
||||
}
|
||||
|
||||
void Logic::Load(obs_data_t *obj, const char *name)
|
||||
{
|
||||
_type = static_cast<Type>(obs_data_get_int(obj, name));
|
||||
}
|
||||
|
||||
bool Logic::IsRootType() const
|
||||
{
|
||||
return _type < static_cast<Type>(rootOffset);
|
||||
}
|
||||
|
||||
bool Logic::IsNegationType(Logic::Type type)
|
||||
{
|
||||
return type == Type::ROOT_NOT || type == Type::AND_NOT ||
|
||||
type == Type::OR_NOT;
|
||||
;
|
||||
}
|
||||
|
||||
bool Logic::IsValidSelection(bool isRootCondition) const
|
||||
{
|
||||
if (!IsRootType() == isRootCondition) {
|
||||
return false;
|
||||
}
|
||||
if (IsRootType() &&
|
||||
(_type < Type::ROOT_NONE || _type >= Type::ROOT_LAST)) {
|
||||
return false;
|
||||
}
|
||||
if (!IsRootType() &&
|
||||
(_type <= Type::ROOT_LAST || _type >= Type::LAST)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
56
lib/utils/condition-logic.hpp
Normal file
56
lib/utils/condition-logic.hpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <obs-data.h>
|
||||
#include <string>
|
||||
|
||||
class QComboBox;
|
||||
|
||||
namespace advss {
|
||||
|
||||
class Logic {
|
||||
public:
|
||||
static constexpr auto rootOffset = 100;
|
||||
|
||||
enum class Type {
|
||||
ROOT_NONE = 0,
|
||||
ROOT_NOT,
|
||||
ROOT_LAST,
|
||||
|
||||
// leave some space for potential expansion
|
||||
NONE = rootOffset,
|
||||
AND,
|
||||
OR,
|
||||
AND_NOT,
|
||||
OR_NOT,
|
||||
LAST,
|
||||
};
|
||||
|
||||
Logic(Type type) { _type = type; }
|
||||
|
||||
void Save(obs_data_t *obj, const char *name) const;
|
||||
void Load(obs_data_t *obj, const char *name);
|
||||
|
||||
Type GetType() const { return _type; }
|
||||
void SetType(const Type &type) { _type = type; }
|
||||
bool IsRootType() const;
|
||||
static bool IsNegationType(Logic::Type);
|
||||
bool IsValidSelection(bool isRootCondition) const;
|
||||
|
||||
static bool ApplyConditionLogic(Type, bool currentMatchResult,
|
||||
bool conditionMatched,
|
||||
const char *context);
|
||||
static bool
|
||||
ApplyConditionLogic(Type, bool currentMatchResult,
|
||||
const std::function<bool()> &evaluateCondition,
|
||||
const char *context);
|
||||
|
||||
static void PopulateLogicTypeSelection(QComboBox *list,
|
||||
bool isRootCondition);
|
||||
|
||||
private:
|
||||
Type _type = Type::NONE;
|
||||
static const std::map<Type, const char *> localeMap;
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
@@ -77,13 +77,12 @@ bool CurlHelper::LoadLib()
|
||||
{
|
||||
_lib = new QLibrary(curl_library_name, nullptr);
|
||||
if (Resolve()) {
|
||||
blog(LOG_INFO, "[adv-ss] found curl library");
|
||||
blog(LOG_INFO, "found curl library");
|
||||
return true;
|
||||
} else {
|
||||
delete _lib;
|
||||
_lib = nullptr;
|
||||
blog(LOG_WARNING,
|
||||
"[adv-ss] couldn't find the curl library in PATH");
|
||||
blog(LOG_WARNING, "couldn't find the curl library in PATH");
|
||||
}
|
||||
QStringList locations;
|
||||
locations << QDir::currentPath();
|
||||
@@ -94,14 +93,13 @@ bool CurlHelper::LoadLib()
|
||||
locations << "/usr/local/opt/curl/lib";
|
||||
#endif
|
||||
for (QString path : locations) {
|
||||
blog(LOG_INFO, "[adv-ss] trying '%s'",
|
||||
path.toUtf8().constData());
|
||||
blog(LOG_INFO, "trying '%s'", path.toUtf8().constData());
|
||||
QFileInfo libPath(
|
||||
QDir(path).absoluteFilePath(curl_library_name));
|
||||
|
||||
if (libPath.exists() && libPath.isFile()) {
|
||||
QString libFilePath = libPath.absoluteFilePath();
|
||||
blog(LOG_INFO, "[adv-ss] found curl library at '%s'",
|
||||
blog(LOG_INFO, "found curl library at '%s'",
|
||||
libFilePath.toUtf8().constData());
|
||||
|
||||
_lib = new QLibrary(libFilePath, nullptr);
|
||||
@@ -113,7 +111,7 @@ bool CurlHelper::LoadLib()
|
||||
}
|
||||
}
|
||||
}
|
||||
blog(LOG_WARNING, "[adv-ss] can't find the curl library");
|
||||
blog(LOG_WARNING, "can't find the curl library");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -128,11 +126,11 @@ bool CurlHelper::Resolve()
|
||||
|
||||
if (_init && _setopt && _slistAppend && _perform && _cleanup &&
|
||||
_error) {
|
||||
blog(LOG_INFO, "[adv-ss] curl loaded successfully");
|
||||
blog(LOG_INFO, "curl loaded successfully");
|
||||
return true;
|
||||
}
|
||||
|
||||
blog(LOG_INFO, "[adv-ss] curl symbols not resolved");
|
||||
blog(LOG_INFO, "curl symbols not resolved");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
34
lib/utils/cursor-shape-changer.cpp
Normal file
34
lib/utils/cursor-shape-changer.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "cursor-shape-changer.hpp"
|
||||
|
||||
#include <QCursor>
|
||||
#include <QEvent>
|
||||
#include <QGuiApplication>
|
||||
|
||||
namespace advss {
|
||||
|
||||
CursorShapeChanger::CursorShapeChanger(QObject *parent, Qt::CursorShape shape)
|
||||
: QObject(parent),
|
||||
_shape(shape)
|
||||
{
|
||||
}
|
||||
|
||||
bool CursorShapeChanger::eventFilter(QObject *o, QEvent *e)
|
||||
{
|
||||
if ((e->type() == QEvent::HoverEnter || e->type() == QEvent::Enter) &&
|
||||
!_overrideActive) {
|
||||
_overrideActive = true;
|
||||
QGuiApplication::setOverrideCursor(QCursor(_shape));
|
||||
} else if (_overrideActive && e->type() == QEvent::Leave) {
|
||||
_overrideActive = false;
|
||||
QGuiApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
return QObject::eventFilter(o, e);
|
||||
}
|
||||
|
||||
void SetCursorOnWidgetHover(QWidget *widget, Qt::CursorShape shape)
|
||||
{
|
||||
widget->installEventFilter(new CursorShapeChanger(widget, shape));
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
20
lib/utils/cursor-shape-changer.hpp
Normal file
20
lib/utils/cursor-shape-changer.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include <QWidget>
|
||||
|
||||
namespace advss {
|
||||
|
||||
class CursorShapeChanger : public QObject {
|
||||
public:
|
||||
CursorShapeChanger(QObject *, Qt::CursorShape shape);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *o, QEvent *e) override;
|
||||
|
||||
private:
|
||||
Qt::CursorShape _shape;
|
||||
std::atomic_bool _overrideActive = {false};
|
||||
};
|
||||
|
||||
void SetCursorOnWidgetHover(QWidget *widget, Qt::CursorShape shape);
|
||||
|
||||
} // namespace advss
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user