mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 09:05:57 -05:00
Compare commits
108 Commits
1.25.0-bet
...
1.26.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7cc44b4470 | ||
|
|
54356d9410 | ||
|
|
defbdf8b7a | ||
|
|
a01af6cfc3 | ||
|
|
4d9c7f1054 | ||
|
|
ced36e2b5b | ||
|
|
d2749f29b0 | ||
|
|
b78c8bc1de | ||
|
|
cc4a3560d8 | ||
|
|
3ab2ea9e66 | ||
|
|
69b82ee2a3 | ||
|
|
f14e6bf252 | ||
|
|
e51ae79b4c | ||
|
|
8f55856fd5 | ||
|
|
a360d53419 | ||
|
|
d28164d02f | ||
|
|
f723212394 | ||
|
|
a0cb08d18f | ||
|
|
d18044b764 | ||
|
|
406b5d61f5 | ||
|
|
9a4eef4a83 | ||
|
|
efaf9a2ef3 | ||
|
|
edb2952fd6 | ||
|
|
088828a351 | ||
|
|
e359b7fa00 | ||
|
|
44fc5177d6 | ||
|
|
604a27141f | ||
|
|
fd65a84d7d | ||
|
|
966b389807 | ||
|
|
a6bcce5a63 | ||
|
|
530fbdd282 | ||
|
|
54f1051456 | ||
|
|
d136bf5561 | ||
|
|
5cba948e02 | ||
|
|
ab922f6735 | ||
|
|
d71c87535f | ||
|
|
ce501bd972 | ||
|
|
ec5944f53c | ||
|
|
5e64e0bbaa | ||
|
|
e16f1d732d | ||
|
|
cdacfc946c | ||
|
|
26e854f0a3 | ||
|
|
2bc89364b2 | ||
|
|
e080d2de9b | ||
|
|
ca1262aeb7 | ||
|
|
cbc95e2095 | ||
|
|
9c5051cbf8 | ||
|
|
e6ca3390a2 | ||
|
|
e74b531905 | ||
|
|
01437183ac | ||
|
|
e5ab2ceca3 | ||
|
|
e19f4ddf7c | ||
|
|
4e3a062084 | ||
|
|
96db0ad507 | ||
|
|
6b4bcc074a | ||
|
|
14dd390680 | ||
|
|
3fe8ea8961 | ||
|
|
3ee913ea98 | ||
|
|
d18277653c | ||
|
|
8c478cc330 | ||
|
|
003ffc161b | ||
|
|
74dc0c871b | ||
|
|
c8545dea4d | ||
|
|
e1b8edd444 | ||
|
|
f3996855c3 | ||
|
|
ea17e8ea08 | ||
|
|
00fc313609 | ||
|
|
c72f9abc2b | ||
|
|
6df818503e | ||
|
|
b17a6cc109 | ||
|
|
82d1aed472 | ||
|
|
eb6fc6c140 | ||
|
|
2710406f5f | ||
|
|
a634499423 | ||
|
|
71b3fbaa19 | ||
|
|
c656bb4571 | ||
|
|
6c4e4b8cd8 | ||
|
|
7b1a256f8a | ||
|
|
66f9eaf8c2 | ||
|
|
7fa0ba3355 | ||
|
|
eec9244e4c | ||
|
|
e265e4828e | ||
|
|
ad6e720912 | ||
|
|
70dad8ebb4 | ||
|
|
497b3b3e04 | ||
|
|
891811aa47 | ||
|
|
be9ddaa4c9 | ||
|
|
03494c2915 | ||
|
|
bcf7c247bf | ||
|
|
132d89b350 | ||
|
|
daf16357c9 | ||
|
|
8080abc93c | ||
|
|
902715bd3e | ||
|
|
8271a6e8db | ||
|
|
6c121a093b | ||
|
|
ab0cce9eaa | ||
|
|
9acbead87b | ||
|
|
03e71e9183 | ||
|
|
f8dadd38b4 | ||
|
|
2928775f5b | ||
|
|
673ac8078b | ||
|
|
234ae27205 | ||
|
|
a740a29798 | ||
|
|
341a58b8e4 | ||
|
|
ba9a16e718 | ||
|
|
2b2bab8fbc | ||
|
|
f50f31ec4c | ||
|
|
3a1c353ea3 |
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/build-aux/*.zsh eol=lf
|
||||||
|
/build-aux/.functions/* eol=lf
|
||||||
1
.github/scripts/.Brewfile
vendored
1
.github/scripts/.Brewfile
vendored
@@ -1,6 +1,5 @@
|
|||||||
brew "ccache"
|
brew "ccache"
|
||||||
brew "coreutils"
|
brew "coreutils"
|
||||||
brew "cmake"
|
brew "cmake"
|
||||||
brew "git"
|
|
||||||
brew "jq"
|
brew "jq"
|
||||||
brew "xcbeautify"
|
brew "xcbeautify"
|
||||||
|
|||||||
12
.github/scripts/.package.zsh
vendored
12
.github/scripts/.package.zsh
vendored
@@ -163,9 +163,13 @@ ${_usage_host:-}"
|
|||||||
|
|
||||||
local product_name
|
local product_name
|
||||||
local product_version
|
local product_version
|
||||||
|
local git_tag="$(git describe --tags)"
|
||||||
read -r product_name product_version <<< \
|
read -r product_name product_version <<< \
|
||||||
"$(jq -r '. | {name, version} | join(" ")' ${buildspec_file})"
|
"$(jq -r '. | {name, version} | join(" ")' ${buildspec_file})"
|
||||||
|
|
||||||
|
log_info "Using git tag as version identifier '${git_tag}'"
|
||||||
|
product_version="${git_tag}"
|
||||||
|
|
||||||
if [[ ${host_os} == macos ]] {
|
if [[ ${host_os} == macos ]] {
|
||||||
autoload -Uz check_packages read_codesign read_codesign_installer read_codesign_pass
|
autoload -Uz check_packages read_codesign read_codesign_installer read_codesign_pass
|
||||||
|
|
||||||
@@ -247,15 +251,21 @@ ${_usage_host:-}"
|
|||||||
cmake --build build_${target##*-} --config ${config} -t package_source ${cmake_args}
|
cmake --build build_${target##*-} --config ${config} -t package_source ${cmake_args}
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
local output_name="${product_name}-${product_version}-${target##*-}-linux-gnu"
|
||||||
|
|
||||||
if (( package )) {
|
if (( package )) {
|
||||||
log_group "Packaging ${product_name}..."
|
log_group "Packaging ${product_name}..."
|
||||||
pushd ${project_root}
|
pushd ${project_root}
|
||||||
cmake --build build_${target##*-} --config ${config} -t package ${cmake_args}
|
cmake --build build_${target##*-} --config ${config} -t package ${cmake_args}
|
||||||
|
|
||||||
|
if [ ! -e ${project_root}/release/${output_name}.deb ]; then
|
||||||
|
mv ${project_root}/release/*.deb ${project_root}/release/${output_name}.deb
|
||||||
|
mv ${project_root}/release/*.ddeb ${project_root}/release/${output_name}.ddeb
|
||||||
|
fi
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
log_group "Archiving ${product_name}..."
|
log_group "Archiving ${product_name}..."
|
||||||
local output_name="${product_name}-${product_version}-${target##*-}-linux-gnu"
|
|
||||||
local _tarflags='cJf'
|
local _tarflags='cJf'
|
||||||
if (( _loglevel > 1 || ${+CI} )) _tarflags="v${_tarflags}"
|
if (( _loglevel > 1 || ${+CI} )) _tarflags="v${_tarflags}"
|
||||||
|
|
||||||
|
|||||||
4
.github/scripts/Package-Windows.ps1
vendored
4
.github/scripts/Package-Windows.ps1
vendored
@@ -48,6 +48,10 @@ function Package {
|
|||||||
$ProductName = $BuildSpec.name
|
$ProductName = $BuildSpec.name
|
||||||
$ProductVersion = $BuildSpec.version
|
$ProductVersion = $BuildSpec.version
|
||||||
|
|
||||||
|
$GitOutput = git describe --tags
|
||||||
|
Log-Information "Using git tag as version identifier '${GitOutput}'"
|
||||||
|
$ProductVersion = $GitOutput
|
||||||
|
|
||||||
$OutputName = "${ProductName}-${ProductVersion}-windows-${Target}"
|
$OutputName = "${ProductName}-${ProductVersion}-windows-${Target}"
|
||||||
|
|
||||||
if ( ! $SkipDeps ) {
|
if ( ! $SkipDeps ) {
|
||||||
|
|||||||
0
.github/test
vendored
Normal file
0
.github/test
vendored
Normal file
5
.gitignore
vendored
5
.gitignore
vendored
@@ -14,7 +14,9 @@
|
|||||||
!/tests
|
!/tests
|
||||||
!.clang-format
|
!.clang-format
|
||||||
!.cmake-format.json
|
!.cmake-format.json
|
||||||
|
!.gitattributes
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
!.pre-commit-config.yaml
|
||||||
!BUILDING.md
|
!BUILDING.md
|
||||||
!buildspec.json
|
!buildspec.json
|
||||||
!CMakeLists.txt
|
!CMakeLists.txt
|
||||||
@@ -22,6 +24,9 @@
|
|||||||
!LICENSE
|
!LICENSE
|
||||||
!README.md
|
!README.md
|
||||||
|
|
||||||
|
# Exclude .orig leftovers
|
||||||
|
*.orig
|
||||||
|
|
||||||
# Exclude lock files
|
# Exclude lock files
|
||||||
*.lock.json
|
*.lock.json
|
||||||
|
|
||||||
|
|||||||
24
.pre-commit-config.yaml
Normal file
24
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||||
|
rev: v16.0.6
|
||||||
|
hooks:
|
||||||
|
- id: clang-format
|
||||||
|
args: [-fallback-style=none]
|
||||||
|
types_or: [c++, c]
|
||||||
|
exclude: |
|
||||||
|
(?x)^(
|
||||||
|
deps/.*|
|
||||||
|
tests/catch\.hpp|
|
||||||
|
.*\.mm
|
||||||
|
)$
|
||||||
|
|
||||||
|
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
||||||
|
rev: v0.6.13
|
||||||
|
hooks:
|
||||||
|
- id: cmake-format
|
||||||
|
|
||||||
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
|
rev: v0.3.2
|
||||||
|
hooks:
|
||||||
|
- id: ruff-format
|
||||||
|
types_or: [python]
|
||||||
48
BUILDING.md
48
BUILDING.md
@@ -4,11 +4,13 @@ You have the option to ...
|
|||||||
- either add the plugin to the OBS source tree directly and build the plugin while building OBS itself. (**in tree**)
|
- either add the plugin to the OBS source tree directly and build the plugin while building OBS itself. (**in tree**)
|
||||||
- or you can move the sources of this plugin outside of the OBS source tree and build it separately from OBS. (**out of tree**)
|
- or you can move the sources of this plugin outside of the OBS source tree and build it separately from OBS. (**out of tree**)
|
||||||
|
|
||||||
As both methods require you to have a working [OBS Studio development environment](https://obsproject.com/wiki/Building-OBS-Studio) and [CMake](https://cmake.org/download/) it is recommended to build the plugin in tree as it is easier to set up and will enable straightforward debugging.
|
Both methods require [CMake](https://cmake.org/download/).
|
||||||
|
|
||||||
The plugin can be compiled for OBS 25 and above, although using the latest version of OBS is recommended to support all features.
|
The plugin can be compiled for OBS 27 and above, although using the latest version of OBS is recommended to support all features.
|
||||||
|
|
||||||
## Compiling in tree (recommended for development)
|
## Compiling in tree (recommended for development)
|
||||||
|
This section assumes that you have a working [OBS Studio development environment](https://obsproject.com/wiki/Building-OBS-Studio).
|
||||||
|
|
||||||
Add the "SceneSwitcher" source directory to your obs-studio source directory under obs-studio/UI/frontend-plugins/:
|
Add the "SceneSwitcher" source directory to your obs-studio source directory under obs-studio/UI/frontend-plugins/:
|
||||||
```
|
```
|
||||||
cd obs-studio/UI/frontend-plugins/
|
cd obs-studio/UI/frontend-plugins/
|
||||||
@@ -46,12 +48,12 @@ cmake -DOpenCV_DIR="C:/Users/BuildUser/Documents/OBS/opencv/build/" -DLeptonica_
|
|||||||
First you will need to clone the plugin sources by running the following command:
|
First you will need to clone the plugin sources by running the following command:
|
||||||
```
|
```
|
||||||
git clone --recursive https://github.com/WarmUpTill/SceneSwitcher.git
|
git clone --recursive https://github.com/WarmUpTill/SceneSwitcher.git
|
||||||
cd SceneSwitcher
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Next you will need [CMake](https://cmake.org/download/) and run the command with suitable arguments for your particular platform.
|
Next you will need [CMake](https://cmake.org/download/) and run it with suitable arguments for your particular platform.
|
||||||
For example, on Windows you might want to run this command:
|
For example, on Windows you might want to run this command:
|
||||||
```
|
```
|
||||||
|
cd SceneSwitcher
|
||||||
cmake --preset windows-x64
|
cmake --preset windows-x64
|
||||||
```
|
```
|
||||||
Next, you can build the plugin and install the files into a folder named release using the following commands:
|
Next, you can build the plugin and install the files into a folder named release using the following commands:
|
||||||
@@ -72,7 +74,7 @@ cd SceneSwitcher
|
|||||||
cmake -DOpenCV_DIR="C:/Users/BuildUser/Documents/OBS/opencv/build/" -DLeptonica_DIR="C:/Users/BuildUser/Documents/OBS/leptonica/build" -DTesseract_DIR="C:/Users/BuildUser/Documents/OBS/tesseract/build/lib/cmake/tesseract" --preset windows-x64
|
cmake -DOpenCV_DIR="C:/Users/BuildUser/Documents/OBS/opencv/build/" -DLeptonica_DIR="C:/Users/BuildUser/Documents/OBS/leptonica/build" -DTesseract_DIR="C:/Users/BuildUser/Documents/OBS/tesseract/build/lib/cmake/tesseract" --preset windows-x64
|
||||||
```
|
```
|
||||||
|
|
||||||
You can rely on the CI scripts to build the dependencies for you, although it is not guaranteed that they will work in every environment:
|
You can rely on the CI scripts to build the dependencies for you, although it is not guaranteed that they will function in every environment:
|
||||||
|
|
||||||
| Platform | Command |
|
| Platform | Command |
|
||||||
| ----------- | ----------- |
|
| ----------- | ----------- |
|
||||||
@@ -83,10 +85,10 @@ You can rely on the CI scripts to build the dependencies for you, although it is
|
|||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
Contributions to the plugin are always welcome and if you need any assistance do not hesitate to reach out.
|
Contributions to the plugin are always welcome and if you need any assistance do not hesitate to reach out!
|
||||||
|
|
||||||
If you would like to expand upon the macro system by adding a new condition or action type have a look at the examples in `plugins/base`.
|
If you would like to expand upon the macro system by adding a new condition or action type have a look at the examples in `plugins/base`.
|
||||||
In general changes in the `lib/legacy` folder should be avoided.
|
In general changes in the `lib/legacy` folder should be avoided, if possible.
|
||||||
|
|
||||||
## Macro condition
|
## Macro condition
|
||||||
Macro conditions should inherit from the `MacroCondition` class and must implement the following functions:
|
Macro conditions should inherit from the `MacroCondition` class and must implement the following functions:
|
||||||
@@ -97,12 +99,12 @@ public:
|
|||||||
MacroConditionExample(Macro *m) : MacroCondition(m) {}
|
MacroConditionExample(Macro *m) : MacroCondition(m) {}
|
||||||
// This function should perform the condition check
|
// This function should perform the condition check
|
||||||
bool CheckCondition();
|
bool CheckCondition();
|
||||||
// This function should store the required condition data to "obj"
|
// This function should store the required condition data to "data"
|
||||||
// For example called on OBS shutdown
|
// For example called on OBS shutdown
|
||||||
bool Save(obs_data_t *obj);
|
bool Save(obs_data_t *data);
|
||||||
// This function should load the condition data from "obj"
|
// This function should load the condition data from "data"
|
||||||
// For example called on OBS startup
|
// For example called on OBS startup
|
||||||
bool Load(obs_data_t *obj);
|
bool Load(obs_data_t *data);
|
||||||
// This function should return a unique id for this condition type
|
// This function should return a unique id for this condition type
|
||||||
// The _id is defined below
|
// The _id is defined below
|
||||||
std::string GetId() { return _id; };
|
std::string GetId() { return _id; };
|
||||||
@@ -120,7 +122,7 @@ private:
|
|||||||
static const std::string _id;
|
static const std::string _id;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
When defining the widget used to control the settings of the condition type, it is important to add a static `Create()` method.
|
When defining the widget used to control the settings of the condition type, a static `Create()` method is required.
|
||||||
It will be called whenever a new condition MacroConditionExample is created. (See `MacroConditionFactory::Register()`)
|
It will be called whenever a new condition MacroConditionExample is created. (See `MacroConditionFactory::Register()`)
|
||||||
```
|
```
|
||||||
class MacroConditionExampleEdit : public QWidget {
|
class MacroConditionExampleEdit : public QWidget {
|
||||||
@@ -151,7 +153,7 @@ bool MacroConditionExample::_registered = MacroConditionFactory::Register(
|
|||||||
MacroConditionExample::id, // Unique string identifying this condition type
|
MacroConditionExample::id, // Unique string identifying this condition type
|
||||||
{
|
{
|
||||||
MacroConditionExample::Create, // Function called to create the object performing the condition
|
MacroConditionExample::Create, // Function called to create the object performing the condition
|
||||||
MacroConditionExampleEdit::Create, // Function called to create the widget configure the condition
|
MacroConditionExampleEdit::Create, // Function called to create the widget to configure the settings
|
||||||
"AdvSceneSwitcher.condition.example", // User facing name of the condition type (will be translated)
|
"AdvSceneSwitcher.condition.example", // User facing name of the condition type (will be translated)
|
||||||
true // Condition type supports duration modifiers (default true)
|
true // Condition type supports duration modifiers (default true)
|
||||||
}
|
}
|
||||||
@@ -167,16 +169,18 @@ The differences are highlighted in the comments below.
|
|||||||
class MacroActionExample : public MacroAction {
|
class MacroActionExample : public MacroAction {
|
||||||
public:
|
public:
|
||||||
MacroActionExample(Macro *m) : MacroAction(m) {}
|
MacroActionExample(Macro *m) : MacroAction(m) {}
|
||||||
|
static std::shared_ptr<MacroAction> Create(Macro *m);
|
||||||
|
// Used to create a copy of the action (used for action queues)
|
||||||
|
std::shared_ptr<MacroAction> Copy() const;
|
||||||
// This function should perform the action
|
// This function should perform the action
|
||||||
// If false is returned the macro will aborted
|
// If false is returned the macro will aborted
|
||||||
bool PerformAction();
|
bool PerformAction();
|
||||||
bool Save(obs_data_t *obj);
|
bool Save(obs_data_t *data);
|
||||||
bool Load(obs_data_t *obj);
|
bool Load(obs_data_t *data);
|
||||||
std::string GetId() { return _id; };
|
std::string GetId() { return _id; };
|
||||||
static std::shared_ptr<MacroAction> Create(Macro *m)
|
// Optional:
|
||||||
{
|
// Might be called when action is inserted to action queue
|
||||||
return std::make_shared<MacroActionExample>(m);
|
void ResolveVariablesToFixedValues();
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool _registered;
|
static bool _registered;
|
||||||
@@ -207,11 +211,11 @@ MacroActionFactory::Register(
|
|||||||
MacroActionExample::id, // Unique string identifying this action type
|
MacroActionExample::id, // Unique string identifying this action type
|
||||||
{
|
{
|
||||||
MacroActionExample::Create, // Function called to create the object performing the action
|
MacroActionExample::Create, // Function called to create the object performing the action
|
||||||
MacroActionExampleEdit::Create, // Function called to create the widget configure the action
|
MacroActionExampleEdit::Create, // Function called to create the widget to configure the settings
|
||||||
"AdvSceneSwitcher.action.example" // User facing name of the action type
|
"AdvSceneSwitcher.action.example" // User facing name of the action type
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
## External dependencies
|
## External dependencies
|
||||||
If your intention is to add macro functionality which depends on external libraries, which is likely not to exist on all user setups, have a look at the folders in the `plugins/` directory, which are not named base.
|
If your intention is to add macro functionality which depends on external libraries, which might not exist on all user environments, have a look at the folders in the `plugins/` directory, which are not named `base`.
|
||||||
For example `plugins/video` will only be loaded if the `OpenCV` dependencies are met.
|
For example, `plugins/video` will only be loaded if the `OpenCV` dependencies are met.
|
||||||
|
|||||||
@@ -128,6 +128,8 @@ target_sources(
|
|||||||
lib/macro/macro-ref.hpp
|
lib/macro/macro-ref.hpp
|
||||||
lib/macro/macro-run-button.cpp
|
lib/macro/macro-run-button.cpp
|
||||||
lib/macro/macro-run-button.hpp
|
lib/macro/macro-run-button.hpp
|
||||||
|
lib/macro/macro-segment-copy-paste.cpp
|
||||||
|
lib/macro/macro-segment-copy-paste.hpp
|
||||||
lib/macro/macro-segment-list.cpp
|
lib/macro/macro-segment-list.cpp
|
||||||
lib/macro/macro-segment-list.hpp
|
lib/macro/macro-segment-list.hpp
|
||||||
lib/macro/macro-segment-selection.cpp
|
lib/macro/macro-segment-selection.cpp
|
||||||
@@ -145,10 +147,16 @@ target_sources(
|
|||||||
# Utility function sources
|
# Utility function sources
|
||||||
target_sources(
|
target_sources(
|
||||||
${LIB_NAME}
|
${LIB_NAME}
|
||||||
PRIVATE lib/utils/action-queue.cpp
|
PRIVATE lib/queue/action-queue.cpp
|
||||||
lib/utils/action-queue.hpp
|
lib/queue/action-queue.hpp
|
||||||
|
lib/queue/action-queue-tab.cpp
|
||||||
|
lib/queue/action-queue-tab.hpp
|
||||||
|
lib/utils/backup.cpp
|
||||||
|
lib/utils/backup.hpp
|
||||||
lib/utils/curl-helper.cpp
|
lib/utils/curl-helper.cpp
|
||||||
lib/utils/curl-helper.hpp
|
lib/utils/curl-helper.hpp
|
||||||
|
lib/utils/double-slider.cpp
|
||||||
|
lib/utils/double-slider.hpp
|
||||||
lib/utils/duration-control.cpp
|
lib/utils/duration-control.cpp
|
||||||
lib/utils/duration-control.hpp
|
lib/utils/duration-control.hpp
|
||||||
lib/utils/duration.cpp
|
lib/utils/duration.cpp
|
||||||
@@ -187,6 +195,10 @@ target_sources(
|
|||||||
lib/utils/regex-config.hpp
|
lib/utils/regex-config.hpp
|
||||||
lib/utils/resizing-text-edit.cpp
|
lib/utils/resizing-text-edit.cpp
|
||||||
lib/utils/resizing-text-edit.hpp
|
lib/utils/resizing-text-edit.hpp
|
||||||
|
lib/utils/resource-table.cpp
|
||||||
|
lib/utils/resource-table.hpp
|
||||||
|
lib/utils/resource-table-hotkey-handler.cpp
|
||||||
|
lib/utils/resource-table-hotkey-handler.hpp
|
||||||
lib/utils/scene-selection.cpp
|
lib/utils/scene-selection.cpp
|
||||||
lib/utils/scene-selection.hpp
|
lib/utils/scene-selection.hpp
|
||||||
lib/utils/scene-switch-helpers.cpp
|
lib/utils/scene-switch-helpers.cpp
|
||||||
@@ -197,6 +209,8 @@ target_sources(
|
|||||||
lib/utils/section.hpp
|
lib/utils/section.hpp
|
||||||
lib/utils/selection-helpers.cpp
|
lib/utils/selection-helpers.cpp
|
||||||
lib/utils/selection-helpers.hpp
|
lib/utils/selection-helpers.hpp
|
||||||
|
lib/utils/single-char-selection.cpp
|
||||||
|
lib/utils/single-char-selection.hpp
|
||||||
lib/utils/slider-spinbox.cpp
|
lib/utils/slider-spinbox.cpp
|
||||||
lib/utils/slider-spinbox.hpp
|
lib/utils/slider-spinbox.hpp
|
||||||
lib/utils/source-helpers.cpp
|
lib/utils/source-helpers.cpp
|
||||||
@@ -211,6 +225,8 @@ target_sources(
|
|||||||
lib/utils/switch-button.hpp
|
lib/utils/switch-button.hpp
|
||||||
lib/utils/sync-helpers.cpp
|
lib/utils/sync-helpers.cpp
|
||||||
lib/utils/sync-helpers.hpp
|
lib/utils/sync-helpers.hpp
|
||||||
|
lib/utils/tab-helpers.cpp
|
||||||
|
lib/utils/tab-helpers.hpp
|
||||||
lib/utils/temp-variable.cpp
|
lib/utils/temp-variable.cpp
|
||||||
lib/utils/temp-variable.hpp
|
lib/utils/temp-variable.hpp
|
||||||
lib/utils/ui-helpers.cpp
|
lib/utils/ui-helpers.cpp
|
||||||
@@ -228,6 +244,7 @@ target_sources(
|
|||||||
lib/variables/variable-string.cpp
|
lib/variables/variable-string.cpp
|
||||||
lib/variables/variable-string.hpp
|
lib/variables/variable-string.hpp
|
||||||
lib/variables/variable-tab.cpp
|
lib/variables/variable-tab.cpp
|
||||||
|
lib/variables/variable-tab.hpp
|
||||||
lib/variables/variable-text-edit.cpp
|
lib/variables/variable-text-edit.cpp
|
||||||
lib/variables/variable-text-edit.hpp
|
lib/variables/variable-text-edit.hpp
|
||||||
lib/variables/variable.cpp
|
lib/variables/variable.cpp
|
||||||
@@ -262,6 +279,7 @@ target_include_directories(
|
|||||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/lib"
|
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/lib"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/legacy"
|
"${CMAKE_CURRENT_SOURCE_DIR}/lib/legacy"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/macro"
|
"${CMAKE_CURRENT_SOURCE_DIR}/lib/macro"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/lib/queue"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/utils"
|
"${CMAKE_CURRENT_SOURCE_DIR}/lib/utils"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/variables"
|
"${CMAKE_CURRENT_SOURCE_DIR}/lib/variables"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/forms")
|
"${CMAKE_CURRENT_BINARY_DIR}/forms")
|
||||||
|
|||||||
@@ -22,4 +22,5 @@ sudo snap install obs-studio
|
|||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
- If you wish to contribute code to the project, have a look at this [section](BUILDING.md) describing how to compile the plugin.
|
- If you wish to contribute code to the project, have a look at this [section](BUILDING.md) describing how to compile the plugin.
|
||||||
|
- 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`.
|
- If you wish to contribute translations, feel free to submit pull requests for the corresponding files under `data/locale`.
|
||||||
|
|||||||
@@ -49,7 +49,16 @@ invoke_formatter() {
|
|||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
local -a source_files=(src/**/*.(c|cpp|h|hpp|m|mm)(.N))
|
local -a source_files=()
|
||||||
|
for folder ("lib" "module" "plugins" "tests") {
|
||||||
|
source_files+=(${folder}/**/*.(c|cpp|h|hpp)(.N))
|
||||||
|
}
|
||||||
|
|
||||||
|
for file (${source_files}) {
|
||||||
|
if [[ $file == *"catch.hpp" ]]; then
|
||||||
|
source_files=("${source_files[@]/$file}")
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
local -a format_args=(-style=file -fallback-style=none)
|
local -a format_args=(-style=file -fallback-style=none)
|
||||||
if (( _loglevel > 2 )) format_args+=(--verbose)
|
if (( _loglevel > 2 )) format_args+=(--verbose)
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
defaultLocaleFile = "en-US.ini"
|
defaultLocaleFile = "en-US.ini"
|
||||||
|
|
||||||
|
|
||||||
class localeEntry:
|
class localeEntry:
|
||||||
locale = ""
|
locale = ""
|
||||||
placeholders = []
|
widgetPlaceholders = []
|
||||||
|
qStringArgs = []
|
||||||
|
|
||||||
def __init__(self, locale, widgets) -> None:
|
def __init__(self, locale, widgetPlaceholders, qStringArgs) -> None:
|
||||||
self.locale = locale
|
self.locale = locale
|
||||||
self.placeholders = widgets
|
self.widgetPlaceholders = widgetPlaceholders
|
||||||
|
self.qStringArgs = qStringArgs
|
||||||
|
|
||||||
|
|
||||||
def getNonDefaultLocales(dir):
|
def getNonDefaultLocales(dir):
|
||||||
@@ -22,21 +25,33 @@ def getNonDefaultLocales(dir):
|
|||||||
f = os.path.join(dir, filename)
|
f = os.path.join(dir, filename)
|
||||||
if os.path.isfile(f) and not f.endswith(defaultLocaleFile):
|
if os.path.isfile(f) and not f.endswith(defaultLocaleFile):
|
||||||
files.append(f)
|
files.append(f)
|
||||||
|
|
||||||
return files
|
return files
|
||||||
|
|
||||||
|
|
||||||
def getAllLocaleEntriesWithWidgetPlaceholders(file):
|
def getAllLocaleEntries(file):
|
||||||
localeEntries = []
|
localeEntries = []
|
||||||
with open(file, 'r', encoding='UTF-8') as f:
|
with open(file, "r", encoding="UTF-8") as f:
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
widgetPlaceholders = []
|
widgetPlaceholders = []
|
||||||
|
qStringArgs = []
|
||||||
|
|
||||||
|
if line.startswith(";"):
|
||||||
|
continue
|
||||||
|
|
||||||
for word in line.split("{{"):
|
for word in line.split("{{"):
|
||||||
if not "}}" in word:
|
if not "}}" in word:
|
||||||
continue
|
continue
|
||||||
word = "{{" + word[:word.rfind("}}")] + "}}"
|
placeholder = "{{" + word[: word.rfind("}}")] + "}}"
|
||||||
widgetPlaceholders.append(word)
|
widgetPlaceholders.append(placeholder)
|
||||||
localeEntries.append(localeEntry(
|
|
||||||
line.split("=")[0], widgetPlaceholders))
|
for match in re.finditer(r"%\d+", line):
|
||||||
|
qStringArgs.append(match.group(0))
|
||||||
|
|
||||||
|
localeEntries.append(
|
||||||
|
localeEntry(line.split("=")[0], widgetPlaceholders, qStringArgs)
|
||||||
|
)
|
||||||
|
|
||||||
return localeEntries
|
return localeEntries
|
||||||
|
|
||||||
|
|
||||||
@@ -44,47 +59,85 @@ def getLocaleEntryFrom(entry, list):
|
|||||||
for element in list:
|
for element in list:
|
||||||
if element.locale == entry.locale:
|
if element.locale == entry.locale:
|
||||||
return element
|
return element
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def checkWidgetPlacehodlers(file, expectedPlaceholders):
|
def checkLocaleEntries(file, expectedLocaleEntries):
|
||||||
localeEntries = getAllLocaleEntriesWithWidgetPlaceholders(file)
|
localeEntries = getAllLocaleEntries(file)
|
||||||
result = True
|
result = True
|
||||||
|
|
||||||
for localeEntry in localeEntries:
|
for localeEntry in localeEntries:
|
||||||
expectedEntry = getLocaleEntryFrom(localeEntry, expectedPlaceholders)
|
expectedLocaleEntry = getLocaleEntryFrom(localeEntry, expectedLocaleEntries)
|
||||||
if expectedEntry is None:
|
|
||||||
|
if expectedLocaleEntry is None:
|
||||||
|
result = False
|
||||||
print(
|
print(
|
||||||
"WARNING: Locale entry \"{}\" from \"{}\" not found in \"{}\"".format(localeEntry.locale, file, defaultLocaleFile))
|
'ERROR: Locale entry "{}" from "{}" not found in "{}"'.format(
|
||||||
|
localeEntry.locale, file, defaultLocaleFile
|
||||||
|
)
|
||||||
|
)
|
||||||
continue
|
continue
|
||||||
for p in localeEntry.placeholders:
|
|
||||||
if p not in expectedEntry.placeholders:
|
for placeholder in localeEntry.widgetPlaceholders:
|
||||||
print("WARNING: Locale entry \"{}\" from \"{}\" does contain \"{}\" while \"{}\" does not".format(
|
if placeholder not in expectedLocaleEntry.widgetPlaceholders:
|
||||||
localeEntry.locale, file, p, defaultLocaleFile))
|
|
||||||
for p in expectedEntry.placeholders:
|
|
||||||
if p not in localeEntry.placeholders:
|
|
||||||
result = False
|
result = False
|
||||||
print("ERROR: Locale entry \"{}\" from \"{}\" does not contain \"{}\"".format(
|
print(
|
||||||
localeEntry.locale, file, p))
|
'ERROR: Locale entry "{}" from "{}" does contain "{}" widget placeholder while "{}" does not'.format(
|
||||||
|
localeEntry.locale, file, placeholder, defaultLocaleFile
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
for placeholder in expectedLocaleEntry.widgetPlaceholders:
|
||||||
|
if placeholder not in localeEntry.widgetPlaceholders:
|
||||||
|
result = False
|
||||||
|
print(
|
||||||
|
'ERROR: Locale entry "{}" from "{}" does not contain "{}" widget placeholder'.format(
|
||||||
|
localeEntry.locale, file, placeholder
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
for arg in localeEntry.qStringArgs:
|
||||||
|
if arg not in expectedLocaleEntry.qStringArgs:
|
||||||
|
result = False
|
||||||
|
print(
|
||||||
|
'ERROR: Locale entry "{}" from "{}" does contain "{}" QString arg while "{}" does not'.format(
|
||||||
|
localeEntry.locale, file, arg, defaultLocaleFile
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
for arg in expectedLocaleEntry.qStringArgs:
|
||||||
|
if arg not in localeEntry.qStringArgs:
|
||||||
|
result = False
|
||||||
|
print(
|
||||||
|
'ERROR: Locale entry "{}" from "{}" does not contain "{}" QString arg'.format(
|
||||||
|
localeEntry.locale, file, arg
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description='Checks for inconsistencies regarding widget placeholders in the different locale files.')
|
description="Checks for inconsistencies regarding widget placeholders in the different locale files."
|
||||||
parser.add_argument(
|
)
|
||||||
'-p', '--path', help='Path to locale folder', required=True)
|
parser.add_argument("-p", "--path", help="Path to locale folder", required=True)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
placeholders = getAllLocaleEntriesWithWidgetPlaceholders(
|
defaultLocaleEntries = getAllLocaleEntries(
|
||||||
os.path.join(args.path, defaultLocaleFile))
|
os.path.join(args.path, defaultLocaleFile)
|
||||||
|
)
|
||||||
nonDefaultLocales = getNonDefaultLocales(args.path)
|
nonDefaultLocales = getNonDefaultLocales(args.path)
|
||||||
|
|
||||||
result = True
|
result = True
|
||||||
for f in nonDefaultLocales:
|
for file in nonDefaultLocales:
|
||||||
if checkWidgetPlacehodlers(f, placeholders) == False:
|
if checkLocaleEntries(file, defaultLocaleEntries) == False:
|
||||||
result = False
|
result = False
|
||||||
|
|
||||||
if result == False:
|
if result == False:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print("SUCCESS: No issues found!")
|
print("SUCCESS: No issues found!")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,14 @@ if(NOT DEFINED PLUGIN_BUILD_NUMBER AND EXISTS "${_BUILD_NUMBER_CACHE}")
|
|||||||
file(READ "${_BUILD_NUMBER_CACHE}" PLUGIN_BUILD_NUMBER)
|
file(READ "${_BUILD_NUMBER_CACHE}" PLUGIN_BUILD_NUMBER)
|
||||||
math(EXPR PLUGIN_BUILD_NUMBER "${PLUGIN_BUILD_NUMBER}+1")
|
math(EXPR PLUGIN_BUILD_NUMBER "${PLUGIN_BUILD_NUMBER}+1")
|
||||||
elseif(NOT DEFINED PLUGIN_BUILD_NUMBER)
|
elseif(NOT DEFINED PLUGIN_BUILD_NUMBER)
|
||||||
if($ENV{CI} AND $ENV{GITHUB_RUN_ID})
|
if($ENV{CI})
|
||||||
set(PLUGIN_BUILD_NUMBER "$ENV{GITHUB_RUN_ID}")
|
if($ENV{GITHUB_RUN_ID})
|
||||||
|
set(PLUGIN_BUILD_NUMBER "$ENV{GITHUB_RUN_ID}")
|
||||||
|
elseif($ENV{GITLAB_RUN_ID})
|
||||||
|
set(PLUGIN_BUILD_NUMBER "$ENV{GITLAB_RUN_ID}")
|
||||||
|
else()
|
||||||
|
set(PLUGIN_BUILD_NUMBER "1")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
set(PLUGIN_BUILD_NUMBER "1")
|
set(PLUGIN_BUILD_NUMBER "1")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -68,13 +68,21 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
||||||
|
# Disable warning for https://github.com/WarmUpTill/SceneSwitcher/issues/1091
|
||||||
|
add_compile_options(-Wno-error=psabi)
|
||||||
|
|
||||||
# Disable false-positive warning in GCC 12.1.0 and later
|
# Disable false-positive warning in GCC 12.1.0 and later
|
||||||
add_compile_options(-Wno-error=maybe-uninitialized)
|
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.1.0)
|
||||||
|
add_compile_options(-Wno-error=maybe-uninitialized)
|
||||||
|
add_compile_options(-Wno-error=stringop-overflow)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add warning for infinite recursion (added in GCC 12)
|
# Add warning for infinite recursion (added in GCC 12)
|
||||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0.0)
|
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0.0)
|
||||||
add_compile_options(-Winfinite-recursion)
|
add_compile_options(-Winfinite-recursion)
|
||||||
endif()
|
endif()
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||||
|
add_compile_options(-Wno-error=null-pointer-subtraction)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Enable compiler and build tracing (requires Ninja generator)
|
# Enable compiler and build tracing (requires Ninja generator)
|
||||||
|
|||||||
@@ -75,13 +75,12 @@ AdvSceneSwitcher.macroTab.edit.action="Aktions-Typ:"
|
|||||||
AdvSceneSwitcher.macroTab.add="Neues Makro hinzufügen"
|
AdvSceneSwitcher.macroTab.add="Neues Makro hinzufügen"
|
||||||
AdvSceneSwitcher.macroTab.name="Name:"
|
AdvSceneSwitcher.macroTab.name="Name:"
|
||||||
AdvSceneSwitcher.macroTab.run="Makro ausführen"
|
AdvSceneSwitcher.macroTab.run="Makro ausführen"
|
||||||
AdvSceneSwitcher.macroTab.runFail="Ausführen von \"%1\" fehlgeschlagen!\nEntweder ist eine der Aktionen fehlgeschlagen oder das Makro wird bereits ausgeführt."
|
AdvSceneSwitcher.macroTab.runFail="Ausführen von \"%1\" fehlgeschlagen!\nEntweder ist eine der Aktionen fehlgeschlagen oder das Makro wird bereits ausgeführt.\nSoll die aktuelle Ausführung gestoppt werden?"
|
||||||
AdvSceneSwitcher.macroTab.runInParallel="Parallel zu anderen Makros ausführen"
|
AdvSceneSwitcher.macroTab.runInParallel="Parallel zu anderen Makros ausführen"
|
||||||
AdvSceneSwitcher.macroTab.onChange="Nur bei Änderung ausführen"
|
AdvSceneSwitcher.macroTab.onChange="Nur bei Änderung ausführen"
|
||||||
AdvSceneSwitcher.macroTab.defaultname="Makro %1"
|
AdvSceneSwitcher.macroTab.defaultname="Makro %1"
|
||||||
AdvSceneSwitcher.macroTab.defaultGroupName="Gruppe %1"
|
AdvSceneSwitcher.macroTab.defaultGroupName="Gruppe %1"
|
||||||
AdvSceneSwitcher.macroTab.exists="Makro-Name existiert bereits"
|
AdvSceneSwitcher.macroTab.removeGroupPopup.text="Sicher, dass \"%1\" und alle zugehörigen Elemente gelöscht werden?"
|
||||||
AdvSceneSwitcher.macroTab.groupDeleteConfirm="Sicher, dass \"%1\" und alle zugehörigen Elemente gelöscht werden?"
|
|
||||||
AdvSceneSwitcher.macroTab.copy="Kopie des aktuellen Makros erstellen"
|
AdvSceneSwitcher.macroTab.copy="Kopie des aktuellen Makros erstellen"
|
||||||
AdvSceneSwitcher.macroTab.group="Ausgewählte Elemente gruppieren"
|
AdvSceneSwitcher.macroTab.group="Ausgewählte Elemente gruppieren"
|
||||||
AdvSceneSwitcher.macroTab.ungroup="Gruppierung ausgewählter Gruppen aufheben"
|
AdvSceneSwitcher.macroTab.ungroup="Gruppierung ausgewählter Gruppen aufheben"
|
||||||
@@ -288,8 +287,8 @@ AdvSceneSwitcher.condition.sceneOrder.entry="Auf{{scenes}}{{sources}}{{condition
|
|||||||
AdvSceneSwitcher.condition.hotkey="Hotkey"
|
AdvSceneSwitcher.condition.hotkey="Hotkey"
|
||||||
AdvSceneSwitcher.condition.hotkey.name="Makro-Trigger-Hotkey"
|
AdvSceneSwitcher.condition.hotkey.name="Makro-Trigger-Hotkey"
|
||||||
AdvSceneSwitcher.condition.hotkey.tip="Hinweis: Die Tastenkombinationen für diesen Hotkey können in den OBS-Einstellungen konfiguriert werden"
|
AdvSceneSwitcher.condition.hotkey.tip="Hinweis: Die Tastenkombinationen für diesen Hotkey können in den OBS-Einstellungen konfiguriert werden"
|
||||||
AdvSceneSwitcher.condition.hotkey.entry.line1="Hotkey ist gedrückt"
|
AdvSceneSwitcher.condition.hotkey.entry.keyState="Hotkey ist{{keyState}}"
|
||||||
AdvSceneSwitcher.condition.hotkey.entry.line2="Name: {{name}}"
|
AdvSceneSwitcher.condition.hotkey.entry.name="Name:{{name}}"
|
||||||
AdvSceneSwitcher.condition.replay="Replay Buffer"
|
AdvSceneSwitcher.condition.replay="Replay Buffer"
|
||||||
AdvSceneSwitcher.condition.replay.state.stopped="Replay Buffer gestoppt"
|
AdvSceneSwitcher.condition.replay.state.stopped="Replay Buffer gestoppt"
|
||||||
AdvSceneSwitcher.condition.replay.state.started="Replay Buffer gestartet"
|
AdvSceneSwitcher.condition.replay.state.started="Replay Buffer gestartet"
|
||||||
@@ -445,7 +444,7 @@ AdvSceneSwitcher.action.filter="Filter"
|
|||||||
AdvSceneSwitcher.action.filter.type.enable="Aktivieren"
|
AdvSceneSwitcher.action.filter.type.enable="Aktivieren"
|
||||||
AdvSceneSwitcher.action.filter.type.disable="Deaktivieren"
|
AdvSceneSwitcher.action.filter.type.disable="Deaktivieren"
|
||||||
AdvSceneSwitcher.action.filter.type.settings="Einstellungen festlegen"
|
AdvSceneSwitcher.action.filter.type.settings="Einstellungen festlegen"
|
||||||
AdvSceneSwitcher.action.filter.entry="Auf{{sources}}{{actions}}{{filters}}{{filters}}{{refresh}}"
|
AdvSceneSwitcher.action.filter.entry="Auf{{sources}}{{actions}}{{filters}}{{filters}}{{refresh}}{{settingsButtons}}"
|
||||||
AdvSceneSwitcher.action.filter.getSettings="Aktuelle Einstellungen abfragen"
|
AdvSceneSwitcher.action.filter.getSettings="Aktuelle Einstellungen abfragen"
|
||||||
AdvSceneSwitcher.action.source="Quelle"
|
AdvSceneSwitcher.action.source="Quelle"
|
||||||
AdvSceneSwitcher.action.source.type.enable="Aktivieren"
|
AdvSceneSwitcher.action.source.type.enable="Aktivieren"
|
||||||
@@ -454,7 +453,6 @@ AdvSceneSwitcher.action.source.type.settings="Einstellungen festlegen"
|
|||||||
AdvSceneSwitcher.action.source.type.refreshSettings="Aktualisieren der Quelleneinstellungen"
|
AdvSceneSwitcher.action.source.type.refreshSettings="Aktualisieren der Quelleneinstellungen"
|
||||||
AdvSceneSwitcher.action.source.type.pressSettingsButton="Drücken der Einstellungstaste"
|
AdvSceneSwitcher.action.source.type.pressSettingsButton="Drücken der Einstellungstaste"
|
||||||
AdvSceneSwitcher.action.source.type.refreshSettings.tooltip="Kann verwendet werden, um Browser-, Medien- usw. Quellen zu aktualisieren"
|
AdvSceneSwitcher.action.source.type.refreshSettings.tooltip="Kann verwendet werden, um Browser-, Medien- usw. Quellen zu aktualisieren"
|
||||||
AdvSceneSwitcher.action.source.noSettingsButtons="Keine Buttons gefunden!"
|
|
||||||
AdvSceneSwitcher.action.source.warning="Warnung: Das globale Aktivieren und Deaktivieren von Quellen kann nicht über die OBS-Benutzeroberfläche gesteuert werden"
|
AdvSceneSwitcher.action.source.warning="Warnung: Das globale Aktivieren und Deaktivieren von Quellen kann nicht über die OBS-Benutzeroberfläche gesteuert werden"
|
||||||
AdvSceneSwitcher.action.source.getSettings="Aktuelle Einstellungen abfragen"
|
AdvSceneSwitcher.action.source.getSettings="Aktuelle Einstellungen abfragen"
|
||||||
AdvSceneSwitcher.action.media="Medien"
|
AdvSceneSwitcher.action.media="Medien"
|
||||||
@@ -471,7 +469,6 @@ AdvSceneSwitcher.action.macro.type.unpause="Nicht mehr pausieren"
|
|||||||
AdvSceneSwitcher.action.macro.type.resetCounter="Zähler zurücksetzen"
|
AdvSceneSwitcher.action.macro.type.resetCounter="Zähler zurücksetzen"
|
||||||
AdvSceneSwitcher.action.macro.type.run="Aktionen ausführen"
|
AdvSceneSwitcher.action.macro.type.run="Aktionen ausführen"
|
||||||
AdvSceneSwitcher.action.macro.type.stop="Aktionen stoppen"
|
AdvSceneSwitcher.action.macro.type.stop="Aktionen stoppen"
|
||||||
AdvSceneSwitcher.action.macro.entry="{{actions}}{{actionIndex}}{{macros}}"
|
|
||||||
AdvSceneSwitcher.action.pluginState="Plugin-Status"
|
AdvSceneSwitcher.action.pluginState="Plugin-Status"
|
||||||
AdvSceneSwitcher.action.pluginState.type.stop="Erweiterten Automatischen Szenenwechsler stoppen"
|
AdvSceneSwitcher.action.pluginState.type.stop="Erweiterten Automatischen Szenenwechsler stoppen"
|
||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="Ändern des Nichtübereinstimmungsverhaltens:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="Ändern des Nichtübereinstimmungsverhaltens:"
|
||||||
@@ -545,7 +542,7 @@ AdvSceneSwitcher.action.sceneCollection="Szenensammlung"
|
|||||||
AdvSceneSwitcher.action.sceneCollection.entry="Aktive Szenensammlung umschalten auf {{sceneCollections}}"
|
AdvSceneSwitcher.action.sceneCollection.entry="Aktive Szenensammlung umschalten auf {{sceneCollections}}"
|
||||||
AdvSceneSwitcher.action.sceneCollection.warning="Hinweis: Alle danach folgenden Aktionen werden nicht ausgeführt, da durch die Änderung der Szenensammlung auch die Einstellungen des Szenenwechslers neu geladen werden.\nDie Szenensammlungsaktion wird ignoriert, solange das Einstellungsfenster geöffnet ist."
|
AdvSceneSwitcher.action.sceneCollection.warning="Hinweis: Alle danach folgenden Aktionen werden nicht ausgeführt, da durch die Änderung der Szenensammlung auch die Einstellungen des Szenenwechslers neu geladen werden.\nDie Szenensammlungsaktion wird ignoriert, solange das Einstellungsfenster geöffnet ist."
|
||||||
AdvSceneSwitcher.action.sequence="Sequenz"
|
AdvSceneSwitcher.action.sequence="Sequenz"
|
||||||
AdvSceneSwitcher.action.sequence.entry="Jedes Mal, wenn diese Aktion ausgeführt wird, wird das nächste Makro in der Liste ausgeführt (pausierte Makros werden ignoriert)"
|
; AdvSceneSwitcher.action.sequence.entry="Jedes Mal, wenn diese Aktion ausgeführt wird, wird das nächste Makro in der Liste ausgeführt (pausierte Makros werden ignoriert)"
|
||||||
AdvSceneSwitcher.action.sequence.status="Zuletzt ausgeführtes Makro: %1 - Nächstes auszuführendes Makro: %2"
|
AdvSceneSwitcher.action.sequence.status="Zuletzt ausgeführtes Makro: %1 - Nächstes auszuführendes Makro: %2"
|
||||||
AdvSceneSwitcher.action.sequence.status.none="keines"
|
AdvSceneSwitcher.action.sequence.status.none="keines"
|
||||||
AdvSceneSwitcher.action.sequence.restart="Neustart am Anfang, wenn das Ende der Liste erreicht ist"
|
AdvSceneSwitcher.action.sequence.restart="Neustart am Anfang, wenn das Ende der Liste erreicht ist"
|
||||||
@@ -571,6 +568,7 @@ AdvSceneSwitcher.action.variable.actionNoVariableSupport="Das Abrufen von Variab
|
|||||||
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="Das Abrufen von Variablenwerten aus %1 Bedingungen wird nicht unterstützt!"
|
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="Das Abrufen von Variablenwerten aus %1 Bedingungen wird nicht unterstützt!"
|
||||||
AdvSceneSwitcher.action.variable.currentSegmentValue="Aktueller Wert:"
|
AdvSceneSwitcher.action.variable.currentSegmentValue="Aktueller Wert:"
|
||||||
|
|
||||||
|
AdvSceneSwitcher.noSettingsButtons="Keine Buttons gefunden!"
|
||||||
|
|
||||||
; Transition Tab
|
; Transition Tab
|
||||||
AdvSceneSwitcher.transitionTab.title="Szenenübergänge"
|
AdvSceneSwitcher.transitionTab.title="Szenenübergänge"
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Switch to an
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Switch to:"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Switch to:"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="After performing actions skip performing actions for"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="After performing actions skip performing actions for"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="During this time potential matches will be ignored!"
|
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="During this time potential matches will be ignored!"
|
||||||
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel="Log level:"
|
||||||
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default="Default"
|
||||||
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.printActions="Log performed actions"
|
||||||
|
AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose="Verbose logging"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Enable verbose logging"
|
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Enable verbose logging"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Save window position and size"
|
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Save window position and size"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Show system tray notifications"
|
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Show system tray notifications"
|
||||||
@@ -68,14 +72,62 @@ AdvSceneSwitcher.generalTab.transitionBehaviorSelectionError="At least one optio
|
|||||||
; Variables Tab
|
; Variables Tab
|
||||||
AdvSceneSwitcher.variableTab.title="Variables"
|
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.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.tooltip.variableAddButton="Add new variable"
|
AdvSceneSwitcher.variableTab.variableAddButton.tooltip="Add new variable"
|
||||||
AdvSceneSwitcher.variableTab.tooltip.variableRemoveButton="Remove selected variables"
|
AdvSceneSwitcher.variableTab.variableRemoveButton.tooltip="Remove selected variables"
|
||||||
AdvSceneSwitcher.variableTab.header.name="Name"
|
AdvSceneSwitcher.variableTab.removeSingleVariablePopup.text="Are you sure you want to remove \"%1\"?"
|
||||||
AdvSceneSwitcher.variableTab.header.value="Value"
|
AdvSceneSwitcher.variableTab.removeMultipleVariablesPopup.text="Are you sure you want to remove %1 variables?"
|
||||||
AdvSceneSwitcher.variableTab.header.saveLoadBehavior="Save/Load behavior"
|
AdvSceneSwitcher.variableTab.name.header="Name"
|
||||||
AdvSceneSwitcher.variableTab.header.lastUse="Last used"
|
AdvSceneSwitcher.variableTab.value.header="Value"
|
||||||
AdvSceneSwitcher.variableTab.neverNused="Never"
|
AdvSceneSwitcher.variableTab.saveLoadBehavior.header="Save/Load behavior"
|
||||||
AdvSceneSwitcher.variableTab.lastUsed="%1 seconds ago"
|
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
|
||||||
|
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"
|
||||||
|
AdvSceneSwitcher.actionQueueTab.queueRemoveButton.tooltip="Remove selected action queues"
|
||||||
|
AdvSceneSwitcher.actionQueueTab.name.header="Name"
|
||||||
|
AdvSceneSwitcher.actionQueueTab.size.header="Size"
|
||||||
|
AdvSceneSwitcher.actionQueueTab.isRunning.header="Is running"
|
||||||
|
AdvSceneSwitcher.actionQueueTab.runOnStartup.header="Run on startup"
|
||||||
|
AdvSceneSwitcher.actionQueueTab.yes="Yes"
|
||||||
|
AdvSceneSwitcher.actionQueueTab.no="No"
|
||||||
|
AdvSceneSwitcher.actionQueueTab.removeSingleConnectionPopup.text="Are you sure you want to remove \"%1\"?"
|
||||||
|
AdvSceneSwitcher.actionQueueTab.removeMultipleConnectionsPopup.text="Are you sure you want to remove %1 action queues?"
|
||||||
|
|
||||||
|
; 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"
|
||||||
|
AdvSceneSwitcher.websocketConnectionTab.websocketConnectionRemoveButton.tooltip="Remove selected websocket connections"
|
||||||
|
AdvSceneSwitcher.websocketConnectionTab.name.header="Name"
|
||||||
|
AdvSceneSwitcher.websocketConnectionTab.address.header="Address"
|
||||||
|
AdvSceneSwitcher.websocketConnectionTab.port.header="Port"
|
||||||
|
AdvSceneSwitcher.websocketConnectionTab.protocol.header="Is using OBS protocol?"
|
||||||
|
AdvSceneSwitcher.websocketConnectionTab.protocol.yes="Yes"
|
||||||
|
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
|
||||||
|
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.twitchConnectionRemoveButton.tooltip="Remove selected Twitch connections"
|
||||||
|
AdvSceneSwitcher.twitchConnectionTab.name.header="Name"
|
||||||
|
AdvSceneSwitcher.twitchConnectionTab.isValid.header="Is valid?"
|
||||||
|
AdvSceneSwitcher.twitchConnectionTab.permissionCount.header="Number of permissions"
|
||||||
|
AdvSceneSwitcher.twitchConnectionTab.yes="Yes"
|
||||||
|
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.title="Macro"
|
||||||
@@ -90,19 +142,21 @@ AdvSceneSwitcher.macroTab.edit.logic="Logic type:"
|
|||||||
AdvSceneSwitcher.macroTab.edit.condition="Condition type:"
|
AdvSceneSwitcher.macroTab.edit.condition="Condition type:"
|
||||||
AdvSceneSwitcher.macroTab.edit.action="Action type:"
|
AdvSceneSwitcher.macroTab.edit.action="Action type:"
|
||||||
AdvSceneSwitcher.macroTab.add="Add new macro"
|
AdvSceneSwitcher.macroTab.add="Add new macro"
|
||||||
|
AdvSceneSwitcher.macroTab.addGroup="Add new macro group"
|
||||||
AdvSceneSwitcher.macroTab.name="Name:"
|
AdvSceneSwitcher.macroTab.name="Name:"
|
||||||
AdvSceneSwitcher.macroTab.run="Run macro"
|
AdvSceneSwitcher.macroTab.run="Run macro"
|
||||||
AdvSceneSwitcher.macroTab.run.tooltip="Run all macro actions regardless of condition.\nIf else actions are available, hold Shift and click the button to execute them instead."
|
AdvSceneSwitcher.macroTab.run.tooltip="Run all macro actions regardless of condition.\nIf else actions are available, hold Shift and click the button to execute them instead."
|
||||||
AdvSceneSwitcher.macroTab.runElse="Run macro (else)"
|
AdvSceneSwitcher.macroTab.runElse="Run macro (else)"
|
||||||
AdvSceneSwitcher.macroTab.runFail="Running \"%1\" failed!\nEither one of the actions failed or the macro is running already."
|
AdvSceneSwitcher.macroTab.runFail="Running \"%1\" failed!\nEither one of the actions failed or the macro is running already.\nDo you want to stop it?"
|
||||||
AdvSceneSwitcher.macroTab.runInParallel="Run macro in parallel to other macros"
|
AdvSceneSwitcher.macroTab.runInParallel="Run macro in parallel to other macros"
|
||||||
AdvSceneSwitcher.macroTab.onChange="Perform actions only on condition change"
|
AdvSceneSwitcher.macroTab.onChange="Perform actions only on condition change"
|
||||||
AdvSceneSwitcher.macroTab.defaultname="Macro %1"
|
AdvSceneSwitcher.macroTab.defaultname="Macro %1"
|
||||||
AdvSceneSwitcher.macroTab.defaultGroupName="Group %1"
|
AdvSceneSwitcher.macroTab.defaultGroupName="Group %1"
|
||||||
AdvSceneSwitcher.macroTab.exists="Macro name exists already"
|
AdvSceneSwitcher.macroTab.macroNameExists="The name \"%1\" is already used by a macro."
|
||||||
AdvSceneSwitcher.macroTab.groupDeleteConfirm="Are you sure you want to delete \"%1\" and all its elements?"
|
AdvSceneSwitcher.macroTab.groupNameExists="The name \"%1\" is already used by a macro group."
|
||||||
AdvSceneSwitcher.macroTab.deleteMultipleMacrosConfirmation="Are you sure you want to delete %1 macros?"
|
AdvSceneSwitcher.macroTab.removeSingleMacroPopup.text="Are you sure you want to remove \"%1\"?"
|
||||||
AdvSceneSwitcher.macroTab.deleteSingleMacroConfirmation="Are you sure you want to delete \"%1\"?"
|
AdvSceneSwitcher.macroTab.removeMultipleMacrosPopup.text="Are you sure you want to remove %1 macros/groups?"
|
||||||
|
AdvSceneSwitcher.macroTab.removeGroupPopup.text="Are you sure you want to remove \"%1\" group and all its elements?"
|
||||||
AdvSceneSwitcher.macroTab.contextMenuAdd="Add"
|
AdvSceneSwitcher.macroTab.contextMenuAdd="Add"
|
||||||
AdvSceneSwitcher.macroTab.copy="Duplicate Macro"
|
AdvSceneSwitcher.macroTab.copy="Duplicate Macro"
|
||||||
AdvSceneSwitcher.macroTab.group="Group Selected Macros"
|
AdvSceneSwitcher.macroTab.group="Group Selected Macros"
|
||||||
@@ -111,14 +165,20 @@ AdvSceneSwitcher.macroTab.rename="Rename"
|
|||||||
AdvSceneSwitcher.macroTab.remove="Remove"
|
AdvSceneSwitcher.macroTab.remove="Remove"
|
||||||
AdvSceneSwitcher.macroTab.export="Export"
|
AdvSceneSwitcher.macroTab.export="Export"
|
||||||
AdvSceneSwitcher.macroTab.export.info="Paste the string below into the import dialog to import the selected macros:"
|
AdvSceneSwitcher.macroTab.export.info="Paste the string below into the import dialog to import the selected macros:"
|
||||||
|
AdvSceneSwitcher.macroTab.export.usePlainText="Use plain text"
|
||||||
AdvSceneSwitcher.macroTab.import="Import"
|
AdvSceneSwitcher.macroTab.import="Import"
|
||||||
AdvSceneSwitcher.macroTab.import.info="Paste the export string into the below text box to import macros:"
|
AdvSceneSwitcher.macroTab.import.info="Paste the export string into the below text box to import macros:"
|
||||||
AdvSceneSwitcher.macroTab.import.invalid="Invalid import data provided!"
|
AdvSceneSwitcher.macroTab.import.invalid="Invalid import data provided!"
|
||||||
AdvSceneSwitcher.macroTab.import.nameConflict="Cannot continue importing macro \"%1\" as a macro with the same name already exists!\nDo you want to continue with the import of \"%2\" and choose a new name? (Will be skipped otherwise)"
|
AdvSceneSwitcher.macroTab.import.nameConflict="Cannot continue with import of \"%1\" as the name is already in use!\nDo want to choose a new name for the imported \"%2\"? (It will be skipped otherwise)"
|
||||||
AdvSceneSwitcher.macroTab.expandAll="Expand all"
|
AdvSceneSwitcher.macroTab.expandAll="Expand all"
|
||||||
AdvSceneSwitcher.macroTab.collapseAll="Collapse all"
|
AdvSceneSwitcher.macroTab.collapseAll="Collapse all"
|
||||||
AdvSceneSwitcher.macroTab.maximize="Maximize"
|
AdvSceneSwitcher.macroTab.maximize="Maximize"
|
||||||
AdvSceneSwitcher.macroTab.minimize="Minimize"
|
AdvSceneSwitcher.macroTab.minimize="Minimize"
|
||||||
|
AdvSceneSwitcher.macroTab.segment.useCustomLabel="Use custom label"
|
||||||
|
AdvSceneSwitcher.macroTab.segment.defaultCustomLabel="My label"
|
||||||
|
AdvSceneSwitcher.macroTab.segment.setCustomLabel="Set label ..."
|
||||||
|
AdvSceneSwitcher.macroTab.segment.copy="Copy"
|
||||||
|
AdvSceneSwitcher.macroTab.segment.paste="Paste"
|
||||||
AdvSceneSwitcher.macroTab.highlightSettings="Visual settings"
|
AdvSceneSwitcher.macroTab.highlightSettings="Visual settings"
|
||||||
AdvSceneSwitcher.macroTab.hotkeySettings="Hotkey settings"
|
AdvSceneSwitcher.macroTab.hotkeySettings="Hotkey settings"
|
||||||
AdvSceneSwitcher.macroTab.generalSettings="General settings"
|
AdvSceneSwitcher.macroTab.generalSettings="General settings"
|
||||||
@@ -129,6 +189,7 @@ AdvSceneSwitcher.macroTab.highlightPerformedActions="Highlight recently performe
|
|||||||
AdvSceneSwitcher.macroTab.newMacroRegisterHotkey="Register hotkeys to control the pause state of new macros"
|
AdvSceneSwitcher.macroTab.newMacroRegisterHotkey="Register hotkeys to control the pause state of new macros"
|
||||||
AdvSceneSwitcher.macroTab.currentDisableHotkeys="Register hotkeys to control the pause state of selected macro"
|
AdvSceneSwitcher.macroTab.currentDisableHotkeys="Register hotkeys to control the pause state of selected macro"
|
||||||
AdvSceneSwitcher.macroTab.currentSkipExecutionOnStartup="Skip execution of actions of current macro on startup"
|
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.currentRegisterDock="Register dock widget to control the pause state of selected macro or run it manually"
|
AdvSceneSwitcher.macroTab.currentRegisterDock="Register dock widget to control the pause state of selected macro or run it manually"
|
||||||
AdvSceneSwitcher.macroTab.currentDockAddRunButton="Add button to run the macro"
|
AdvSceneSwitcher.macroTab.currentDockAddRunButton="Add button to run the macro"
|
||||||
AdvSceneSwitcher.macroTab.currentDockAddPauseButton="Add button to pause or unpause the macro"
|
AdvSceneSwitcher.macroTab.currentDockAddPauseButton="Add button to pause or unpause the macro"
|
||||||
@@ -423,10 +484,12 @@ AdvSceneSwitcher.condition.sceneOrder.type.position="Is at position"
|
|||||||
AdvSceneSwitcher.condition.sceneOrder.positionInfo="The position value starts at the bottom with 0 and increases by one for each scene item including the ones in scene groups"
|
AdvSceneSwitcher.condition.sceneOrder.positionInfo="The position value starts at the bottom with 0 and increases by one for each scene item including the ones in scene groups"
|
||||||
AdvSceneSwitcher.condition.sceneOrder.entry="On{{scenes}}{{sources}}{{conditions}}{{sources2}}{{position}}"
|
AdvSceneSwitcher.condition.sceneOrder.entry="On{{scenes}}{{sources}}{{conditions}}{{sources2}}{{position}}"
|
||||||
AdvSceneSwitcher.condition.hotkey="Hotkey"
|
AdvSceneSwitcher.condition.hotkey="Hotkey"
|
||||||
|
AdvSceneSwitcher.condition.hotkey.pressed="pressed"
|
||||||
|
AdvSceneSwitcher.condition.hotkey.released="released"
|
||||||
AdvSceneSwitcher.condition.hotkey.name="Macro trigger hotkey"
|
AdvSceneSwitcher.condition.hotkey.name="Macro trigger hotkey"
|
||||||
AdvSceneSwitcher.condition.hotkey.tip="Note: You can configure the keybindings for this hotkey in the OBS settings window"
|
AdvSceneSwitcher.condition.hotkey.tip="Note: You can configure the keybindings for this hotkey in the OBS settings window"
|
||||||
AdvSceneSwitcher.condition.hotkey.entry.line1="Hotkey is pressed"
|
AdvSceneSwitcher.condition.hotkey.entry.keyState="Hotkey is{{keyState}}"
|
||||||
AdvSceneSwitcher.condition.hotkey.entry.line2="Name:{{name}}"
|
AdvSceneSwitcher.condition.hotkey.entry.name="Name:{{name}}"
|
||||||
AdvSceneSwitcher.condition.replay="Replay buffer"
|
AdvSceneSwitcher.condition.replay="Replay buffer"
|
||||||
AdvSceneSwitcher.condition.replay.state.stopped="Replay buffer stopped"
|
AdvSceneSwitcher.condition.replay.state.stopped="Replay buffer stopped"
|
||||||
AdvSceneSwitcher.condition.replay.state.started="Replay buffer started"
|
AdvSceneSwitcher.condition.replay.state.started="Replay buffer started"
|
||||||
@@ -531,7 +594,7 @@ AdvSceneSwitcher.condition.run="Run"
|
|||||||
AdvSceneSwitcher.condition.run.entry="Process exits before timeout of{{timeout}}seconds"
|
AdvSceneSwitcher.condition.run.entry="Process exits before timeout of{{timeout}}seconds"
|
||||||
AdvSceneSwitcher.condition.run.entry.exit="{{checkExitCode}}Check for exit code{{exitCode}}"
|
AdvSceneSwitcher.condition.run.entry.exit="{{checkExitCode}}Check for exit code{{exitCode}}"
|
||||||
AdvSceneSwitcher.condition.midi="MIDI"
|
AdvSceneSwitcher.condition.midi="MIDI"
|
||||||
AdvSceneSwitcher.condition.midi.entry="Mesasge was received from{{device}}which matches:"
|
AdvSceneSwitcher.condition.midi.entry="Message was received from{{device}}which matches:"
|
||||||
AdvSceneSwitcher.condition.midi.entry.listen="Set MIDI message selection to messages incoming on selected device:{{listenButton}}"
|
AdvSceneSwitcher.condition.midi.entry.listen="Set MIDI message selection to messages incoming on selected device:{{listenButton}}"
|
||||||
AdvSceneSwitcher.condition.display="Display"
|
AdvSceneSwitcher.condition.display="Display"
|
||||||
AdvSceneSwitcher.condition.display.type.displayName="Name of connected displays matches"
|
AdvSceneSwitcher.condition.display.type.displayName="Name of connected displays matches"
|
||||||
@@ -611,6 +674,26 @@ AdvSceneSwitcher.condition.queue.type.stopped="Stopped"
|
|||||||
AdvSceneSwitcher.condition.queue.type.size="Size"
|
AdvSceneSwitcher.condition.queue.type.size="Size"
|
||||||
AdvSceneSwitcher.condition.queue.entry.startStop="Queue{{queues}}is{{conditions}}"
|
AdvSceneSwitcher.condition.queue.entry.startStop="Queue{{queues}}is{{conditions}}"
|
||||||
AdvSceneSwitcher.condition.queue.entry.size="Queue{{queues}}{{conditions}}is less than{{size}}"
|
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.condition.changed="Clipboard content changed"
|
||||||
|
AdvSceneSwitcher.condition.clipboard.condition.isText="Clipboard contains text"
|
||||||
|
AdvSceneSwitcher.condition.clipboard.condition.isImage="Clipboard contains an image"
|
||||||
|
AdvSceneSwitcher.condition.clipboard.condition.isURL="Clipboard contains an URL"
|
||||||
|
AdvSceneSwitcher.condition.clipboard.condition.matches="Clipboard content matches"
|
||||||
|
AdvSceneSwitcher.condition.clipboard.condition.entry="{{conditions}}{{regex}}{{urlInfo}}"
|
||||||
|
AdvSceneSwitcher.condition.folder="Folder watch"
|
||||||
|
AdvSceneSwitcher.condition.folder.tooltip="This condition type will allow you to monitor the contents of a folder.\nNote that the monitoring will *not* recursively scan for changes in sub directories within directories of the selected folder!\nNote that if there are several changes during a short period of time, some of the changes might not emit this signal.\nHowever, the last change in the sequence of changes always will."
|
||||||
|
AdvSceneSwitcher.condition.folder.condition.any="Any change happened"
|
||||||
|
AdvSceneSwitcher.condition.folder.condition.fileAdd="A file was added"
|
||||||
|
AdvSceneSwitcher.condition.folder.condition.fileChange="A file was modified"
|
||||||
|
AdvSceneSwitcher.condition.folder.condition.fileRemove="A file was removed"
|
||||||
|
AdvSceneSwitcher.condition.folder.condition.folderAdd="A directory was added"
|
||||||
|
AdvSceneSwitcher.condition.folder.condition.folderRemove="A directory was removed"
|
||||||
|
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}}"
|
||||||
|
|
||||||
; Macro Actions
|
; Macro Actions
|
||||||
AdvSceneSwitcher.action.scene="Switch scene"
|
AdvSceneSwitcher.action.scene="Switch scene"
|
||||||
@@ -632,6 +715,8 @@ AdvSceneSwitcher.action.audio.type.sourceVolume="Set source volume"
|
|||||||
AdvSceneSwitcher.action.audio.type.masterVolume="Set master volume"
|
AdvSceneSwitcher.action.audio.type.masterVolume="Set master volume"
|
||||||
AdvSceneSwitcher.action.audio.type.syncOffset="Set sync offset"
|
AdvSceneSwitcher.action.audio.type.syncOffset="Set sync offset"
|
||||||
AdvSceneSwitcher.action.audio.type.monitor="Set audio monitoring"
|
AdvSceneSwitcher.action.audio.type.monitor="Set audio monitoring"
|
||||||
|
AdvSceneSwitcher.action.audio.type.enableOnTrack="Enable on audio track"
|
||||||
|
AdvSceneSwitcher.action.audio.type.disableOnTrack="Disable on audio track"
|
||||||
AdvSceneSwitcher.action.audio.type.balance="Set balance"
|
AdvSceneSwitcher.action.audio.type.balance="Set balance"
|
||||||
AdvSceneSwitcher.action.audio.balance.description="Move the slider in the direction of the audio channel you want to focus on."
|
AdvSceneSwitcher.action.audio.balance.description="Move the slider in the direction of the audio channel you want to focus on."
|
||||||
AdvSceneSwitcher.action.audio.fade.type.duration="over a duration of"
|
AdvSceneSwitcher.action.audio.fade.type.duration="over a duration of"
|
||||||
@@ -640,7 +725,7 @@ AdvSceneSwitcher.action.audio.fade.duration="{{fade}}Fade{{fadeTypes}}{{duration
|
|||||||
AdvSceneSwitcher.action.audio.fade.rate="{{fade}}Fade{{fadeTypes}}{{rate}}per second."
|
AdvSceneSwitcher.action.audio.fade.rate="{{fade}}Fade{{fadeTypes}}{{rate}}per second."
|
||||||
AdvSceneSwitcher.action.audio.fade.wait="Wait for fade to complete."
|
AdvSceneSwitcher.action.audio.fade.wait="Wait for fade to complete."
|
||||||
AdvSceneSwitcher.action.audio.fade.abort="Abort already active fade."
|
AdvSceneSwitcher.action.audio.fade.abort="Abort already active fade."
|
||||||
AdvSceneSwitcher.action.audio.entry="{{actions}}{{audioSources}}{{volume}}{{volumeDB}}{{percentDBToggle}}{{syncOffset}}{{monitorTypes}}"
|
AdvSceneSwitcher.action.audio.entry="{{actions}}{{audioSources}}{{volume}}{{volumeDB}}{{percentDBToggle}}{{syncOffset}}{{monitorTypes}}{{track}}"
|
||||||
AdvSceneSwitcher.action.recording="Recording"
|
AdvSceneSwitcher.action.recording="Recording"
|
||||||
AdvSceneSwitcher.action.recording.type.stop="Stop recording"
|
AdvSceneSwitcher.action.recording.type.stop="Stop recording"
|
||||||
AdvSceneSwitcher.action.recording.type.start="Start recording"
|
AdvSceneSwitcher.action.recording.type.start="Start recording"
|
||||||
@@ -668,7 +753,8 @@ AdvSceneSwitcher.action.streaming.type.username="Set username"
|
|||||||
AdvSceneSwitcher.action.streaming.type.password="Set password"
|
AdvSceneSwitcher.action.streaming.type.password="Set password"
|
||||||
AdvSceneSwitcher.action.streaming.entry="{{actions}}{{keyFrameInterval}}{{stringValue}}{{showPassword}}"
|
AdvSceneSwitcher.action.streaming.entry="{{actions}}{{keyFrameInterval}}{{stringValue}}{{showPassword}}"
|
||||||
AdvSceneSwitcher.action.run="Run"
|
AdvSceneSwitcher.action.run="Run"
|
||||||
AdvSceneSwitcher.action.run.entry.wait="{{wait}}Wait for process exit or at most {{timeout}}"
|
AdvSceneSwitcher.action.run.wait.entry="{{wait}}Wait for process exit or at most {{timeout}}{{waitHelp}}"
|
||||||
|
AdvSceneSwitcher.action.run.wait.help.tooltip="Note that macro properties won't work if you leave this unticked, as the process spawns detached from the rest of logic and there's no control over it."
|
||||||
AdvSceneSwitcher.action.sceneVisibility="Scene item visibility"
|
AdvSceneSwitcher.action.sceneVisibility="Scene item visibility"
|
||||||
AdvSceneSwitcher.action.sceneVisibility.type.show="Show"
|
AdvSceneSwitcher.action.sceneVisibility.type.show="Show"
|
||||||
AdvSceneSwitcher.action.sceneVisibility.type.hide="Hide"
|
AdvSceneSwitcher.action.sceneVisibility.type.hide="Hide"
|
||||||
@@ -681,9 +767,10 @@ AdvSceneSwitcher.action.filter.type.enable="Enable"
|
|||||||
AdvSceneSwitcher.action.filter.type.disable="Disable"
|
AdvSceneSwitcher.action.filter.type.disable="Disable"
|
||||||
AdvSceneSwitcher.action.filter.type.toggle="Toggle"
|
AdvSceneSwitcher.action.filter.type.toggle="Toggle"
|
||||||
AdvSceneSwitcher.action.filter.type.settings="Set settings"
|
AdvSceneSwitcher.action.filter.type.settings="Set settings"
|
||||||
|
AdvSceneSwitcher.action.filter.type.pressSettingsButton="Press settings button"
|
||||||
AdvSceneSwitcher.action.filter.refresh="Refresh"
|
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.refreshTooltip="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}}"
|
AdvSceneSwitcher.action.filter.entry="On{{sources}}{{actions}}{{filters}}{{refresh}}{{settingsButtons}}"
|
||||||
AdvSceneSwitcher.action.filter.entry.settings="{{settings}}{{settingsInputMethod}}{{settingValue}}{{tempVar}}"
|
AdvSceneSwitcher.action.filter.entry.settings="{{settings}}{{settingsInputMethod}}{{settingValue}}{{tempVar}}"
|
||||||
AdvSceneSwitcher.action.filter.getSettings="Get current settings"
|
AdvSceneSwitcher.action.filter.getSettings="Get current settings"
|
||||||
AdvSceneSwitcher.action.filter.inputMethod.individualManual="Set to fixed value"
|
AdvSceneSwitcher.action.filter.inputMethod.individualManual="Set to fixed value"
|
||||||
@@ -701,7 +788,6 @@ AdvSceneSwitcher.action.source.type.deinterlaceOrder="Set deinterlace field orde
|
|||||||
AdvSceneSwitcher.action.source.type.openInteractionDialog="Open interaction dialog"
|
AdvSceneSwitcher.action.source.type.openInteractionDialog="Open interaction dialog"
|
||||||
AdvSceneSwitcher.action.source.type.openFilterDialog="Open filter dialog"
|
AdvSceneSwitcher.action.source.type.openFilterDialog="Open filter dialog"
|
||||||
AdvSceneSwitcher.action.source.type.openPropertiesDialog="Open properties dialog"
|
AdvSceneSwitcher.action.source.type.openPropertiesDialog="Open properties dialog"
|
||||||
AdvSceneSwitcher.action.source.noSettingsButtons="No buttons found!"
|
|
||||||
AdvSceneSwitcher.action.source.entry="{{actions}}{{sources}}{{settingsButtons}}{{deinterlaceMode}}{{deinterlaceOrder}}{{refresh}}"
|
AdvSceneSwitcher.action.source.entry="{{actions}}{{sources}}{{settingsButtons}}{{deinterlaceMode}}{{deinterlaceOrder}}{{refresh}}"
|
||||||
AdvSceneSwitcher.action.source.entry.settings="{{settings}}{{settingsInputMethod}}{{settingValue}}{{tempVar}}"
|
AdvSceneSwitcher.action.source.entry.settings="{{settings}}{{settingsInputMethod}}{{settingValue}}{{tempVar}}"
|
||||||
AdvSceneSwitcher.action.source.warning="Warning: Enabling and disabling sources globally cannot be controlled by the OBS UI\nYou might be looking for \"Scene item visibility\""
|
AdvSceneSwitcher.action.source.warning="Warning: Enabling and disabling sources globally cannot be controlled by the OBS UI\nYou might be looking for \"Scene item visibility\""
|
||||||
@@ -739,12 +825,20 @@ AdvSceneSwitcher.action.macro="Macro"
|
|||||||
AdvSceneSwitcher.action.macro.type.pause="Pause"
|
AdvSceneSwitcher.action.macro.type.pause="Pause"
|
||||||
AdvSceneSwitcher.action.macro.type.unpause="Unpause"
|
AdvSceneSwitcher.action.macro.type.unpause="Unpause"
|
||||||
AdvSceneSwitcher.action.macro.type.resetCounter="Reset counter"
|
AdvSceneSwitcher.action.macro.type.resetCounter="Reset counter"
|
||||||
AdvSceneSwitcher.action.macro.type.run="Run actions"
|
AdvSceneSwitcher.action.macro.type.run="Run macro"
|
||||||
|
AdvSceneSwitcher.action.macro.type.run.conditions.ignore="Do not consider condition state"
|
||||||
|
AdvSceneSwitcher.action.macro.type.run.conditions.true="Only if conditions evaluate to true"
|
||||||
|
AdvSceneSwitcher.action.macro.type.run.conditions.false="Only if conditions evaluate to false"
|
||||||
|
AdvSceneSwitcher.action.macro.type.run.actionType.regular="actions"
|
||||||
|
AdvSceneSwitcher.action.macro.type.run.actionType.else="else-actions"
|
||||||
|
AdvSceneSwitcher.action.macro.type.run.skipWhenPaused="Skip execution when macro is paused"
|
||||||
AdvSceneSwitcher.action.macro.type.stop="Stop actions"
|
AdvSceneSwitcher.action.macro.type.stop="Stop actions"
|
||||||
AdvSceneSwitcher.action.macro.type.disableAction="Disable action"
|
AdvSceneSwitcher.action.macro.type.disableAction="Disable action"
|
||||||
AdvSceneSwitcher.action.macro.type.enableAction="Enable action"
|
AdvSceneSwitcher.action.macro.type.enableAction="Enable action"
|
||||||
AdvSceneSwitcher.action.macro.type.toggleAction="Toggle action"
|
AdvSceneSwitcher.action.macro.type.toggleAction="Toggle action"
|
||||||
AdvSceneSwitcher.action.macro.entry="{{actions}}{{actionIndex}}{{macros}}"
|
AdvSceneSwitcher.action.macro.entry.run="{{actions}}{{actionTypes}}of{{macros}}"
|
||||||
|
AdvSceneSwitcher.action.macro.entry.run.condition="{{conditionBehaviors}}of{{conditionMacros}}"
|
||||||
|
AdvSceneSwitcher.action.macro.entry.other="{{actions}}{{actionIndex}}{{macros}}"
|
||||||
AdvSceneSwitcher.action.pluginState="Plugin state"
|
AdvSceneSwitcher.action.pluginState="Plugin state"
|
||||||
AdvSceneSwitcher.action.pluginState.type.stop="Stop the Advanced Scene Switcher plugin"
|
AdvSceneSwitcher.action.pluginState.type.stop="Stop the Advanced Scene Switcher plugin"
|
||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="Change the no-match behaviour:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="Change the no-match behaviour:"
|
||||||
@@ -829,6 +923,7 @@ AdvSceneSwitcher.action.systray.title="Title:"
|
|||||||
AdvSceneSwitcher.action.systray.message="Message:"
|
AdvSceneSwitcher.action.systray.message="Message:"
|
||||||
AdvSceneSwitcher.action.systray.icon="Icon:"
|
AdvSceneSwitcher.action.systray.icon="Icon:"
|
||||||
AdvSceneSwitcher.action.systray.iconHint="Leave blank to use the default 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="Screenshot"
|
||||||
AdvSceneSwitcher.action.screenshot.save.default="Default"
|
AdvSceneSwitcher.action.screenshot.save.default="Default"
|
||||||
AdvSceneSwitcher.action.screenshot.save.custom="Custom"
|
AdvSceneSwitcher.action.screenshot.save.custom="Custom"
|
||||||
@@ -888,7 +983,12 @@ AdvSceneSwitcher.action.variable.type.sceneItemCount="Set to scene item count of
|
|||||||
AdvSceneSwitcher.action.variable.type.stringLength="Set to length of string"
|
AdvSceneSwitcher.action.variable.type.stringLength="Set to length of string"
|
||||||
AdvSceneSwitcher.action.variable.type.extractJson="Extract json field with name"
|
AdvSceneSwitcher.action.variable.type.extractJson="Extract json field with name"
|
||||||
AdvSceneSwitcher.action.variable.type.setToTempvar="Set to macro property"
|
AdvSceneSwitcher.action.variable.type.setToTempvar="Set to macro property"
|
||||||
|
AdvSceneSwitcher.action.variable.type.setToTempvar.help="This action type will allow you to extract values out of segments of the current macro and assign those values to the selected variable.\nFor example, you can get the current scene name from a scene condition and assign this name to a variable."
|
||||||
AdvSceneSwitcher.action.variable.type.sceneItemName="Set to scene item name at index"
|
AdvSceneSwitcher.action.variable.type.sceneItemName="Set to scene item name at index"
|
||||||
|
AdvSceneSwitcher.action.variable.type.padValue="Pad current value"
|
||||||
|
AdvSceneSwitcher.action.variable.type.truncateValue="Truncate current value"
|
||||||
|
AdvSceneSwitcher.action.variable.truncateOrPadDirection.left="Left"
|
||||||
|
AdvSceneSwitcher.action.variable.truncateOrPadDirection.right="Right"
|
||||||
AdvSceneSwitcher.action.variable.askForValuePromptDefault="Assign value to variable \"%1\":"
|
AdvSceneSwitcher.action.variable.askForValuePromptDefault="Assign value to variable \"%1\":"
|
||||||
AdvSceneSwitcher.action.variable.askForValuePrompt="Assign value to variable:"
|
AdvSceneSwitcher.action.variable.askForValuePrompt="Assign value to variable:"
|
||||||
AdvSceneSwitcher.action.variable.mathExpression.example="( 1 + 2 * 3 ) / 4"
|
AdvSceneSwitcher.action.variable.mathExpression.example="( 1 + 2 * 3 ) / 4"
|
||||||
@@ -900,7 +1000,9 @@ AdvSceneSwitcher.action.variable.invalidSelection="Invalid selection!"
|
|||||||
AdvSceneSwitcher.action.variable.actionNoVariableSupport="Getting variable values from %1 actions is not supported!"
|
AdvSceneSwitcher.action.variable.actionNoVariableSupport="Getting variable values from %1 actions is not supported!"
|
||||||
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="Getting variable values from %1 conditions is not supported!"
|
AdvSceneSwitcher.action.variable.conditionNoVariableSupport="Getting variable values from %1 conditions is not supported!"
|
||||||
AdvSceneSwitcher.action.variable.currentSegmentValue="Current value:"
|
AdvSceneSwitcher.action.variable.currentSegmentValue="Current value:"
|
||||||
AdvSceneSwitcher.action.variable.entry="{{actions}}{{variables}}{{variables2}}{{strValue}}{{numValue}}{{segmentIndex}}{{mathExpression}}{{envVariableName}}{{scenes}}{{tempVars}}{{sceneItemIndex}}"
|
AdvSceneSwitcher.action.variable.entry.other="{{actions}}{{variables}}{{variables2}}{{strValue}}{{numValue}}{{segmentIndex}}{{mathExpression}}{{envVariableName}}{{scenes}}{{tempVars}}{{tempVarsHelp}}{{sceneItemIndex}}{{direction}}{{stringLength}}{{paddingCharSelection}}"
|
||||||
|
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}}"
|
AdvSceneSwitcher.action.variable.entry.substringIndex="Substring start:{{subStringStart}}Substring size:{{subStringSize}}"
|
||||||
AdvSceneSwitcher.action.variable.entry.substringRegex="Assign value of{{regexMatchIdx}}match using regular expression:"
|
AdvSceneSwitcher.action.variable.entry.substringRegex="Assign value of{{regexMatchIdx}}match using regular expression:"
|
||||||
AdvSceneSwitcher.action.variable.entry.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
AdvSceneSwitcher.action.variable.entry.findAndReplace="{{findStr}}{{findRegex}}{{replaceStr}}"
|
||||||
@@ -962,6 +1064,17 @@ AdvSceneSwitcher.action.queue.type.start="Start"
|
|||||||
AdvSceneSwitcher.action.queue.type.stop="Stop"
|
AdvSceneSwitcher.action.queue.type.stop="Stop"
|
||||||
AdvSceneSwitcher.action.queue.entry.add="{{actions}}actions of macro{{macros}}to queue{{queues}}"
|
AdvSceneSwitcher.action.queue.entry.add="{{actions}}actions of macro{{macros}}to queue{{queues}}"
|
||||||
AdvSceneSwitcher.action.queue.entry.other="{{actions}}queue{{queues}}"
|
AdvSceneSwitcher.action.queue.entry.other="{{actions}}queue{{queues}}"
|
||||||
|
AdvSceneSwitcher.action.window="Window"
|
||||||
|
AdvSceneSwitcher.action.window.type.setFocusWindow="Focus window"
|
||||||
|
AdvSceneSwitcher.action.window.type.setFocusWindow.limitation="The focus action can only be performed under certain circumstances"
|
||||||
|
AdvSceneSwitcher.action.window.type.setFocusWindow.limitation.details="At least one of the following conditions must be true:\n OBS is the foreground process.\n There is currently no foreground window, and thus no foreground process.\n OBS received the last input event."
|
||||||
|
AdvSceneSwitcher.action.window.type.maximizeWindow="Maximize window"
|
||||||
|
AdvSceneSwitcher.action.window.type.minimizeWindow="Minimize window"
|
||||||
|
AdvSceneSwitcher.action.window.type.closeWindow="Close window"
|
||||||
|
AdvSceneSwitcher.action.window.entry="{{actions}}{{windows}}{{regex}}"
|
||||||
|
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.startSwitcherHotkey="Start the Advanced Scene Switcher"
|
||||||
@@ -1034,6 +1147,7 @@ AdvSceneSwitcher.actionQueues.configure="Configure action queue settings"
|
|||||||
AdvSceneSwitcher.actionQueues.invalid="Invalid action queue selection"
|
AdvSceneSwitcher.actionQueues.invalid="Invalid action queue selection"
|
||||||
AdvSceneSwitcher.actionQueues.name="Name:"
|
AdvSceneSwitcher.actionQueues.name="Name:"
|
||||||
AdvSceneSwitcher.actionQueues.runOnStartup="Run action queue when starting the plugin"
|
AdvSceneSwitcher.actionQueues.runOnStartup="Run action queue when starting the plugin"
|
||||||
|
AdvSceneSwitcher.actionQueues.resolveVariablesOnAdd="Resolve variables when action is inserted into the queue"
|
||||||
AdvSceneSwitcher.actionQueues.running="Queue is running"
|
AdvSceneSwitcher.actionQueues.running="Queue is running"
|
||||||
AdvSceneSwitcher.actionQueues.stopped="Queue is stopped"
|
AdvSceneSwitcher.actionQueues.stopped="Queue is stopped"
|
||||||
AdvSceneSwitcher.actionQueues.start="Start action queue"
|
AdvSceneSwitcher.actionQueues.start="Start action queue"
|
||||||
@@ -1586,6 +1700,15 @@ AdvSceneSwitcher.tempVar.macro.matchedCount.description="The number of macros of
|
|||||||
|
|
||||||
AdvSceneSwitcher.tempVar.process.name="Process name"
|
AdvSceneSwitcher.tempVar.process.name="Process name"
|
||||||
|
|
||||||
|
AdvSceneSwitcher.tempVar.run.process.id="Process ID"
|
||||||
|
AdvSceneSwitcher.tempVar.run.process.id.description="PID of the process assigned by the system."
|
||||||
|
AdvSceneSwitcher.tempVar.run.process.exitCode="Process exit code"
|
||||||
|
AdvSceneSwitcher.tempVar.run.process.exitCode.description="Numeric code with which the process exited. Usually 0 is positive and other values are error codes."
|
||||||
|
AdvSceneSwitcher.tempVar.run.process.stream.output="Process standard output stream"
|
||||||
|
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.recording.durationSeconds="Recording duration"
|
AdvSceneSwitcher.tempVar.recording.durationSeconds="Recording duration"
|
||||||
AdvSceneSwitcher.tempVar.recording.durationSeconds.description="Recording duration in seconds.\nThis value does not change while the recording is paused and will be reset to zero if the recording is stopped."
|
AdvSceneSwitcher.tempVar.recording.durationSeconds.description="Recording duration in seconds.\nThis value does not change while the recording is paused and will be reset to zero if the recording is stopped."
|
||||||
|
|
||||||
@@ -1617,6 +1740,18 @@ AdvSceneSwitcher.tempVar.streaming.keyframeInterval.description="Stream keyframe
|
|||||||
AdvSceneSwitcher.tempVar.streaming.durationSeconds="Stream duration"
|
AdvSceneSwitcher.tempVar.streaming.durationSeconds="Stream duration"
|
||||||
AdvSceneSwitcher.tempVar.streaming.durationSeconds.description="Seconds passed since the stream was started.\nThis value will be zero if the stream is stopped."
|
AdvSceneSwitcher.tempVar.streaming.durationSeconds.description="Seconds passed since the stream was started.\nThis value will be zero if the stream is stopped."
|
||||||
|
|
||||||
|
AdvSceneSwitcher.tempVar.clipboard.text="Clipboard text"
|
||||||
|
AdvSceneSwitcher.tempVar.clipboard.text.description="The text contained in the clipboard.\nWill be empty if the clipboard does not contain text."
|
||||||
|
|
||||||
|
AdvSceneSwitcher.tempVar.file.content="File content"
|
||||||
|
AdvSceneSwitcher.tempVar.file.date="File modification date"
|
||||||
|
|
||||||
|
AdvSceneSwitcher.tempVar.folder.newFiles="New files"
|
||||||
|
AdvSceneSwitcher.tempVar.folder.changedFiles="Changed files"
|
||||||
|
AdvSceneSwitcher.tempVar.folder.removedFiles="Removed files"
|
||||||
|
AdvSceneSwitcher.tempVar.folder.newDirs="New directories"
|
||||||
|
AdvSceneSwitcher.tempVar.folder.removedDirs="Removed directories"
|
||||||
|
|
||||||
AdvSceneSwitcher.selectScene="--select scene--"
|
AdvSceneSwitcher.selectScene="--select scene--"
|
||||||
AdvSceneSwitcher.selectPreviousScene="Previous Scene"
|
AdvSceneSwitcher.selectPreviousScene="Previous Scene"
|
||||||
AdvSceneSwitcher.selectCurrentScene="Current Scene"
|
AdvSceneSwitcher.selectCurrentScene="Current Scene"
|
||||||
@@ -1642,10 +1777,27 @@ AdvSceneSwitcher.enterText="--enter text--"
|
|||||||
AdvSceneSwitcher.enterURL="--enter URL--"
|
AdvSceneSwitcher.enterURL="--enter URL--"
|
||||||
AdvSceneSwitcher.selectHotkey="--select hotkey--"
|
AdvSceneSwitcher.selectHotkey="--select hotkey--"
|
||||||
AdvSceneSwitcher.selectDisplay="--select display--"
|
AdvSceneSwitcher.selectDisplay="--select display--"
|
||||||
AdvSceneSwitcher.selectSetting="--select setting--"
|
|
||||||
AdvSceneSwitcher.invaildEntriesWillNotBeSaved="invalid entries will not be saved"
|
AdvSceneSwitcher.invaildEntriesWillNotBeSaved="invalid entries will not be saved"
|
||||||
AdvSceneSwitcher.selectWindowTip="Use \"OBS\" to specify OBS window\nUse \"Task Switching\"to specify ALT + TAB"
|
AdvSceneSwitcher.selectWindowTip="Use \"OBS\" to specify OBS window\nUse \"Task Switching\"to specify ALT + TAB"
|
||||||
|
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.invalid=" (Invalid)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.bool=" (Bool)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.int=" (Int)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.float=" (Float)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.text=" (Text)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.path=" (Path)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.list=" (List)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.color=" (Color)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.button=" (Button)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.font=" (Font)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.font=" (Font)"
|
||||||
|
AdvSceneSwitcher.settings.suffix.type.editableList=" (Editable list)"
|
||||||
|
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.sceneItemSelection.configure="Configure scene item selection type"
|
AdvSceneSwitcher.sceneItemSelection.configure="Configure scene item selection type"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceName="Source name"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceName="Source name"
|
||||||
AdvSceneSwitcher.sceneItemSelection.type.sourceName.entry="{{nameConflictIndex}}{{sourceName}}"
|
AdvSceneSwitcher.sceneItemSelection.type.sourceName.entry="{{nameConflictIndex}}{{sourceName}}"
|
||||||
@@ -1689,6 +1841,8 @@ AdvSceneSwitcher.audio.monitor.none="Monitor Off"
|
|||||||
AdvSceneSwitcher.audio.monitor.monitorOnly="Monitor Only (mute output)"
|
AdvSceneSwitcher.audio.monitor.monitorOnly="Monitor Only (mute output)"
|
||||||
AdvSceneSwitcher.audio.monitor.both="Monitor and 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 :)
|
; Legacy tabs below - please don't waste your time adding translations for these :)
|
||||||
; Transition Tab
|
; Transition Tab
|
||||||
AdvSceneSwitcher.transitionTab.title="Transition"
|
AdvSceneSwitcher.transitionTab.title="Transition"
|
||||||
|
|||||||
@@ -72,11 +72,9 @@ AdvSceneSwitcher.macroTab.edit.action="Tipo de acción:"
|
|||||||
AdvSceneSwitcher.macroTab.add="Agregar nueva macro"
|
AdvSceneSwitcher.macroTab.add="Agregar nueva macro"
|
||||||
AdvSceneSwitcher.macroTab.name="Nombre:"
|
AdvSceneSwitcher.macroTab.name="Nombre:"
|
||||||
AdvSceneSwitcher.macroTab.run="Ejecutar macro"
|
AdvSceneSwitcher.macroTab.run="Ejecutar macro"
|
||||||
AdvSceneSwitcher.macroTab.runFail="Error al ejecutar \"%1\" si se ha producido un error en una de las acciones o si la macro ya se está ejecutando."
|
|
||||||
AdvSceneSwitcher.macroTab.runInParallel="Ejecutar macro en paralelo a otras macros"
|
AdvSceneSwitcher.macroTab.runInParallel="Ejecutar macro en paralelo a otras macros"
|
||||||
AdvSceneSwitcher.macroTab.onChange="Realizar acciones solo en el cambio de condición"
|
AdvSceneSwitcher.macroTab.onChange="Realizar acciones solo en el cambio de condición"
|
||||||
AdvSceneSwitcher.macroTab.defaultname="Macro %1"
|
AdvSceneSwitcher.macroTab.defaultname="Macro %1"
|
||||||
AdvSceneSwitcher.macroTab.exists="El nombre de la macro ya existe"
|
|
||||||
AdvSceneSwitcher.macroTab.copy="Crear copia"
|
AdvSceneSwitcher.macroTab.copy="Crear copia"
|
||||||
AdvSceneSwitcher.macroTab.expandAll="Expandir todo"
|
AdvSceneSwitcher.macroTab.expandAll="Expandir todo"
|
||||||
AdvSceneSwitcher.macroTab.collapseAll="Contraer todo"
|
AdvSceneSwitcher.macroTab.collapseAll="Contraer todo"
|
||||||
@@ -240,8 +238,7 @@ AdvSceneSwitcher.condition.sceneOrder.entry="En{{scenes}}{{sources}}{{conditions
|
|||||||
AdvSceneSwitcher.condition.hotkey="Tecla de acceso rápido"
|
AdvSceneSwitcher.condition.hotkey="Tecla de acceso rápido"
|
||||||
AdvSceneSwitcher.condition.hotkey.name="Tecla de acceso directo de activación de macro"
|
AdvSceneSwitcher.condition.hotkey.name="Tecla de acceso directo de activación de macro"
|
||||||
AdvSceneSwitcher.condition.hotkey.tip="Nota: puede configurar las combinaciones de teclas para esta tecla de acceso rápido en la ventana de configuración de OBS"
|
AdvSceneSwitcher.condition.hotkey.tip="Nota: puede configurar las combinaciones de teclas para esta tecla de acceso rápido en la ventana de configuración de OBS"
|
||||||
AdvSceneSwitcher.condition.hotkey.entry.line1="Se presiona la tecla de acceso rápido"
|
AdvSceneSwitcher.condition.hotkey.entry.name="Nombre:{{name}}"
|
||||||
AdvSceneSwitcher.condition.hotkey.entry.line2="Nombre: {{name}}"
|
|
||||||
AdvSceneSwitcher.condition.replay="Búfer de reproducción"
|
AdvSceneSwitcher.condition.replay="Búfer de reproducción"
|
||||||
AdvSceneSwitcher.condition.replay.state.stopped="Búfer de reproducción detenido"
|
AdvSceneSwitcher.condition.replay.state.stopped="Búfer de reproducción detenido"
|
||||||
AdvSceneSwitcher.condition.replay.state.started="Búfer de reproducción iniciado"
|
AdvSceneSwitcher.condition.replay.state.started="Búfer de reproducción iniciado"
|
||||||
@@ -367,7 +364,7 @@ AdvSceneSwitcher.action.filter="Filtro"
|
|||||||
AdvSceneSwitcher.action.filter.type.enable="Habilitar"
|
AdvSceneSwitcher.action.filter.type.enable="Habilitar"
|
||||||
AdvSceneSwitcher.action.filter.type.disable="Deshabilitar"
|
AdvSceneSwitcher.action.filter.type.disable="Deshabilitar"
|
||||||
AdvSceneSwitcher.action.filter.type.settings="Establecer configuración"
|
AdvSceneSwitcher.action.filter.type.settings="Establecer configuración"
|
||||||
AdvSceneSwitcher.action.filter.entry="En{{sources}}{{actions}}{{filters}}{{refresh}}"
|
AdvSceneSwitcher.action.filter.entry="En{{sources}}{{actions}}{{filters}}{{refresh}}{{settingsButtons}}"
|
||||||
AdvSceneSwitcher.action.filter.getSettings="Obtener la configuración actual"
|
AdvSceneSwitcher.action.filter.getSettings="Obtener la configuración actual"
|
||||||
AdvSceneSwitcher.action.source="Fuente"
|
AdvSceneSwitcher.action.source="Fuente"
|
||||||
AdvSceneSwitcher.action.source.type.enable="Habilitar"
|
AdvSceneSwitcher.action.source.type.enable="Habilitar"
|
||||||
@@ -389,7 +386,6 @@ AdvSceneSwitcher.action.macro.type.unpause="Reanudar"
|
|||||||
AdvSceneSwitcher.action.macro.type.resetCounter="Reiniciar contador"
|
AdvSceneSwitcher.action.macro.type.resetCounter="Reiniciar contador"
|
||||||
AdvSceneSwitcher.action.macro.type.run="Ejecutar"
|
AdvSceneSwitcher.action.macro.type.run="Ejecutar"
|
||||||
AdvSceneSwitcher.action.macro.type.stop="Detener"
|
AdvSceneSwitcher.action.macro.type.stop="Detener"
|
||||||
AdvSceneSwitcher.action.macro.entry="{{actions}}{{actionIndex}}{{macros}}"
|
|
||||||
AdvSceneSwitcher.action.pluginState="Estado del complemento"
|
AdvSceneSwitcher.action.pluginState="Estado del complemento"
|
||||||
AdvSceneSwitcher.action.pluginState.type.stop="Detener el complemento Advanced Scene Switcher"
|
AdvSceneSwitcher.action.pluginState.type.stop="Detener el complemento Advanced Scene Switcher"
|
||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="Cambiar el comportamiento de no coincidencia:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="Cambiar el comportamiento de no coincidencia:"
|
||||||
@@ -456,7 +452,7 @@ AdvSceneSwitcher.action.sceneCollection="Colección de escenas"
|
|||||||
AdvSceneSwitcher.action.sceneCollection.entry="Cambiar la colección de escenas activa a {{sceneCollections}}"
|
AdvSceneSwitcher.action.sceneCollection.entry="Cambiar la colección de escenas activa a {{sceneCollections}}"
|
||||||
AdvSceneSwitcher.action.sceneCollection.warning="Nota: Cualquier acción posterior a esta no se ejecutará, ya que la colección de escenas cambiante también volverá a cargar la configuración del conmutador de escenas.\nLa acción de la colección de escenas se ignorará mientras se abra la ventana de configuración".
|
AdvSceneSwitcher.action.sceneCollection.warning="Nota: Cualquier acción posterior a esta no se ejecutará, ya que la colección de escenas cambiante también volverá a cargar la configuración del conmutador de escenas.\nLa acción de la colección de escenas se ignorará mientras se abra la ventana de configuración".
|
||||||
AdvSceneSwitcher.action.sequence="Secuencia"
|
AdvSceneSwitcher.action.sequence="Secuencia"
|
||||||
AdvSceneSwitcher.action.sequence.entry="Cada vez que se realiza esta acción, ejecute la siguiente macro de la lista (las macros en pausa se ignoran)"
|
; AdvSceneSwitcher.action.sequence.entry="Cada vez que se realiza esta acción, ejecute la siguiente macro de la lista (las macros en pausa se ignoran)"
|
||||||
AdvSceneSwitcher.action.sequence.status="Última macro ejecutada: %1 - Siguiente macro a ejecutar: %2"
|
AdvSceneSwitcher.action.sequence.status="Última macro ejecutada: %1 - Siguiente macro a ejecutar: %2"
|
||||||
AdvSceneSwitcher.action.sequence.status.none="ninguno"
|
AdvSceneSwitcher.action.sequence.status.none="ninguno"
|
||||||
AdvSceneSwitcher.action.sequence.restart="Reiniciar desde el principio una vez que se alcance el final de la lista"
|
AdvSceneSwitcher.action.sequence.restart="Reiniciar desde el principio una vez que se alcance el final de la lista"
|
||||||
|
|||||||
@@ -78,15 +78,13 @@ AdvSceneSwitcher.macroTab.edit.action="Type d'action :"
|
|||||||
AdvSceneSwitcher.macroTab.add="Ajouter une nouvelle macro"
|
AdvSceneSwitcher.macroTab.add="Ajouter une nouvelle macro"
|
||||||
AdvSceneSwitcher.macroTab.name="Nom :"
|
AdvSceneSwitcher.macroTab.name="Nom :"
|
||||||
AdvSceneSwitcher.macroTab.run="Exécuter la macro"
|
AdvSceneSwitcher.macroTab.run="Exécuter la macro"
|
||||||
AdvSceneSwitcher.macroTab.runFail="Échec de l'exécution de \"%1\" !\nSoit l'une des actions a échoué, soit la macro est déjà en cours d'exécution."
|
|
||||||
AdvSceneSwitcher.macroTab.runInParallel="Exécuter la macro en parallèle avec d'autres macros"
|
AdvSceneSwitcher.macroTab.runInParallel="Exécuter la macro en parallèle avec d'autres macros"
|
||||||
AdvSceneSwitcher.macroTab.onChange="Exécuter des actions uniquement en cas de changement de condition"
|
AdvSceneSwitcher.macroTab.onChange="Exécuter des actions uniquement en cas de changement de condition"
|
||||||
AdvSceneSwitcher.macroTab.defaultname="Macro %1"
|
AdvSceneSwitcher.macroTab.defaultname="Macro %1"
|
||||||
AdvSceneSwitcher.macroTab.defaultGroupName="Groupe %1"
|
AdvSceneSwitcher.macroTab.defaultGroupName="Groupe %1"
|
||||||
AdvSceneSwitcher.macroTab.exists="Le nom de la macro existe déjà"
|
AdvSceneSwitcher.macroTab.removeSingleMacroPopup.text="Êtes-vous sûr de vouloir supprimer \"%1\" ?"
|
||||||
AdvSceneSwitcher.macroTab.groupDeleteConfirm="Êtes-vous sûr de vouloir supprimer \"%1\" et tous ses éléments ?"
|
AdvSceneSwitcher.macroTab.removeMultipleMacrosPopup.text="Êtes-vous sûr de vouloir supprimer %1 macros ?"
|
||||||
AdvSceneSwitcher.macroTab.deleteMultipleMacrosConfirmation="Êtes-vous sûr de vouloir supprimer %1 macros ?"
|
AdvSceneSwitcher.macroTab.removeGroupPopup.text="Êtes-vous sûr de vouloir supprimer \"%1\" et tous ses éléments ?"
|
||||||
AdvSceneSwitcher.macroTab.deleteSingleMacroConfirmation="Êtes-vous sûr de vouloir supprimer \"%1\" ?"
|
|
||||||
AdvSceneSwitcher.macroTab.contextMenuAdd="Ajouter"
|
AdvSceneSwitcher.macroTab.contextMenuAdd="Ajouter"
|
||||||
AdvSceneSwitcher.macroTab.copy="Dupliquer la macro"
|
AdvSceneSwitcher.macroTab.copy="Dupliquer la macro"
|
||||||
AdvSceneSwitcher.macroTab.group="Grouper les macros sélectionnées"
|
AdvSceneSwitcher.macroTab.group="Grouper les macros sélectionnées"
|
||||||
@@ -353,8 +351,7 @@ AdvSceneSwitcher.condition.sceneOrder.entry="Sur{{scenes}}{{sources}}{{condition
|
|||||||
AdvSceneSwitcher.condition.hotkey="Raccourci clavier"
|
AdvSceneSwitcher.condition.hotkey="Raccourci clavier"
|
||||||
AdvSceneSwitcher.condition.hotkey.name="Raccourci clavier de déclenchement de macro"
|
AdvSceneSwitcher.condition.hotkey.name="Raccourci clavier de déclenchement de macro"
|
||||||
AdvSceneSwitcher.condition.hotkey.tip="Remarque : Vous pouvez configurer les raccourcis clavier pour ce raccourci dans la fenêtre de paramètres d'OBS"
|
AdvSceneSwitcher.condition.hotkey.tip="Remarque : Vous pouvez configurer les raccourcis clavier pour ce raccourci dans la fenêtre de paramètres d'OBS"
|
||||||
AdvSceneSwitcher.condition.hotkey.entry.line1="Raccourci clavier est enfoncé"
|
AdvSceneSwitcher.condition.hotkey.entry.name="Nom:{{name}}"
|
||||||
AdvSceneSwitcher.condition.hotkey.entry.line2="Nom :{{name}}"
|
|
||||||
AdvSceneSwitcher.condition.replay="Tampon de répétition"
|
AdvSceneSwitcher.condition.replay="Tampon de répétition"
|
||||||
AdvSceneSwitcher.condition.replay.state.stopped="Tampon de répétition arrêté"
|
AdvSceneSwitcher.condition.replay.state.stopped="Tampon de répétition arrêté"
|
||||||
AdvSceneSwitcher.condition.replay.state.started="Tampon de répétition démarré"
|
AdvSceneSwitcher.condition.replay.state.started="Tampon de répétition démarré"
|
||||||
@@ -523,7 +520,7 @@ AdvSceneSwitcher.action.filter.type.enable="Activer"
|
|||||||
AdvSceneSwitcher.action.filter.type.disable="Désactiver"
|
AdvSceneSwitcher.action.filter.type.disable="Désactiver"
|
||||||
AdvSceneSwitcher.action.filter.type.toggle="Basculer"
|
AdvSceneSwitcher.action.filter.type.toggle="Basculer"
|
||||||
AdvSceneSwitcher.action.filter.type.settings="Définir les paramètres"
|
AdvSceneSwitcher.action.filter.type.settings="Définir les paramètres"
|
||||||
AdvSceneSwitcher.action.filter.entry="Sur{{sources}}{{actions}}{{filters}}{{refresh}}"
|
AdvSceneSwitcher.action.filter.entry="Sur{{sources}}{{actions}}{{filters}}{{refresh}}{{settingsButtons}}"
|
||||||
AdvSceneSwitcher.action.filter.getSettings="Obtenir les paramètres actuels"
|
AdvSceneSwitcher.action.filter.getSettings="Obtenir les paramètres actuels"
|
||||||
AdvSceneSwitcher.action.source="Source"
|
AdvSceneSwitcher.action.source="Source"
|
||||||
AdvSceneSwitcher.action.source.type.enable="Activer"
|
AdvSceneSwitcher.action.source.type.enable="Activer"
|
||||||
@@ -535,7 +532,6 @@ AdvSceneSwitcher.action.source.type.refreshSettings.tooltip="Peut être utilisé
|
|||||||
AdvSceneSwitcher.action.source.type.deinterlaceMode="Définir le mode de désentrelacement"
|
AdvSceneSwitcher.action.source.type.deinterlaceMode="Définir le mode de désentrelacement"
|
||||||
AdvSceneSwitcher.action.source.type.deinterlaceOrder="Définir l'ordre de désentrelacement des champs"
|
AdvSceneSwitcher.action.source.type.deinterlaceOrder="Définir l'ordre de désentrelacement des champs"
|
||||||
AdvSceneSwitcher.action.source.type.openInteractionDialog="Ouvrir la boîte de dialogue d'interaction"
|
AdvSceneSwitcher.action.source.type.openInteractionDialog="Ouvrir la boîte de dialogue d'interaction"
|
||||||
AdvSceneSwitcher.action.source.noSettingsButtons="Aucun bouton trouvé !"
|
|
||||||
AdvSceneSwitcher.action.source.warning="Avertissement : Activer et désactiver les sources globalement ne peut pas être contrôlé par l'interface utilisateur d'OBS\nVous pourriez rechercher \"Visibilité de l'élément de scène\""
|
AdvSceneSwitcher.action.source.warning="Avertissement : Activer et désactiver les sources globalement ne peut pas être contrôlé par l'interface utilisateur d'OBS\nVous pourriez rechercher \"Visibilité de l'élément de scène\""
|
||||||
AdvSceneSwitcher.action.source.getSettings="Obtenir les paramètres actuels"
|
AdvSceneSwitcher.action.source.getSettings="Obtenir les paramètres actuels"
|
||||||
AdvSceneSwitcher.action.source.deinterlaceMode.disable="Désactiver"
|
AdvSceneSwitcher.action.source.deinterlaceMode.disable="Désactiver"
|
||||||
@@ -661,7 +657,7 @@ AdvSceneSwitcher.action.sceneCollection="Collection de scènes"
|
|||||||
AdvSceneSwitcher.action.sceneCollection.entry="Changer la collection de scènes active vers{{sceneCollections}}"
|
AdvSceneSwitcher.action.sceneCollection.entry="Changer la collection de scènes active vers{{sceneCollections}}"
|
||||||
AdvSceneSwitcher.action.sceneCollection.warning="Note : Toutes les actions suivantes ne seront pas exécutées car le changement de collection de scènes rechargera également les paramètres du commutateur de scènes. L'action de collection de scènes sera ignorée lorsque la fenêtre des paramètres est ouverte."
|
AdvSceneSwitcher.action.sceneCollection.warning="Note : Toutes les actions suivantes ne seront pas exécutées car le changement de collection de scènes rechargera également les paramètres du commutateur de scènes. L'action de collection de scènes sera ignorée lorsque la fenêtre des paramètres est ouverte."
|
||||||
AdvSceneSwitcher.action.sequence="Séquence"
|
AdvSceneSwitcher.action.sequence="Séquence"
|
||||||
AdvSceneSwitcher.action.sequence.entry="Chaque fois que cette action est effectuée, exécutez le macro suivant dans la liste (les macros en pause sont ignorés)"
|
; AdvSceneSwitcher.action.sequence.entry="Chaque fois que cette action est effectuée, exécutez le macro suivant dans la liste (les macros en pause sont ignorés)"
|
||||||
AdvSceneSwitcher.action.sequence.status="Dernier macro exécuté : %1 - Prochain macro à exécuter : %2"
|
AdvSceneSwitcher.action.sequence.status="Dernier macro exécuté : %1 - Prochain macro à exécuter : %2"
|
||||||
AdvSceneSwitcher.action.sequence.status.none="aucun"
|
AdvSceneSwitcher.action.sequence.status.none="aucun"
|
||||||
AdvSceneSwitcher.action.sequence.restart="Recommencer depuis le début une fois la fin de la liste atteinte"
|
AdvSceneSwitcher.action.sequence.restart="Recommencer depuis le début une fois la fin de la liste atteinte"
|
||||||
@@ -740,6 +736,8 @@ AdvSceneSwitcher.action.twitch.type.channel.info.category.set="Définir la caté
|
|||||||
AdvSceneSwitcher.action.twitch.type.commercial.start="Démarrer une publicité d'une durée de"
|
AdvSceneSwitcher.action.twitch.type.commercial.start="Démarrer une publicité d'une durée de"
|
||||||
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Impossible de sélectionner une catégorie sans avoir d'abord sélectionné un compte Twitch !"
|
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Impossible de sélectionner une catégorie sans avoir d'abord sélectionné un compte Twitch !"
|
||||||
|
|
||||||
|
AdvSceneSwitcher.noSettingsButtons="Aucun bouton trouvé !"
|
||||||
|
|
||||||
; Transition Tab
|
; Transition Tab
|
||||||
AdvSceneSwitcher.transitionTab.title="Transition"
|
AdvSceneSwitcher.transitionTab.title="Transition"
|
||||||
AdvSceneSwitcher.transitionTab.transitionForAToB="Utiliser une transition pour le passage automatisé de la scène A à la scène B"
|
AdvSceneSwitcher.transitionTab.transitionForAToB="Utiliser une transition pour le passage automatisé de la scène A à la scène B"
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ AdvSceneSwitcher.macroTab.edit.action="Тип действия:"
|
|||||||
AdvSceneSwitcher.macroTab.add="Добавить новый макрос"
|
AdvSceneSwitcher.macroTab.add="Добавить новый макрос"
|
||||||
AdvSceneSwitcher.macroTab.name="Имя:"
|
AdvSceneSwitcher.macroTab.name="Имя:"
|
||||||
AdvSceneSwitcher.macroTab.defaultname="Макрос %1"
|
AdvSceneSwitcher.macroTab.defaultname="Макрос %1"
|
||||||
AdvSceneSwitcher.macroTab.exists="Имя макроса уже существует"
|
|
||||||
AdvSceneSwitcher.macroTab.copy="Создать копию"
|
AdvSceneSwitcher.macroTab.copy="Создать копию"
|
||||||
; Macro Logic
|
; Macro Logic
|
||||||
AdvSceneSwitcher.logic.none="Игнорировать вход"
|
AdvSceneSwitcher.logic.none="Игнорировать вход"
|
||||||
|
|||||||
@@ -72,11 +72,9 @@ AdvSceneSwitcher.macroTab.edit.action="Eylem türü:"
|
|||||||
AdvSceneSwitcher.macroTab.add="Yeni Makro ekle"
|
AdvSceneSwitcher.macroTab.add="Yeni Makro ekle"
|
||||||
AdvSceneSwitcher.macroTab.name="İsim:"
|
AdvSceneSwitcher.macroTab.name="İsim:"
|
||||||
AdvSceneSwitcher.macroTab.run="Makro Çalıştırma"
|
AdvSceneSwitcher.macroTab.run="Makro Çalıştırma"
|
||||||
AdvSceneSwitcher.macroTab.runFail="\"%1\" çalıştırılamadı!\n Eylemlerden biri başarısız oldu veya makro zaten çalışıyor."
|
|
||||||
AdvSceneSwitcher.macroTab.runInParallel="Makroyu diğer makrolara paralel olarak çalıştırın"
|
AdvSceneSwitcher.macroTab.runInParallel="Makroyu diğer makrolara paralel olarak çalıştırın"
|
||||||
AdvSceneSwitcher.macroTab.onChange="Eylemleri yalnızca koşul değişikliğinde gerçekleştirin"
|
AdvSceneSwitcher.macroTab.onChange="Eylemleri yalnızca koşul değişikliğinde gerçekleştirin"
|
||||||
AdvSceneSwitcher.macroTab.defaultname="Makro %1"
|
AdvSceneSwitcher.macroTab.defaultname="Makro %1"
|
||||||
AdvSceneSwitcher.macroTab.exists="Macro adı zaten mevcut"
|
|
||||||
AdvSceneSwitcher.macroTab.copy="Kopya oluştur"
|
AdvSceneSwitcher.macroTab.copy="Kopya oluştur"
|
||||||
AdvSceneSwitcher.macroTab.expandAll="Hepsini Genişlet"
|
AdvSceneSwitcher.macroTab.expandAll="Hepsini Genişlet"
|
||||||
AdvSceneSwitcher.macroTab.collapseAll="Hepsini Küçült"
|
AdvSceneSwitcher.macroTab.collapseAll="Hepsini Küçült"
|
||||||
@@ -297,7 +295,7 @@ AdvSceneSwitcher.action.filter="Filtrele"
|
|||||||
AdvSceneSwitcher.action.filter.type.enable="Etkin"
|
AdvSceneSwitcher.action.filter.type.enable="Etkin"
|
||||||
AdvSceneSwitcher.action.filter.type.disable="Etkisiz"
|
AdvSceneSwitcher.action.filter.type.disable="Etkisiz"
|
||||||
AdvSceneSwitcher.action.filter.type.settings="Ayarları yap"
|
AdvSceneSwitcher.action.filter.type.settings="Ayarları yap"
|
||||||
AdvSceneSwitcher.action.filter.entry="Açık{{sources}}{{actions}}{{filters}}{{refresh}}"
|
AdvSceneSwitcher.action.filter.entry="Açık{{sources}}{{actions}}{{filters}}{{refresh}}{{settingsButtons}}"
|
||||||
AdvSceneSwitcher.action.filter.getSettings="Mevcut ayarları al"
|
AdvSceneSwitcher.action.filter.getSettings="Mevcut ayarları al"
|
||||||
AdvSceneSwitcher.action.source="Kaynak"
|
AdvSceneSwitcher.action.source="Kaynak"
|
||||||
AdvSceneSwitcher.action.source.type.enable="Etkin"
|
AdvSceneSwitcher.action.source.type.enable="Etkin"
|
||||||
@@ -317,7 +315,6 @@ AdvSceneSwitcher.action.macro.type.pause="Duraklat"
|
|||||||
AdvSceneSwitcher.action.macro.type.unpause="Duraklatma"
|
AdvSceneSwitcher.action.macro.type.unpause="Duraklatma"
|
||||||
AdvSceneSwitcher.action.macro.type.resetCounter="Sayacı sıfırla"
|
AdvSceneSwitcher.action.macro.type.resetCounter="Sayacı sıfırla"
|
||||||
AdvSceneSwitcher.action.macro.type.run="Çalıştır"
|
AdvSceneSwitcher.action.macro.type.run="Çalıştır"
|
||||||
AdvSceneSwitcher.action.macro.entry="{{actions}}{{actionIndex}}{{macros}}"
|
|
||||||
AdvSceneSwitcher.action.pluginState="Eklenti durumu"
|
AdvSceneSwitcher.action.pluginState="Eklenti durumu"
|
||||||
AdvSceneSwitcher.action.pluginState.type.stop="Advanced Scene Switcher eklentisini durdurun"
|
AdvSceneSwitcher.action.pluginState.type.stop="Advanced Scene Switcher eklentisini durdurun"
|
||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="Eşleşmeme davranışını değiştirin:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="Eşleşmeme davranışını değiştirin:"
|
||||||
|
|||||||
@@ -77,15 +77,13 @@ AdvSceneSwitcher.macroTab.edit.action="动作类型:"
|
|||||||
AdvSceneSwitcher.macroTab.add="添加新宏"
|
AdvSceneSwitcher.macroTab.add="添加新宏"
|
||||||
AdvSceneSwitcher.macroTab.name="名称:"
|
AdvSceneSwitcher.macroTab.name="名称:"
|
||||||
AdvSceneSwitcher.macroTab.run="运行宏"
|
AdvSceneSwitcher.macroTab.run="运行宏"
|
||||||
AdvSceneSwitcher.macroTab.runFail="运行 \"%1\" 失败!\n其中一个操作失败,或者宏已在运行."
|
|
||||||
AdvSceneSwitcher.macroTab.runInParallel="与其他宏同时运行宏"
|
AdvSceneSwitcher.macroTab.runInParallel="与其他宏同时运行宏"
|
||||||
AdvSceneSwitcher.macroTab.onChange="仅在条件更改时执行操作"
|
AdvSceneSwitcher.macroTab.onChange="仅在条件更改时执行操作"
|
||||||
AdvSceneSwitcher.macroTab.defaultname="宏 %1"
|
AdvSceneSwitcher.macroTab.defaultname="宏 %1"
|
||||||
AdvSceneSwitcher.macroTab.defaultGroupName="组 %1"
|
AdvSceneSwitcher.macroTab.defaultGroupName="组 %1"
|
||||||
AdvSceneSwitcher.macroTab.exists="宏名称已存在"
|
AdvSceneSwitcher.macroTab.removeSingleMacroPopup.text="你确定你要删除 \"%1\"?"
|
||||||
AdvSceneSwitcher.macroTab.groupDeleteConfirm="您确定要删除 \"%1\"及其所有元素吗?"
|
AdvSceneSwitcher.macroTab.removeMultipleMacrosPopup.text="您确定要删除 %1 宏吗?"
|
||||||
AdvSceneSwitcher.macroTab.deleteMultipleMacrosConfirmation="您确定要删除 %1 宏吗?"
|
AdvSceneSwitcher.macroTab.removeGroupPopup.text="您确定要删除 \"%1\"及其所有元素吗?"
|
||||||
AdvSceneSwitcher.macroTab.deleteSingleMacroConfirmation="你确定你要删除 \"%1\"?"
|
|
||||||
AdvSceneSwitcher.macroTab.contextMenuAdd="增加"
|
AdvSceneSwitcher.macroTab.contextMenuAdd="增加"
|
||||||
AdvSceneSwitcher.macroTab.copy="创建副本"
|
AdvSceneSwitcher.macroTab.copy="创建副本"
|
||||||
AdvSceneSwitcher.macroTab.group="对选定的宏进行分组"
|
AdvSceneSwitcher.macroTab.group="对选定的宏进行分组"
|
||||||
@@ -334,8 +332,7 @@ AdvSceneSwitcher.condition.sceneOrder.entry="在 {{scenes}} {{sources}} {{condit
|
|||||||
AdvSceneSwitcher.condition.hotkey="热键"
|
AdvSceneSwitcher.condition.hotkey="热键"
|
||||||
AdvSceneSwitcher.condition.hotkey.name="宏触发热键"
|
AdvSceneSwitcher.condition.hotkey.name="宏触发热键"
|
||||||
AdvSceneSwitcher.condition.hotkey.tip="注意:您可以在OBS设置窗口中为此热键配置按键绑定"
|
AdvSceneSwitcher.condition.hotkey.tip="注意:您可以在OBS设置窗口中为此热键配置按键绑定"
|
||||||
AdvSceneSwitcher.condition.hotkey.entry.line1="热键被按下"
|
AdvSceneSwitcher.condition.hotkey.entry.name="名称:{{name}}"
|
||||||
AdvSceneSwitcher.condition.hotkey.entry.line2="名称: {{name}}"
|
|
||||||
AdvSceneSwitcher.condition.replay="回放缓存"
|
AdvSceneSwitcher.condition.replay="回放缓存"
|
||||||
AdvSceneSwitcher.condition.replay.state.stopped="回放缓存已停止"
|
AdvSceneSwitcher.condition.replay.state.stopped="回放缓存已停止"
|
||||||
AdvSceneSwitcher.condition.replay.state.started="回放缓存已启动"
|
AdvSceneSwitcher.condition.replay.state.started="回放缓存已启动"
|
||||||
@@ -502,7 +499,7 @@ AdvSceneSwitcher.action.filter="滤镜"
|
|||||||
AdvSceneSwitcher.action.filter.type.enable="开启"
|
AdvSceneSwitcher.action.filter.type.enable="开启"
|
||||||
AdvSceneSwitcher.action.filter.type.disable="关闭"
|
AdvSceneSwitcher.action.filter.type.disable="关闭"
|
||||||
AdvSceneSwitcher.action.filter.type.settings="参数设置"
|
AdvSceneSwitcher.action.filter.type.settings="参数设置"
|
||||||
AdvSceneSwitcher.action.filter.entry="置{{sources}}{{actions}}{{filters}}{{refresh}}"
|
AdvSceneSwitcher.action.filter.entry="置{{sources}}{{actions}}{{filters}}{{refresh}}{{settingsButtons}}"
|
||||||
AdvSceneSwitcher.action.filter.getSettings="获取当前设置"
|
AdvSceneSwitcher.action.filter.getSettings="获取当前设置"
|
||||||
AdvSceneSwitcher.action.source="源"
|
AdvSceneSwitcher.action.source="源"
|
||||||
AdvSceneSwitcher.action.source.type.enable="启用"
|
AdvSceneSwitcher.action.source.type.enable="启用"
|
||||||
@@ -511,7 +508,6 @@ AdvSceneSwitcher.action.source.type.settings="配置设置"
|
|||||||
AdvSceneSwitcher.action.source.type.refreshSettings="刷新源设置"
|
AdvSceneSwitcher.action.source.type.refreshSettings="刷新源设置"
|
||||||
AdvSceneSwitcher.action.source.type.pressSettingsButton="按下设置按钮"
|
AdvSceneSwitcher.action.source.type.pressSettingsButton="按下设置按钮"
|
||||||
AdvSceneSwitcher.action.source.type.refreshSettings.tooltip="可用于刷新浏览器、媒体、源、etc"
|
AdvSceneSwitcher.action.source.type.refreshSettings.tooltip="可用于刷新浏览器、媒体、源、etc"
|
||||||
AdvSceneSwitcher.action.source.noSettingsButtons="未找到按钮!"
|
|
||||||
AdvSceneSwitcher.action.source.warning="警告:OBS UI无法控制全局启用和禁用源,注意,通过这个设置禁用,我测试,你必须通过这个在启用才行,不然点击小眼睛你无法显示!"
|
AdvSceneSwitcher.action.source.warning="警告:OBS UI无法控制全局启用和禁用源,注意,通过这个设置禁用,我测试,你必须通过这个在启用才行,不然点击小眼睛你无法显示!"
|
||||||
AdvSceneSwitcher.action.source.getSettings="获取当前设置"
|
AdvSceneSwitcher.action.source.getSettings="获取当前设置"
|
||||||
AdvSceneSwitcher.action.media="媒体"
|
AdvSceneSwitcher.action.media="媒体"
|
||||||
@@ -528,7 +524,6 @@ AdvSceneSwitcher.action.macro.type.unpause="取消暂停"
|
|||||||
AdvSceneSwitcher.action.macro.type.resetCounter="复位计数器"
|
AdvSceneSwitcher.action.macro.type.resetCounter="复位计数器"
|
||||||
AdvSceneSwitcher.action.macro.type.run="运行操作"
|
AdvSceneSwitcher.action.macro.type.run="运行操作"
|
||||||
AdvSceneSwitcher.action.macro.type.stop="停止操作"
|
AdvSceneSwitcher.action.macro.type.stop="停止操作"
|
||||||
AdvSceneSwitcher.action.macro.entry="{{actions}}{{actionIndex}}{{macros}}"
|
|
||||||
AdvSceneSwitcher.action.pluginState="插件状态"
|
AdvSceneSwitcher.action.pluginState="插件状态"
|
||||||
AdvSceneSwitcher.action.pluginState.type.stop="停止高级场景切换插件"
|
AdvSceneSwitcher.action.pluginState.type.stop="停止高级场景切换插件"
|
||||||
AdvSceneSwitcher.action.pluginState.type.noMatch="没有匹配项时:"
|
AdvSceneSwitcher.action.pluginState.type.noMatch="没有匹配项时:"
|
||||||
@@ -608,7 +603,7 @@ AdvSceneSwitcher.action.sceneCollection="场景集合"
|
|||||||
AdvSceneSwitcher.action.sceneCollection.entry="将活动场景集合切换到 {{sceneCollections}}"
|
AdvSceneSwitcher.action.sceneCollection.entry="将活动场景集合切换到 {{sceneCollections}}"
|
||||||
AdvSceneSwitcher.action.sceneCollection.warning="注意:在此之后的任何操作都不会执行,因为更改场景集合也会重新加载场景切换器设置。\n打开“设置”窗口时,场景采集操作将被忽略."
|
AdvSceneSwitcher.action.sceneCollection.warning="注意:在此之后的任何操作都不会执行,因为更改场景集合也会重新加载场景切换器设置。\n打开“设置”窗口时,场景采集操作将被忽略."
|
||||||
AdvSceneSwitcher.action.sequence="场景序列"
|
AdvSceneSwitcher.action.sequence="场景序列"
|
||||||
AdvSceneSwitcher.action.sequence.entry="每次执行此操作时,运行列表中的下一个宏(暂停的宏将被忽略)"
|
; AdvSceneSwitcher.action.sequence.entry="每次执行此操作时,运行列表中的下一个宏(暂停的宏将被忽略)"
|
||||||
AdvSceneSwitcher.action.sequence.status="上次执行的宏:%1 - 要执行的下一个宏: %2"
|
AdvSceneSwitcher.action.sequence.status="上次执行的宏:%1 - 要执行的下一个宏: %2"
|
||||||
AdvSceneSwitcher.action.sequence.status.none="无"
|
AdvSceneSwitcher.action.sequence.status.none="无"
|
||||||
AdvSceneSwitcher.action.sequence.restart="到达列表末尾后,从开头重新启动"
|
AdvSceneSwitcher.action.sequence.restart="到达列表末尾后,从开头重新启动"
|
||||||
@@ -663,6 +658,8 @@ AdvSceneSwitcher.action.midi.entry="发送消息到 {{device}}:"
|
|||||||
AdvSceneSwitcher.action.midi.entry.listen="将MIDI消息选择设置为 {{listenDevices}} 上传入的消息: {{listenButton}}"
|
AdvSceneSwitcher.action.midi.entry.listen="将MIDI消息选择设置为 {{listenDevices}} 上传入的消息: {{listenButton}}"
|
||||||
AdvSceneSwitcher.action.osc="打开声音控制"
|
AdvSceneSwitcher.action.osc="打开声音控制"
|
||||||
|
|
||||||
|
AdvSceneSwitcher.noSettingsButtons="未找到按钮!"
|
||||||
|
|
||||||
; Transition Tab
|
; Transition Tab
|
||||||
AdvSceneSwitcher.transitionTab.title="转场特效"
|
AdvSceneSwitcher.transitionTab.title="转场特效"
|
||||||
AdvSceneSwitcher.transitionTab.transitionForAToB="当自动从场景A切换到场景B时使用的转场特效"
|
AdvSceneSwitcher.transitionTab.transitionForAToB="当自动从场景A切换到场景B时使用的转场特效"
|
||||||
|
|||||||
@@ -163,12 +163,31 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_52">
|
<layout class="QHBoxLayout" name="horizontalLayout_52">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="verboseLogging">
|
<widget class="QLabel" name="label_21">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging</string>
|
<string>AdvSceneSwitcher.generalTab.generalBehavior.logLevel</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="logLevel">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>AdvSceneSwitcher.generalTab.generalBehavior.logLevel.printActions</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_49">
|
<spacer name="horizontalSpacer_49">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@@ -883,6 +902,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="runMacroInParallel">
|
<widget class="QCheckBox" name="runMacroInParallel">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.runInParallel</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -903,6 +925,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="runMacroOnChange">
|
<widget class="QCheckBox" name="runMacroOnChange">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.macroTab.onChange</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -1577,104 +1602,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="variableTab">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>AdvSceneSwitcher.variableTab.title</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_33">
|
|
||||||
<item>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_25">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QTableWidget" name="variables">
|
|
||||||
<property name="editTriggers">
|
|
||||||
<set>QAbstractItemView::NoEditTriggers</set>
|
|
||||||
</property>
|
|
||||||
<property name="selectionBehavior">
|
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
|
||||||
</property>
|
|
||||||
<property name="showGrid">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="cornerButtonEnabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<attribute name="verticalHeaderVisible">
|
|
||||||
<bool>false</bool>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="variablesHelp">
|
|
||||||
<property name="text">
|
|
||||||
<string>AdvSceneSwitcher.variableTab.help</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_30">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="variableAdd">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>22</width>
|
|
||||||
<height>22</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>AdvSceneSwitcher.variableTab.tooltip.variableAddButton</string>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="themeID" stdset="0">
|
|
||||||
<string notr="true">addIconSmall</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="variableRemove">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>22</width>
|
|
||||||
<height>22</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>AdvSceneSwitcher.variableTab.tooltip.variableRemoveButton</string>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="themeID" stdset="0">
|
|
||||||
<string notr="true">removeIconSmall</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_211">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="networkTab">
|
<widget class="QWidget" name="networkTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>AdvSceneSwitcher.networkTab.title</string>
|
<string>AdvSceneSwitcher.networkTab.title</string>
|
||||||
@@ -5078,7 +5005,7 @@
|
|||||||
<tabstop>checkInterval</tabstop>
|
<tabstop>checkInterval</tabstop>
|
||||||
<tabstop>startupBehavior</tabstop>
|
<tabstop>startupBehavior</tabstop>
|
||||||
<tabstop>autoStartEvent</tabstop>
|
<tabstop>autoStartEvent</tabstop>
|
||||||
<tabstop>verboseLogging</tabstop>
|
<tabstop>logLevel</tabstop>
|
||||||
<tabstop>saveWindowGeo</tabstop>
|
<tabstop>saveWindowGeo</tabstop>
|
||||||
<tabstop>showTrayNotifications</tabstop>
|
<tabstop>showTrayNotifications</tabstop>
|
||||||
<tabstop>uiHintsDisable</tabstop>
|
<tabstop>uiHintsDisable</tabstop>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "advanced-scene-switcher.hpp"
|
#include "advanced-scene-switcher.hpp"
|
||||||
|
#include "backup.hpp"
|
||||||
#include "curl-helper.hpp"
|
#include "curl-helper.hpp"
|
||||||
#include "log-helper.hpp"
|
#include "log-helper.hpp"
|
||||||
#include "macro-helpers.hpp"
|
#include "macro-helpers.hpp"
|
||||||
@@ -10,6 +11,7 @@
|
|||||||
#include "status-control.hpp"
|
#include "status-control.hpp"
|
||||||
#include "switcher-data.hpp"
|
#include "switcher-data.hpp"
|
||||||
#include "ui-helpers.hpp"
|
#include "ui-helpers.hpp"
|
||||||
|
#include "tab-helpers.hpp"
|
||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
@@ -17,7 +19,6 @@
|
|||||||
#include <obs-frontend-api.h>
|
#include <obs-frontend-api.h>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
#include <QFileDialog>
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
@@ -44,7 +45,7 @@ AdvSceneSwitcher::~AdvSceneSwitcher()
|
|||||||
{
|
{
|
||||||
if (switcher) {
|
if (switcher) {
|
||||||
switcher->settingsWindowOpened = false;
|
switcher->settingsWindowOpened = false;
|
||||||
switcher->lastOpenedTab = ui->tabWidget->currentIndex();
|
SaveLastOpenedTab(ui->tabWidget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,11 +113,11 @@ void AdvSceneSwitcher::LoadUI()
|
|||||||
SetupSceneGroupTab();
|
SetupSceneGroupTab();
|
||||||
SetupTriggerTab();
|
SetupTriggerTab();
|
||||||
SetupMacroTab();
|
SetupMacroTab();
|
||||||
SetupVariableTab();
|
SetupOtherTabs(ui->tabWidget);
|
||||||
|
|
||||||
SetDeprecationWarnings();
|
SetDeprecationWarnings();
|
||||||
SetTabOrder();
|
SetTabOrder(ui->tabWidget);
|
||||||
SetCurrentTab();
|
SetCurrentTab(ui->tabWidget);
|
||||||
RestoreWindowGeo();
|
RestoreWindowGeo();
|
||||||
CheckFirstTimeSetup();
|
CheckFirstTimeSetup();
|
||||||
|
|
||||||
@@ -135,6 +136,17 @@ bool AdvSceneSwitcher::eventFilter(QObject *obj, QEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetElseActionsStateToVisible();
|
SetElseActionsStateToVisible();
|
||||||
|
} else if (eventType == QEvent::KeyPress) {
|
||||||
|
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
|
||||||
|
auto pressedKey = keyEvent->key();
|
||||||
|
|
||||||
|
if (obj == ui->macros && ui->macros->isVisible()) {
|
||||||
|
if (pressedKey == Qt::Key_F2) {
|
||||||
|
RenameSelectedMacro();
|
||||||
|
} else if (pressedKey == Qt::Key_Delete) {
|
||||||
|
RemoveSelectedMacros();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QDialog::eventFilter(obj, event);
|
return QDialog::eventFilter(obj, event);
|
||||||
@@ -143,7 +155,6 @@ bool AdvSceneSwitcher::eventFilter(QObject *obj, QEvent *event)
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Saving and loading
|
* Saving and loading
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
static void AskForBackup(const QString &json);
|
|
||||||
|
|
||||||
static void SaveSceneSwitcher(obs_data_t *save_data, bool saving, void *)
|
static void SaveSceneSwitcher(obs_data_t *save_data, bool saving, void *)
|
||||||
{
|
{
|
||||||
@@ -192,34 +203,6 @@ static void SaveSceneSwitcher(obs_data_t *save_data, bool saving, void *)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AskForBackup(const QString &json)
|
|
||||||
{
|
|
||||||
const bool backupWasConfirmed = DisplayMessage(
|
|
||||||
obs_module_text("AdvSceneSwitcher.askBackup"), true, false);
|
|
||||||
|
|
||||||
if (!backupWasConfirmed) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString path = QFileDialog::getSaveFileName(
|
|
||||||
nullptr,
|
|
||||||
obs_module_text(
|
|
||||||
"AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle"),
|
|
||||||
GetDefaultSettingsSaveLocation(),
|
|
||||||
obs_module_text(
|
|
||||||
"AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType"));
|
|
||||||
if (path.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QFile file(path);
|
|
||||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
auto out = QTextStream(&file);
|
|
||||||
out << json;
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Main switcher thread
|
* Main switcher thread
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
@@ -257,7 +240,7 @@ void SwitcherData::Thread()
|
|||||||
if (duration.count() < 1) {
|
if (duration.count() < 1) {
|
||||||
blog(LOG_INFO,
|
blog(LOG_INFO,
|
||||||
"detected busy loop - refusing to sleep less than 1ms");
|
"detected busy loop - refusing to sleep less than 1ms");
|
||||||
duration = std::chrono::milliseconds(50);
|
duration = std::chrono::milliseconds(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -539,9 +522,7 @@ bool SwitcherData::AnySceneTransitionStarted()
|
|||||||
extern "C" EXPORT void FreeSceneSwitcher()
|
extern "C" EXPORT void FreeSceneSwitcher()
|
||||||
{
|
{
|
||||||
PlatformCleanup();
|
PlatformCleanup();
|
||||||
for (const auto &cleanupStep : switcher->pluginCleanupSteps) {
|
RunPluginCleanupSteps();
|
||||||
cleanupStep();
|
|
||||||
}
|
|
||||||
|
|
||||||
delete switcher;
|
delete switcher;
|
||||||
switcher = nullptr;
|
switcher = nullptr;
|
||||||
@@ -635,6 +616,8 @@ static void handleShutdown()
|
|||||||
// TODO: Look for a way to possibly resolve this
|
// TODO: Look for a way to possibly resolve this
|
||||||
obs_frontend_save();
|
obs_frontend_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BackupSettingsOfCurrentVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handleSceneCollectionChanging()
|
static void handleSceneCollectionChanging()
|
||||||
@@ -769,13 +752,6 @@ QWidget *GetSettingsWindow()
|
|||||||
|
|
||||||
void SetupActionQueues();
|
void SetupActionQueues();
|
||||||
|
|
||||||
extern "C" EXPORT void RunPluginPostLoadSteps()
|
|
||||||
{
|
|
||||||
for (const auto &postLoadStep : switcher->pluginPostLoadSteps) {
|
|
||||||
postLoadStep();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" EXPORT void InitSceneSwitcher(obs_module_t *module,
|
extern "C" EXPORT void InitSceneSwitcher(obs_module_t *module,
|
||||||
translateFunc translate)
|
translateFunc translate)
|
||||||
{
|
{
|
||||||
@@ -789,9 +765,7 @@ extern "C" EXPORT void InitSceneSwitcher(obs_module_t *module,
|
|||||||
SetupDock();
|
SetupDock();
|
||||||
SetupActionQueues();
|
SetupActionQueues();
|
||||||
|
|
||||||
for (const auto &initStep : switcher->pluginInitSteps) {
|
RunPluginInitSteps();
|
||||||
initStep();
|
|
||||||
}
|
|
||||||
|
|
||||||
obs_frontend_add_save_callback(SaveSceneSwitcher, nullptr);
|
obs_frontend_add_save_callback(SaveSceneSwitcher, nullptr);
|
||||||
obs_frontend_add_event_callback(OBSEvent, switcher);
|
obs_frontend_add_event_callback(OBSEvent, switcher);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class MacroActionEdit;
|
|||||||
class MacroConditionEdit;
|
class MacroConditionEdit;
|
||||||
class Duration;
|
class Duration;
|
||||||
class SequenceWidget;
|
class SequenceWidget;
|
||||||
|
enum class LogicType;
|
||||||
struct SceneGroup;
|
struct SceneGroup;
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@@ -34,8 +35,6 @@ public:
|
|||||||
|
|
||||||
void LoadUI();
|
void LoadUI();
|
||||||
|
|
||||||
void SetTabOrder();
|
|
||||||
void SetCurrentTab();
|
|
||||||
void RestoreWindowGeo();
|
void RestoreWindowGeo();
|
||||||
void CheckFirstTimeSetup();
|
void CheckFirstTimeSetup();
|
||||||
|
|
||||||
@@ -55,14 +54,13 @@ public slots:
|
|||||||
void NoMatchDelayDurationChanged(const Duration &);
|
void NoMatchDelayDurationChanged(const Duration &);
|
||||||
void CooldownDurationChanged(const Duration &);
|
void CooldownDurationChanged(const Duration &);
|
||||||
void on_startupBehavior_currentIndexChanged(int index);
|
void on_startupBehavior_currentIndexChanged(int index);
|
||||||
|
void on_logLevel_currentIndexChanged(int index);
|
||||||
void on_autoStartEvent_currentIndexChanged(int index);
|
void on_autoStartEvent_currentIndexChanged(int index);
|
||||||
void on_noMatchSwitchScene_currentTextChanged(const QString &text);
|
void on_noMatchSwitchScene_currentTextChanged(const QString &text);
|
||||||
void on_checkInterval_valueChanged(int value);
|
void on_checkInterval_valueChanged(int value);
|
||||||
void on_tabMoved(int from, int to);
|
|
||||||
void on_tabWidget_currentChanged(int index);
|
void on_tabWidget_currentChanged(int index);
|
||||||
void on_exportSettings_clicked();
|
void on_exportSettings_clicked();
|
||||||
void on_importSettings_clicked();
|
void on_importSettings_clicked();
|
||||||
void on_verboseLogging_stateChanged(int state);
|
|
||||||
void on_saveWindowGeo_stateChanged(int state);
|
void on_saveWindowGeo_stateChanged(int state);
|
||||||
void on_showTrayNotifications_stateChanged(int state);
|
void on_showTrayNotifications_stateChanged(int state);
|
||||||
void on_uiHintsDisable_stateChanged(int state);
|
void on_uiHintsDisable_stateChanged(int state);
|
||||||
@@ -81,6 +79,7 @@ public:
|
|||||||
bool AddNewMacro(std::shared_ptr<Macro> &res, std::string &name,
|
bool AddNewMacro(std::shared_ptr<Macro> &res, std::string &name,
|
||||||
std::string format = "");
|
std::string format = "");
|
||||||
void RemoveMacro(std::shared_ptr<Macro> &);
|
void RemoveMacro(std::shared_ptr<Macro> &);
|
||||||
|
void RemoveSelectedMacros();
|
||||||
void RenameMacro(std::shared_ptr<Macro> &, const QString &name);
|
void RenameMacro(std::shared_ptr<Macro> &, const QString &name);
|
||||||
std::shared_ptr<Macro> GetSelectedMacro();
|
std::shared_ptr<Macro> GetSelectedMacro();
|
||||||
std::vector<std::shared_ptr<Macro>> GetSelectedMacros();
|
std::vector<std::shared_ptr<Macro>> GetSelectedMacros();
|
||||||
@@ -135,7 +134,7 @@ public slots:
|
|||||||
void ShowMacroElseActionsContextMenu(const QPoint &);
|
void ShowMacroElseActionsContextMenu(const QPoint &);
|
||||||
void ShowMacroConditionsContextMenu(const QPoint &);
|
void ShowMacroConditionsContextMenu(const QPoint &);
|
||||||
void CopyMacro();
|
void CopyMacro();
|
||||||
void RenameCurrentMacro();
|
void RenameSelectedMacro();
|
||||||
void ExportMacros();
|
void ExportMacros();
|
||||||
void ImportMacros();
|
void ImportMacros();
|
||||||
void ExpandAllActions();
|
void ExpandAllActions();
|
||||||
@@ -154,12 +153,16 @@ public slots:
|
|||||||
void SetElseActionsStateToVisible();
|
void SetElseActionsStateToVisible();
|
||||||
void MacroActionSelectionChanged(int idx);
|
void MacroActionSelectionChanged(int idx);
|
||||||
void MacroActionReorder(int to, int target);
|
void MacroActionReorder(int to, int target);
|
||||||
|
void AddMacroAction(Macro *macro, int idx, const std::string &id,
|
||||||
|
obs_data_t *data);
|
||||||
void AddMacroAction(int idx);
|
void AddMacroAction(int idx);
|
||||||
void RemoveMacroAction(int idx);
|
void RemoveMacroAction(int idx);
|
||||||
void MoveMacroActionUp(int idx);
|
void MoveMacroActionUp(int idx);
|
||||||
void MoveMacroActionDown(int idx);
|
void MoveMacroActionDown(int idx);
|
||||||
void MacroElseActionSelectionChanged(int idx);
|
void MacroElseActionSelectionChanged(int idx);
|
||||||
void MacroElseActionReorder(int to, int target);
|
void MacroElseActionReorder(int to, int target);
|
||||||
|
void AddMacroElseAction(Macro *macro, int idx, const std::string &id,
|
||||||
|
obs_data_t *data);
|
||||||
void AddMacroElseAction(int idx);
|
void AddMacroElseAction(int idx);
|
||||||
void RemoveMacroElseAction(int idx);
|
void RemoveMacroElseAction(int idx);
|
||||||
void SwapElseActions(Macro *m, int pos1, int pos2);
|
void SwapElseActions(Macro *m, int pos1, int pos2);
|
||||||
@@ -168,16 +171,16 @@ public slots:
|
|||||||
void MacroConditionSelectionChanged(int idx);
|
void MacroConditionSelectionChanged(int idx);
|
||||||
void MacroConditionReorder(int to, int target);
|
void MacroConditionReorder(int to, int target);
|
||||||
void AddMacroCondition(int idx);
|
void AddMacroCondition(int idx);
|
||||||
|
void AddMacroCondition(Macro *macro, int idx, const std::string &id,
|
||||||
|
obs_data_t *data, LogicType logic);
|
||||||
void RemoveMacroCondition(int idx);
|
void RemoveMacroCondition(int idx);
|
||||||
void MoveMacroConditionUp(int idx);
|
void MoveMacroConditionUp(int idx);
|
||||||
void MoveMacroConditionDown(int idx);
|
void MoveMacroConditionDown(int idx);
|
||||||
void FadeOutActionControls();
|
|
||||||
void FadeOutConditionControls();
|
|
||||||
void ResetOpacityActionControls();
|
|
||||||
void ResetOpacityConditionControls();
|
|
||||||
void HighlightControls();
|
void HighlightControls();
|
||||||
void HighlightOnChange();
|
void HighlightOnChange();
|
||||||
void on_macroProperties_clicked();
|
void on_macroProperties_clicked();
|
||||||
|
void CopyMacroSegment();
|
||||||
|
void PasteMacroSegment();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void MacroAdded(const QString &name);
|
void MacroAdded(const QString &name);
|
||||||
@@ -186,9 +189,6 @@ signals:
|
|||||||
void MacroSegmentOrderChanged();
|
void MacroSegmentOrderChanged();
|
||||||
void SegmentTempVarsChanged();
|
void SegmentTempVarsChanged();
|
||||||
void HighlightMacrosChanged(bool value);
|
void HighlightMacrosChanged(bool value);
|
||||||
void HighlightActionsChanged(bool value);
|
|
||||||
void HighlightElseActionsChanged(bool value);
|
|
||||||
void HighlightConditionsChanged(bool value);
|
|
||||||
|
|
||||||
void ConnectionAdded(const QString &);
|
void ConnectionAdded(const QString &);
|
||||||
void ConnectionRenamed(const QString &oldName, const QString &newName);
|
void ConnectionRenamed(const QString &oldName, const QString &newName);
|
||||||
@@ -208,16 +208,6 @@ private:
|
|||||||
|
|
||||||
/* --- End of macro tab section --- */
|
/* --- End of macro tab section --- */
|
||||||
|
|
||||||
/* --- Begin of variable tab section --- */
|
|
||||||
public:
|
|
||||||
void SetupVariableTab();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void on_variableAdd_clicked();
|
|
||||||
void on_variableRemove_clicked();
|
|
||||||
|
|
||||||
/* --- End of variable tab section --- */
|
|
||||||
|
|
||||||
/* --- Begin of legacy tab section --- */
|
/* --- Begin of legacy tab section --- */
|
||||||
public:
|
public:
|
||||||
void ClearFrames(QListWidget *list);
|
void ClearFrames(QListWidget *list);
|
||||||
|
|||||||
144
lib/general.cpp
144
lib/general.cpp
@@ -9,6 +9,7 @@
|
|||||||
#include "splitter-helpers.hpp"
|
#include "splitter-helpers.hpp"
|
||||||
#include "status-control.hpp"
|
#include "status-control.hpp"
|
||||||
#include "switcher-data.hpp"
|
#include "switcher-data.hpp"
|
||||||
|
#include "tab-helpers.hpp"
|
||||||
#include "ui-helpers.hpp"
|
#include "ui-helpers.hpp"
|
||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
#include "variable.hpp"
|
#include "variable.hpp"
|
||||||
@@ -19,17 +20,6 @@
|
|||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
static constexpr std::array<const char *, 19> tabNames = {
|
|
||||||
"generalTab", "macroTab", "variableTab",
|
|
||||||
"windowTitleTab", "executableTab", "screenRegionTab",
|
|
||||||
"mediaTab", "fileTab", "randomTab",
|
|
||||||
"timeTab", "idleTab", "sceneSequenceTab",
|
|
||||||
"audioTab", "videoTab", "networkTab",
|
|
||||||
"sceneGroupTab", "transitionsTab", "pauseTab",
|
|
||||||
"sceneTriggerTab"};
|
|
||||||
|
|
||||||
static std::vector<int> tabOrder = std::vector<int>(tabNames.size());
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::reject()
|
void AdvSceneSwitcher::reject()
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
@@ -112,6 +102,14 @@ void AdvSceneSwitcher::on_startupBehavior_currentIndexChanged(int index)
|
|||||||
static_cast<SwitcherData::StartupBehavior>(index);
|
static_cast<SwitcherData::StartupBehavior>(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::on_logLevel_currentIndexChanged(int value)
|
||||||
|
{
|
||||||
|
if (loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switcher->logLevel = static_cast<SwitcherData::LogLevel>(value);
|
||||||
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_autoStartEvent_currentIndexChanged(int index)
|
void AdvSceneSwitcher::on_autoStartEvent_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if (loading) {
|
if (loading) {
|
||||||
@@ -157,15 +155,6 @@ void AdvSceneSwitcher::closeEvent(QCloseEvent *)
|
|||||||
obs_frontend_save();
|
obs_frontend_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_verboseLogging_stateChanged(int state)
|
|
||||||
{
|
|
||||||
if (loading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switcher->verbose = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_saveWindowGeo_stateChanged(int state)
|
void AdvSceneSwitcher::on_saveWindowGeo_stateChanged(int state)
|
||||||
{
|
{
|
||||||
if (loading) {
|
if (loading) {
|
||||||
@@ -245,14 +234,7 @@ void AdvSceneSwitcher::on_hideLegacyTabs_stateChanged(int state)
|
|||||||
|
|
||||||
for (int idx = 0; idx < ui->tabWidget->count(); idx++) {
|
for (int idx = 0; idx < ui->tabWidget->count(); idx++) {
|
||||||
if (isLegacyTab(ui->tabWidget->tabText(idx))) {
|
if (isLegacyTab(ui->tabWidget->tabText(idx))) {
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
// TODO: Switch to setTabVisible() once QT 5.15 is more wide spread
|
|
||||||
ui->tabWidget->setTabEnabled(idx, !state);
|
|
||||||
ui->tabWidget->setStyleSheet(
|
|
||||||
"QTabBar::tab::disabled {width: 0; height: 0; margin: 0; padding: 0; border: none;} ");
|
|
||||||
#else
|
|
||||||
ui->tabWidget->setTabVisible(idx, !state);
|
ui->tabWidget->setTabVisible(idx, !state);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -364,67 +346,6 @@ void AdvSceneSwitcher::on_importSettings_clicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int findTabIndex(QTabWidget *tabWidget, int pos)
|
|
||||||
{
|
|
||||||
int at = -1;
|
|
||||||
QString tabName = tabNames.at(pos);
|
|
||||||
QWidget *page = tabWidget->findChild<QWidget *>(tabName);
|
|
||||||
if (page) {
|
|
||||||
at = tabWidget->indexOf(page);
|
|
||||||
}
|
|
||||||
if (at == -1) {
|
|
||||||
blog(LOG_INFO, "failed to find tab %s",
|
|
||||||
tabName.toUtf8().constData());
|
|
||||||
}
|
|
||||||
|
|
||||||
return at;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool tabWidgetOrderValid()
|
|
||||||
{
|
|
||||||
auto tmp = std::vector<int>(tabNames.size());
|
|
||||||
std::iota(tmp.begin(), tmp.end(), 0);
|
|
||||||
|
|
||||||
for (auto &p : tmp) {
|
|
||||||
auto it = std::find(tabOrder.begin(), tabOrder.end(), p);
|
|
||||||
if (it == tabOrder.end()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void resetTabWidgetOrder()
|
|
||||||
{
|
|
||||||
tabOrder = std::vector<int>(tabNames.size());
|
|
||||||
std::iota(tabOrder.begin(), tabOrder.end(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::SetTabOrder()
|
|
||||||
{
|
|
||||||
if (!tabWidgetOrderValid()) {
|
|
||||||
resetTabWidgetOrder();
|
|
||||||
}
|
|
||||||
|
|
||||||
QTabBar *bar = ui->tabWidget->tabBar();
|
|
||||||
for (int i = 0; i < bar->count(); ++i) {
|
|
||||||
int curPos = findTabIndex(ui->tabWidget, tabOrder[i]);
|
|
||||||
|
|
||||||
if (i != curPos && curPos != -1) {
|
|
||||||
bar->moveTab(curPos, i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
connect(bar, &QTabBar::tabMoved, this, &AdvSceneSwitcher::on_tabMoved);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::SetCurrentTab()
|
|
||||||
{
|
|
||||||
if (switcher->lastOpenedTab >= 0) {
|
|
||||||
ui->tabWidget->setCurrentIndex(switcher->lastOpenedTab);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool windowPosValid(QPoint pos)
|
static bool windowPosValid(QPoint pos)
|
||||||
{
|
{
|
||||||
return !!QGuiApplication::screenAt(pos);
|
return !!QGuiApplication::screenAt(pos);
|
||||||
@@ -447,17 +368,12 @@ void AdvSceneSwitcher::CheckFirstTimeSetup()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_tabMoved(int from, int to)
|
void AdvSceneSwitcher::on_tabWidget_currentChanged(int)
|
||||||
{
|
{
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::swap(tabOrder[from], tabOrder[to]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_tabWidget_currentChanged(int)
|
|
||||||
{
|
|
||||||
switcher->showFrame = false;
|
switcher->showFrame = false;
|
||||||
ClearFrames(ui->screenRegionSwitches);
|
ClearFrames(ui->screenRegionSwitches);
|
||||||
SetShowFrames();
|
SetShowFrames();
|
||||||
@@ -538,7 +454,7 @@ void SwitcherData::LoadSettings(obs_data_t *obj)
|
|||||||
RunPostLoadSteps();
|
RunPostLoadSteps();
|
||||||
|
|
||||||
// Reset on startup and scene collection change
|
// Reset on startup and scene collection change
|
||||||
switcher->lastOpenedTab = -1;
|
ResetLastOpenedTab();
|
||||||
startupLoadDone = true;
|
startupLoadDone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -598,7 +514,7 @@ void SwitcherData::SaveGeneralSettings(obs_data_t *obj)
|
|||||||
obs_data_set_int(obj, "autoStartEvent",
|
obs_data_set_int(obj, "autoStartEvent",
|
||||||
static_cast<int>(autoStartEvent));
|
static_cast<int>(autoStartEvent));
|
||||||
|
|
||||||
obs_data_set_bool(obj, "verbose", verbose);
|
obs_data_set_int(obj, "logLevel", static_cast<int>(logLevel));
|
||||||
obs_data_set_bool(obj, "showSystemTrayNotifications",
|
obs_data_set_bool(obj, "showSystemTrayNotifications",
|
||||||
showSystemTrayNotifications);
|
showSystemTrayNotifications);
|
||||||
obs_data_set_bool(obj, "disableHints", disableHints);
|
obs_data_set_bool(obj, "disableHints", disableHints);
|
||||||
@@ -649,7 +565,7 @@ void SwitcherData::LoadGeneralSettings(obs_data_t *obj)
|
|||||||
autoStartEvent =
|
autoStartEvent =
|
||||||
static_cast<AutoStart>(obs_data_get_int(obj, "autoStartEvent"));
|
static_cast<AutoStart>(obs_data_get_int(obj, "autoStartEvent"));
|
||||||
|
|
||||||
verbose = obs_data_get_bool(obj, "verbose");
|
logLevel = static_cast<LogLevel>(obs_data_get_int(obj, "logLevel"));
|
||||||
showSystemTrayNotifications =
|
showSystemTrayNotifications =
|
||||||
obs_data_get_bool(obj, "showSystemTrayNotifications");
|
obs_data_get_bool(obj, "showSystemTrayNotifications");
|
||||||
disableHints = obs_data_get_bool(obj, "disableHints");
|
disableHints = obs_data_get_bool(obj, "disableHints");
|
||||||
@@ -686,13 +602,7 @@ void SwitcherData::LoadGeneralSettings(obs_data_t *obj)
|
|||||||
|
|
||||||
void SwitcherData::SaveUISettings(obs_data_t *obj)
|
void SwitcherData::SaveUISettings(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
OBSDataArrayAutoRelease tabWidgetOrder = obs_data_array_create();
|
SaveTabOrder(obj);
|
||||||
for (size_t i = 0; i < tabNames.size(); i++) {
|
|
||||||
OBSDataAutoRelease entry = obs_data_create();
|
|
||||||
obs_data_set_int(entry, tabNames[i], tabOrder[i]);
|
|
||||||
obs_data_array_push_back(tabWidgetOrder, entry);
|
|
||||||
}
|
|
||||||
obs_data_set_array(obj, "tabWidgetOrder", tabWidgetOrder);
|
|
||||||
|
|
||||||
obs_data_set_bool(obj, "saveWindowGeo", saveWindowGeo);
|
obs_data_set_bool(obj, "saveWindowGeo", saveWindowGeo);
|
||||||
obs_data_set_int(obj, "windowPosX", windowPos.x());
|
obs_data_set_int(obj, "windowPosX", windowPos.x());
|
||||||
@@ -706,28 +616,7 @@ void SwitcherData::SaveUISettings(obs_data_t *obj)
|
|||||||
|
|
||||||
void SwitcherData::LoadUISettings(obs_data_t *obj)
|
void SwitcherData::LoadUISettings(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
OBSDataArrayAutoRelease defaultTabWidgetOrder = obs_data_array_create();
|
LoadTabOrder(obj);
|
||||||
for (size_t i = 0; i < tabNames.size(); i++) {
|
|
||||||
OBSDataAutoRelease entry = obs_data_create();
|
|
||||||
obs_data_set_default_int(entry, tabNames[i], i);
|
|
||||||
obs_data_array_push_back(defaultTabWidgetOrder, entry);
|
|
||||||
}
|
|
||||||
obs_data_set_default_array(obj, "tabWidgetOrder",
|
|
||||||
defaultTabWidgetOrder);
|
|
||||||
|
|
||||||
tabOrder.clear();
|
|
||||||
OBSDataArrayAutoRelease tabWidgetOrder =
|
|
||||||
obs_data_get_array(obj, "tabWidgetOrder");
|
|
||||||
for (size_t i = 0; i < tabNames.size(); i++) {
|
|
||||||
OBSDataAutoRelease entry =
|
|
||||||
obs_data_array_item(tabWidgetOrder, i);
|
|
||||||
tabOrder.emplace_back(
|
|
||||||
(int)(obs_data_get_int(entry, tabNames[i])));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tabWidgetOrderValid()) {
|
|
||||||
resetTabWidgetOrder();
|
|
||||||
}
|
|
||||||
|
|
||||||
saveWindowGeo = obs_data_get_bool(obj, "saveWindowGeo");
|
saveWindowGeo = obs_data_get_bool(obj, "saveWindowGeo");
|
||||||
windowPos = {(int)obs_data_get_int(obj, "windowPosX"),
|
windowPos = {(int)obs_data_get_int(obj, "windowPosX"),
|
||||||
@@ -940,7 +829,8 @@ void AdvSceneSwitcher::SetupGeneralTab()
|
|||||||
SIGNAL(DurationChanged(const Duration &)), this,
|
SIGNAL(DurationChanged(const Duration &)), this,
|
||||||
SLOT(CooldownDurationChanged(const Duration &)));
|
SLOT(CooldownDurationChanged(const Duration &)));
|
||||||
|
|
||||||
ui->verboseLogging->setChecked(switcher->verbose);
|
ui->logLevel->setCurrentIndex(static_cast<int>(switcher->logLevel));
|
||||||
|
|
||||||
ui->saveWindowGeo->setChecked(switcher->saveWindowGeo);
|
ui->saveWindowGeo->setChecked(switcher->saveWindowGeo);
|
||||||
ui->showTrayNotifications->setChecked(
|
ui->showTrayNotifications->setChecked(
|
||||||
switcher->showSystemTrayNotifications);
|
switcher->showSystemTrayNotifications);
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ void AdvSceneSwitcher::on_sceneGroupAdd_clicked()
|
|||||||
placeHolderText = format.arg(++i);
|
placeHolderText = format.arg(++i);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool accepted = AdvSSNameDialog::AskForName(
|
bool accepted = NameDialog::AskForName(
|
||||||
this, obs_module_text("AdvSceneSwitcher.sceneGroupTab.add"),
|
this, obs_module_text("AdvSceneSwitcher.sceneGroupTab.add"),
|
||||||
obs_module_text("AdvSceneSwitcher.sceneGroupTab.add"), name,
|
obs_module_text("AdvSceneSwitcher.sceneGroupTab.add"), name,
|
||||||
placeHolderText);
|
placeHolderText);
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ void SwitcherData::checkAudioSwitchFallback(OBSWeakSource &scene,
|
|||||||
scene = audioFallback.getScene();
|
scene = audioFallback.getScene();
|
||||||
transition = audioFallback.transition;
|
transition = audioFallback.transition;
|
||||||
|
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
audioFallback.logMatch();
|
audioFallback.logMatch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ bool SwitcherData::checkAudioSwitch(OBSWeakSource &scene,
|
|||||||
transition = s.transition;
|
transition = s.transition;
|
||||||
match = true;
|
match = true;
|
||||||
|
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
s.logMatch();
|
s.logMatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,10 +437,8 @@ AudioSwitchWidget::AudioSwitchWidget(QWidget *parent, AudioSwitch *s)
|
|||||||
audioVolumeThreshold->setMaximum(100);
|
audioVolumeThreshold->setMaximum(100);
|
||||||
audioVolumeThreshold->setMinimum(0);
|
audioVolumeThreshold->setMinimum(0);
|
||||||
|
|
||||||
QWidget::connect(volMeter->GetSlider(), SIGNAL(valueChanged(int)),
|
QWidget::connect(volMeter->GetSlider(), &DoubleSlider::DoubleValChanged,
|
||||||
audioVolumeThreshold, SLOT(setValue(int)));
|
[=](double) { SyncSliderAndValueSelection(true); });
|
||||||
QWidget::connect(audioVolumeThreshold, SIGNAL(valueChanged(int)),
|
|
||||||
volMeter->GetSlider(), SLOT(setValue(int)));
|
|
||||||
QWidget::connect(audioVolumeThreshold, SIGNAL(valueChanged(int)), this,
|
QWidget::connect(audioVolumeThreshold, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(VolumeThresholdChanged(int)));
|
SLOT(VolumeThresholdChanged(int)));
|
||||||
QWidget::connect(condition, SIGNAL(currentIndexChanged(int)), this,
|
QWidget::connect(condition, SIGNAL(currentIndexChanged(int)), this,
|
||||||
@@ -487,6 +485,7 @@ AudioSwitchWidget::AudioSwitchWidget(QWidget *parent, AudioSwitch *s)
|
|||||||
switchData = s;
|
switchData = s;
|
||||||
|
|
||||||
loading = false;
|
loading = false;
|
||||||
|
SyncSliderAndValueSelection(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioSwitch *AudioSwitchWidget::getSwitchData()
|
AudioSwitch *AudioSwitchWidget::getSwitchData()
|
||||||
@@ -509,6 +508,21 @@ void AudioSwitchWidget::swapSwitchData(AudioSwitchWidget *s1,
|
|||||||
s2->setSwitchData(t);
|
s2->setSwitchData(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AudioSwitchWidget::SyncSliderAndValueSelection(bool sliderMoved)
|
||||||
|
{
|
||||||
|
if (loading || !switchData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sliderMoved) {
|
||||||
|
auto sliderPosition = volMeter->GetSlider()->DoubleValue();
|
||||||
|
audioVolumeThreshold->setValue(sliderPosition);
|
||||||
|
} else {
|
||||||
|
volMeter->GetSlider()->SetDoubleVal(
|
||||||
|
switchData->volumeThreshold);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void AudioSwitchWidget::UpdateVolmeterSource()
|
void AudioSwitchWidget::UpdateVolmeterSource()
|
||||||
{
|
{
|
||||||
delete volMeter;
|
delete volMeter;
|
||||||
@@ -520,10 +534,8 @@ void AudioSwitchWidget::UpdateVolmeterSource()
|
|||||||
QLayout *layout = this->layout();
|
QLayout *layout = this->layout();
|
||||||
layout->addWidget(volMeter);
|
layout->addWidget(volMeter);
|
||||||
|
|
||||||
QWidget::connect(volMeter->GetSlider(), SIGNAL(valueChanged(int)),
|
QWidget::connect(volMeter->GetSlider(), &DoubleSlider::DoubleValChanged,
|
||||||
audioVolumeThreshold, SLOT(setValue(int)));
|
[=](double) { SyncSliderAndValueSelection(true); });
|
||||||
QWidget::connect(audioVolumeThreshold, SIGNAL(valueChanged(int)),
|
|
||||||
volMeter->GetSlider(), SLOT(setValue(int)));
|
|
||||||
|
|
||||||
// Slider will default to 0 so set it manually once
|
// Slider will default to 0 so set it manually once
|
||||||
volMeter->GetSlider()->setValue(switchData->volumeThreshold);
|
volMeter->GetSlider()->setValue(switchData->volumeThreshold);
|
||||||
@@ -547,8 +559,11 @@ void AudioSwitchWidget::VolumeThresholdChanged(int vol)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
{
|
||||||
switchData->volumeThreshold = vol;
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
switchData->volumeThreshold = vol;
|
||||||
|
}
|
||||||
|
SyncSliderAndValueSelection(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioSwitchWidget::ConditionChanged(int cond)
|
void AudioSwitchWidget::ConditionChanged(int cond)
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ private slots:
|
|||||||
void ConditionChanged(int cond);
|
void ConditionChanged(int cond);
|
||||||
void DurationChanged(const Duration &);
|
void DurationChanged(const Duration &);
|
||||||
void IgnoreInactiveChanged(int state);
|
void IgnoreInactiveChanged(int state);
|
||||||
|
void SyncSliderAndValueSelection(bool sliderMoved);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QComboBox *audioSources;
|
QComboBox *audioSources;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ bool SwitcherData::checkExeSwitch(OBSWeakSource &scene,
|
|||||||
scene = s.getScene();
|
scene = s.getScene();
|
||||||
transition = s.transition;
|
transition = s.transition;
|
||||||
|
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
s.logMatch();
|
s.logMatch();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ bool SwitcherData::checkFileContent(OBSWeakSource &scene,
|
|||||||
transition = s.transition;
|
transition = s.transition;
|
||||||
match = true;
|
match = true;
|
||||||
|
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
s.logMatch();
|
s.logMatch();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ bool SwitcherData::checkIdleSwitch(OBSWeakSource &scene,
|
|||||||
match = true;
|
match = true;
|
||||||
idleData.alreadySwitched = true;
|
idleData.alreadySwitched = true;
|
||||||
|
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
idleData.logMatch();
|
idleData.logMatch();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ bool SwitcherData::checkMediaSwitch(OBSWeakSource &scene,
|
|||||||
scene = mediaSwitch.getScene();
|
scene = mediaSwitch.getScene();
|
||||||
transition = mediaSwitch.transition;
|
transition = mediaSwitch.transition;
|
||||||
|
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
mediaSwitch.logMatch();
|
mediaSwitch.logMatch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ void WSServer::sendMessage(SceneSwitchInfo sceneSwitch, bool preview)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switcher->verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
blog(LOG_INFO, "server sent message:\n%s", message.c_str());
|
blog(LOG_INFO, "server sent message:\n%s", message.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -305,7 +305,7 @@ std::string processMessage(std::string payload)
|
|||||||
std::string ret = "message ok";
|
std::string ret = "message ok";
|
||||||
|
|
||||||
auto transition = GetWeakTransitionByName(transitionName.c_str());
|
auto transition = GetWeakTransitionByName(transitionName.c_str());
|
||||||
if (switcher->verbose && !transition) {
|
if (VerboseLoggingEnabled() && !transition) {
|
||||||
ret += " - ignoring invalid transition: '" + transitionName +
|
ret += " - ignoring invalid transition: '" + transitionName +
|
||||||
"'";
|
"'";
|
||||||
}
|
}
|
||||||
@@ -481,7 +481,7 @@ void WSClient::onMessage(connection_hdl hdl, client::message_ptr message)
|
|||||||
errorCodeMessage.c_str());
|
errorCodeMessage.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switcher->verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
blog(LOG_INFO, "client sent message:\n%s", response.c_str());
|
blog(LOG_INFO, "client sent message:\n%s", response.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,6 +132,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QRunnable *CreateFunctionRunnable(std::function<void()> func);
|
QRunnable *CreateFunctionRunnable(std::function<void()> func);
|
||||||
}
|
} // namespace Compatability
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ bool SwitcherData::checkRandom(OBSWeakSource &scene, OBSWeakSource &transition,
|
|||||||
lastRandomScene = r.scene;
|
lastRandomScene = r.scene;
|
||||||
lastRandomSceneGroup = r.group;
|
lastRandomSceneGroup = r.group;
|
||||||
|
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
r.logMatch();
|
r.logMatch();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ bool SwitcherData::checkScreenRegionSwitch(OBSWeakSource &scene,
|
|||||||
transition = s.transition;
|
transition = s.transition;
|
||||||
minRegionSize = regionSize;
|
minRegionSize = regionSize;
|
||||||
|
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
s.logMatch();
|
s.logMatch();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -225,13 +225,13 @@ bool SwitcherData::checkSceneSequence(OBSWeakSource &scene,
|
|||||||
scene = s.getScene();
|
scene = s.getScene();
|
||||||
transition = s.transition;
|
transition = s.transition;
|
||||||
setPrevSceneAfterLinger = s.usePreviousScene;
|
setPrevSceneAfterLinger = s.usePreviousScene;
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
s.logMatch();
|
s.logMatch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s.advanceActiveSequence();
|
s.advanceActiveSequence();
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
s.logAdvanceSequence();
|
s.logAdvanceSequence();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ bool SwitcherData::checkTimeSwitch(OBSWeakSource &scene,
|
|||||||
transition = s.transition;
|
transition = s.transition;
|
||||||
match = true;
|
match = true;
|
||||||
|
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
s.logMatch();
|
s.logMatch();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ void SwitcherData::checkDefaultSceneTransitions()
|
|||||||
|
|
||||||
for (auto &t : defaultSceneTransitions) {
|
for (auto &t : defaultSceneTransitions) {
|
||||||
if (t.checkMatch(currentScene)) {
|
if (t.checkMatch(currentScene)) {
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
t.logMatch();
|
t.logMatch();
|
||||||
}
|
}
|
||||||
t.setTransition();
|
t.setTransition();
|
||||||
@@ -427,7 +427,8 @@ DefTransitionSwitchWidget::DefTransitionSwitchWidget(QWidget *parent,
|
|||||||
{
|
{
|
||||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||||
{"{{scenes}}", scenes}, {"{{transitions}}", transitions}};
|
{"{{scenes}}", scenes},
|
||||||
|
{"{{transitions}}", transitions}};
|
||||||
PlaceWidgets(
|
PlaceWidgets(
|
||||||
obs_module_text(
|
obs_module_text(
|
||||||
"AdvSceneSwitcher.transitionTab.defaultTransitionEntry"),
|
"AdvSceneSwitcher.transitionTab.defaultTransitionEntry"),
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ bool SwitcherData::checkVideoSwitch(OBSWeakSource &scene,
|
|||||||
match = true;
|
match = true;
|
||||||
scene = s.getScene();
|
scene = s.getScene();
|
||||||
transition = s.transition;
|
transition = s.transition;
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
s.logMatch();
|
s.logMatch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ bool SwitcherData::checkWindowTitleSwitch(OBSWeakSource &scene,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (match) {
|
if (match) {
|
||||||
if (verbose) {
|
if (VerboseLoggingEnabled()) {
|
||||||
s.logMatch();
|
s.logMatch();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "macro-helpers.hpp"
|
#include "macro-helpers.hpp"
|
||||||
#include "macro-properties.hpp"
|
#include "macro-properties.hpp"
|
||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
|
#include "plugin-state-helpers.hpp"
|
||||||
#include "section.hpp"
|
#include "section.hpp"
|
||||||
#include "switch-button.hpp"
|
#include "switch-button.hpp"
|
||||||
|
|
||||||
@@ -28,8 +29,7 @@ static inline void populateActionSelection(QComboBox *list)
|
|||||||
MacroActionEdit::MacroActionEdit(QWidget *parent,
|
MacroActionEdit::MacroActionEdit(QWidget *parent,
|
||||||
std::shared_ptr<MacroAction> *entryData,
|
std::shared_ptr<MacroAction> *entryData,
|
||||||
const std::string &id)
|
const std::string &id)
|
||||||
: MacroSegmentEdit(GetGlobalMacroProperties()._highlightActions,
|
: MacroSegmentEdit(parent),
|
||||||
parent),
|
|
||||||
_actionSelection(new FilterComboBox()),
|
_actionSelection(new FilterComboBox()),
|
||||||
_enable(new SwitchButton()),
|
_enable(new SwitchButton()),
|
||||||
_entryData(entryData)
|
_entryData(entryData)
|
||||||
@@ -39,8 +39,6 @@ MacroActionEdit::MacroActionEdit(QWidget *parent,
|
|||||||
SLOT(ActionSelectionChanged(const QString &)));
|
SLOT(ActionSelectionChanged(const QString &)));
|
||||||
QWidget::connect(_enable, SIGNAL(checked(bool)), this,
|
QWidget::connect(_enable, SIGNAL(checked(bool)), this,
|
||||||
SLOT(ActionEnableChanged(bool)));
|
SLOT(ActionEnableChanged(bool)));
|
||||||
QWidget::connect(window(), SIGNAL(HighlightActionsChanged(bool)), this,
|
|
||||||
SLOT(EnableHighlight(bool)));
|
|
||||||
QWidget::connect(&_actionStateTimer, SIGNAL(timeout()), this,
|
QWidget::connect(&_actionStateTimer, SIGNAL(timeout()), this,
|
||||||
SLOT(UpdateActionState()));
|
SLOT(UpdateActionState()));
|
||||||
|
|
||||||
@@ -88,6 +86,7 @@ void MacroActionEdit::ActionSelectionChanged(const QString &text)
|
|||||||
*_entryData = MacroActionFactory::Create(id, macro);
|
*_entryData = MacroActionFactory::Create(id, macro);
|
||||||
(*_entryData)->SetIndex(idx);
|
(*_entryData)->SetIndex(idx);
|
||||||
(*_entryData)->PostLoad();
|
(*_entryData)->PostLoad();
|
||||||
|
RunPostLoadSteps();
|
||||||
}
|
}
|
||||||
auto widget = MacroActionFactory::CreateWidget(id, this, *_entryData);
|
auto widget = MacroActionFactory::CreateWidget(id, this, *_entryData);
|
||||||
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
||||||
@@ -159,6 +158,34 @@ std::shared_ptr<MacroSegment> MacroActionEdit::Data() const
|
|||||||
return *_entryData;
|
return *_entryData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::AddMacroAction(Macro *macro, int idx,
|
||||||
|
const std::string &id, obs_data_t *data)
|
||||||
|
{
|
||||||
|
if (idx < 0 || idx > (int)macro->Actions().size()) {
|
||||||
|
assert(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto lock = LockContext();
|
||||||
|
macro->Actions().emplace(macro->Actions().begin() + idx,
|
||||||
|
MacroActionFactory::Create(id, macro));
|
||||||
|
if (data) {
|
||||||
|
macro->Actions().at(idx)->Load(data);
|
||||||
|
}
|
||||||
|
macro->Actions().at(idx)->PostLoad();
|
||||||
|
RunPostLoadSteps();
|
||||||
|
macro->UpdateActionIndices();
|
||||||
|
ui->actionsList->Insert(
|
||||||
|
idx,
|
||||||
|
new MacroActionEdit(this, ¯o->Actions()[idx], id));
|
||||||
|
SetActionData(*macro);
|
||||||
|
}
|
||||||
|
HighlightAction(idx);
|
||||||
|
ui->actionsList->SetHelpMsgVisible(false);
|
||||||
|
emit(MacroSegmentOrderChanged());
|
||||||
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::AddMacroAction(int idx)
|
void AdvSceneSwitcher::AddMacroAction(int idx)
|
||||||
{
|
{
|
||||||
auto macro = GetSelectedMacro();
|
auto macro = GetSelectedMacro();
|
||||||
@@ -167,6 +194,7 @@ void AdvSceneSwitcher::AddMacroAction(int idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (idx < 0 || idx > (int)macro->Actions().size()) {
|
if (idx < 0 || idx > (int)macro->Actions().size()) {
|
||||||
|
assert(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,26 +204,13 @@ void AdvSceneSwitcher::AddMacroAction(int idx)
|
|||||||
} else {
|
} else {
|
||||||
id = MacroAction::GetDefaultID();
|
id = MacroAction::GetDefaultID();
|
||||||
}
|
}
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
OBSDataAutoRelease data;
|
||||||
macro->Actions().emplace(
|
if (idx - 1 >= 0) {
|
||||||
macro->Actions().begin() + idx,
|
data = obs_data_create();
|
||||||
MacroActionFactory::Create(id, macro.get()));
|
macro->Actions().at(idx - 1)->Save(data);
|
||||||
if (idx - 1 >= 0) {
|
|
||||||
auto data = obs_data_create();
|
|
||||||
macro->Actions().at(idx - 1)->Save(data);
|
|
||||||
macro->Actions().at(idx)->Load(data);
|
|
||||||
macro->Actions().at(idx)->PostLoad();
|
|
||||||
obs_data_release(data);
|
|
||||||
}
|
|
||||||
macro->UpdateActionIndices();
|
|
||||||
ui->actionsList->Insert(
|
|
||||||
idx,
|
|
||||||
new MacroActionEdit(this, ¯o->Actions()[idx], id));
|
|
||||||
SetActionData(*macro);
|
|
||||||
}
|
}
|
||||||
HighlightAction(idx);
|
AddMacroAction(macro.get(), idx, id, data);
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_actionAdd_clicked()
|
void AdvSceneSwitcher::on_actionAdd_clicked()
|
||||||
@@ -213,7 +228,6 @@ void AdvSceneSwitcher::on_actionAdd_clicked()
|
|||||||
if (currentActionIdx != -1) {
|
if (currentActionIdx != -1) {
|
||||||
MacroActionSelectionChanged(currentActionIdx + 1);
|
MacroActionSelectionChanged(currentActionIdx + 1);
|
||||||
}
|
}
|
||||||
ui->actionsList->SetHelpMsgVisible(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::RemoveMacroAction(int idx)
|
void AdvSceneSwitcher::RemoveMacroAction(int idx)
|
||||||
@@ -308,7 +322,6 @@ void AdvSceneSwitcher::on_elseActionAdd_clicked()
|
|||||||
if (currentElseActionIdx != -1) {
|
if (currentElseActionIdx != -1) {
|
||||||
MacroElseActionSelectionChanged(currentElseActionIdx + 1);
|
MacroElseActionSelectionChanged(currentElseActionIdx + 1);
|
||||||
}
|
}
|
||||||
ui->elseActionsList->SetHelpMsgVisible(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_elseActionRemove_clicked()
|
void AdvSceneSwitcher::on_elseActionRemove_clicked()
|
||||||
@@ -447,6 +460,36 @@ void AdvSceneSwitcher::MacroElseActionReorder(int to, int from)
|
|||||||
emit(MacroSegmentOrderChanged());
|
emit(MacroSegmentOrderChanged());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::AddMacroElseAction(Macro *macro, int idx,
|
||||||
|
const std::string &id,
|
||||||
|
obs_data_t *data)
|
||||||
|
{
|
||||||
|
if (idx < 0 || idx > (int)macro->ElseActions().size()) {
|
||||||
|
assert(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto lock = LockContext();
|
||||||
|
macro->ElseActions().emplace(macro->ElseActions().begin() + idx,
|
||||||
|
MacroActionFactory::Create(id,
|
||||||
|
macro));
|
||||||
|
if (data) {
|
||||||
|
macro->ElseActions().at(idx)->Load(data);
|
||||||
|
}
|
||||||
|
macro->ElseActions().at(idx)->PostLoad();
|
||||||
|
RunPostLoadSteps();
|
||||||
|
macro->UpdateElseActionIndices();
|
||||||
|
ui->elseActionsList->Insert(
|
||||||
|
idx, new MacroActionEdit(
|
||||||
|
this, ¯o->ElseActions()[idx], id));
|
||||||
|
SetElseActionData(*macro);
|
||||||
|
}
|
||||||
|
HighlightElseAction(idx);
|
||||||
|
ui->elseActionsList->SetHelpMsgVisible(false);
|
||||||
|
emit(MacroSegmentOrderChanged());
|
||||||
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::AddMacroElseAction(int idx)
|
void AdvSceneSwitcher::AddMacroElseAction(int idx)
|
||||||
{
|
{
|
||||||
auto macro = GetSelectedMacro();
|
auto macro = GetSelectedMacro();
|
||||||
@@ -455,6 +498,7 @@ void AdvSceneSwitcher::AddMacroElseAction(int idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (idx < 0 || idx > (int)macro->ElseActions().size()) {
|
if (idx < 0 || idx > (int)macro->ElseActions().size()) {
|
||||||
|
assert(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,25 +508,13 @@ void AdvSceneSwitcher::AddMacroElseAction(int idx)
|
|||||||
} else {
|
} else {
|
||||||
id = MacroAction::GetDefaultID();
|
id = MacroAction::GetDefaultID();
|
||||||
}
|
}
|
||||||
{
|
|
||||||
auto lock = LockContext();
|
OBSDataAutoRelease data;
|
||||||
macro->ElseActions().emplace(
|
if (idx - 1 >= 0) {
|
||||||
macro->ElseActions().begin() + idx,
|
data = obs_data_create();
|
||||||
MacroActionFactory::Create(id, macro.get()));
|
macro->ElseActions().at(idx - 1)->Save(data);
|
||||||
if (idx - 1 >= 0) {
|
|
||||||
OBSDataAutoRelease data = obs_data_create();
|
|
||||||
macro->ElseActions().at(idx - 1)->Save(data);
|
|
||||||
macro->ElseActions().at(idx)->Load(data);
|
|
||||||
}
|
|
||||||
macro->ElseActions().at(idx)->PostLoad();
|
|
||||||
macro->UpdateElseActionIndices();
|
|
||||||
ui->elseActionsList->Insert(
|
|
||||||
idx, new MacroActionEdit(
|
|
||||||
this, ¯o->ElseActions()[idx], id));
|
|
||||||
SetElseActionData(*macro);
|
|
||||||
}
|
}
|
||||||
HighlightElseAction(idx);
|
AddMacroElseAction(macro.get(), idx, id, data);
|
||||||
emit(MacroSegmentOrderChanged());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::RemoveMacroElseAction(int idx)
|
void AdvSceneSwitcher::RemoveMacroElseAction(int idx)
|
||||||
@@ -503,7 +535,7 @@ void AdvSceneSwitcher::RemoveMacroElseAction(int idx)
|
|||||||
SetMacroAbortWait(true);
|
SetMacroAbortWait(true);
|
||||||
GetMacroWaitCV().notify_all();
|
GetMacroWaitCV().notify_all();
|
||||||
macro->UpdateElseActionIndices();
|
macro->UpdateElseActionIndices();
|
||||||
SetActionData(*macro);
|
SetElseActionData(*macro);
|
||||||
}
|
}
|
||||||
MacroElseActionSelectionChanged(-1);
|
MacroElseActionSelectionChanged(-1);
|
||||||
lastInteracted = MacroSection::ELSE_ACTIONS;
|
lastInteracted = MacroSection::ELSE_ACTIONS;
|
||||||
|
|||||||
@@ -48,9 +48,7 @@ bool MacroActionMacro::PerformAction()
|
|||||||
macro->ResetRunCount();
|
macro->ResetRunCount();
|
||||||
break;
|
break;
|
||||||
case Action::RUN:
|
case Action::RUN:
|
||||||
if (!macro->Paused()) {
|
RunActions(macro.get());
|
||||||
macro->PerformActions(true, false, true);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case Action::STOP:
|
case Action::STOP:
|
||||||
macro->Stop();
|
macro->Stop();
|
||||||
@@ -88,32 +86,32 @@ void MacroActionMacro::LogAction() const
|
|||||||
}
|
}
|
||||||
switch (_action) {
|
switch (_action) {
|
||||||
case Action::PAUSE:
|
case Action::PAUSE:
|
||||||
vblog(LOG_INFO, "paused \"%s\"", macro->Name().c_str());
|
ablog(LOG_INFO, "paused \"%s\"", macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
case Action::UNPAUSE:
|
case Action::UNPAUSE:
|
||||||
vblog(LOG_INFO, "unpaused \"%s\"", macro->Name().c_str());
|
ablog(LOG_INFO, "unpaused \"%s\"", macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
case Action::RESET_COUNTER:
|
case Action::RESET_COUNTER:
|
||||||
vblog(LOG_INFO, "reset counter for \"%s\"",
|
ablog(LOG_INFO, "reset counter for \"%s\"",
|
||||||
macro->Name().c_str());
|
macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
case Action::RUN:
|
case Action::RUN:
|
||||||
vblog(LOG_INFO, "run nested macro \"%s\"",
|
ablog(LOG_INFO, "run nested macro \"%s\"",
|
||||||
macro->Name().c_str());
|
macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
case Action::STOP:
|
case Action::STOP:
|
||||||
vblog(LOG_INFO, "stopped macro \"%s\"", macro->Name().c_str());
|
ablog(LOG_INFO, "stopped macro \"%s\"", macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
case Action::DISABLE_ACTION:
|
case Action::DISABLE_ACTION:
|
||||||
vblog(LOG_INFO, "disabled action %d of macro \"%s\"",
|
ablog(LOG_INFO, "disabled action %d of macro \"%s\"",
|
||||||
_actionIndex.GetValue(), macro->Name().c_str());
|
_actionIndex.GetValue(), macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
case Action::ENABLE_ACTION:
|
case Action::ENABLE_ACTION:
|
||||||
vblog(LOG_INFO, "enabled action %d of macro \"%s\"",
|
ablog(LOG_INFO, "enabled action %d of macro \"%s\"",
|
||||||
_actionIndex.GetValue(), macro->Name().c_str());
|
_actionIndex.GetValue(), macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
case Action::TOGGLE_ACTION:
|
case Action::TOGGLE_ACTION:
|
||||||
vblog(LOG_INFO, "toggled action %d of macro \"%s\"",
|
ablog(LOG_INFO, "toggled action %d of macro \"%s\"",
|
||||||
_actionIndex.GetValue(), macro->Name().c_str());
|
_actionIndex.GetValue(), macro->Name().c_str());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -127,6 +125,7 @@ bool MacroActionMacro::Save(obs_data_t *obj) const
|
|||||||
_macro.Save(obj);
|
_macro.Save(obj);
|
||||||
_actionIndex.Save(obj, "actionIndex");
|
_actionIndex.Save(obj, "actionIndex");
|
||||||
obs_data_set_int(obj, "action", static_cast<int>(_action));
|
obs_data_set_int(obj, "action", static_cast<int>(_action));
|
||||||
|
_runOptions.Save(obj);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,6 +136,15 @@ bool MacroActionMacro::Load(obs_data_t *obj)
|
|||||||
_actionIndex.Load(obj, "actionIndex");
|
_actionIndex.Load(obj, "actionIndex");
|
||||||
_action = static_cast<MacroActionMacro::Action>(
|
_action = static_cast<MacroActionMacro::Action>(
|
||||||
obs_data_get_int(obj, "action"));
|
obs_data_get_int(obj, "action"));
|
||||||
|
_runOptions.Load(obj);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MacroActionMacro::PostLoad()
|
||||||
|
{
|
||||||
|
MacroRefAction::PostLoad();
|
||||||
|
MacroAction::PostLoad();
|
||||||
|
_runOptions.macro.PostLoad();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,11 +153,70 @@ std::string MacroActionMacro::GetShortDesc() const
|
|||||||
return _macro.Name();
|
return _macro.Name();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void populateActionSelection(QComboBox *list)
|
std::shared_ptr<MacroAction> MacroActionMacro::Create(Macro *m)
|
||||||
{
|
{
|
||||||
for (auto entry : actionTypes) {
|
return std::make_shared<MacroActionMacro>(m);
|
||||||
list->addItem(obs_module_text(entry.second.c_str()));
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<MacroAction> MacroActionMacro::Copy() const
|
||||||
|
{
|
||||||
|
return std::make_shared<MacroActionMacro>(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionMacro::ResolveVariablesToFixedValues()
|
||||||
|
{
|
||||||
|
_actionIndex.ResolveVariables();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionMacro::RunActions(Macro *actionMacro) const
|
||||||
|
{
|
||||||
|
if (_runOptions.skipWhenPaused && actionMacro->Paused()) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_runOptions.logic == RunOptions::Logic::IGNORE_CONDITIONS) {
|
||||||
|
actionMacro->PerformActions(!_runOptions.runElseActions, false,
|
||||||
|
true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto conditionMacro = _runOptions.macro.GetMacro();
|
||||||
|
if (!conditionMacro) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((_runOptions.logic == RunOptions::Logic::CONDITIONS &&
|
||||||
|
conditionMacro->Matched()) ||
|
||||||
|
(_runOptions.logic == RunOptions::Logic::INVERT_CONDITIONS &&
|
||||||
|
!conditionMacro->Matched())) {
|
||||||
|
actionMacro->PerformActions(!_runOptions.runElseActions, false,
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void populateActionSelection(QComboBox *list)
|
||||||
|
{
|
||||||
|
for (const auto &[_, name] : actionTypes) {
|
||||||
|
list->addItem(obs_module_text(name.c_str()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void populateConditionBehaviorSelection(QComboBox *list)
|
||||||
|
{
|
||||||
|
list->addItem(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.macro.type.run.conditions.ignore"));
|
||||||
|
list->addItem(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.macro.type.run.conditions.true"));
|
||||||
|
list->addItem(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.macro.type.run.conditions.false"));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void populateActionTypeSelection(QComboBox *list)
|
||||||
|
{
|
||||||
|
list->addItem(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.macro.type.run.actionType.regular"));
|
||||||
|
list->addItem(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.macro.type.run.actionType.else"));
|
||||||
}
|
}
|
||||||
|
|
||||||
MacroActionMacroEdit::MacroActionMacroEdit(
|
MacroActionMacroEdit::MacroActionMacroEdit(
|
||||||
@@ -158,9 +225,20 @@ MacroActionMacroEdit::MacroActionMacroEdit(
|
|||||||
_macros(new MacroSelection(parent)),
|
_macros(new MacroSelection(parent)),
|
||||||
_actionIndex(new MacroSegmentSelection(
|
_actionIndex(new MacroSegmentSelection(
|
||||||
this, MacroSegmentSelection::Type::ACTION)),
|
this, MacroSegmentSelection::Type::ACTION)),
|
||||||
_actions(new QComboBox())
|
_actions(new QComboBox()),
|
||||||
|
_conditionMacros(new MacroSelection(parent)),
|
||||||
|
_conditionBehaviors(new QComboBox()),
|
||||||
|
_actionTypes(new QComboBox()),
|
||||||
|
_skipWhenPaused(new QCheckBox(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.macro.type.run.skipWhenPaused"))),
|
||||||
|
_entryLayout(new QHBoxLayout()),
|
||||||
|
_conditionLayout(new QHBoxLayout())
|
||||||
{
|
{
|
||||||
populateActionSelection(_actions);
|
populateActionSelection(_actions);
|
||||||
|
populateConditionBehaviorSelection(_conditionBehaviors);
|
||||||
|
populateActionTypeSelection(_actionTypes);
|
||||||
|
|
||||||
|
_conditionMacros->HideSelectedMacro();
|
||||||
|
|
||||||
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
|
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
|
||||||
this, SLOT(MacroChanged(const QString &)));
|
this, SLOT(MacroChanged(const QString &)));
|
||||||
@@ -169,15 +247,21 @@ MacroActionMacroEdit::MacroActionMacroEdit(
|
|||||||
QWidget::connect(_actionIndex,
|
QWidget::connect(_actionIndex,
|
||||||
SIGNAL(SelectionChanged(const IntVariable &)), this,
|
SIGNAL(SelectionChanged(const IntVariable &)), this,
|
||||||
SLOT(ActionIndexChanged(const IntVariable &)));
|
SLOT(ActionIndexChanged(const IntVariable &)));
|
||||||
|
QWidget::connect(_conditionMacros,
|
||||||
|
SIGNAL(currentTextChanged(const QString &)), this,
|
||||||
|
SLOT(ConditionMacroChanged(const QString &)));
|
||||||
|
QWidget::connect(_conditionBehaviors, SIGNAL(currentIndexChanged(int)),
|
||||||
|
this, SLOT(ConditionBehaviorChanged(int)));
|
||||||
|
QWidget::connect(_actionTypes, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(ActionTypeChanged(int)));
|
||||||
|
QWidget::connect(_skipWhenPaused, SIGNAL(stateChanged(int)), this,
|
||||||
|
SLOT(SkipWhenPausedChanged(int)));
|
||||||
|
|
||||||
auto mainLayout = new QHBoxLayout;
|
auto layout = new QVBoxLayout();
|
||||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.macro.entry"),
|
layout->addLayout(_entryLayout);
|
||||||
mainLayout,
|
layout->addLayout(_conditionLayout);
|
||||||
{{"{{actions}}", _actions},
|
layout->addWidget(_skipWhenPaused);
|
||||||
{"{{actionIndex}}", _actionIndex},
|
setLayout(layout);
|
||||||
{"{{macros}}", _macros}});
|
|
||||||
setLayout(mainLayout);
|
|
||||||
|
|
||||||
_entryData = entryData;
|
_entryData = entryData;
|
||||||
UpdateEntryData();
|
UpdateEntryData();
|
||||||
_loading = false;
|
_loading = false;
|
||||||
@@ -192,6 +276,12 @@ void MacroActionMacroEdit::UpdateEntryData()
|
|||||||
_actionIndex->SetValue(_entryData->_actionIndex);
|
_actionIndex->SetValue(_entryData->_actionIndex);
|
||||||
_actionIndex->SetMacro(_entryData->_macro.GetMacro());
|
_actionIndex->SetMacro(_entryData->_macro.GetMacro());
|
||||||
_macros->SetCurrentMacro(_entryData->_macro);
|
_macros->SetCurrentMacro(_entryData->_macro);
|
||||||
|
_conditionMacros->SetCurrentMacro(_entryData->_runOptions.macro);
|
||||||
|
_conditionBehaviors->setCurrentIndex(
|
||||||
|
static_cast<int>(_entryData->_runOptions.logic));
|
||||||
|
_actionTypes->setCurrentIndex(
|
||||||
|
_entryData->_runOptions.runElseActions ? 1 : 0);
|
||||||
|
_skipWhenPaused->setChecked(_entryData->_runOptions.skipWhenPaused);
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,8 +319,88 @@ void MacroActionMacroEdit::ActionIndexChanged(const IntVariable &value)
|
|||||||
_entryData->_actionIndex = value;
|
_entryData->_actionIndex = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroActionMacroEdit::ConditionMacroChanged(const QString &text)
|
||||||
|
{
|
||||||
|
if (_loading || !_entryData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto lock = LockContext();
|
||||||
|
_entryData->_runOptions.macro = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionMacroEdit::ConditionBehaviorChanged(int value)
|
||||||
|
{
|
||||||
|
if (_loading || !_entryData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto lock = LockContext();
|
||||||
|
_entryData->_runOptions.logic =
|
||||||
|
static_cast<MacroActionMacro::RunOptions::Logic>(value);
|
||||||
|
SetWidgetVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionMacroEdit::ActionTypeChanged(int value)
|
||||||
|
{
|
||||||
|
if (_loading || !_entryData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto lock = LockContext();
|
||||||
|
_entryData->_runOptions.runElseActions = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionMacroEdit::SkipWhenPausedChanged(int value)
|
||||||
|
{
|
||||||
|
if (_loading || !_entryData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto lock = LockContext();
|
||||||
|
_entryData->_runOptions.skipWhenPaused = value;
|
||||||
|
}
|
||||||
|
|
||||||
void MacroActionMacroEdit::SetWidgetVisibility()
|
void MacroActionMacroEdit::SetWidgetVisibility()
|
||||||
{
|
{
|
||||||
|
_entryLayout->removeWidget(_actions);
|
||||||
|
_entryLayout->removeWidget(_actionIndex);
|
||||||
|
_entryLayout->removeWidget(_macros);
|
||||||
|
_entryLayout->removeWidget(_actionTypes);
|
||||||
|
_conditionLayout->removeWidget(_conditionBehaviors);
|
||||||
|
_conditionLayout->removeWidget(_conditionMacros);
|
||||||
|
|
||||||
|
ClearLayout(_entryLayout);
|
||||||
|
ClearLayout(_conditionLayout);
|
||||||
|
|
||||||
|
const std::unordered_map<std::string, QWidget *> placeholders = {
|
||||||
|
{"{{actions}}", _actions},
|
||||||
|
{"{{actionIndex}}", _actionIndex},
|
||||||
|
{"{{macros}}", _macros},
|
||||||
|
{"{{actionTypes}}", _actionTypes},
|
||||||
|
{"{{conditionBehaviors}}", _conditionBehaviors},
|
||||||
|
{"{{conditionMacros}}", _conditionMacros},
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
PlaceWidgets(
|
||||||
|
obs_module_text(
|
||||||
|
_entryData->_action == MacroActionMacro::Action::RUN
|
||||||
|
? "AdvSceneSwitcher.action.macro.entry.run"
|
||||||
|
: "AdvSceneSwitcher.action.macro.entry.other"),
|
||||||
|
_entryLayout, placeholders);
|
||||||
|
|
||||||
|
if (_entryData->_runOptions.logic ==
|
||||||
|
MacroActionMacro::RunOptions::Logic::IGNORE_CONDITIONS) {
|
||||||
|
_conditionLayout->addWidget(_conditionBehaviors);
|
||||||
|
_conditionLayout->addStretch();
|
||||||
|
} else {
|
||||||
|
PlaceWidgets(
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.macro.entry.run.condition"),
|
||||||
|
_conditionLayout, placeholders);
|
||||||
|
}
|
||||||
|
|
||||||
if (_entryData->_action == MacroActionMacro::Action::RUN ||
|
if (_entryData->_action == MacroActionMacro::Action::RUN ||
|
||||||
_entryData->_action == MacroActionMacro::Action::STOP) {
|
_entryData->_action == MacroActionMacro::Action::STOP) {
|
||||||
_macros->HideSelectedMacro();
|
_macros->HideSelectedMacro();
|
||||||
@@ -245,6 +415,42 @@ void MacroActionMacroEdit::SetWidgetVisibility()
|
|||||||
MacroActionMacro::Action::ENABLE_ACTION ||
|
MacroActionMacro::Action::ENABLE_ACTION ||
|
||||||
_entryData->_action == MacroActionMacro::Action::TOGGLE_ACTION;
|
_entryData->_action == MacroActionMacro::Action::TOGGLE_ACTION;
|
||||||
_actionIndex->setVisible(isModifyingActionState);
|
_actionIndex->setVisible(isModifyingActionState);
|
||||||
|
|
||||||
|
SetLayoutVisible(_conditionLayout,
|
||||||
|
_entryData->_action == MacroActionMacro::Action::RUN);
|
||||||
|
_conditionMacros->setVisible(
|
||||||
|
_entryData->_action == MacroActionMacro::Action::RUN &&
|
||||||
|
_entryData->_runOptions.logic !=
|
||||||
|
MacroActionMacro::RunOptions::Logic::IGNORE_CONDITIONS);
|
||||||
|
_actionTypes->setVisible(_entryData->_action ==
|
||||||
|
MacroActionMacro::Action::RUN);
|
||||||
|
_skipWhenPaused->setVisible(_entryData->_action ==
|
||||||
|
MacroActionMacro::Action::RUN);
|
||||||
|
|
||||||
|
adjustSize();
|
||||||
|
updateGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionMacro::RunOptions::Save(obs_data_t *obj) const
|
||||||
|
{
|
||||||
|
OBSDataAutoRelease data = obs_data_create();
|
||||||
|
obs_data_set_int(data, "logic", static_cast<int>(logic));
|
||||||
|
obs_data_set_bool(data, "runElseActions", runElseActions);
|
||||||
|
obs_data_set_bool(data, "skipWhenPaused", skipWhenPaused);
|
||||||
|
macro.Save(data);
|
||||||
|
obs_data_set_obj(obj, "runOptions", data);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionMacro::RunOptions::Load(obs_data_t *obj)
|
||||||
|
{
|
||||||
|
if (!obs_data_has_user_value(obj, "runOptions")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
OBSDataAutoRelease data = obs_data_get_obj(obj, "runOptions");
|
||||||
|
logic = static_cast<Logic>(obs_data_get_int(data, "logic"));
|
||||||
|
runElseActions = obs_data_get_bool(data, "runElseActions");
|
||||||
|
skipWhenPaused = obs_data_get_bool(data, "skipWhenPaused");
|
||||||
|
macro.Load(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "macro-selection.hpp"
|
#include "macro-selection.hpp"
|
||||||
#include "macro-segment-selection.hpp"
|
#include "macro-segment-selection.hpp"
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
@@ -14,12 +15,26 @@ public:
|
|||||||
void LogAction() const;
|
void LogAction() const;
|
||||||
bool Save(obs_data_t *obj) const;
|
bool Save(obs_data_t *obj) const;
|
||||||
bool Load(obs_data_t *obj);
|
bool Load(obs_data_t *obj);
|
||||||
|
bool PostLoad();
|
||||||
std::string GetShortDesc() const;
|
std::string GetShortDesc() const;
|
||||||
std::string GetId() const { return id; };
|
std::string GetId() const { return id; };
|
||||||
static std::shared_ptr<MacroAction> Create(Macro *m)
|
static std::shared_ptr<MacroAction> Create(Macro *m);
|
||||||
{
|
std::shared_ptr<MacroAction> Copy() const;
|
||||||
return std::make_shared<MacroActionMacro>(m);
|
void ResolveVariablesToFixedValues();
|
||||||
}
|
|
||||||
|
struct RunOptions {
|
||||||
|
void Save(obs_data_t *obj) const;
|
||||||
|
void Load(obs_data_t *obj);
|
||||||
|
enum class Logic {
|
||||||
|
IGNORE_CONDITIONS,
|
||||||
|
CONDITIONS,
|
||||||
|
INVERT_CONDITIONS,
|
||||||
|
};
|
||||||
|
Logic logic;
|
||||||
|
bool runElseActions = false;
|
||||||
|
bool skipWhenPaused = true;
|
||||||
|
MacroRef macro;
|
||||||
|
};
|
||||||
|
|
||||||
enum class Action {
|
enum class Action {
|
||||||
PAUSE,
|
PAUSE,
|
||||||
@@ -33,8 +48,11 @@ public:
|
|||||||
};
|
};
|
||||||
Action _action = Action::PAUSE;
|
Action _action = Action::PAUSE;
|
||||||
IntVariable _actionIndex = 1;
|
IntVariable _actionIndex = 1;
|
||||||
|
RunOptions _runOptions = {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void RunActions(Macro *actionMacro) const;
|
||||||
|
|
||||||
static bool _registered;
|
static bool _registered;
|
||||||
static const std::string id;
|
static const std::string id;
|
||||||
};
|
};
|
||||||
@@ -59,18 +77,28 @@ private slots:
|
|||||||
void MacroChanged(const QString &text);
|
void MacroChanged(const QString &text);
|
||||||
void ActionChanged(int value);
|
void ActionChanged(int value);
|
||||||
void ActionIndexChanged(const IntVariable &value);
|
void ActionIndexChanged(const IntVariable &value);
|
||||||
|
void ConditionMacroChanged(const QString &text);
|
||||||
|
void ConditionBehaviorChanged(int value);
|
||||||
|
void ActionTypeChanged(int value);
|
||||||
|
void SkipWhenPausedChanged(int value);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void HeaderInfoChanged(const QString &);
|
void HeaderInfoChanged(const QString &);
|
||||||
|
|
||||||
protected:
|
|
||||||
MacroSelection *_macros;
|
|
||||||
MacroSegmentSelection *_actionIndex;
|
|
||||||
QComboBox *_actions;
|
|
||||||
std::shared_ptr<MacroActionMacro> _entryData;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetWidgetVisibility();
|
void SetWidgetVisibility();
|
||||||
|
|
||||||
|
MacroSelection *_macros;
|
||||||
|
MacroSegmentSelection *_actionIndex;
|
||||||
|
QComboBox *_actions;
|
||||||
|
MacroSelection *_conditionMacros;
|
||||||
|
QComboBox *_conditionBehaviors;
|
||||||
|
QComboBox *_actionTypes;
|
||||||
|
QCheckBox *_skipWhenPaused;
|
||||||
|
QHBoxLayout *_entryLayout;
|
||||||
|
QHBoxLayout *_conditionLayout;
|
||||||
|
|
||||||
|
std::shared_ptr<MacroActionMacro> _entryData;
|
||||||
bool _loading = true;
|
bool _loading = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ void MacroActionQueue::AddActions(ActionQueue *queue)
|
|||||||
|
|
||||||
auto actions = *GetMacroActions(macro.get());
|
auto actions = *GetMacroActions(macro.get());
|
||||||
for (const auto &action : actions) {
|
for (const auto &action : actions) {
|
||||||
queue->Add(action);
|
if (action->Enabled()) {
|
||||||
|
queue->Add(action);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,20 +71,20 @@ void MacroActionQueue::LogAction() const
|
|||||||
}
|
}
|
||||||
switch (_action) {
|
switch (_action) {
|
||||||
case Action::ADD_TO_QUEUE:
|
case Action::ADD_TO_QUEUE:
|
||||||
vblog(LOG_INFO, "queued actions of \"%s\" to \"%s\"",
|
ablog(LOG_INFO, "queued actions of \"%s\" to \"%s\"",
|
||||||
GetMacroName(macro.get()).c_str(),
|
GetMacroName(macro.get()).c_str(),
|
||||||
GetActionQueueName(_queue).c_str());
|
GetActionQueueName(_queue).c_str());
|
||||||
break;
|
break;
|
||||||
case Action::START_QUEUE:
|
case Action::START_QUEUE:
|
||||||
vblog(LOG_INFO, "start queue \"%s\"",
|
ablog(LOG_INFO, "start queue \"%s\"",
|
||||||
GetActionQueueName(_queue).c_str());
|
GetActionQueueName(_queue).c_str());
|
||||||
break;
|
break;
|
||||||
case Action::STOP_QUEUE:
|
case Action::STOP_QUEUE:
|
||||||
vblog(LOG_INFO, "stop queue \"%s\"",
|
ablog(LOG_INFO, "stop queue \"%s\"",
|
||||||
GetActionQueueName(_queue).c_str());
|
GetActionQueueName(_queue).c_str());
|
||||||
break;
|
break;
|
||||||
case Action::CLEAR_QUEUE:
|
case Action::CLEAR_QUEUE:
|
||||||
vblog(LOG_INFO, "cleared queue \"%s\"",
|
ablog(LOG_INFO, "cleared queue \"%s\"",
|
||||||
GetActionQueueName(_queue).c_str());
|
GetActionQueueName(_queue).c_str());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -114,6 +116,16 @@ std::string MacroActionQueue::GetShortDesc() const
|
|||||||
return GetActionQueueName(_queue);
|
return GetActionQueueName(_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<MacroAction> MacroActionQueue::Create(Macro *m)
|
||||||
|
{
|
||||||
|
return std::make_shared<MacroActionQueue>(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<MacroAction> MacroActionQueue::Copy() const
|
||||||
|
{
|
||||||
|
return std::make_shared<MacroActionQueue>(*this);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void populateActionSelection(QComboBox *list)
|
static inline void populateActionSelection(QComboBox *list)
|
||||||
{
|
{
|
||||||
for (const auto &[_, name] : actionTypes) {
|
for (const auto &[_, name] : actionTypes) {
|
||||||
|
|||||||
@@ -16,10 +16,8 @@ public:
|
|||||||
bool Load(obs_data_t *obj);
|
bool Load(obs_data_t *obj);
|
||||||
std::string GetShortDesc() const;
|
std::string GetShortDesc() const;
|
||||||
std::string GetId() const { return id; };
|
std::string GetId() const { return id; };
|
||||||
static std::shared_ptr<MacroAction> Create(Macro *m)
|
static std::shared_ptr<MacroAction> Create(Macro *m);
|
||||||
{
|
std::shared_ptr<MacroAction> Copy() const;
|
||||||
return std::make_shared<MacroActionQueue>(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class Action {
|
enum class Action {
|
||||||
ADD_TO_QUEUE,
|
ADD_TO_QUEUE,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
#include "non-modal-dialog.hpp"
|
#include "non-modal-dialog.hpp"
|
||||||
#include "source-helpers.hpp"
|
#include "source-helpers.hpp"
|
||||||
|
#include "ui-helpers.hpp"
|
||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
@@ -54,6 +55,10 @@ const static std::map<MacroActionVariable::Type, std::string> actionTypes = {
|
|||||||
"AdvSceneSwitcher.action.variable.type.setToTempvar"},
|
"AdvSceneSwitcher.action.variable.type.setToTempvar"},
|
||||||
{MacroActionVariable::Type::SCENE_ITEM_NAME,
|
{MacroActionVariable::Type::SCENE_ITEM_NAME,
|
||||||
"AdvSceneSwitcher.action.variable.type.sceneItemName"},
|
"AdvSceneSwitcher.action.variable.type.sceneItemName"},
|
||||||
|
{MacroActionVariable::Type::PAD,
|
||||||
|
"AdvSceneSwitcher.action.variable.type.padValue"},
|
||||||
|
{MacroActionVariable::Type::TRUNCATE,
|
||||||
|
"AdvSceneSwitcher.action.variable.type.truncateValue"},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void apppend(Variable &var, const std::string &value)
|
static void apppend(Variable &var, const std::string &value)
|
||||||
@@ -198,7 +203,8 @@ void MacroActionVariable::SetToSceneItemName(Variable *var)
|
|||||||
|
|
||||||
struct AskForInputParams {
|
struct AskForInputParams {
|
||||||
AskForInputParams(const QString &prompt_, const QString &placeholder_)
|
AskForInputParams(const QString &prompt_, const QString &placeholder_)
|
||||||
: prompt(prompt_), placeholder(placeholder_){};
|
: prompt(prompt_),
|
||||||
|
placeholder(placeholder_){};
|
||||||
QString prompt;
|
QString prompt;
|
||||||
QString placeholder;
|
QString placeholder;
|
||||||
std::optional<std::string> result;
|
std::optional<std::string> result;
|
||||||
@@ -216,6 +222,38 @@ static void askForInput(void *param)
|
|||||||
parameters->resultReady = true;
|
parameters->resultReady = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string truncate(const std::string &input,
|
||||||
|
MacroActionVariable::Direction direction,
|
||||||
|
size_t length)
|
||||||
|
{
|
||||||
|
if (input.length() <= length) {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (direction == MacroActionVariable::Direction::RIGHT) {
|
||||||
|
return input.substr(0, length);
|
||||||
|
} else {
|
||||||
|
return input.substr(input.length() - length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string pad(const std::string &input,
|
||||||
|
MacroActionVariable::Direction direction, size_t length,
|
||||||
|
char paddingChar)
|
||||||
|
{
|
||||||
|
if (input.length() >= length) {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (direction == MacroActionVariable::Direction::RIGHT) {
|
||||||
|
return input +
|
||||||
|
std::string(length - input.length(), paddingChar);
|
||||||
|
} else {
|
||||||
|
return std::string(length - input.length(), paddingChar) +
|
||||||
|
input;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool MacroActionVariable::PerformAction()
|
bool MacroActionVariable::PerformAction()
|
||||||
{
|
{
|
||||||
auto var = _variable.lock();
|
auto var = _variable.lock();
|
||||||
@@ -310,7 +348,10 @@ bool MacroActionVariable::PerformAction()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case Type::ENV_VARIABLE: {
|
case Type::ENV_VARIABLE: {
|
||||||
var->SetValue(std::getenv(_envVariableName.c_str()));
|
auto value = std::getenv(_envVariableName.c_str());
|
||||||
|
if (value) {
|
||||||
|
var->SetValue(value);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case Type::SCENE_ITEM_COUNT: {
|
case Type::SCENE_ITEM_COUNT: {
|
||||||
@@ -344,6 +385,14 @@ bool MacroActionVariable::PerformAction()
|
|||||||
case Type::SCENE_ITEM_NAME:
|
case Type::SCENE_ITEM_NAME:
|
||||||
SetToSceneItemName(var.get());
|
SetToSceneItemName(var.get());
|
||||||
return true;
|
return true;
|
||||||
|
case Type::PAD:
|
||||||
|
var->SetValue(pad(var->Value(), _direction, _stringLength,
|
||||||
|
_paddingChar));
|
||||||
|
return true;
|
||||||
|
case Type::TRUNCATE:
|
||||||
|
var->SetValue(
|
||||||
|
truncate(var->Value(), _direction, _stringLength));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -377,6 +426,9 @@ bool MacroActionVariable::Save(obs_data_t *obj) const
|
|||||||
_scene.Save(obj);
|
_scene.Save(obj);
|
||||||
_tempVar.Save(obj);
|
_tempVar.Save(obj);
|
||||||
_sceneItemIndex.Save(obj, "sceneItemIndex");
|
_sceneItemIndex.Save(obj, "sceneItemIndex");
|
||||||
|
obs_data_set_int(obj, "direction", static_cast<int>(_direction));
|
||||||
|
_stringLength.Save(obj, "stringLength");
|
||||||
|
obs_data_set_int(obj, "paddingChar", _paddingChar);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,6 +460,13 @@ bool MacroActionVariable::Load(obs_data_t *obj)
|
|||||||
_scene.Load(obj);
|
_scene.Load(obj);
|
||||||
_tempVar.Load(obj, GetMacro());
|
_tempVar.Load(obj, GetMacro());
|
||||||
_sceneItemIndex.Load(obj, "sceneItemIndex");
|
_sceneItemIndex.Load(obj, "sceneItemIndex");
|
||||||
|
_direction = static_cast<Direction>(obs_data_get_int(obj, "direction"));
|
||||||
|
_stringLength.Load(obj, "stringLength");
|
||||||
|
if (obs_data_has_user_value(obj, "paddingChar")) {
|
||||||
|
_paddingChar = obs_data_get_int(obj, "paddingChar");
|
||||||
|
} else {
|
||||||
|
_paddingChar = ' ';
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,6 +481,16 @@ std::string MacroActionVariable::GetShortDesc() const
|
|||||||
return GetWeakVariableName(_variable);
|
return GetWeakVariableName(_variable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<MacroAction> MacroActionVariable::Create(Macro *m)
|
||||||
|
{
|
||||||
|
return std::make_shared<MacroActionVariable>(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<MacroAction> MacroActionVariable::Copy() const
|
||||||
|
{
|
||||||
|
return std::make_shared<MacroActionVariable>(*this);
|
||||||
|
}
|
||||||
|
|
||||||
void MacroActionVariable::SetSegmentIndexValue(int value)
|
void MacroActionVariable::SetSegmentIndexValue(int value)
|
||||||
{
|
{
|
||||||
DecrementCurrentSegmentVariableRef();
|
DecrementCurrentSegmentVariableRef();
|
||||||
@@ -485,6 +554,19 @@ int MacroActionVariable::GetSegmentIndexValue() const
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroActionVariable::ResolveVariablesToFixedValues()
|
||||||
|
{
|
||||||
|
_strValue.ResolveVariables();
|
||||||
|
_findStr.ResolveVariables();
|
||||||
|
_replaceStr.ResolveVariables();
|
||||||
|
_mathExpression.ResolveVariables();
|
||||||
|
_inputPrompt.ResolveVariables();
|
||||||
|
_inputPlaceholder.ResolveVariables();
|
||||||
|
_envVariableName.ResolveVariables();
|
||||||
|
_scene.ResolveVariables();
|
||||||
|
_sceneItemIndex.ResolveVariables();
|
||||||
|
}
|
||||||
|
|
||||||
void MacroActionVariable::DecrementCurrentSegmentVariableRef()
|
void MacroActionVariable::DecrementCurrentSegmentVariableRef()
|
||||||
{
|
{
|
||||||
auto segment = _macroSegment.lock();
|
auto segment = _macroSegment.lock();
|
||||||
@@ -503,6 +585,16 @@ static inline void populateTypeSelection(QComboBox *list)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void populateDirectionSelection(QComboBox *list)
|
||||||
|
{
|
||||||
|
list->addItems(
|
||||||
|
QStringList()
|
||||||
|
<< obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.variable.truncateOrPadDirection.left")
|
||||||
|
<< obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.variable.truncateOrPadDirection.right"));
|
||||||
|
}
|
||||||
|
|
||||||
MacroActionVariableEdit::MacroActionVariableEdit(
|
MacroActionVariableEdit::MacroActionVariableEdit(
|
||||||
QWidget *parent, std::shared_ptr<MacroActionVariable> entryData)
|
QWidget *parent, std::shared_ptr<MacroActionVariable> entryData)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
@@ -539,7 +631,11 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||||||
_scenes(new SceneSelectionWidget(this, true, false, true, true,
|
_scenes(new SceneSelectionWidget(this, true, false, true, true,
|
||||||
true)),
|
true)),
|
||||||
_tempVars(new TempVariableSelection(this)),
|
_tempVars(new TempVariableSelection(this)),
|
||||||
|
_tempVarsHelp(new QLabel()),
|
||||||
_sceneItemIndex(new VariableSpinBox()),
|
_sceneItemIndex(new VariableSpinBox()),
|
||||||
|
_direction(new QComboBox()),
|
||||||
|
_stringLength(new VariableSpinBox()),
|
||||||
|
_paddingCharSelection(new SingleCharSelection()),
|
||||||
_entryLayout(new QHBoxLayout())
|
_entryLayout(new QHBoxLayout())
|
||||||
{
|
{
|
||||||
_numValue->setMinimum(-9999999999);
|
_numValue->setMinimum(-9999999999);
|
||||||
@@ -559,7 +655,18 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||||||
_inputPrompt->setSizePolicy(QSizePolicy::MinimumExpanding,
|
_inputPrompt->setSizePolicy(QSizePolicy::MinimumExpanding,
|
||||||
QSizePolicy::Preferred);
|
QSizePolicy::Preferred);
|
||||||
_sceneItemIndex->setMinimum(1);
|
_sceneItemIndex->setMinimum(1);
|
||||||
|
_stringLength->setMaximum(999);
|
||||||
populateTypeSelection(_actions);
|
populateTypeSelection(_actions);
|
||||||
|
populateDirectionSelection(_direction);
|
||||||
|
|
||||||
|
QString path = GetThemeTypeName() == "Light"
|
||||||
|
? ":/res/images/help.svg"
|
||||||
|
: ":/res/images/help_light.svg";
|
||||||
|
QIcon icon(path);
|
||||||
|
QPixmap pixmap = icon.pixmap(QSize(16, 16));
|
||||||
|
_tempVarsHelp->setPixmap(pixmap);
|
||||||
|
_tempVarsHelp->setToolTip(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.variable.type.setToTempvar.help"));
|
||||||
|
|
||||||
QWidget::connect(_variables, SIGNAL(SelectionChanged(const QString &)),
|
QWidget::connect(_variables, SIGNAL(SelectionChanged(const QString &)),
|
||||||
this, SLOT(VariableChanged(const QString &)));
|
this, SLOT(VariableChanged(const QString &)));
|
||||||
@@ -615,8 +722,17 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||||||
_sceneItemIndex,
|
_sceneItemIndex,
|
||||||
SIGNAL(NumberVariableChanged(const NumberVariable<int> &)),
|
SIGNAL(NumberVariableChanged(const NumberVariable<int> &)),
|
||||||
this, SLOT(SceneItemIndexChanged(const NumberVariable<int> &)));
|
this, SLOT(SceneItemIndexChanged(const NumberVariable<int> &)));
|
||||||
|
QWidget::connect(_direction, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(DirectionChanged(int)));
|
||||||
|
QWidget::connect(
|
||||||
|
_stringLength,
|
||||||
|
SIGNAL(NumberVariableChanged(const NumberVariable<int> &)),
|
||||||
|
this, SLOT(StringLengthChanged(const NumberVariable<int> &)));
|
||||||
|
QWidget::connect(_paddingCharSelection,
|
||||||
|
SIGNAL(CharChanged(const QString &)), this,
|
||||||
|
SLOT(CharSelectionChanged(const QString &)));
|
||||||
|
|
||||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
const std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||||
{"{{variables}}", _variables},
|
{"{{variables}}", _variables},
|
||||||
{"{{variables2}}", _variables2},
|
{"{{variables2}}", _variables2},
|
||||||
{"{{actions}}", _actions},
|
{"{{actions}}", _actions},
|
||||||
@@ -637,10 +753,15 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||||||
{"{{envVariableName}}", _envVariable},
|
{"{{envVariableName}}", _envVariable},
|
||||||
{"{{scenes}}", _scenes},
|
{"{{scenes}}", _scenes},
|
||||||
{"{{tempVars}}", _tempVars},
|
{"{{tempVars}}", _tempVars},
|
||||||
|
{"{{tempVarsHelp}}", _tempVarsHelp},
|
||||||
{"{{sceneItemIndex}}", _sceneItemIndex},
|
{"{{sceneItemIndex}}", _sceneItemIndex},
|
||||||
|
{"{{direction}}", _direction},
|
||||||
|
{"{{stringLength}}", _stringLength},
|
||||||
|
{"{{paddingCharSelection}}", _paddingCharSelection},
|
||||||
};
|
};
|
||||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.variable.entry"),
|
PlaceWidgets(
|
||||||
_entryLayout, widgetPlaceholders);
|
obs_module_text("AdvSceneSwitcher.action.variable.entry.other"),
|
||||||
|
_entryLayout, widgetPlaceholders);
|
||||||
|
|
||||||
PlaceWidgets(
|
PlaceWidgets(
|
||||||
obs_module_text(
|
obs_module_text(
|
||||||
@@ -733,6 +854,10 @@ void MacroActionVariableEdit::UpdateEntryData()
|
|||||||
_scenes->SetScene(_entryData->_scene);
|
_scenes->SetScene(_entryData->_scene);
|
||||||
_tempVars->SetVariable(_entryData->_tempVar);
|
_tempVars->SetVariable(_entryData->_tempVar);
|
||||||
_sceneItemIndex->SetValue(_entryData->_sceneItemIndex);
|
_sceneItemIndex->SetValue(_entryData->_sceneItemIndex);
|
||||||
|
_direction->setCurrentIndex(static_cast<int>(_entryData->_direction));
|
||||||
|
_stringLength->SetValue(_entryData->_stringLength);
|
||||||
|
_paddingCharSelection->setText(
|
||||||
|
QChar::fromLatin1(_entryData->_paddingChar));
|
||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1089,6 +1214,7 @@ void MacroActionVariableEdit::SelectionChanged(const TempVariableRef &var)
|
|||||||
|
|
||||||
auto lock = LockContext();
|
auto lock = LockContext();
|
||||||
_entryData->_tempVar = var;
|
_entryData->_tempVar = var;
|
||||||
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::SceneItemIndexChanged(
|
void MacroActionVariableEdit::SceneItemIndexChanged(
|
||||||
@@ -1102,12 +1228,85 @@ void MacroActionVariableEdit::SceneItemIndexChanged(
|
|||||||
_entryData->_sceneItemIndex = value;
|
_entryData->_sceneItemIndex = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroActionVariableEdit::DirectionChanged(int value)
|
||||||
|
{
|
||||||
|
if (_loading || !_entryData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto lock = LockContext();
|
||||||
|
_entryData->_direction =
|
||||||
|
static_cast<MacroActionVariable::Direction>(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionVariableEdit::StringLengthChanged(
|
||||||
|
const NumberVariable<int> &value)
|
||||||
|
{
|
||||||
|
if (_loading || !_entryData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto lock = LockContext();
|
||||||
|
_entryData->_stringLength = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MacroActionVariableEdit::CharSelectionChanged(const QString &character)
|
||||||
|
{
|
||||||
|
if (_loading || !_entryData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto lock = LockContext();
|
||||||
|
if (character.isEmpty()) {
|
||||||
|
_entryData->_paddingChar = ' ';
|
||||||
|
} else {
|
||||||
|
_entryData->_paddingChar = character.toStdString().at(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MacroActionVariableEdit::SetWidgetVisibility()
|
void MacroActionVariableEdit::SetWidgetVisibility()
|
||||||
{
|
{
|
||||||
if (!_entryData) {
|
if (!_entryData) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||||
|
{"{{variables}}", _variables},
|
||||||
|
{"{{variables2}}", _variables2},
|
||||||
|
{"{{actions}}", _actions},
|
||||||
|
{"{{strValue}}", _strValue},
|
||||||
|
{"{{numValue}}", _numValue},
|
||||||
|
{"{{segmentIndex}}", _segmentIdx},
|
||||||
|
{"{{mathExpression}}", _mathExpression},
|
||||||
|
{"{{envVariableName}}", _envVariable},
|
||||||
|
{"{{scenes}}", _scenes},
|
||||||
|
{"{{tempVars}}", _tempVars},
|
||||||
|
{"{{tempVarsHelp}}", _tempVarsHelp},
|
||||||
|
{"{{sceneItemIndex}}", _sceneItemIndex},
|
||||||
|
{"{{direction}}", _direction},
|
||||||
|
{"{{stringLength}}", _stringLength},
|
||||||
|
{"{{paddingCharSelection}}", _paddingCharSelection},
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *layoutString = "";
|
||||||
|
if (_entryData->_type == MacroActionVariable::Type::PAD) {
|
||||||
|
layoutString = obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.variable.entry.pad");
|
||||||
|
} else if (_entryData->_type == MacroActionVariable::Type::TRUNCATE) {
|
||||||
|
layoutString = obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.variable.entry.truncate");
|
||||||
|
} else {
|
||||||
|
layoutString = obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.variable.entry.other");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto &[_, widget] : widgetPlaceholders) {
|
||||||
|
_entryLayout->removeWidget(widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearLayout(_entryLayout);
|
||||||
|
PlaceWidgets(layoutString, _entryLayout, widgetPlaceholders);
|
||||||
|
|
||||||
if (_entryData->_type == MacroActionVariable::Type::SET_FIXED_VALUE ||
|
if (_entryData->_type == MacroActionVariable::Type::SET_FIXED_VALUE ||
|
||||||
_entryData->_type == MacroActionVariable::Type::APPEND ||
|
_entryData->_type == MacroActionVariable::Type::APPEND ||
|
||||||
_entryData->_type == MacroActionVariable::Type::MATH_EXPRESSION ||
|
_entryData->_type == MacroActionVariable::Type::MATH_EXPRESSION ||
|
||||||
@@ -1196,8 +1395,20 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
|||||||
MacroActionVariable::Type::SCENE_ITEM_NAME);
|
MacroActionVariable::Type::SCENE_ITEM_NAME);
|
||||||
_tempVars->setVisible(_entryData->_type ==
|
_tempVars->setVisible(_entryData->_type ==
|
||||||
MacroActionVariable::Type::SET_TO_TEMPVAR);
|
MacroActionVariable::Type::SET_TO_TEMPVAR);
|
||||||
|
_tempVarsHelp->setVisible(
|
||||||
|
_entryData->_type ==
|
||||||
|
MacroActionVariable::Type::SET_TO_TEMPVAR &&
|
||||||
|
!_entryData->_tempVar.HasValidID());
|
||||||
_sceneItemIndex->setVisible(_entryData->_type ==
|
_sceneItemIndex->setVisible(_entryData->_type ==
|
||||||
MacroActionVariable::Type::SCENE_ITEM_NAME);
|
MacroActionVariable::Type::SCENE_ITEM_NAME);
|
||||||
|
_direction->setVisible(
|
||||||
|
_entryData->_type == MacroActionVariable::Type::PAD ||
|
||||||
|
_entryData->_type == MacroActionVariable::Type::TRUNCATE);
|
||||||
|
_stringLength->setVisible(
|
||||||
|
_entryData->_type == MacroActionVariable::Type::PAD ||
|
||||||
|
_entryData->_type == MacroActionVariable::Type::TRUNCATE);
|
||||||
|
_paddingCharSelection->setVisible(_entryData->_type ==
|
||||||
|
MacroActionVariable::Type::PAD);
|
||||||
adjustSize();
|
adjustSize();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "regex-config.hpp"
|
#include "regex-config.hpp"
|
||||||
#include "resizing-text-edit.hpp"
|
#include "resizing-text-edit.hpp"
|
||||||
#include "scene-selection.hpp"
|
#include "scene-selection.hpp"
|
||||||
|
#include "single-char-selection.hpp"
|
||||||
#include "variable-line-edit.hpp"
|
#include "variable-line-edit.hpp"
|
||||||
#include "variable-text-edit.hpp"
|
#include "variable-text-edit.hpp"
|
||||||
#include "variable-spinbox.hpp"
|
#include "variable-spinbox.hpp"
|
||||||
@@ -17,15 +18,14 @@ public:
|
|||||||
bool PerformAction();
|
bool PerformAction();
|
||||||
bool Save(obs_data_t *obj) const;
|
bool Save(obs_data_t *obj) const;
|
||||||
bool Load(obs_data_t *obj);
|
bool Load(obs_data_t *obj);
|
||||||
bool PostLoad() override;
|
bool PostLoad();
|
||||||
std::string GetShortDesc() const;
|
std::string GetShortDesc() const;
|
||||||
std::string GetId() const { return id; };
|
std::string GetId() const { return id; };
|
||||||
static std::shared_ptr<MacroAction> Create(Macro *m)
|
static std::shared_ptr<MacroAction> Create(Macro *m);
|
||||||
{
|
std::shared_ptr<MacroAction> Copy() const;
|
||||||
return std::make_shared<MacroActionVariable>(m);
|
|
||||||
}
|
|
||||||
void SetSegmentIndexValue(int);
|
void SetSegmentIndexValue(int);
|
||||||
int GetSegmentIndexValue() const;
|
int GetSegmentIndexValue() const;
|
||||||
|
void ResolveVariablesToFixedValues();
|
||||||
|
|
||||||
enum class Type {
|
enum class Type {
|
||||||
SET_FIXED_VALUE,
|
SET_FIXED_VALUE,
|
||||||
@@ -46,6 +46,8 @@ public:
|
|||||||
EXTRACT_JSON,
|
EXTRACT_JSON,
|
||||||
SET_TO_TEMPVAR,
|
SET_TO_TEMPVAR,
|
||||||
SCENE_ITEM_NAME,
|
SCENE_ITEM_NAME,
|
||||||
|
PAD,
|
||||||
|
TRUNCATE,
|
||||||
};
|
};
|
||||||
|
|
||||||
Type _type = Type::SET_FIXED_VALUE;
|
Type _type = Type::SET_FIXED_VALUE;
|
||||||
@@ -80,6 +82,11 @@ public:
|
|||||||
TempVariableRef _tempVar;
|
TempVariableRef _tempVar;
|
||||||
IntVariable _sceneItemIndex = 1;
|
IntVariable _sceneItemIndex = 1;
|
||||||
|
|
||||||
|
enum class Direction { LEFT, RIGHT };
|
||||||
|
Direction _direction = Direction::LEFT;
|
||||||
|
IntVariable _stringLength = 1;
|
||||||
|
char _paddingChar = '0';
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void DecrementCurrentSegmentVariableRef();
|
void DecrementCurrentSegmentVariableRef();
|
||||||
void HandleIndexSubString(Variable *);
|
void HandleIndexSubString(Variable *);
|
||||||
@@ -136,6 +143,9 @@ private slots:
|
|||||||
void SceneChanged(const SceneSelection &);
|
void SceneChanged(const SceneSelection &);
|
||||||
void SelectionChanged(const TempVariableRef &var);
|
void SelectionChanged(const TempVariableRef &var);
|
||||||
void SceneItemIndexChanged(const NumberVariable<int> &);
|
void SceneItemIndexChanged(const NumberVariable<int> &);
|
||||||
|
void DirectionChanged(int);
|
||||||
|
void StringLengthChanged(const NumberVariable<int> &);
|
||||||
|
void CharSelectionChanged(const QString &);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void HeaderInfoChanged(const QString &);
|
void HeaderInfoChanged(const QString &);
|
||||||
@@ -175,7 +185,11 @@ private:
|
|||||||
VariableLineEdit *_envVariable;
|
VariableLineEdit *_envVariable;
|
||||||
SceneSelectionWidget *_scenes;
|
SceneSelectionWidget *_scenes;
|
||||||
TempVariableSelection *_tempVars;
|
TempVariableSelection *_tempVars;
|
||||||
|
QLabel *_tempVarsHelp;
|
||||||
VariableSpinBox *_sceneItemIndex;
|
VariableSpinBox *_sceneItemIndex;
|
||||||
|
QComboBox *_direction;
|
||||||
|
VariableSpinBox *_stringLength;
|
||||||
|
SingleCharSelection *_paddingCharSelection;
|
||||||
QHBoxLayout *_entryLayout;
|
QHBoxLayout *_entryLayout;
|
||||||
|
|
||||||
std::shared_ptr<MacroActionVariable> _entryData;
|
std::shared_ptr<MacroActionVariable> _entryData;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ bool MacroAction::Load(obs_data_t *obj)
|
|||||||
|
|
||||||
void MacroAction::LogAction() const
|
void MacroAction::LogAction() const
|
||||||
{
|
{
|
||||||
vblog(LOG_INFO, "performed action %s", GetId().c_str());
|
ablog(LOG_INFO, "performed action %s", GetId().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroAction::SetEnabled(bool value)
|
void MacroAction::SetEnabled(bool value)
|
||||||
@@ -38,6 +38,8 @@ bool MacroAction::Enabled() const
|
|||||||
return _enabled;
|
return _enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroAction::ResolveVariablesToFixedValues() {}
|
||||||
|
|
||||||
std::string_view MacroAction::GetDefaultID()
|
std::string_view MacroAction::GetDefaultID()
|
||||||
{
|
{
|
||||||
return "scene_switch";
|
return "scene_switch";
|
||||||
|
|||||||
@@ -8,10 +8,17 @@ class EXPORT MacroAction : public MacroSegment {
|
|||||||
public:
|
public:
|
||||||
MacroAction(Macro *m, bool supportsVariableValue = false);
|
MacroAction(Macro *m, bool supportsVariableValue = false);
|
||||||
virtual ~MacroAction() = default;
|
virtual ~MacroAction() = default;
|
||||||
|
virtual std::shared_ptr<MacroAction> Copy() const = 0;
|
||||||
|
|
||||||
virtual bool PerformAction() = 0;
|
virtual bool PerformAction() = 0;
|
||||||
|
virtual void LogAction() const;
|
||||||
|
|
||||||
virtual bool Save(obs_data_t *obj) const = 0;
|
virtual bool Save(obs_data_t *obj) const = 0;
|
||||||
virtual bool Load(obs_data_t *obj) = 0;
|
virtual bool Load(obs_data_t *obj) = 0;
|
||||||
virtual void LogAction() const;
|
|
||||||
|
// Used to resolve variables before actions are added to action queues
|
||||||
|
virtual void ResolveVariablesToFixedValues();
|
||||||
|
|
||||||
void SetEnabled(bool);
|
void SetEnabled(bool);
|
||||||
bool Enabled() const;
|
bool Enabled() const;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "macro-properties.hpp"
|
#include "macro-properties.hpp"
|
||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
#include "path-helpers.hpp"
|
#include "path-helpers.hpp"
|
||||||
|
#include "plugin-state-helpers.hpp"
|
||||||
#include "section.hpp"
|
#include "section.hpp"
|
||||||
#include "ui-helpers.hpp"
|
#include "ui-helpers.hpp"
|
||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
@@ -120,8 +121,7 @@ void DurationModifierEdit::Collapse(bool collapse)
|
|||||||
MacroConditionEdit::MacroConditionEdit(
|
MacroConditionEdit::MacroConditionEdit(
|
||||||
QWidget *parent, std::shared_ptr<MacroCondition> *entryData,
|
QWidget *parent, std::shared_ptr<MacroCondition> *entryData,
|
||||||
const std::string &id, bool root)
|
const std::string &id, bool root)
|
||||||
: MacroSegmentEdit(GetGlobalMacroProperties()._highlightConditions,
|
: MacroSegmentEdit(parent),
|
||||||
parent),
|
|
||||||
_logicSelection(new QComboBox()),
|
_logicSelection(new QComboBox()),
|
||||||
_conditionSelection(new FilterComboBox()),
|
_conditionSelection(new FilterComboBox()),
|
||||||
_dur(new DurationModifierEdit()),
|
_dur(new DurationModifierEdit()),
|
||||||
@@ -138,8 +138,6 @@ MacroConditionEdit::MacroConditionEdit(
|
|||||||
QWidget::connect(_dur, SIGNAL(ModifierChanged(DurationModifier::Type)),
|
QWidget::connect(_dur, SIGNAL(ModifierChanged(DurationModifier::Type)),
|
||||||
this,
|
this,
|
||||||
SLOT(DurationModifierChanged(DurationModifier::Type)));
|
SLOT(DurationModifierChanged(DurationModifier::Type)));
|
||||||
QWidget::connect(window(), SIGNAL(HighlightConditionsChanged(bool)),
|
|
||||||
this, SLOT(EnableHighlight(bool)));
|
|
||||||
|
|
||||||
populateLogicSelection(_logicSelection, root);
|
populateLogicSelection(_logicSelection, root);
|
||||||
populateConditionSelection(_conditionSelection);
|
populateConditionSelection(_conditionSelection);
|
||||||
@@ -254,6 +252,7 @@ void MacroConditionEdit::ConditionSelectionChanged(const QString &text)
|
|||||||
(*_entryData)->SetIndex(idx);
|
(*_entryData)->SetIndex(idx);
|
||||||
(*_entryData)->SetLogicType(logic);
|
(*_entryData)->SetLogicType(logic);
|
||||||
(*_entryData)->PostLoad();
|
(*_entryData)->PostLoad();
|
||||||
|
RunPostLoadSteps();
|
||||||
}
|
}
|
||||||
auto widget =
|
auto widget =
|
||||||
MacroConditionFactory::CreateWidget(id, this, *_entryData);
|
MacroConditionFactory::CreateWidget(id, this, *_entryData);
|
||||||
@@ -297,6 +296,7 @@ void AdvSceneSwitcher::AddMacroCondition(int idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (idx < 0 || idx > (int)macro->Conditions().size()) {
|
if (idx < 0 || idx > (int)macro->Conditions().size()) {
|
||||||
|
assert(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,18 +313,34 @@ void AdvSceneSwitcher::AddMacroCondition(int idx)
|
|||||||
id = MacroCondition::GetDefaultID();
|
id = MacroCondition::GetDefaultID();
|
||||||
logic = LogicType::ROOT_NONE;
|
logic = LogicType::ROOT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OBSDataAutoRelease data;
|
||||||
|
if (idx - 1 >= 0) {
|
||||||
|
data = obs_data_create();
|
||||||
|
macro->Conditions().at(idx - 1)->Save(data);
|
||||||
|
}
|
||||||
|
AddMacroCondition(macro.get(), idx, id, data.Get(), logic);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::AddMacroCondition(Macro *macro, int idx,
|
||||||
|
const std::string &id,
|
||||||
|
obs_data_t *data, LogicType logic)
|
||||||
|
{
|
||||||
|
if (idx < 0 || idx > (int)macro->Conditions().size()) {
|
||||||
|
assert(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
auto lock = LockContext();
|
auto lock = LockContext();
|
||||||
auto cond = macro->Conditions().emplace(
|
auto cond = macro->Conditions().emplace(
|
||||||
macro->Conditions().begin() + idx,
|
macro->Conditions().begin() + idx,
|
||||||
MacroConditionFactory::Create(id, macro.get()));
|
MacroConditionFactory::Create(id, macro));
|
||||||
if (idx - 1 >= 0) {
|
if (data) {
|
||||||
auto data = obs_data_create();
|
|
||||||
macro->Conditions().at(idx - 1)->Save(data);
|
|
||||||
macro->Conditions().at(idx)->Load(data);
|
macro->Conditions().at(idx)->Load(data);
|
||||||
obs_data_release(data);
|
|
||||||
}
|
}
|
||||||
macro->Conditions().at(idx)->PostLoad();
|
macro->Conditions().at(idx)->PostLoad();
|
||||||
|
RunPostLoadSteps();
|
||||||
(*cond)->SetLogicType(logic);
|
(*cond)->SetLogicType(logic);
|
||||||
macro->UpdateConditionIndices();
|
macro->UpdateConditionIndices();
|
||||||
ui->conditionsList->Insert(
|
ui->conditionsList->Insert(
|
||||||
@@ -334,6 +350,7 @@ void AdvSceneSwitcher::AddMacroCondition(int idx)
|
|||||||
SetConditionData(*macro);
|
SetConditionData(*macro);
|
||||||
}
|
}
|
||||||
HighlightCondition(idx);
|
HighlightCondition(idx);
|
||||||
|
ui->conditionsList->SetHelpMsgVisible(false);
|
||||||
emit(MacroSegmentOrderChanged());
|
emit(MacroSegmentOrderChanged());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,7 +369,6 @@ void AdvSceneSwitcher::on_conditionAdd_clicked()
|
|||||||
if (currentConditionIdx != -1) {
|
if (currentConditionIdx != -1) {
|
||||||
MacroConditionSelectionChanged(currentConditionIdx + 1);
|
MacroConditionSelectionChanged(currentConditionIdx + 1);
|
||||||
}
|
}
|
||||||
ui->conditionsList->SetHelpMsgVisible(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::RemoveMacroCondition(int idx)
|
void AdvSceneSwitcher::RemoveMacroCondition(int idx)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public:
|
|||||||
bool CheckCondition();
|
bool CheckCondition();
|
||||||
bool Save(obs_data_t *obj) const;
|
bool Save(obs_data_t *obj) const;
|
||||||
bool Load(obs_data_t *obj);
|
bool Load(obs_data_t *obj);
|
||||||
bool PostLoad() override;
|
bool PostLoad();
|
||||||
std::string GetShortDesc() const;
|
std::string GetShortDesc() const;
|
||||||
std::string GetId() const { return id; };
|
std::string GetId() const { return id; };
|
||||||
static std::shared_ptr<MacroCondition> Create(Macro *m)
|
static std::shared_ptr<MacroCondition> Create(Macro *m)
|
||||||
|
|||||||
@@ -8,8 +8,13 @@
|
|||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
|
static bool usePlainText = false;
|
||||||
|
|
||||||
MacroExportImportDialog::MacroExportImportDialog(Type type)
|
MacroExportImportDialog::MacroExportImportDialog(Type type)
|
||||||
: QDialog(nullptr), _importExportString(new QPlainTextEdit(this))
|
: QDialog(nullptr),
|
||||||
|
_importExportString(new QPlainTextEdit(this)),
|
||||||
|
_usePlainText(new QCheckBox(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.export.usePlainText")))
|
||||||
{
|
{
|
||||||
_importExportString->setReadOnly(type == Type::EXPORT_MACRO);
|
_importExportString->setReadOnly(type == Type::EXPORT_MACRO);
|
||||||
auto label = new QLabel(obs_module_text(
|
auto label = new QLabel(obs_module_text(
|
||||||
@@ -29,9 +34,15 @@ MacroExportImportDialog::MacroExportImportDialog(Type type)
|
|||||||
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
buttons->setCenterButtons(true);
|
buttons->setCenterButtons(true);
|
||||||
|
|
||||||
|
_usePlainText->setChecked(usePlainText);
|
||||||
|
_usePlainText->setVisible(type == Type::EXPORT_MACRO);
|
||||||
|
connect(_usePlainText, &QCheckBox::stateChanged, this,
|
||||||
|
&MacroExportImportDialog::UsePlainTextChanged);
|
||||||
|
|
||||||
auto layout = new QVBoxLayout;
|
auto layout = new QVBoxLayout;
|
||||||
layout->addWidget(label);
|
layout->addWidget(label);
|
||||||
layout->addWidget(_importExportString);
|
layout->addWidget(_importExportString);
|
||||||
|
layout->addWidget(_usePlainText);
|
||||||
layout->addWidget(buttons);
|
layout->addWidget(buttons);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
@@ -64,6 +75,21 @@ void MacroExportImportDialog::ExportMacros(const QString &json)
|
|||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroExportImportDialog::UsePlainTextChanged(int value)
|
||||||
|
{
|
||||||
|
if (usePlainText == (!!value)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto current = _importExportString->toPlainText();
|
||||||
|
if (usePlainText) {
|
||||||
|
_importExportString->setPlainText(compressMacroString(current));
|
||||||
|
} else {
|
||||||
|
_importExportString->setPlainText(
|
||||||
|
decompressMacroString(current));
|
||||||
|
}
|
||||||
|
usePlainText = value;
|
||||||
|
}
|
||||||
|
|
||||||
static bool isValidData(const QString &json)
|
static bool isValidData(const QString &json)
|
||||||
{
|
{
|
||||||
OBSDataAutoRelease data =
|
OBSDataAutoRelease data =
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
|
|
||||||
@@ -13,8 +14,12 @@ public:
|
|||||||
static void ExportMacros(const QString &json);
|
static void ExportMacros(const QString &json);
|
||||||
static bool ImportMacros(QString &json);
|
static bool ImportMacros(QString &json);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void UsePlainTextChanged(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPlainTextEdit *_importExportString;
|
QPlainTextEdit *_importExportString;
|
||||||
|
QCheckBox *_usePlainText;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ MacroPropertiesDialog::MacroPropertiesDialog(QWidget *parent,
|
|||||||
"AdvSceneSwitcher.macroTab.currentDisableHotkeys"))),
|
"AdvSceneSwitcher.macroTab.currentDisableHotkeys"))),
|
||||||
_currentSkipOnStartup(new QCheckBox(obs_module_text(
|
_currentSkipOnStartup(new QCheckBox(obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.currentSkipExecutionOnStartup"))),
|
"AdvSceneSwitcher.macroTab.currentSkipExecutionOnStartup"))),
|
||||||
|
_currentStopActionsIfNotDone(new QCheckBox(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.currentStopActionsIfNotDone"))),
|
||||||
_currentMacroRegisterDock(new QCheckBox(obs_module_text(
|
_currentMacroRegisterDock(new QCheckBox(obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.currentRegisterDock"))),
|
"AdvSceneSwitcher.macroTab.currentRegisterDock"))),
|
||||||
_currentMacroDockAddRunButton(new QCheckBox(obs_module_text(
|
_currentMacroDockAddRunButton(new QCheckBox(obs_module_text(
|
||||||
@@ -96,6 +98,7 @@ MacroPropertiesDialog::MacroPropertiesDialog(QWidget *parent,
|
|||||||
obs_module_text("AdvSceneSwitcher.macroTab.generalSettings"));
|
obs_module_text("AdvSceneSwitcher.macroTab.generalSettings"));
|
||||||
auto generalLayout = new QVBoxLayout;
|
auto generalLayout = new QVBoxLayout;
|
||||||
generalLayout->addWidget(_currentSkipOnStartup);
|
generalLayout->addWidget(_currentSkipOnStartup);
|
||||||
|
generalLayout->addWidget(_currentStopActionsIfNotDone);
|
||||||
generalOptions->setLayout(generalLayout);
|
generalOptions->setLayout(generalLayout);
|
||||||
|
|
||||||
int row = 0;
|
int row = 0;
|
||||||
@@ -184,14 +187,17 @@ MacroPropertiesDialog::MacroPropertiesDialog(QWidget *parent,
|
|||||||
_conditions->setChecked(prop._highlightConditions);
|
_conditions->setChecked(prop._highlightConditions);
|
||||||
_actions->setChecked(prop._highlightActions);
|
_actions->setChecked(prop._highlightActions);
|
||||||
_newMacroRegisterHotkeys->setChecked(prop._newMacroRegisterHotkeys);
|
_newMacroRegisterHotkeys->setChecked(prop._newMacroRegisterHotkeys);
|
||||||
|
|
||||||
if (!macro || macro->IsGroup()) {
|
if (!macro || macro->IsGroup()) {
|
||||||
hotkeyOptions->hide();
|
hotkeyOptions->hide();
|
||||||
generalOptions->hide();
|
generalOptions->hide();
|
||||||
_dockOptions->hide();
|
_dockOptions->hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_currentMacroRegisterHotkeys->setChecked(macro->PauseHotkeysEnabled());
|
_currentMacroRegisterHotkeys->setChecked(macro->PauseHotkeysEnabled());
|
||||||
_currentSkipOnStartup->setChecked(macro->SkipExecOnStart());
|
_currentSkipOnStartup->setChecked(macro->SkipExecOnStart());
|
||||||
|
_currentStopActionsIfNotDone->setChecked(macro->StopActionsIfNotDone());
|
||||||
const bool dockEnabled = macro->DockEnabled();
|
const bool dockEnabled = macro->DockEnabled();
|
||||||
_currentMacroRegisterDock->setChecked(dockEnabled);
|
_currentMacroRegisterDock->setChecked(dockEnabled);
|
||||||
_currentMacroDockAddRunButton->setChecked(macro->DockHasRunButton());
|
_currentMacroDockAddRunButton->setChecked(macro->DockHasRunButton());
|
||||||
@@ -260,6 +266,7 @@ void MacroPropertiesDialog::DockEnableChanged(int enabled)
|
|||||||
SetGridLayoutRowVisible(
|
SetGridLayoutRowVisible(
|
||||||
_dockLayout, _conditionsFalseTextRow,
|
_dockLayout, _conditionsFalseTextRow,
|
||||||
enabled && _currentMacroDockAddStatusLabel->isChecked());
|
enabled && _currentMacroDockAddStatusLabel->isChecked());
|
||||||
|
|
||||||
Resize();
|
Resize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,6 +317,8 @@ bool MacroPropertiesDialog::AskForSettings(QWidget *parent,
|
|||||||
macro->EnablePauseHotkeys(
|
macro->EnablePauseHotkeys(
|
||||||
dialog._currentMacroRegisterHotkeys->isChecked());
|
dialog._currentMacroRegisterHotkeys->isChecked());
|
||||||
macro->SetSkipExecOnStart(dialog._currentSkipOnStartup->isChecked());
|
macro->SetSkipExecOnStart(dialog._currentSkipOnStartup->isChecked());
|
||||||
|
macro->SetStopActionsIfNotDone(
|
||||||
|
dialog._currentStopActionsIfNotDone->isChecked());
|
||||||
macro->EnableDock(dialog._currentMacroRegisterDock->isChecked());
|
macro->EnableDock(dialog._currentMacroRegisterDock->isChecked());
|
||||||
macro->SetDockHasRunButton(
|
macro->SetDockHasRunButton(
|
||||||
dialog._currentMacroDockAddRunButton->isChecked());
|
dialog._currentMacroDockAddRunButton->isChecked());
|
||||||
@@ -328,6 +337,7 @@ bool MacroPropertiesDialog::AskForSettings(QWidget *parent,
|
|||||||
dialog._conditionsTrueStatusText->text().toStdString());
|
dialog._conditionsTrueStatusText->text().toStdString());
|
||||||
macro->SetConditionsFalseStatusText(
|
macro->SetConditionsFalseStatusText(
|
||||||
dialog._conditionsFalseStatusText->text().toStdString());
|
dialog._conditionsFalseStatusText->text().toStdString());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ private:
|
|||||||
// Current macro specific settings
|
// Current macro specific settings
|
||||||
QCheckBox *_currentMacroRegisterHotkeys;
|
QCheckBox *_currentMacroRegisterHotkeys;
|
||||||
QCheckBox *_currentSkipOnStartup;
|
QCheckBox *_currentSkipOnStartup;
|
||||||
|
QCheckBox *_currentStopActionsIfNotDone;
|
||||||
QCheckBox *_currentMacroRegisterDock;
|
QCheckBox *_currentMacroRegisterDock;
|
||||||
QCheckBox *_currentMacroDockAddRunButton;
|
QCheckBox *_currentMacroDockAddRunButton;
|
||||||
QCheckBox *_currentMacroDockAddPauseButton;
|
QCheckBox *_currentMacroDockAddPauseButton;
|
||||||
|
|||||||
@@ -96,11 +96,15 @@ void MacroRunButton::Pressed()
|
|||||||
|
|
||||||
bool ret = _elseStateActive ? macro->PerformActions(false, true, true)
|
bool ret = _elseStateActive ? macro->PerformActions(false, true, true)
|
||||||
: macro->PerformActions(true, true, true);
|
: macro->PerformActions(true, true, true);
|
||||||
|
if (ret) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ret) {
|
QString err = obs_module_text("AdvSceneSwitcher.macroTab.runFail");
|
||||||
QString err =
|
const bool abortMacro = DisplayMessage(
|
||||||
obs_module_text("AdvSceneSwitcher.macroTab.runFail");
|
err.arg(QString::fromStdString(macro->Name())), true);
|
||||||
DisplayMessage(err.arg(QString::fromStdString(macro->Name())));
|
if (abortMacro) {
|
||||||
|
macro->Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
104
lib/macro/macro-segment-copy-paste.cpp
Normal file
104
lib/macro/macro-segment-copy-paste.cpp
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
#include "advanced-scene-switcher.hpp"
|
||||||
|
#include "macro.hpp"
|
||||||
|
|
||||||
|
#include <QShortcut>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
struct MacroSegmentCopyInfo {
|
||||||
|
enum class Type { NONE, CONDITION, ACTION, ELSE };
|
||||||
|
Type type = Type::NONE;
|
||||||
|
std::shared_ptr<MacroSegment> segment;
|
||||||
|
};
|
||||||
|
static MacroSegmentCopyInfo copyInfo;
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::CopyMacroSegment()
|
||||||
|
{
|
||||||
|
copyInfo.segment.reset();
|
||||||
|
copyInfo.type = MacroSegmentCopyInfo::Type::NONE;
|
||||||
|
|
||||||
|
if (currentConditionIdx == -1 && currentActionIdx == -1 &&
|
||||||
|
currentElseActionIdx == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto macro = GetSelectedMacro();
|
||||||
|
if (!macro) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentConditionIdx != -1) {
|
||||||
|
copyInfo.type = MacroSegmentCopyInfo::Type::CONDITION;
|
||||||
|
copyInfo.segment = macro->Conditions().at(currentConditionIdx);
|
||||||
|
} else if (currentActionIdx != -1) {
|
||||||
|
copyInfo.type = MacroSegmentCopyInfo::Type::ACTION;
|
||||||
|
copyInfo.segment = macro->Actions().at(currentActionIdx);
|
||||||
|
} else if (currentElseActionIdx != -1) {
|
||||||
|
copyInfo.type = MacroSegmentCopyInfo::Type::ELSE;
|
||||||
|
copyInfo.segment =
|
||||||
|
macro->ElseActions().at(currentElseActionIdx);
|
||||||
|
} else {
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::PasteMacroSegment()
|
||||||
|
{
|
||||||
|
if (copyInfo.type == MacroSegmentCopyInfo::Type::NONE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto macro = GetSelectedMacro();
|
||||||
|
if (!macro || !copyInfo.segment) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
OBSDataAutoRelease data = obs_data_create();
|
||||||
|
copyInfo.segment->Save(data);
|
||||||
|
|
||||||
|
switch (copyInfo.type) {
|
||||||
|
case MacroSegmentCopyInfo::Type::CONDITION: {
|
||||||
|
const auto condition = std::static_pointer_cast<MacroCondition>(
|
||||||
|
copyInfo.segment);
|
||||||
|
auto logic = condition->GetLogicType();
|
||||||
|
if (logic > LogicType::ROOT_LAST &&
|
||||||
|
macro->Conditions().empty()) {
|
||||||
|
logic = LogicType::ROOT_NONE;
|
||||||
|
}
|
||||||
|
if (logic < LogicType::ROOT_LAST &&
|
||||||
|
!macro->Conditions().empty()) {
|
||||||
|
logic = LogicType::OR;
|
||||||
|
}
|
||||||
|
AddMacroCondition(macro.get(), macro->Conditions().size(),
|
||||||
|
copyInfo.segment->GetId(), data.Get(), logic);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case MacroSegmentCopyInfo::Type::ACTION:
|
||||||
|
AddMacroAction(macro.get(), macro->Actions().size(),
|
||||||
|
copyInfo.segment->GetId(), data.Get());
|
||||||
|
break;
|
||||||
|
case MacroSegmentCopyInfo::Type::ELSE:
|
||||||
|
AddMacroElseAction(macro.get(), macro->ElseActions().size(),
|
||||||
|
copyInfo.segment->GetId(), data.Get());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MacroSegmentIsInClipboard()
|
||||||
|
{
|
||||||
|
return copyInfo.type != MacroSegmentCopyInfo::Type::NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetupSegmentCopyPasteShortcutHandlers(AdvSceneSwitcher *window)
|
||||||
|
{
|
||||||
|
auto copyShortcut = new QShortcut(QKeySequence("Ctrl+C"), window);
|
||||||
|
QWidget::connect(copyShortcut, &QShortcut::activated, window,
|
||||||
|
&AdvSceneSwitcher::CopyMacroSegment);
|
||||||
|
auto pasteShortcut = new QShortcut(QKeySequence("Ctrl+V"), window);
|
||||||
|
QWidget::connect(pasteShortcut, &QShortcut::activated, window,
|
||||||
|
&AdvSceneSwitcher::PasteMacroSegment);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
8
lib/macro/macro-segment-copy-paste.hpp
Normal file
8
lib/macro/macro-segment-copy-paste.hpp
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace advss {
|
||||||
|
|
||||||
|
class AdvSceneSwitcher;
|
||||||
|
|
||||||
|
bool MacroSegmentIsInClipboard();
|
||||||
|
void SetupSegmentCopyPasteShortcutHandlers(AdvSceneSwitcher *window);
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
@@ -176,7 +176,8 @@ bool MacroSegmentList::eventFilter(QObject *object, QEvent *event)
|
|||||||
|
|
||||||
void MacroSegmentList::mousePressEvent(QMouseEvent *event)
|
void MacroSegmentList::mousePressEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton) {
|
if (event->button() == Qt::LeftButton ||
|
||||||
|
event->button() == Qt::RightButton) {
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
_dragPosition = GetDragIndex(event->globalPos());
|
_dragPosition = GetDragIndex(event->globalPos());
|
||||||
#else
|
#else
|
||||||
@@ -246,6 +247,11 @@ MacroSegmentEdit *MacroSegmentList::WidgetAt(int idx)
|
|||||||
return static_cast<MacroSegmentEdit *>(item->widget());
|
return static_cast<MacroSegmentEdit *>(item->widget());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MacroSegmentEdit *MacroSegmentList::WidgetAt(const QPoint &pos)
|
||||||
|
{
|
||||||
|
return WidgetAt(GetSegmentIndexFromPos(mapToGlobal(pos)));
|
||||||
|
}
|
||||||
|
|
||||||
void MacroSegmentList::HideLastDropLine()
|
void MacroSegmentList::HideLastDropLine()
|
||||||
{
|
{
|
||||||
if (_dropLineIdx >= 0 && _dropLineIdx < _contentLayout->count()) {
|
if (_dropLineIdx >= 0 && _dropLineIdx < _contentLayout->count()) {
|
||||||
@@ -319,7 +325,7 @@ QRect MacroSegmentList::GetContentItemRectWithPadding(int idx)
|
|||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MacroSegmentList::GetWidgetIdx(const QPoint &pos)
|
int MacroSegmentList::GetSegmentIndexFromPos(const QPoint &pos)
|
||||||
{
|
{
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
for (int i = 0; i < _contentLayout->count(); ++i) {
|
for (int i = 0; i < _contentLayout->count(); ++i) {
|
||||||
@@ -359,7 +365,7 @@ void MacroSegmentList::CheckScroll()
|
|||||||
|
|
||||||
void MacroSegmentList::CheckDropLine(const QPoint &pos)
|
void MacroSegmentList::CheckDropLine(const QPoint &pos)
|
||||||
{
|
{
|
||||||
int idx = GetWidgetIdx(pos);
|
int idx = GetSegmentIndexFromPos(pos);
|
||||||
if (idx == _dragPosition) {
|
if (idx == _dragPosition) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -410,7 +416,7 @@ bool MacroSegmentList::IsInListArea(const QPoint &pos)
|
|||||||
|
|
||||||
int MacroSegmentList::GetDropIndex(const QPoint &pos)
|
int MacroSegmentList::GetDropIndex(const QPoint &pos)
|
||||||
{
|
{
|
||||||
int idx = GetWidgetIdx(pos);
|
int idx = GetSegmentIndexFromPos(pos);
|
||||||
if (idx == _dragPosition) {
|
if (idx == _dragPosition) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ public:
|
|||||||
void SetHelpMsg(const QString &msg);
|
void SetHelpMsg(const QString &msg);
|
||||||
void SetHelpMsgVisible(bool visible);
|
void SetHelpMsgVisible(bool visible);
|
||||||
MacroSegmentEdit *WidgetAt(int idx);
|
MacroSegmentEdit *WidgetAt(int idx);
|
||||||
|
MacroSegmentEdit *WidgetAt(const QPoint &);
|
||||||
void Insert(int idx, MacroSegmentEdit *widget);
|
void Insert(int idx, MacroSegmentEdit *widget);
|
||||||
void Add(QWidget *widget);
|
void Add(QWidget *widget);
|
||||||
void Remove(int idx);
|
void Remove(int idx);
|
||||||
@@ -44,7 +45,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
int GetDragIndex(const QPoint &);
|
int GetDragIndex(const QPoint &);
|
||||||
int GetDropIndex(const QPoint &);
|
int GetDropIndex(const QPoint &);
|
||||||
int GetWidgetIdx(const QPoint &);
|
int GetSegmentIndexFromPos(const QPoint &);
|
||||||
void CheckScroll();
|
void CheckScroll();
|
||||||
void CheckDropLine(const QPoint &);
|
void CheckDropLine(const QPoint &);
|
||||||
bool IsInListArea(const QPoint &);
|
bool IsInListArea(const QPoint &);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include "section.hpp"
|
#include "section.hpp"
|
||||||
#include "ui-helpers.hpp"
|
#include "ui-helpers.hpp"
|
||||||
|
|
||||||
#include <obs.hpp>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@@ -14,19 +13,37 @@
|
|||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
MacroSegment::MacroSegment(Macro *m, bool supportsVariableValue)
|
MacroSegment::MacroSegment(Macro *m, bool supportsVariableValue)
|
||||||
: _macro(m), _supportsVariableValue(supportsVariableValue)
|
: _macro(m),
|
||||||
|
_supportsVariableValue(supportsVariableValue)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroSegment::Save(obs_data_t *obj) const
|
bool MacroSegment::Save(obs_data_t *obj) const
|
||||||
{
|
{
|
||||||
obs_data_set_bool(obj, "collapsed", static_cast<int>(_collapsed));
|
OBSDataAutoRelease data = obs_data_create();
|
||||||
|
obs_data_set_bool(data, "collapsed", _collapsed);
|
||||||
|
obs_data_set_bool(data, "useCustomLabel", _useCustomLabel);
|
||||||
|
obs_data_set_string(data, "customLabel", _customLabel.c_str());
|
||||||
|
obs_data_set_obj(obj, "segmentSettings", data);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroSegment::Load(obs_data_t *obj)
|
bool MacroSegment::Load(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
_collapsed = obs_data_get_bool(obj, "collapsed");
|
// TODO: remove this fallback at some point
|
||||||
|
if (obs_data_has_user_value(obj, "segmentSettings")) {
|
||||||
|
OBSDataAutoRelease data =
|
||||||
|
obs_data_get_obj(obj, "segmentSettings");
|
||||||
|
_collapsed = obs_data_get_bool(data, "collapsed");
|
||||||
|
_useCustomLabel = obs_data_get_bool(data, "useCustomLabel");
|
||||||
|
_customLabel = obs_data_get_string(data, "customLabel");
|
||||||
|
} else {
|
||||||
|
_collapsed = obs_data_get_bool(obj, "collapsed");
|
||||||
|
_useCustomLabel = false;
|
||||||
|
_customLabel = obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.segment.defaultCustomLabel");
|
||||||
|
}
|
||||||
|
|
||||||
ClearAvailableTempvars();
|
ClearAvailableTempvars();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -42,12 +59,12 @@ std::string MacroSegment::GetShortDesc() const
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSegment::SetHighlight()
|
void MacroSegment::EnableHighlight()
|
||||||
{
|
{
|
||||||
_highlight = true;
|
_highlight = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroSegment::Highlight()
|
bool MacroSegment::GetHighlightAndReset()
|
||||||
{
|
{
|
||||||
if (_highlight) {
|
if (_highlight) {
|
||||||
_highlight = false;
|
_highlight = false;
|
||||||
@@ -177,7 +194,7 @@ void DecrementVariableRef(MacroSegment *segment)
|
|||||||
segment->_variableRefs--;
|
segment->_variableRefs--;
|
||||||
}
|
}
|
||||||
|
|
||||||
MacroSegmentEdit::MacroSegmentEdit(bool highlight, QWidget *parent)
|
MacroSegmentEdit::MacroSegmentEdit(QWidget *parent)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
_section(new Section(300)),
|
_section(new Section(300)),
|
||||||
_headerInfo(new QLabel()),
|
_headerInfo(new QLabel()),
|
||||||
@@ -186,8 +203,7 @@ MacroSegmentEdit::MacroSegmentEdit(bool highlight, QWidget *parent)
|
|||||||
_noBorderframe(new QFrame),
|
_noBorderframe(new QFrame),
|
||||||
_borderFrame(new QFrame),
|
_borderFrame(new QFrame),
|
||||||
_dropLineAbove(new QFrame),
|
_dropLineAbove(new QFrame),
|
||||||
_dropLineBelow(new QFrame),
|
_dropLineBelow(new QFrame)
|
||||||
_showHighlight(highlight)
|
|
||||||
{
|
{
|
||||||
_dropLineAbove->setLineWidth(3);
|
_dropLineAbove->setLineWidth(3);
|
||||||
_dropLineAbove->setFixedHeight(11);
|
_dropLineAbove->setFixedHeight(11);
|
||||||
@@ -265,10 +281,6 @@ MacroSegmentEdit::MacroSegmentEdit(bool highlight, QWidget *parent)
|
|||||||
|
|
||||||
// Enable dragging while clicking on the header text
|
// Enable dragging while clicking on the header text
|
||||||
_headerInfo->installEventFilter(this);
|
_headerInfo->installEventFilter(this);
|
||||||
|
|
||||||
_timer.setInterval(1500);
|
|
||||||
connect(&_timer, SIGNAL(timeout()), this, SLOT(Highlight()));
|
|
||||||
_timer.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroSegmentEdit::eventFilter(QObject *obj, QEvent *ev)
|
bool MacroSegmentEdit::eventFilter(QObject *obj, QEvent *ev)
|
||||||
@@ -296,6 +308,12 @@ bool MacroSegmentEdit::eventFilter(QObject *obj, QEvent *ev)
|
|||||||
|
|
||||||
void MacroSegmentEdit::HeaderInfoChanged(const QString &text)
|
void MacroSegmentEdit::HeaderInfoChanged(const QString &text)
|
||||||
{
|
{
|
||||||
|
if (Data() && Data()->GetUseCustomLabel()) {
|
||||||
|
_headerInfo->show();
|
||||||
|
_headerInfo->setText(
|
||||||
|
QString::fromStdString(Data()->GetCustomLabel()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
_headerInfo->setVisible(!text.isEmpty());
|
_headerInfo->setVisible(!text.isEmpty());
|
||||||
_headerInfo->setText(text);
|
_headerInfo->setText(text);
|
||||||
}
|
}
|
||||||
@@ -307,22 +325,6 @@ void MacroSegmentEdit::Collapsed(bool collapsed)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroSegmentEdit::Highlight()
|
|
||||||
{
|
|
||||||
if (!Data()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_showHighlight && Data()->Highlight()) {
|
|
||||||
PulseWidget(this, Qt::green, QColor(0, 0, 0, 0), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MacroSegmentEdit::EnableHighlight(bool value)
|
|
||||||
{
|
|
||||||
_showHighlight = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MacroSegmentEdit::SetFocusPolicyOfWidgets()
|
void MacroSegmentEdit::SetFocusPolicyOfWidgets()
|
||||||
{
|
{
|
||||||
QList<QWidget *> widgets = this->findChildren<QWidget *>();
|
QList<QWidget *> widgets = this->findChildren<QWidget *>();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <obs.hpp>
|
#include <obs-data.h>
|
||||||
|
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
|
||||||
@@ -28,13 +28,17 @@ public:
|
|||||||
int GetIndex() const { return _idx; }
|
int GetIndex() const { return _idx; }
|
||||||
void SetCollapsed(bool collapsed) { _collapsed = collapsed; }
|
void SetCollapsed(bool collapsed) { _collapsed = collapsed; }
|
||||||
bool GetCollapsed() const { return _collapsed; }
|
bool GetCollapsed() const { return _collapsed; }
|
||||||
|
void SetUseCustomLabel(bool enable) { _useCustomLabel = enable; }
|
||||||
|
bool GetUseCustomLabel() const { return _useCustomLabel; }
|
||||||
|
void SetCustomLabel(const std::string &label) { _customLabel = label; }
|
||||||
|
std::string GetCustomLabel() const { return _customLabel; }
|
||||||
virtual bool Save(obs_data_t *obj) const = 0;
|
virtual bool Save(obs_data_t *obj) const = 0;
|
||||||
virtual bool Load(obs_data_t *obj) = 0;
|
virtual bool Load(obs_data_t *obj) = 0;
|
||||||
virtual bool PostLoad();
|
virtual bool PostLoad();
|
||||||
virtual std::string GetShortDesc() const;
|
virtual std::string GetShortDesc() const;
|
||||||
virtual std::string GetId() const = 0;
|
virtual std::string GetId() const = 0;
|
||||||
void SetHighlight();
|
void EnableHighlight();
|
||||||
bool Highlight();
|
bool GetHighlightAndReset();
|
||||||
virtual std::string GetVariableValue() const;
|
virtual std::string GetVariableValue() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -63,6 +67,11 @@ private:
|
|||||||
bool _highlight = false;
|
bool _highlight = false;
|
||||||
bool _collapsed = false;
|
bool _collapsed = false;
|
||||||
|
|
||||||
|
// Custom header labels
|
||||||
|
bool _useCustomLabel = false;
|
||||||
|
std::string _customLabel = obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.segment.defaultCustomLabel");
|
||||||
|
|
||||||
// Variable helpers
|
// Variable helpers
|
||||||
const bool _supportsVariableValue = false;
|
const bool _supportsVariableValue = false;
|
||||||
int _variableRefs = 0;
|
int _variableRefs = 0;
|
||||||
@@ -78,7 +87,7 @@ class MacroSegmentEdit : public QWidget {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MacroSegmentEdit(bool highlight, QWidget *parent = nullptr);
|
MacroSegmentEdit(QWidget *parent = nullptr);
|
||||||
// Use this function to avoid accidental edits when scrolling through
|
// Use this function to avoid accidental edits when scrolling through
|
||||||
// list of actions and conditions
|
// list of actions and conditions
|
||||||
void SetFocusPolicyOfWidgets();
|
void SetFocusPolicyOfWidgets();
|
||||||
@@ -86,11 +95,11 @@ public:
|
|||||||
void SetSelected(bool);
|
void SetSelected(bool);
|
||||||
virtual std::shared_ptr<MacroSegment> Data() const = 0;
|
virtual std::shared_ptr<MacroSegment> Data() const = 0;
|
||||||
|
|
||||||
protected slots:
|
public slots:
|
||||||
void HeaderInfoChanged(const QString &);
|
void HeaderInfoChanged(const QString &);
|
||||||
|
|
||||||
|
protected slots:
|
||||||
void Collapsed(bool);
|
void Collapsed(bool);
|
||||||
void Highlight();
|
|
||||||
void EnableHighlight(bool);
|
|
||||||
signals:
|
signals:
|
||||||
void MacroAdded(const QString &name);
|
void MacroAdded(const QString &name);
|
||||||
void MacroRemoved(const QString &name);
|
void MacroRemoved(const QString &name);
|
||||||
@@ -116,8 +125,8 @@ private:
|
|||||||
|
|
||||||
void ShowDropLine(DropLineState);
|
void ShowDropLine(DropLineState);
|
||||||
|
|
||||||
// The reason for using two separate frame widget each with their own
|
// The reason for using two separate frame widgets, each with their own
|
||||||
// stylesheet and changing their visibility vs. using a single frame
|
// stylesheet, and changing their visibility vs. using a single frame
|
||||||
// and changing the stylesheet at runtime is that the operation of
|
// and changing the stylesheet at runtime is that the operation of
|
||||||
// adjusting the stylesheet is very expensive and can take multiple
|
// adjusting the stylesheet is very expensive and can take multiple
|
||||||
// hundred milliseconds per widget.
|
// hundred milliseconds per widget.
|
||||||
@@ -132,9 +141,6 @@ private:
|
|||||||
QFrame *_dropLineAbove;
|
QFrame *_dropLineAbove;
|
||||||
QFrame *_dropLineBelow;
|
QFrame *_dropLineBelow;
|
||||||
|
|
||||||
bool _showHighlight;
|
|
||||||
QTimer _timer;
|
|
||||||
|
|
||||||
friend class MacroSegmentList;
|
friend class MacroSegmentList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,9 @@ void MacroSelection::MacroRename(const QString &oldName, const QString &newName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MacroSelectionDialog::MacroSelectionDialog(QWidget *)
|
MacroSelectionDialog::MacroSelectionDialog(QWidget *parent)
|
||||||
|
: QDialog(parent),
|
||||||
|
_macroSelection(new MacroSelection(this))
|
||||||
{
|
{
|
||||||
setModal(true);
|
setModal(true);
|
||||||
setWindowModality(Qt::WindowModality::ApplicationModal);
|
setWindowModality(Qt::WindowModality::ApplicationModal);
|
||||||
@@ -103,21 +105,20 @@ MacroSelectionDialog::MacroSelectionDialog(QWidget *)
|
|||||||
setMinimumWidth(350);
|
setMinimumWidth(350);
|
||||||
setMinimumHeight(70);
|
setMinimumHeight(70);
|
||||||
|
|
||||||
QDialogButtonBox *buttonbox = new QDialogButtonBox(
|
auto buttonbox = new QDialogButtonBox(QDialogButtonBox::Ok |
|
||||||
QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
QDialogButtonBox::Cancel);
|
||||||
|
|
||||||
buttonbox->setCenterButtons(true);
|
buttonbox->setCenterButtons(true);
|
||||||
connect(buttonbox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
connect(buttonbox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
connect(buttonbox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
connect(buttonbox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
|
|
||||||
_macroSelection = new MacroSelection(window());
|
auto selectionLayout = new QHBoxLayout;
|
||||||
auto *selectionLayout = new QHBoxLayout;
|
|
||||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||||
{"{{macroSelection}}", _macroSelection},
|
{"{{macroSelection}}", _macroSelection},
|
||||||
};
|
};
|
||||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.askForMacro"),
|
PlaceWidgets(obs_module_text("AdvSceneSwitcher.askForMacro"),
|
||||||
selectionLayout, widgetPlaceholders);
|
selectionLayout, widgetPlaceholders);
|
||||||
auto *layout = new QVBoxLayout();
|
auto layout = new QVBoxLayout();
|
||||||
layout->addLayout(selectionLayout);
|
layout->addLayout(selectionLayout);
|
||||||
layout->addWidget(buttonbox);
|
layout->addWidget(buttonbox);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
@@ -125,7 +126,7 @@ MacroSelectionDialog::MacroSelectionDialog(QWidget *)
|
|||||||
|
|
||||||
bool MacroSelectionDialog::AskForMacro(QWidget *parent, std::string ¯oName)
|
bool MacroSelectionDialog::AskForMacro(QWidget *parent, std::string ¯oName)
|
||||||
{
|
{
|
||||||
MacroSelectionDialog dialog(parent);
|
MacroSelectionDialog dialog(GetSettingsWindow());
|
||||||
dialog.setWindowTitle(obs_module_text("AdvSceneSwitcher.windowTitle"));
|
dialog.setWindowTitle(obs_module_text("AdvSceneSwitcher.windowTitle"));
|
||||||
|
|
||||||
if (dialog.exec() != DialogCode::Accepted) {
|
if (dialog.exec() != DialogCode::Accepted) {
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#include "advanced-scene-switcher.hpp"
|
#include "advanced-scene-switcher.hpp"
|
||||||
|
#include "action-queue.hpp"
|
||||||
#include "macro-action-edit.hpp"
|
#include "macro-action-edit.hpp"
|
||||||
#include "macro-condition-edit.hpp"
|
#include "macro-condition-edit.hpp"
|
||||||
#include "macro-export-import-dialog.hpp"
|
#include "macro-export-import-dialog.hpp"
|
||||||
#include "macro-properties.hpp"
|
#include "macro-properties.hpp"
|
||||||
|
#include "macro-segment-copy-paste.hpp"
|
||||||
#include "macro-tree.hpp"
|
#include "macro-tree.hpp"
|
||||||
#include "macro.hpp"
|
#include "macro.hpp"
|
||||||
#include "math-helpers.hpp"
|
#include "math-helpers.hpp"
|
||||||
@@ -13,6 +15,7 @@
|
|||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
#include <obs-frontend-api.h>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QGraphicsOpacityEffect>
|
#include <QGraphicsOpacityEffect>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@@ -28,6 +31,25 @@ static bool macroNameExists(const std::string &name)
|
|||||||
return !!GetMacroByName(name.c_str());
|
return !!GetMacroByName(name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool newMacroNameIsValid(const std::string &name)
|
||||||
|
{
|
||||||
|
if (!macroNameExists(name)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto macro = GetMacroByName(name.c_str());
|
||||||
|
if (!macro) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString fmt = obs_module_text(
|
||||||
|
macro->IsGroup() ? "AdvSceneSwitcher.macroTab.groupNameExists"
|
||||||
|
: "AdvSceneSwitcher.macroTab.macroNameExists");
|
||||||
|
|
||||||
|
DisplayMessage(fmt.arg(QString::fromStdString(name)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool AdvSceneSwitcher::AddNewMacro(std::shared_ptr<Macro> &res,
|
bool AdvSceneSwitcher::AddNewMacro(std::shared_ptr<Macro> &res,
|
||||||
std::string &name, std::string format)
|
std::string &name, std::string format)
|
||||||
{
|
{
|
||||||
@@ -46,7 +68,7 @@ bool AdvSceneSwitcher::AddNewMacro(std::shared_ptr<Macro> &res,
|
|||||||
placeHolderText = fmt.arg(++i);
|
placeHolderText = fmt.arg(++i);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool accepted = AdvSSNameDialog::AskForName(
|
bool accepted = NameDialog::AskForName(
|
||||||
this, obs_module_text("AdvSceneSwitcher.macroTab.add"),
|
this, obs_module_text("AdvSceneSwitcher.macroTab.add"),
|
||||||
obs_module_text("AdvSceneSwitcher.macroTab.name"), name,
|
obs_module_text("AdvSceneSwitcher.macroTab.name"), name,
|
||||||
placeHolderText);
|
placeHolderText);
|
||||||
@@ -59,9 +81,7 @@ bool AdvSceneSwitcher::AddNewMacro(std::shared_ptr<Macro> &res,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (macroNameExists(name)) {
|
if (!newMacroNameIsValid(name)) {
|
||||||
DisplayMessage(
|
|
||||||
obs_module_text("AdvSceneSwitcher.macroTab.exists"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +112,7 @@ void AdvSceneSwitcher::RemoveMacro(std::shared_ptr<Macro> ¯o)
|
|||||||
auto name = QString::fromStdString(macro->Name());
|
auto name = QString::fromStdString(macro->Name());
|
||||||
if (macro->IsGroup() && macro->GroupSize() > 0) {
|
if (macro->IsGroup() && macro->GroupSize() > 0) {
|
||||||
QString deleteWarning = obs_module_text(
|
QString deleteWarning = obs_module_text(
|
||||||
"AdvSceneSwitcher.macroTab.groupDeleteConfirm");
|
"AdvSceneSwitcher.macroTab.removeGroupPopup.text");
|
||||||
if (!DisplayMessage(deleteWarning.arg(name), true)) {
|
if (!DisplayMessage(deleteWarning.arg(name), true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -102,6 +122,41 @@ void AdvSceneSwitcher::RemoveMacro(std::shared_ptr<Macro> ¯o)
|
|||||||
emit MacroRemoved(name);
|
emit MacroRemoved(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::RemoveSelectedMacros()
|
||||||
|
{
|
||||||
|
auto macros = GetSelectedMacros();
|
||||||
|
if (macros.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int macroCount = macros.size();
|
||||||
|
if (macroCount == 1) {
|
||||||
|
QString deleteWarning = obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.removeSingleMacroPopup.text");
|
||||||
|
auto macro = macros.at(0);
|
||||||
|
deleteWarning = deleteWarning.arg(
|
||||||
|
QString::fromStdString(macro->Name()));
|
||||||
|
|
||||||
|
if ((!macro->IsGroup() || macro->GroupSize() == 0) &&
|
||||||
|
!DisplayMessage(deleteWarning, true)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RemoveMacro(macro);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString deleteWarning = obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.removeMultipleMacrosPopup.text");
|
||||||
|
if (!DisplayMessage(deleteWarning.arg(macroCount), true)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto ¯o : macros) {
|
||||||
|
RemoveMacro(macro);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::RenameMacro(std::shared_ptr<Macro> ¯o,
|
void AdvSceneSwitcher::RenameMacro(std::shared_ptr<Macro> ¯o,
|
||||||
const QString &name)
|
const QString &name)
|
||||||
{
|
{
|
||||||
@@ -115,32 +170,7 @@ void AdvSceneSwitcher::RenameMacro(std::shared_ptr<Macro> ¯o,
|
|||||||
|
|
||||||
void AdvSceneSwitcher::on_macroRemove_clicked()
|
void AdvSceneSwitcher::on_macroRemove_clicked()
|
||||||
{
|
{
|
||||||
auto macros = GetSelectedMacros();
|
RemoveSelectedMacros();
|
||||||
if (macros.empty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (macros.size() == 1) {
|
|
||||||
QString deleteWarning = obs_module_text(
|
|
||||||
"AdvSceneSwitcher.macroTab.deleteSingleMacroConfirmation");
|
|
||||||
if (!DisplayMessage(deleteWarning.arg(QString::fromStdString(
|
|
||||||
macros.at(0)->Name())),
|
|
||||||
true)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
RemoveMacro(macros.at(0));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString deleteWarning = obs_module_text(
|
|
||||||
"AdvSceneSwitcher.macroTab.deleteMultipleMacrosConfirmation");
|
|
||||||
if (!DisplayMessage(deleteWarning.arg(macros.size()), true)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto ¯o : macros) {
|
|
||||||
RemoveMacro(macro);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::on_macroUp_clicked()
|
void AdvSceneSwitcher::on_macroUp_clicked()
|
||||||
@@ -161,32 +191,26 @@ void AdvSceneSwitcher::on_macroDown_clicked()
|
|||||||
ui->macros->Down(macro);
|
ui->macros->Down(macro);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool newMacroNameValid(const std::string &name)
|
void AdvSceneSwitcher::RenameSelectedMacro()
|
||||||
{
|
|
||||||
if (!macroNameExists(name)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
DisplayMessage(obs_module_text("AdvSceneSwitcher.macroTab.exists"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::RenameCurrentMacro()
|
|
||||||
{
|
{
|
||||||
auto macro = GetSelectedMacro();
|
auto macro = GetSelectedMacro();
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string oldName = macro->Name();
|
std::string oldName = macro->Name();
|
||||||
std::string name;
|
std::string name;
|
||||||
if (!AdvSSNameDialog::AskForName(
|
if (!NameDialog::AskForName(
|
||||||
this, obs_module_text("AdvSceneSwitcher.windowTitle"),
|
this, obs_module_text("AdvSceneSwitcher.windowTitle"),
|
||||||
obs_module_text("AdvSceneSwitcher.item.newName"), name,
|
obs_module_text("AdvSceneSwitcher.item.newName"), name,
|
||||||
QString::fromStdString(oldName))) {
|
QString::fromStdString(oldName))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (name.empty() || name == oldName || !newMacroNameValid(name)) {
|
|
||||||
|
if (name.empty() || name == oldName || !newMacroNameIsValid(name)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenameMacro(macro, QString::fromStdString(name));
|
RenameMacro(macro, QString::fromStdString(name));
|
||||||
|
|
||||||
const QSignalBlocker b(ui->macroName);
|
const QSignalBlocker b(ui->macroName);
|
||||||
@@ -247,6 +271,7 @@ void AdvSceneSwitcher::ExportMacros()
|
|||||||
}
|
}
|
||||||
obs_data_set_array(data, "macros", macroArray);
|
obs_data_set_array(data, "macros", macroArray);
|
||||||
SaveVariables(data);
|
SaveVariables(data);
|
||||||
|
SaveActionQueues(data);
|
||||||
obs_data_set_string(data, "version", g_GIT_TAG);
|
obs_data_set_string(data, "version", g_GIT_TAG);
|
||||||
auto json = obs_data_get_json(data);
|
auto json = obs_data_get_json(data);
|
||||||
QString exportString(json);
|
QString exportString(json);
|
||||||
@@ -346,8 +371,11 @@ bool AdvSceneSwitcher::ResolveMacroImportNameConflict(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string newName;
|
std::string newName;
|
||||||
bool accepted = AdvSSNameDialog::AskForName(
|
bool accepted = NameDialog::AskForName(
|
||||||
this, obs_module_text("AdvSceneSwitcher.macroTab.add"),
|
this,
|
||||||
|
obs_module_text(macro->IsGroup()
|
||||||
|
? "AdvSceneSwitcher.macroTab.addGroup"
|
||||||
|
: "AdvSceneSwitcher.macroTab.add"),
|
||||||
obs_module_text("AdvSceneSwitcher.macroTab.name"), newName,
|
obs_module_text("AdvSceneSwitcher.macroTab.name"), newName,
|
||||||
placeHolderText);
|
placeHolderText);
|
||||||
|
|
||||||
@@ -359,9 +387,7 @@ bool AdvSceneSwitcher::ResolveMacroImportNameConflict(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (macroNameExists(newName)) {
|
if (!newMacroNameIsValid(newName)) {
|
||||||
DisplayMessage(
|
|
||||||
obs_module_text("AdvSceneSwitcher.macroTab.exists"));
|
|
||||||
return ResolveMacroImportNameConflict(macro);
|
return ResolveMacroImportNameConflict(macro);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,26 +395,6 @@ bool AdvSceneSwitcher::ResolveMacroImportNameConflict(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool variableWithNameExists(const std::string &name)
|
|
||||||
{
|
|
||||||
return !!GetVariableByName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void importVariables(obs_data_t *obj)
|
|
||||||
{
|
|
||||||
OBSDataArrayAutoRelease array = obs_data_get_array(obj, "variables");
|
|
||||||
size_t count = obs_data_array_count(array);
|
|
||||||
for (size_t i = 0; i < count; i++) {
|
|
||||||
OBSDataAutoRelease data = obs_data_array_item(array, i);
|
|
||||||
auto var = Variable::Create();
|
|
||||||
var->Load(data);
|
|
||||||
if (variableWithNameExists(var->Name())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
GetVariables().emplace_back(var);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::ImportMacros()
|
void AdvSceneSwitcher::ImportMacros()
|
||||||
{
|
{
|
||||||
QString json;
|
QString json;
|
||||||
@@ -403,7 +409,8 @@ void AdvSceneSwitcher::ImportMacros()
|
|||||||
ImportMacros();
|
ImportMacros();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
importVariables(data);
|
ImportVariables(data);
|
||||||
|
ImportQueues(data);
|
||||||
|
|
||||||
auto version = obs_data_get_string(data, "version");
|
auto version = obs_data_get_string(data, "version");
|
||||||
if (strcmp(version, g_GIT_TAG) != 0) {
|
if (strcmp(version, g_GIT_TAG) != 0) {
|
||||||
@@ -424,6 +431,7 @@ void AdvSceneSwitcher::ImportMacros()
|
|||||||
OBSDataAutoRelease array_obj = obs_data_array_item(array, i);
|
OBSDataAutoRelease array_obj = obs_data_array_item(array, i);
|
||||||
auto macro = std::make_shared<Macro>();
|
auto macro = std::make_shared<Macro>();
|
||||||
macro->Load(array_obj);
|
macro->Load(array_obj);
|
||||||
|
RunPostLoadSteps();
|
||||||
|
|
||||||
if (macroNameExists(macro->Name()) &&
|
if (macroNameExists(macro->Name()) &&
|
||||||
!ResolveMacroImportNameConflict(macro)) {
|
!ResolveMacroImportNameConflict(macro)) {
|
||||||
@@ -468,7 +476,7 @@ void AdvSceneSwitcher::on_macroName_editingFinished()
|
|||||||
QString oldName = QString::fromStdString(macro->Name());
|
QString oldName = QString::fromStdString(macro->Name());
|
||||||
|
|
||||||
if (newName.isEmpty() || newName == oldName ||
|
if (newName.isEmpty() || newName == oldName ||
|
||||||
!newMacroNameValid(newName.toStdString())) {
|
!newMacroNameIsValid(newName.toStdString())) {
|
||||||
ui->macroName->setText(oldName);
|
ui->macroName->setText(oldName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -729,6 +737,7 @@ void AdvSceneSwitcher::MacroSelectionChanged()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SetEditMacro(*macro);
|
SetEditMacro(*macro);
|
||||||
|
obs_frontend_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::HighlightOnChange()
|
void AdvSceneSwitcher::HighlightOnChange()
|
||||||
@@ -759,8 +768,6 @@ void AdvSceneSwitcher::on_macroProperties_clicked()
|
|||||||
}
|
}
|
||||||
GetGlobalMacroProperties() = prop;
|
GetGlobalMacroProperties() = prop;
|
||||||
emit HighlightMacrosChanged(prop._highlightExecuted);
|
emit HighlightMacrosChanged(prop._highlightExecuted);
|
||||||
emit HighlightActionsChanged(prop._highlightActions);
|
|
||||||
emit HighlightConditionsChanged(prop._highlightConditions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void moveControlsToSplitter(QSplitter *splitter, int idx,
|
static void moveControlsToSplitter(QSplitter *splitter, int idx,
|
||||||
@@ -775,7 +782,7 @@ static void moveControlsToSplitter(QSplitter *splitter, int idx,
|
|||||||
splitter->setStyleSheet("QSplitter::handle {background: transparent;}");
|
splitter->setStyleSheet("QSplitter::handle {background: transparent;}");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool shouldRestoreSplitter(const QList<int> &pos)
|
static bool shouldRestoreSplitter(const QList<int> &pos)
|
||||||
{
|
{
|
||||||
if (pos.size() == 0) {
|
if (pos.size() == 0) {
|
||||||
return false;
|
return false;
|
||||||
@@ -789,9 +796,40 @@ bool shouldRestoreSplitter(const QList<int> &pos)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void runSegmentHighligtChecksHelper(MacroSegmentList *list)
|
||||||
|
{
|
||||||
|
MacroSegmentEdit *widget = nullptr;
|
||||||
|
for (int i = 0; (widget = list->WidgetAt(i)); i++) {
|
||||||
|
if (widget->Data() && widget->Data()->GetHighlightAndReset()) {
|
||||||
|
list->Highlight(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void runSegmentHighligtChecks(AdvSceneSwitcher *ss)
|
||||||
|
{
|
||||||
|
if (!ss || !HighlightUIElementsEnabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto macro = ss->GetSelectedMacro();
|
||||||
|
if (!macro) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto &properties = GetGlobalMacroProperties();
|
||||||
|
if (properties._highlightConditions) {
|
||||||
|
runSegmentHighligtChecksHelper(ss->ui->conditionsList);
|
||||||
|
}
|
||||||
|
if (properties._highlightActions) {
|
||||||
|
runSegmentHighligtChecksHelper(ss->ui->actionsList);
|
||||||
|
runSegmentHighligtChecksHelper(ss->ui->elseActionsList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::SetupMacroTab()
|
void AdvSceneSwitcher::SetupMacroTab()
|
||||||
{
|
{
|
||||||
ui->macroElseActions->installEventFilter(this);
|
ui->macroElseActions->installEventFilter(this);
|
||||||
|
ui->macros->installEventFilter(this);
|
||||||
|
|
||||||
if (GetMacros().size() == 0 && !switcher->disableHints) {
|
if (GetMacros().size() == 0 && !switcher->disableHints) {
|
||||||
addPulse = PulseWidget(ui->macroAdd, QColor(Qt::green));
|
addPulse = PulseWidget(ui->macroAdd, QColor(Qt::green));
|
||||||
@@ -882,6 +920,14 @@ void AdvSceneSwitcher::SetupMacroTab()
|
|||||||
switcher->macroListMacroEditSplitterPosition);
|
switcher->macroListMacroEditSplitterPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetupSegmentCopyPasteShortcutHandlers(this);
|
||||||
|
|
||||||
|
// Macro segment highlight
|
||||||
|
auto timer = new QTimer(this);
|
||||||
|
connect(timer, &QTimer::timeout,
|
||||||
|
[this]() { runSegmentHighligtChecks(this); });
|
||||||
|
timer->start(1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::ShowMacroContextMenu(const QPoint &pos)
|
void AdvSceneSwitcher::ShowMacroContextMenu(const QPoint &pos)
|
||||||
@@ -915,7 +961,7 @@ void AdvSceneSwitcher::ShowMacroContextMenu(const QPoint &pos)
|
|||||||
|
|
||||||
auto rename = menu.addAction(
|
auto rename = menu.addAction(
|
||||||
obs_module_text("AdvSceneSwitcher.macroTab.rename"), this,
|
obs_module_text("AdvSceneSwitcher.macroTab.rename"), this,
|
||||||
&AdvSceneSwitcher::RenameCurrentMacro);
|
&AdvSceneSwitcher::RenameSelectedMacro);
|
||||||
rename->setEnabled(ui->macros->SingleItemSelected());
|
rename->setEnabled(ui->macros->SingleItemSelected());
|
||||||
|
|
||||||
auto remove = menu.addAction(
|
auto remove = menu.addAction(
|
||||||
@@ -934,49 +980,107 @@ void AdvSceneSwitcher::ShowMacroContextMenu(const QPoint &pos)
|
|||||||
menu.exec(globalPos);
|
menu.exec(globalPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handleCustomLabelChange(MacroSegmentEdit *segmentEdit,
|
||||||
|
QAction *contextMenuOption)
|
||||||
|
{
|
||||||
|
bool enable = contextMenuOption->isChecked();
|
||||||
|
auto segment = segmentEdit->Data();
|
||||||
|
segment->SetUseCustomLabel(enable);
|
||||||
|
if (!enable) {
|
||||||
|
segmentEdit->HeaderInfoChanged(
|
||||||
|
QString::fromStdString(segment->GetShortDesc()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string label;
|
||||||
|
bool accepted = NameDialog::AskForName(
|
||||||
|
GetSettingsWindow(),
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.macroTab.segment.setCustomLabel"),
|
||||||
|
"", label, QString::fromStdString(segment->GetCustomLabel()));
|
||||||
|
if (!accepted) {
|
||||||
|
segment->SetUseCustomLabel(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
segment->SetCustomLabel(label);
|
||||||
|
segmentEdit->HeaderInfoChanged("");
|
||||||
|
}
|
||||||
|
|
||||||
static void setupConextMenu(AdvSceneSwitcher *ss, const QPoint &pos,
|
static void setupConextMenu(AdvSceneSwitcher *ss, const QPoint &pos,
|
||||||
std::function<void(AdvSceneSwitcher *)> expand,
|
std::function<void(AdvSceneSwitcher *)> expand,
|
||||||
std::function<void(AdvSceneSwitcher *)> collapse,
|
std::function<void(AdvSceneSwitcher *)> collapse,
|
||||||
std::function<void(AdvSceneSwitcher *)> maximize,
|
std::function<void(AdvSceneSwitcher *)> maximize,
|
||||||
std::function<void(AdvSceneSwitcher *)> minimize)
|
std::function<void(AdvSceneSwitcher *)> minimize,
|
||||||
|
MacroSegmentList *list)
|
||||||
{
|
{
|
||||||
QMenu menu;
|
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());
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
menu.addSeparator();
|
||||||
|
|
||||||
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.expandAll"),
|
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.expandAll"),
|
||||||
ss, [ss, expand]() { expand(ss); });
|
ss, [ss, expand]() { expand(ss); });
|
||||||
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.collapseAll"),
|
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.collapseAll"),
|
||||||
ss, [ss, collapse]() { collapse(ss); });
|
ss, [ss, collapse]() { collapse(ss); });
|
||||||
|
|
||||||
|
menu.addSeparator();
|
||||||
|
|
||||||
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.maximize"),
|
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.maximize"),
|
||||||
ss, [ss, maximize]() { maximize(ss); });
|
ss, [ss, maximize]() { maximize(ss); });
|
||||||
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.minimize"),
|
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.minimize"),
|
||||||
ss, [ss, minimize]() { minimize(ss); });
|
ss, [ss, minimize]() { minimize(ss); });
|
||||||
menu.exec(pos);
|
|
||||||
|
menu.exec(list->mapToGlobal(pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::ShowMacroActionsContextMenu(const QPoint &pos)
|
void AdvSceneSwitcher::ShowMacroActionsContextMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
setupConextMenu(this, ui->actionsList->mapToGlobal(pos),
|
setupConextMenu(this, pos, &AdvSceneSwitcher::ExpandAllActions,
|
||||||
&AdvSceneSwitcher::ExpandAllActions,
|
|
||||||
&AdvSceneSwitcher::CollapseAllActions,
|
&AdvSceneSwitcher::CollapseAllActions,
|
||||||
&AdvSceneSwitcher::MaximizeActions,
|
&AdvSceneSwitcher::MaximizeActions,
|
||||||
&AdvSceneSwitcher::MinimizeActions);
|
&AdvSceneSwitcher::MinimizeActions, ui->actionsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::ShowMacroElseActionsContextMenu(const QPoint &pos)
|
void AdvSceneSwitcher::ShowMacroElseActionsContextMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
setupConextMenu(this, ui->elseActionsList->mapToGlobal(pos),
|
setupConextMenu(this, pos, &AdvSceneSwitcher::ExpandAllElseActions,
|
||||||
&AdvSceneSwitcher::ExpandAllElseActions,
|
|
||||||
&AdvSceneSwitcher::CollapseAllElseActions,
|
&AdvSceneSwitcher::CollapseAllElseActions,
|
||||||
&AdvSceneSwitcher::MaximizeElseActions,
|
&AdvSceneSwitcher::MaximizeElseActions,
|
||||||
&AdvSceneSwitcher::MinimizeElseActions);
|
&AdvSceneSwitcher::MinimizeElseActions,
|
||||||
|
ui->elseActionsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::ShowMacroConditionsContextMenu(const QPoint &pos)
|
void AdvSceneSwitcher::ShowMacroConditionsContextMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
setupConextMenu(this, ui->conditionsList->mapToGlobal(pos),
|
setupConextMenu(this, pos, &AdvSceneSwitcher::ExpandAllConditions,
|
||||||
&AdvSceneSwitcher::ExpandAllConditions,
|
|
||||||
&AdvSceneSwitcher::CollapseAllConditions,
|
&AdvSceneSwitcher::CollapseAllConditions,
|
||||||
&AdvSceneSwitcher::MaximizeConditions,
|
&AdvSceneSwitcher::MaximizeConditions,
|
||||||
&AdvSceneSwitcher::MinimizeConditions);
|
&AdvSceneSwitcher::MinimizeConditions,
|
||||||
|
ui->conditionsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::CopyMacro()
|
void AdvSceneSwitcher::CopyMacro()
|
||||||
@@ -1294,58 +1398,47 @@ static void fade(QWidget *widget, bool fadeOut)
|
|||||||
animation->start(QPropertyAnimation::DeleteWhenStopped);
|
animation->start(QPropertyAnimation::DeleteWhenStopped);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::FadeOutActionControls()
|
void fadeWidgets(const std::vector<QWidget *> &widgets, bool fadeOut)
|
||||||
{
|
{
|
||||||
fade(ui->actionAdd, true);
|
for (const auto &widget : widgets) {
|
||||||
fade(ui->actionRemove, true);
|
fade(widget, fadeOut);
|
||||||
fade(ui->actionTop, true);
|
}
|
||||||
fade(ui->actionUp, true);
|
|
||||||
fade(ui->actionDown, true);
|
|
||||||
fade(ui->actionBottom, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::FadeOutConditionControls()
|
|
||||||
{
|
|
||||||
fade(ui->conditionAdd, true);
|
|
||||||
fade(ui->conditionRemove, true);
|
|
||||||
fade(ui->conditionTop, true);
|
|
||||||
fade(ui->conditionUp, true);
|
|
||||||
fade(ui->conditionDown, true);
|
|
||||||
fade(ui->conditionBottom, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::ResetOpacityActionControls()
|
|
||||||
{
|
|
||||||
fade(ui->actionAdd, false);
|
|
||||||
fade(ui->actionRemove, false);
|
|
||||||
fade(ui->actionTop, false);
|
|
||||||
fade(ui->actionUp, false);
|
|
||||||
fade(ui->actionDown, false);
|
|
||||||
fade(ui->actionBottom, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdvSceneSwitcher::ResetOpacityConditionControls()
|
|
||||||
{
|
|
||||||
fade(ui->conditionAdd, false);
|
|
||||||
fade(ui->conditionRemove, false);
|
|
||||||
fade(ui->conditionTop, false);
|
|
||||||
fade(ui->conditionUp, false);
|
|
||||||
fade(ui->conditionDown, false);
|
|
||||||
fade(ui->conditionBottom, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::HighlightControls()
|
void AdvSceneSwitcher::HighlightControls()
|
||||||
{
|
{
|
||||||
if ((currentActionIdx == -1 && currentConditionIdx == -1) ||
|
const std::vector<QWidget *> conditionControls{
|
||||||
(currentActionIdx != -1 && currentConditionIdx != -1)) {
|
ui->conditionAdd, ui->conditionRemove, ui->conditionTop,
|
||||||
ResetOpacityActionControls();
|
ui->conditionUp, ui->conditionDown, ui->conditionBottom,
|
||||||
ResetOpacityConditionControls();
|
};
|
||||||
|
const std::vector<QWidget *> actionControls{
|
||||||
|
ui->actionAdd, ui->actionRemove, ui->actionTop,
|
||||||
|
ui->actionUp, ui->actionDown, ui->actionBottom,
|
||||||
|
};
|
||||||
|
const std::vector<QWidget *> elseActionControls{
|
||||||
|
ui->elseActionAdd, ui->elseActionRemove, ui->elseActionTop,
|
||||||
|
ui->elseActionUp, ui->elseActionDown, ui->elseActionBottom,
|
||||||
|
};
|
||||||
|
|
||||||
|
if ((currentActionIdx == -1 && currentConditionIdx == -1 &&
|
||||||
|
currentElseActionIdx == -1)) {
|
||||||
|
fadeWidgets(conditionControls, false);
|
||||||
|
fadeWidgets(actionControls, false);
|
||||||
|
fadeWidgets(elseActionControls, false);
|
||||||
|
} else if (currentConditionIdx != -1) {
|
||||||
|
fadeWidgets(conditionControls, false);
|
||||||
|
fadeWidgets(actionControls, true);
|
||||||
|
fadeWidgets(elseActionControls, true);
|
||||||
} else if (currentActionIdx != -1) {
|
} else if (currentActionIdx != -1) {
|
||||||
FadeOutConditionControls();
|
fadeWidgets(conditionControls, true);
|
||||||
ResetOpacityActionControls();
|
fadeWidgets(actionControls, false);
|
||||||
|
fadeWidgets(elseActionControls, true);
|
||||||
|
} else if (currentElseActionIdx != -1) {
|
||||||
|
fadeWidgets(conditionControls, true);
|
||||||
|
fadeWidgets(actionControls, true);
|
||||||
|
fadeWidgets(elseActionControls, false);
|
||||||
} else {
|
} else {
|
||||||
FadeOutActionControls();
|
assert(false);
|
||||||
ResetOpacityConditionControls();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ void MacroTreeItem::Update(bool force)
|
|||||||
|
|
||||||
} else if (_type == Type::Group) {
|
} else if (_type == Type::Group) {
|
||||||
_expand = new SourceTreeSubItemCheckBox();
|
_expand = new SourceTreeSubItemCheckBox();
|
||||||
|
_expand->setProperty("sourceTreeSubItem", true);
|
||||||
_expand->setSizePolicy(QSizePolicy::Maximum,
|
_expand->setSizePolicy(QSizePolicy::Maximum,
|
||||||
QSizePolicy::Maximum);
|
QSizePolicy::Maximum);
|
||||||
_expand->setMaximumSize(10, 16);
|
_expand->setMaximumSize(10, 16);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class QSpacerItem;
|
|||||||
class QHBoxLayout;
|
class QHBoxLayout;
|
||||||
|
|
||||||
// Only used to enable applying "SourceTreeSubItemCheckBox" stylesheet
|
// Only used to enable applying "SourceTreeSubItemCheckBox" stylesheet
|
||||||
|
// Can be removed once the minimum supported OBS version is greater than 30.1
|
||||||
class SourceTreeSubItemCheckBox : public QCheckBox {
|
class SourceTreeSubItemCheckBox : public QCheckBox {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -137,37 +137,37 @@ bool Macro::CeckMatch()
|
|||||||
case LogicType::AND:
|
case LogicType::AND:
|
||||||
_matched = _matched && cond;
|
_matched = _matched && cond;
|
||||||
if (cond) {
|
if (cond) {
|
||||||
c->SetHighlight();
|
c->EnableHighlight();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LogicType::OR:
|
case LogicType::OR:
|
||||||
_matched = _matched || cond;
|
_matched = _matched || cond;
|
||||||
if (cond) {
|
if (cond) {
|
||||||
c->SetHighlight();
|
c->EnableHighlight();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LogicType::AND_NOT:
|
case LogicType::AND_NOT:
|
||||||
_matched = _matched && !cond;
|
_matched = _matched && !cond;
|
||||||
if (!cond) {
|
if (!cond) {
|
||||||
c->SetHighlight();
|
c->EnableHighlight();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LogicType::OR_NOT:
|
case LogicType::OR_NOT:
|
||||||
_matched = _matched || !cond;
|
_matched = _matched || !cond;
|
||||||
if (!cond) {
|
if (!cond) {
|
||||||
c->SetHighlight();
|
c->EnableHighlight();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LogicType::ROOT_NONE:
|
case LogicType::ROOT_NONE:
|
||||||
_matched = cond;
|
_matched = cond;
|
||||||
if (cond) {
|
if (cond) {
|
||||||
c->SetHighlight();
|
c->EnableHighlight();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LogicType::ROOT_NOT:
|
case LogicType::ROOT_NOT:
|
||||||
_matched = !cond;
|
_matched = !cond;
|
||||||
if (!cond) {
|
if (!cond) {
|
||||||
c->SetHighlight();
|
c->EnableHighlight();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -193,9 +193,17 @@ bool Macro::CeckMatch()
|
|||||||
bool Macro::PerformActions(bool match, bool forceParallel, bool ignorePause)
|
bool Macro::PerformActions(bool match, bool forceParallel, bool ignorePause)
|
||||||
{
|
{
|
||||||
if (!_done) {
|
if (!_done) {
|
||||||
vblog(LOG_INFO, "macro %s already running", _name.c_str());
|
vblog(LOG_INFO, "Macro %s already running", _name.c_str());
|
||||||
return !forceParallel;
|
|
||||||
|
if (!_stopActionsIfNotDone) {
|
||||||
|
return !forceParallel;
|
||||||
|
}
|
||||||
|
|
||||||
|
Stop();
|
||||||
|
vblog(LOG_INFO, "Stopped macro %s actions to rerun them",
|
||||||
|
_name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::function<bool(bool)> runFunc =
|
std::function<bool(bool)> runFunc =
|
||||||
match ? std::bind(&Macro::RunActions, this,
|
match ? std::bind(&Macro::RunActions, this,
|
||||||
std::placeholders::_1)
|
std::placeholders::_1)
|
||||||
@@ -213,6 +221,7 @@ bool Macro::PerformActions(bool match, bool forceParallel, bool ignorePause)
|
|||||||
} else {
|
} else {
|
||||||
ret = runFunc(ignorePause);
|
ret = runFunc(ignorePause);
|
||||||
}
|
}
|
||||||
|
|
||||||
_lastExecutionTime = std::chrono::high_resolution_clock::now();
|
_lastExecutionTime = std::chrono::high_resolution_clock::now();
|
||||||
auto group = _parent.lock();
|
auto group = _parent.lock();
|
||||||
if (group) {
|
if (group) {
|
||||||
@@ -304,7 +313,7 @@ bool Macro::RunActionsHelper(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (action->Enabled()) {
|
if (action->Enabled()) {
|
||||||
action->SetHighlight();
|
action->EnableHighlight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_done = true;
|
_done = true;
|
||||||
@@ -550,6 +559,7 @@ bool Macro::Save(obs_data_t *obj) const
|
|||||||
obs_data_set_bool(obj, "parallel", _runInParallel);
|
obs_data_set_bool(obj, "parallel", _runInParallel);
|
||||||
obs_data_set_bool(obj, "onChange", _performActionsOnChange);
|
obs_data_set_bool(obj, "onChange", _performActionsOnChange);
|
||||||
obs_data_set_bool(obj, "skipExecOnStart", _skipExecOnStart);
|
obs_data_set_bool(obj, "skipExecOnStart", _skipExecOnStart);
|
||||||
|
obs_data_set_bool(obj, "stopActionsIfNotDone", _stopActionsIfNotDone);
|
||||||
|
|
||||||
obs_data_set_bool(obj, "group", _isGroup);
|
obs_data_set_bool(obj, "group", _isGroup);
|
||||||
if (_isGroup) {
|
if (_isGroup) {
|
||||||
@@ -644,6 +654,7 @@ bool Macro::Load(obs_data_t *obj)
|
|||||||
_runInParallel = obs_data_get_bool(obj, "parallel");
|
_runInParallel = obs_data_get_bool(obj, "parallel");
|
||||||
_performActionsOnChange = obs_data_get_bool(obj, "onChange");
|
_performActionsOnChange = obs_data_get_bool(obj, "onChange");
|
||||||
_skipExecOnStart = obs_data_get_bool(obj, "skipExecOnStart");
|
_skipExecOnStart = obs_data_get_bool(obj, "skipExecOnStart");
|
||||||
|
_stopActionsIfNotDone = obs_data_get_bool(obj, "stopActionsIfNotDone");
|
||||||
|
|
||||||
_isGroup = obs_data_get_bool(obj, "group");
|
_isGroup = obs_data_get_bool(obj, "group");
|
||||||
if (_isGroup) {
|
if (_isGroup) {
|
||||||
@@ -651,6 +662,7 @@ bool Macro::Load(obs_data_t *obj)
|
|||||||
obs_data_get_obj(obj, "groupData");
|
obs_data_get_obj(obj, "groupData");
|
||||||
_isCollapsed = obs_data_get_bool(groupData, "collapsed");
|
_isCollapsed = obs_data_get_bool(groupData, "collapsed");
|
||||||
_groupSize = obs_data_get_int(groupData, "size");
|
_groupSize = obs_data_get_int(groupData, "size");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -735,6 +747,7 @@ bool Macro::Load(obs_data_t *obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
UpdateElseActionIndices();
|
UpdateElseActionIndices();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,10 +819,10 @@ void Macro::ResetUIHelpers()
|
|||||||
{
|
{
|
||||||
_onPreventedActionExecution = false;
|
_onPreventedActionExecution = false;
|
||||||
for (auto c : _conditions) {
|
for (auto c : _conditions) {
|
||||||
c->Highlight();
|
c->GetHighlightAndReset();
|
||||||
}
|
}
|
||||||
for (auto a : _actions) {
|
for (auto a : _actions) {
|
||||||
a->Highlight();
|
a->GetHighlightAndReset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <obs-data.h>
|
#include <obs.hpp>
|
||||||
#include <obs-module-helper.hpp>
|
#include <obs-module-helper.hpp>
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
@@ -24,6 +24,7 @@ class Macro {
|
|||||||
public:
|
public:
|
||||||
Macro(const std::string &name = "", const bool addHotkey = false);
|
Macro(const std::string &name = "", const bool addHotkey = false);
|
||||||
virtual ~Macro();
|
virtual ~Macro();
|
||||||
|
|
||||||
bool CeckMatch();
|
bool CeckMatch();
|
||||||
bool PerformActions(bool match, bool forceParallel = false,
|
bool PerformActions(bool match, bool forceParallel = false,
|
||||||
bool ignorePause = false);
|
bool ignorePause = false);
|
||||||
@@ -42,6 +43,11 @@ public:
|
|||||||
bool MatchOnChange() const { return _performActionsOnChange; }
|
bool MatchOnChange() const { return _performActionsOnChange; }
|
||||||
void SetSkipExecOnStart(bool skip) { _skipExecOnStart = skip; }
|
void SetSkipExecOnStart(bool skip) { _skipExecOnStart = skip; }
|
||||||
bool SkipExecOnStart() const { return _skipExecOnStart; }
|
bool SkipExecOnStart() const { return _skipExecOnStart; }
|
||||||
|
void SetStopActionsIfNotDone(bool stopActionsIfNotDone)
|
||||||
|
{
|
||||||
|
_stopActionsIfNotDone = stopActionsIfNotDone;
|
||||||
|
}
|
||||||
|
bool StopActionsIfNotDone() const { return _stopActionsIfNotDone; }
|
||||||
int RunCount() const { return _runCount; };
|
int RunCount() const { return _runCount; };
|
||||||
void ResetRunCount() { _runCount = 0; };
|
void ResetRunCount() { _runCount = 0; };
|
||||||
void ResetTimers();
|
void ResetTimers();
|
||||||
@@ -168,6 +174,7 @@ private:
|
|||||||
bool _conditionSateChanged = false;
|
bool _conditionSateChanged = false;
|
||||||
bool _performActionsOnChange = true;
|
bool _performActionsOnChange = true;
|
||||||
bool _skipExecOnStart = false;
|
bool _skipExecOnStart = false;
|
||||||
|
bool _stopActionsIfNotDone = false;
|
||||||
bool _paused = false;
|
bool _paused = false;
|
||||||
int _runCount = 0;
|
int _runCount = 0;
|
||||||
bool _registerHotkeys = true;
|
bool _registerHotkeys = true;
|
||||||
|
|||||||
257
lib/queue/action-queue-tab.cpp
Normal file
257
lib/queue/action-queue-tab.cpp
Normal file
@@ -0,0 +1,257 @@
|
|||||||
|
#include "action-queue-tab.hpp"
|
||||||
|
#include "action-queue.hpp"
|
||||||
|
#include "log-helper.hpp"
|
||||||
|
#include "obs-module-helper.hpp"
|
||||||
|
#include "plugin-state-helpers.hpp"
|
||||||
|
#include "sync-helpers.hpp"
|
||||||
|
#include "tab-helpers.hpp"
|
||||||
|
#include "ui-helpers.hpp"
|
||||||
|
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
static void setupTab(QTabWidget *);
|
||||||
|
|
||||||
|
static ActionQueueTable *tabWidget = nullptr;
|
||||||
|
|
||||||
|
void RegisterActionQueueTab()
|
||||||
|
{
|
||||||
|
AddPluginInitStep([]() {
|
||||||
|
AddSetupTabCallback("actionQueueTab", ActionQueueTable::Create,
|
||||||
|
setupTab);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setTabVisible(QTabWidget *tabWidget, bool visible)
|
||||||
|
{
|
||||||
|
SetTabVisibleByName(
|
||||||
|
tabWidget, visible,
|
||||||
|
obs_module_text("AdvSceneSwitcher.actionQueueTab.title"));
|
||||||
|
}
|
||||||
|
|
||||||
|
ActionQueueTable *ActionQueueTable::Create()
|
||||||
|
{
|
||||||
|
tabWidget = new ActionQueueTable();
|
||||||
|
return tabWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActionQueueTable::Add()
|
||||||
|
{
|
||||||
|
auto newQueue = std::make_shared<ActionQueue>();
|
||||||
|
auto accepted =
|
||||||
|
ActionQueueSettingsDialog::AskForSettings(this, *newQueue);
|
||||||
|
if (!accepted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto lock = LockContext();
|
||||||
|
auto &queues = GetActionQueues();
|
||||||
|
queues.emplace_back(newQueue);
|
||||||
|
}
|
||||||
|
|
||||||
|
ActionQueueSignalManager::Instance()->Add(
|
||||||
|
QString::fromStdString(newQueue->Name()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static QStringList getCellLabels(ActionQueue *queue, bool addName = true)
|
||||||
|
{
|
||||||
|
assert(queue);
|
||||||
|
|
||||||
|
auto result = QStringList();
|
||||||
|
if (addName) {
|
||||||
|
result << QString::fromStdString(queue->Name());
|
||||||
|
}
|
||||||
|
result << QString::number(queue->Size())
|
||||||
|
<< QString::fromStdString(obs_module_text(
|
||||||
|
queue->IsRunning()
|
||||||
|
? "AdvSceneSwitcher.actionQueueTab.yes"
|
||||||
|
: "AdvSceneSwitcher.actionQueueTab.no"))
|
||||||
|
<< QString::fromStdString(obs_module_text(
|
||||||
|
queue->RunsOnStartup()
|
||||||
|
? "AdvSceneSwitcher.actionQueueTab.yes"
|
||||||
|
: "AdvSceneSwitcher.actionQueueTab.no"));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void updateQueueStatus(QTableWidget *table)
|
||||||
|
{
|
||||||
|
for (int row = 0; row < table->rowCount(); row++) {
|
||||||
|
auto item = table->item(row, 0);
|
||||||
|
if (!item) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto weakQueue = GetWeakActionQueueByQString(item->text());
|
||||||
|
auto queue = weakQueue.lock();
|
||||||
|
if (!queue) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateItemTableRow(table, row,
|
||||||
|
getCellLabels(queue.get(), false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void openSettingsDialog()
|
||||||
|
{
|
||||||
|
auto selectedRows =
|
||||||
|
tabWidget->Table()->selectionModel()->selectedRows();
|
||||||
|
if (selectedRows.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto cell = tabWidget->Table()->item(selectedRows.last().row(), 0);
|
||||||
|
if (!cell) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto weakQueue = GetWeakActionQueueByQString(cell->text());
|
||||||
|
auto queue = weakQueue.lock();
|
||||||
|
if (!queue) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto oldName = queue->Name();
|
||||||
|
bool accepted = ActionQueueSettingsDialog::AskForSettings(
|
||||||
|
tabWidget->Table(), *queue.get());
|
||||||
|
if (accepted && oldName != queue->Name()) {
|
||||||
|
ActionQueueSignalManager::Instance()->Rename(
|
||||||
|
QString::fromStdString(oldName),
|
||||||
|
QString::fromStdString(queue->Name()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void removeQueuesWithNames(const QStringList &queueNames)
|
||||||
|
{
|
||||||
|
for (const auto &name : queueNames) {
|
||||||
|
auto queue = GetWeakActionQueueByQString(name).lock();
|
||||||
|
if (!queue) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto &queues = GetActionQueues();
|
||||||
|
queues.erase(
|
||||||
|
std::remove_if(
|
||||||
|
queues.begin(), queues.end(),
|
||||||
|
[queue](const std::shared_ptr<Item> &item) {
|
||||||
|
return item == queue;
|
||||||
|
}),
|
||||||
|
queues.end());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActionQueueTable::Remove()
|
||||||
|
{
|
||||||
|
auto selectedRows =
|
||||||
|
tabWidget->Table()->selectionModel()->selectedRows();
|
||||||
|
if (selectedRows.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList queueNames;
|
||||||
|
for (const auto &row : selectedRows) {
|
||||||
|
auto cell = tabWidget->Table()->item(row.row(), 0);
|
||||||
|
if (!cell) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
queueNames << cell->text();
|
||||||
|
}
|
||||||
|
|
||||||
|
int queueNameCount = queueNames.size();
|
||||||
|
if (queueNameCount == 1) {
|
||||||
|
QString deleteWarning = obs_module_text(
|
||||||
|
"AdvSceneSwitcher.actionQueueTab.removeSingleQueuePopup.text");
|
||||||
|
if (!DisplayMessage(deleteWarning.arg(queueNames.at(0)),
|
||||||
|
true)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
QString deleteWarning = obs_module_text(
|
||||||
|
"AdvSceneSwitcher.actionQueueTab.removeMultipleQueuesPopup.text");
|
||||||
|
if (!DisplayMessage(deleteWarning.arg(queueNameCount), true)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto lock = LockContext();
|
||||||
|
RemoveItemsByName(GetActionQueues(), queueNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto &name : queueNames) {
|
||||||
|
ActionQueueSignalManager::Instance()->Remove(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ActionQueueTable::ActionQueueTable(QTabWidget *parent)
|
||||||
|
: ResourceTable(
|
||||||
|
parent,
|
||||||
|
obs_module_text("AdvSceneSwitcher.actionQueueTab.help"),
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.actionQueueTab.queueAddButton.tooltip"),
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.actionQueueTab.queueRemoveButton.tooltip"),
|
||||||
|
QStringList()
|
||||||
|
<< obs_module_text(
|
||||||
|
"AdvSceneSwitcher.actionQueueTab.name.header")
|
||||||
|
<< obs_module_text(
|
||||||
|
"AdvSceneSwitcher.actionQueueTab.size.header")
|
||||||
|
<< obs_module_text(
|
||||||
|
"AdvSceneSwitcher.actionQueueTab.isRunning.header")
|
||||||
|
<< obs_module_text(
|
||||||
|
"AdvSceneSwitcher.actionQueueTab.runOnStartup.header"),
|
||||||
|
openSettingsDialog)
|
||||||
|
{
|
||||||
|
for (const auto &queue : GetActionQueues()) {
|
||||||
|
auto q = std::static_pointer_cast<ActionQueue>(queue);
|
||||||
|
AddItemTableRow(Table(), getCellLabels(q.get()));
|
||||||
|
}
|
||||||
|
|
||||||
|
SetHelpVisible(GetActionQueues().empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setupTab(QTabWidget *tab)
|
||||||
|
{
|
||||||
|
if (GetActionQueues().empty()) {
|
||||||
|
setTabVisible(tab, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget::connect(ActionQueueSignalManager::Instance(),
|
||||||
|
&ActionQueueSignalManager::Rename,
|
||||||
|
[](const QString &oldName, const QString &newName) {
|
||||||
|
RenameItemTableRow(tabWidget->Table(), oldName,
|
||||||
|
newName);
|
||||||
|
});
|
||||||
|
QWidget::connect(
|
||||||
|
ActionQueueSignalManager::Instance(),
|
||||||
|
&ActionQueueSignalManager::Add, [tab](const QString &name) {
|
||||||
|
AddItemTableRow(
|
||||||
|
tabWidget->Table(),
|
||||||
|
getCellLabels(GetWeakActionQueueByQString(name)
|
||||||
|
.lock()
|
||||||
|
.get()));
|
||||||
|
tabWidget->SetHelpVisible(false);
|
||||||
|
tabWidget->HighlightAddButton(false);
|
||||||
|
setTabVisible(tab, true);
|
||||||
|
});
|
||||||
|
QWidget::connect(ActionQueueSignalManager::Instance(),
|
||||||
|
&ActionQueueSignalManager::Remove,
|
||||||
|
[](const QString &name) {
|
||||||
|
RemoveItemTableRow(tabWidget->Table(), name);
|
||||||
|
if (tabWidget->Table()->rowCount() == 0) {
|
||||||
|
tabWidget->SetHelpVisible(true);
|
||||||
|
tabWidget->HighlightAddButton(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
auto timer = new QTimer(tabWidget);
|
||||||
|
timer->setInterval(1000);
|
||||||
|
QWidget::connect(timer, &QTimer::timeout,
|
||||||
|
[]() { updateQueueStatus(tabWidget->Table()); });
|
||||||
|
timer->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
20
lib/queue/action-queue-tab.hpp
Normal file
20
lib/queue/action-queue-tab.hpp
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "resource-table.hpp"
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
class ActionQueueTable final : public ResourceTable {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
static ActionQueueTable *Create();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void Add();
|
||||||
|
void Remove();
|
||||||
|
|
||||||
|
private:
|
||||||
|
ActionQueueTable(QTabWidget *parent = nullptr);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
@@ -6,6 +6,13 @@ namespace advss {
|
|||||||
|
|
||||||
static std::deque<std::shared_ptr<Item>> queues;
|
static std::deque<std::shared_ptr<Item>> queues;
|
||||||
|
|
||||||
|
std::deque<std::shared_ptr<Item>> &GetActionQueues()
|
||||||
|
{
|
||||||
|
return queues;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterActionQueueTab();
|
||||||
|
|
||||||
void SetupActionQueues()
|
void SetupActionQueues()
|
||||||
{
|
{
|
||||||
static bool done = false;
|
static bool done = false;
|
||||||
@@ -14,6 +21,7 @@ void SetupActionQueues()
|
|||||||
}
|
}
|
||||||
AddSaveStep(SaveActionQueues);
|
AddSaveStep(SaveActionQueues);
|
||||||
AddLoadStep(LoadActionQueues);
|
AddLoadStep(LoadActionQueues);
|
||||||
|
RegisterActionQueueTab();
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,6 +41,7 @@ void ActionQueue::Save(obs_data_t *obj) const
|
|||||||
{
|
{
|
||||||
obs_data_set_string(obj, "name", _name.c_str());
|
obs_data_set_string(obj, "name", _name.c_str());
|
||||||
obs_data_set_bool(obj, "runOnStartup", _runOnStartup);
|
obs_data_set_bool(obj, "runOnStartup", _runOnStartup);
|
||||||
|
obs_data_set_bool(obj, "resolveVariablesOnAdd", _resolveVariablesOnAdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionQueue::Load(obs_data_t *obj)
|
void ActionQueue::Load(obs_data_t *obj)
|
||||||
@@ -40,6 +49,8 @@ void ActionQueue::Load(obs_data_t *obj)
|
|||||||
std::lock_guard<std::mutex> lock(_mutex);
|
std::lock_guard<std::mutex> lock(_mutex);
|
||||||
_name = obs_data_get_string(obj, "name");
|
_name = obs_data_get_string(obj, "name");
|
||||||
_runOnStartup = obs_data_get_bool(obj, "runOnStartup");
|
_runOnStartup = obs_data_get_bool(obj, "runOnStartup");
|
||||||
|
_resolveVariablesOnAdd =
|
||||||
|
obs_data_get_bool(obj, "resolveVariablesOnAdd");
|
||||||
|
|
||||||
if (_runOnStartup) {
|
if (_runOnStartup) {
|
||||||
Start();
|
Start();
|
||||||
@@ -48,9 +59,13 @@ void ActionQueue::Load(obs_data_t *obj)
|
|||||||
|
|
||||||
void ActionQueue::Start()
|
void ActionQueue::Start()
|
||||||
{
|
{
|
||||||
if (_thread.joinable()) {
|
if (!_stop) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_thread.joinable()) {
|
||||||
|
_thread.join();
|
||||||
|
}
|
||||||
_stop = false;
|
_stop = false;
|
||||||
_thread = std::thread(&ActionQueue::RunActions, this);
|
_thread = std::thread(&ActionQueue::RunActions, this);
|
||||||
}
|
}
|
||||||
@@ -59,6 +74,10 @@ void ActionQueue::Stop()
|
|||||||
{
|
{
|
||||||
_stop = true;
|
_stop = true;
|
||||||
_cv.notify_all();
|
_cv.notify_all();
|
||||||
|
if (std::this_thread::get_id() == _thread.get_id()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_thread.joinable()) {
|
if (_thread.joinable()) {
|
||||||
_thread.join();
|
_thread.join();
|
||||||
}
|
}
|
||||||
@@ -66,7 +85,7 @@ void ActionQueue::Stop()
|
|||||||
|
|
||||||
bool ActionQueue::IsRunning() const
|
bool ActionQueue::IsRunning() const
|
||||||
{
|
{
|
||||||
return _thread.joinable();
|
return !_stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ActionQueue::RunsOnStartup() const
|
bool ActionQueue::RunsOnStartup() const
|
||||||
@@ -80,10 +99,21 @@ void ActionQueue::Clear()
|
|||||||
_actions.clear();
|
_actions.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionQueue::Add(const std::shared_ptr<MacroAction> &actions)
|
void ActionQueue::Add(const std::shared_ptr<MacroAction> &action)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(_mutex);
|
std::lock_guard<std::mutex> lock(_mutex);
|
||||||
_actions.emplace_back(actions);
|
if (_resolveVariablesOnAdd) {
|
||||||
|
auto copy = action->Copy();
|
||||||
|
copy->GetMacro();
|
||||||
|
OBSDataAutoRelease data = obs_data_create();
|
||||||
|
action->Save(data);
|
||||||
|
copy->Load(data);
|
||||||
|
copy->PostLoad();
|
||||||
|
copy->ResolveVariablesToFixedValues();
|
||||||
|
_actions.emplace_back(copy);
|
||||||
|
} else {
|
||||||
|
_actions.emplace_back(action);
|
||||||
|
}
|
||||||
_cv.notify_all();
|
_cv.notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,8 +150,11 @@ void ActionQueue::RunActions()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
vblog(LOG_INFO, "Performing action '%s' in queue '%s'",
|
if (ActionLoggingEnabled()) {
|
||||||
action->GetId().c_str(), _name.c_str());
|
blog(LOG_INFO, "Performing action '%s' in queue '%s'",
|
||||||
|
action->GetId().c_str(), _name.c_str());
|
||||||
|
action->LogAction();
|
||||||
|
}
|
||||||
action->PerformAction();
|
action->PerformAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -139,6 +172,7 @@ ActionQueueSettingsDialog::ActionQueueSettingsDialog(QWidget *parent,
|
|||||||
_clear(new QPushButton(
|
_clear(new QPushButton(
|
||||||
obs_module_text("AdvSceneSwitcher.actionQueues.clear"))),
|
obs_module_text("AdvSceneSwitcher.actionQueues.clear"))),
|
||||||
_runOnStartup(new QCheckBox()),
|
_runOnStartup(new QCheckBox()),
|
||||||
|
_resolveVariablesOnAdd(new QCheckBox()),
|
||||||
_queue(settings)
|
_queue(settings)
|
||||||
{
|
{
|
||||||
QWidget::connect(_startStopToggle, SIGNAL(clicked()), this,
|
QWidget::connect(_startStopToggle, SIGNAL(clicked()), this,
|
||||||
@@ -146,6 +180,7 @@ ActionQueueSettingsDialog::ActionQueueSettingsDialog(QWidget *parent,
|
|||||||
QWidget::connect(_clear, SIGNAL(clicked()), this, SLOT(ClearClicked()));
|
QWidget::connect(_clear, SIGNAL(clicked()), this, SLOT(ClearClicked()));
|
||||||
|
|
||||||
_runOnStartup->setChecked(settings._runOnStartup);
|
_runOnStartup->setChecked(settings._runOnStartup);
|
||||||
|
_resolveVariablesOnAdd->setChecked(settings._resolveVariablesOnAdd);
|
||||||
UpdateLabels();
|
UpdateLabels();
|
||||||
|
|
||||||
auto layout = new QGridLayout();
|
auto layout = new QGridLayout();
|
||||||
@@ -167,6 +202,14 @@ ActionQueueSettingsDialog::ActionQueueSettingsDialog(QWidget *parent,
|
|||||||
_runOnStartup->setToolTip(
|
_runOnStartup->setToolTip(
|
||||||
obs_module_text("AdvSceneSwitcher.actionQueues.runOnStartup"));
|
obs_module_text("AdvSceneSwitcher.actionQueues.runOnStartup"));
|
||||||
++row;
|
++row;
|
||||||
|
layout->addWidget(
|
||||||
|
new QLabel(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.actionQueues.resolveVariablesOnAdd")),
|
||||||
|
row, 0);
|
||||||
|
layout->addWidget(_resolveVariablesOnAdd, row, 1);
|
||||||
|
_resolveVariablesOnAdd->setToolTip(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.actionQueues.resolveVariablesOnAdd"));
|
||||||
|
++row;
|
||||||
layout->addWidget(_queueRunStatus, row, 0);
|
layout->addWidget(_queueRunStatus, row, 0);
|
||||||
layout->addWidget(_startStopToggle, row, 1);
|
layout->addWidget(_startStopToggle, row, 1);
|
||||||
++row;
|
++row;
|
||||||
@@ -194,6 +237,8 @@ bool ActionQueueSettingsDialog::AskForSettings(QWidget *parent,
|
|||||||
|
|
||||||
settings._name = dialog._name->text().toStdString();
|
settings._name = dialog._name->text().toStdString();
|
||||||
settings._runOnStartup = dialog._runOnStartup->isChecked();
|
settings._runOnStartup = dialog._runOnStartup->isChecked();
|
||||||
|
settings._resolveVariablesOnAdd =
|
||||||
|
dialog._resolveVariablesOnAdd->isChecked();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,6 +374,27 @@ void LoadActionQueues(obs_data_t *obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool queueWithNameExists(const std::string &name)
|
||||||
|
{
|
||||||
|
return !GetWeakActionQueueByName(name).expired();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImportQueues(obs_data_t *data)
|
||||||
|
{
|
||||||
|
OBSDataArrayAutoRelease array =
|
||||||
|
obs_data_get_array(data, "actionQueues");
|
||||||
|
size_t count = obs_data_array_count(array);
|
||||||
|
for (size_t i = 0; i < count; i++) {
|
||||||
|
OBSDataAutoRelease arrayElement = obs_data_array_item(array, i);
|
||||||
|
auto queue = ActionQueue::Create();
|
||||||
|
queue->Load(arrayElement);
|
||||||
|
if (queueWithNameExists(queue->Name())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
queues.emplace_back(queue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::weak_ptr<ActionQueue> GetWeakActionQueueByName(const std::string &name)
|
std::weak_ptr<ActionQueue> GetWeakActionQueueByName(const std::string &name)
|
||||||
{
|
{
|
||||||
for (const auto &queue : queues) {
|
for (const auto &queue : queues) {
|
||||||
@@ -38,7 +38,8 @@ private:
|
|||||||
void RunActions();
|
void RunActions();
|
||||||
|
|
||||||
bool _runOnStartup = true;
|
bool _runOnStartup = true;
|
||||||
std::atomic_bool _stop = {false};
|
bool _resolveVariablesOnAdd = true;
|
||||||
|
std::atomic_bool _stop = {true};
|
||||||
std::mutex _mutex;
|
std::mutex _mutex;
|
||||||
std::condition_variable _cv;
|
std::condition_variable _cv;
|
||||||
std::thread _thread;
|
std::thread _thread;
|
||||||
@@ -66,6 +67,7 @@ private:
|
|||||||
QLabel *_queueSize;
|
QLabel *_queueSize;
|
||||||
QPushButton *_clear;
|
QPushButton *_clear;
|
||||||
QCheckBox *_runOnStartup;
|
QCheckBox *_runOnStartup;
|
||||||
|
QCheckBox *_resolveVariablesOnAdd;
|
||||||
|
|
||||||
ActionQueue &_queue;
|
ActionQueue &_queue;
|
||||||
};
|
};
|
||||||
@@ -93,9 +95,11 @@ signals:
|
|||||||
void Remove(const QString &);
|
void Remove(const QString &);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::deque<std::shared_ptr<Item>> &GetActionQueues();
|
||||||
void SetupActionQueues();
|
void SetupActionQueues();
|
||||||
void SaveActionQueues(obs_data_t *);
|
void SaveActionQueues(obs_data_t *);
|
||||||
void LoadActionQueues(obs_data_t *);
|
void LoadActionQueues(obs_data_t *);
|
||||||
|
void ImportQueues(obs_data_t *);
|
||||||
std::weak_ptr<ActionQueue> GetWeakActionQueueByName(const std::string &name);
|
std::weak_ptr<ActionQueue> GetWeakActionQueueByName(const std::string &name);
|
||||||
std::weak_ptr<ActionQueue> GetWeakActionQueueByQString(const QString &name);
|
std::weak_ptr<ActionQueue> GetWeakActionQueueByQString(const QString &name);
|
||||||
std::string GetActionQueueName(const std::weak_ptr<ActionQueue> &);
|
std::string GetActionQueueName(const std::weak_ptr<ActionQueue> &);
|
||||||
@@ -187,24 +187,6 @@ void SwitcherData::RunPostLoadSteps()
|
|||||||
postLoadSteps.clear();
|
postLoadSteps.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitcherData::AddPluginInitStep(std::function<void()> function)
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
|
||||||
pluginInitSteps.emplace_back(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwitcherData::AddPluginPostLoadStep(std::function<void()> function)
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
|
||||||
pluginPostLoadSteps.emplace_back(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwitcherData::AddPluginCleanupStep(std::function<void()> function)
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
|
||||||
pluginCleanupSteps.emplace_back(function);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwitcherData::AddSaveStep(std::function<void(obs_data_t *)> function)
|
void SwitcherData::AddSaveStep(std::function<void(obs_data_t *)> function)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
|||||||
@@ -65,9 +65,6 @@ public:
|
|||||||
void AddPostLoadStep(std::function<void()>);
|
void AddPostLoadStep(std::function<void()>);
|
||||||
void AddIntervalResetStep(std::function<void()>, bool lock = true);
|
void AddIntervalResetStep(std::function<void()>, bool lock = true);
|
||||||
void RunPostLoadSteps();
|
void RunPostLoadSteps();
|
||||||
void AddPluginInitStep(std::function<void()>);
|
|
||||||
void AddPluginPostLoadStep(std::function<void()>);
|
|
||||||
void AddPluginCleanupStep(std::function<void()>);
|
|
||||||
bool CheckForMatch(OBSWeakSource &scene, OBSWeakSource &transition,
|
bool CheckForMatch(OBSWeakSource &scene, OBSWeakSource &transition,
|
||||||
int &linger, bool &setPreviousSceneAsMatch,
|
int &linger, bool &setPreviousSceneAsMatch,
|
||||||
bool ¯oMatch);
|
bool ¯oMatch);
|
||||||
@@ -106,9 +103,6 @@ public:
|
|||||||
std::vector<std::function<void(obs_data_t *)>> loadSteps;
|
std::vector<std::function<void(obs_data_t *)>> loadSteps;
|
||||||
std::vector<std::function<void()>> postLoadSteps;
|
std::vector<std::function<void()>> postLoadSteps;
|
||||||
std::vector<std::function<void()>> resetIntervalSteps;
|
std::vector<std::function<void()>> resetIntervalSteps;
|
||||||
std::vector<std::function<void()>> pluginInitSteps;
|
|
||||||
std::vector<std::function<void()>> pluginPostLoadSteps;
|
|
||||||
std::vector<std::function<void()>> pluginCleanupSteps;
|
|
||||||
|
|
||||||
bool firstBoot = true;
|
bool firstBoot = true;
|
||||||
bool transitionActive = false;
|
bool transitionActive = false;
|
||||||
@@ -141,7 +135,9 @@ public:
|
|||||||
bool showSystemTrayNotifications = false;
|
bool showSystemTrayNotifications = false;
|
||||||
bool transitionOverrideOverride = false;
|
bool transitionOverrideOverride = false;
|
||||||
bool adjustActiveTransitionType = true;
|
bool adjustActiveTransitionType = true;
|
||||||
bool verbose = false;
|
|
||||||
|
enum class LogLevel { DEFAULT, PRINT_ACTION, VERBOSE };
|
||||||
|
LogLevel logLevel = LogLevel::DEFAULT;
|
||||||
|
|
||||||
/* --- End of General tab section --- */
|
/* --- End of General tab section --- */
|
||||||
|
|
||||||
@@ -169,7 +165,6 @@ public:
|
|||||||
/* --- Start of UI section --- */
|
/* --- Start of UI section --- */
|
||||||
|
|
||||||
bool settingsWindowOpened = false;
|
bool settingsWindowOpened = false;
|
||||||
int lastOpenedTab = -1;
|
|
||||||
std::string lastImportPath;
|
std::string lastImportPath;
|
||||||
QStringList loadFailureLibs;
|
QStringList loadFailureLibs;
|
||||||
bool warnPluginLoadFailure = true;
|
bool warnPluginLoadFailure = true;
|
||||||
|
|||||||
86
lib/utils/backup.cpp
Normal file
86
lib/utils/backup.cpp
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
#include "backup.hpp"
|
||||||
|
#include "log-helper.hpp"
|
||||||
|
#include "obs-module-helper.hpp"
|
||||||
|
#include "path-helpers.hpp"
|
||||||
|
#include "plugin-state-helpers.hpp"
|
||||||
|
#include "ui-helpers.hpp"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
#include <obs-frontend-api.h>
|
||||||
|
#include <obs-module.h>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QTextStream>
|
||||||
|
#include <util/config-file.h>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
void AskForBackup(const QString &json)
|
||||||
|
{
|
||||||
|
const bool backupWasConfirmed = DisplayMessage(
|
||||||
|
obs_module_text("AdvSceneSwitcher.askBackup"), true, false);
|
||||||
|
|
||||||
|
if (!backupWasConfirmed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString path = QFileDialog::getSaveFileName(
|
||||||
|
nullptr,
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.generalTab.saveOrLoadsettings.exportWindowTitle"),
|
||||||
|
GetDefaultSettingsSaveLocation(),
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.generalTab.saveOrLoadsettings.textType"));
|
||||||
|
if (path.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QFile file(path);
|
||||||
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto out = QTextStream(&file);
|
||||||
|
out << json;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BackupSettingsOfCurrentVersion()
|
||||||
|
{
|
||||||
|
auto sceneCollectionName = obs_frontend_get_current_scene_collection();
|
||||||
|
const std::string fileName =
|
||||||
|
std::string("settings-backup-") +
|
||||||
|
(sceneCollectionName ? sceneCollectionName : "-") + "-" +
|
||||||
|
g_GIT_TAG + ".json";
|
||||||
|
bfree(sceneCollectionName);
|
||||||
|
auto settingsFile = obs_module_config_path(fileName.c_str());
|
||||||
|
if (!settingsFile) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString dirPath = QFileInfo(settingsFile).absolutePath();
|
||||||
|
QDir dir(dirPath);
|
||||||
|
if (!dir.exists()) {
|
||||||
|
if (!dir.mkpath(dirPath)) {
|
||||||
|
blog(LOG_WARNING,
|
||||||
|
"failed to create directory to save automated backup");
|
||||||
|
bfree(settingsFile);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QFile file(settingsFile);
|
||||||
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
|
bfree(settingsFile);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
OBSDataAutoRelease data = obs_data_create();
|
||||||
|
SavePluginSettings(data);
|
||||||
|
|
||||||
|
auto settings = obs_data_get_json(data);
|
||||||
|
QString settingsString = QString(settings ? settings : "");
|
||||||
|
|
||||||
|
auto out = QTextStream(&file);
|
||||||
|
out << settingsString;
|
||||||
|
bfree(settingsFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
9
lib/utils/backup.hpp
Normal file
9
lib/utils/backup.hpp
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
void AskForBackup(const QString &json);
|
||||||
|
void BackupSettingsOfCurrentVersion();
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
#include "curl-helper.hpp"
|
#include "curl-helper.hpp"
|
||||||
|
#include "log-helper.hpp"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include <obs.hpp>
|
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
|
|||||||
63
lib/utils/double-slider.cpp
Normal file
63
lib/utils/double-slider.cpp
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
#include "double-slider.hpp"
|
||||||
|
#include <QWheelEvent>
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
SliderIgnoreScroll::SliderIgnoreScroll(QWidget *parent) : QSlider(parent)
|
||||||
|
{
|
||||||
|
setFocusPolicy(Qt::StrongFocus);
|
||||||
|
}
|
||||||
|
|
||||||
|
SliderIgnoreScroll::SliderIgnoreScroll(Qt::Orientation orientation,
|
||||||
|
QWidget *parent)
|
||||||
|
: QSlider(parent)
|
||||||
|
{
|
||||||
|
setFocusPolicy(Qt::StrongFocus);
|
||||||
|
setOrientation(orientation);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SliderIgnoreScroll::wheelEvent(QWheelEvent *event)
|
||||||
|
{
|
||||||
|
if (!hasFocus()) {
|
||||||
|
event->ignore();
|
||||||
|
} else {
|
||||||
|
QSlider::wheelEvent(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DoubleSlider::DoubleSlider(QWidget *parent) : SliderIgnoreScroll(parent)
|
||||||
|
{
|
||||||
|
connect(this, &DoubleSlider::valueChanged, [this](int val) {
|
||||||
|
emit DoubleValChanged((minVal / minStep + val) * minStep);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoubleSlider::SetDoubleConstraints(double newMin, double newMax,
|
||||||
|
double newStep, double val)
|
||||||
|
{
|
||||||
|
minVal = newMin;
|
||||||
|
maxVal = newMax;
|
||||||
|
minStep = newStep;
|
||||||
|
|
||||||
|
double total = maxVal - minVal;
|
||||||
|
int intMax = int(total / minStep);
|
||||||
|
|
||||||
|
setMinimum(0);
|
||||||
|
setMaximum(intMax);
|
||||||
|
setSingleStep(1);
|
||||||
|
SetDoubleVal(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
double DoubleSlider::DoubleValue()
|
||||||
|
{
|
||||||
|
return (minVal / minStep + value()) * minStep;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoubleSlider::SetDoubleVal(double val)
|
||||||
|
{
|
||||||
|
setValue(lround((val - minVal) / minStep));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
40
lib/utils/double-slider.hpp
Normal file
40
lib/utils/double-slider.hpp
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
// Based on OBS DoubleSlider and SliderIgnoreScroll implementation
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "export-symbol-helper.hpp"
|
||||||
|
|
||||||
|
#include <QSlider>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
class SliderIgnoreScroll : public QSlider {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
SliderIgnoreScroll(QWidget *parent = nullptr);
|
||||||
|
SliderIgnoreScroll(Qt::Orientation orientation,
|
||||||
|
QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void wheelEvent(QWheelEvent *event) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ADVSS_EXPORT DoubleSlider : public SliderIgnoreScroll {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
double minVal = 0, maxVal = 100, minStep = 1;
|
||||||
|
|
||||||
|
public:
|
||||||
|
DoubleSlider(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
void SetDoubleConstraints(double newMin, double newMax, double newStep,
|
||||||
|
double val);
|
||||||
|
double DoubleValue();
|
||||||
|
signals:
|
||||||
|
void DoubleValChanged(double val);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void SetDoubleVal(double val);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
@@ -165,4 +165,9 @@ void Duration::SetUnit(Unit u)
|
|||||||
_value = _value * (prevMultiplier / newMultiplier);
|
_value = _value * (prevMultiplier / newMultiplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Duration::ResolveVariables()
|
||||||
|
{
|
||||||
|
_value.ResolveVariables();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -34,8 +34,10 @@ public:
|
|||||||
// Only use this function if you intend to convert old settings formats
|
// Only use this function if you intend to convert old settings formats
|
||||||
EXPORT void SetUnit(Unit u);
|
EXPORT void SetUnit(Unit u);
|
||||||
|
|
||||||
|
EXPORT void ResolveVariables();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NumberVariable<double> _value = 0.;
|
DoubleVariable _value = 0.;
|
||||||
Unit _unit = Unit::SECONDS;
|
Unit _unit = Unit::SECONDS;
|
||||||
std::chrono::high_resolution_clock::time_point _startTime;
|
std::chrono::high_resolution_clock::time_point _startTime;
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ void ItemSelection::RenameItem()
|
|||||||
Item *item = variant.value<Item *>();
|
Item *item = variant.value<Item *>();
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
bool accepted = AdvSSNameDialog::AskForName(
|
bool accepted = NameDialog::AskForName(
|
||||||
this, obs_module_text("AdvSceneSwitcher.windowTitle"),
|
this, obs_module_text("AdvSceneSwitcher.windowTitle"),
|
||||||
obs_module_text("AdvSceneSwitcher.item.newName"), name,
|
obs_module_text("AdvSceneSwitcher.item.newName"), name,
|
||||||
QString::fromStdString(item->Name()));
|
QString::fromStdString(item->Name()));
|
||||||
@@ -347,4 +347,18 @@ void Item::Save(obs_data_t *obj) const
|
|||||||
obs_data_set_string(obj, "name", _name.c_str());
|
obs_data_set_string(obj, "name", _name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RemoveItemsByName(std::deque<std::shared_ptr<Item>> &items,
|
||||||
|
const QStringList &names)
|
||||||
|
{
|
||||||
|
for (const auto &name : names) {
|
||||||
|
items.erase(std::remove_if(
|
||||||
|
items.begin(), items.end(),
|
||||||
|
[name](const std::shared_ptr<Item> &item) {
|
||||||
|
return item->Name() ==
|
||||||
|
name.toStdString();
|
||||||
|
}),
|
||||||
|
items.end());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ protected:
|
|||||||
friend ItemSettingsDialog;
|
friend ItemSettingsDialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void EXPORT RemoveItemsByName(std::deque<std::shared_ptr<Item>> &items,
|
||||||
|
const QStringList &names);
|
||||||
|
|
||||||
class ItemSettingsDialog : public QDialog {
|
class ItemSettingsDialog : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,16 @@ namespace advss {
|
|||||||
|
|
||||||
bool VerboseLoggingEnabled()
|
bool VerboseLoggingEnabled()
|
||||||
{
|
{
|
||||||
return GetSwitcher() && GetSwitcher()->verbose;
|
return GetSwitcher() &&
|
||||||
|
GetSwitcher()->logLevel == SwitcherData::LogLevel::VERBOSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ActionLoggingEnabled()
|
||||||
|
{
|
||||||
|
return GetSwitcher() &&
|
||||||
|
(GetSwitcher()->logLevel ==
|
||||||
|
SwitcherData::LogLevel::PRINT_ACTION ||
|
||||||
|
GetSwitcher()->logLevel == SwitcherData::LogLevel::VERBOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -3,14 +3,26 @@
|
|||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
|
// Print log with "[adv-ss] " prefix
|
||||||
#define blog(level, msg, ...) blog(level, "[adv-ss] " msg, ##__VA_ARGS__)
|
#define blog(level, msg, ...) blog(level, "[adv-ss] " msg, ##__VA_ARGS__)
|
||||||
|
// Print log with "[adv-ss] " if log level is set to "verbose"
|
||||||
#define vblog(level, msg, ...) \
|
#define vblog(level, msg, ...) \
|
||||||
do { \
|
do { \
|
||||||
if (VerboseLoggingEnabled()) { \
|
if (VerboseLoggingEnabled()) { \
|
||||||
blog(level, msg, ##__VA_ARGS__); \
|
blog(level, msg, ##__VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
// Print log with "[adv-ss] " if log level is set to "action" or "verbose"
|
||||||
|
#define ablog(level, msg, ...) \
|
||||||
|
do { \
|
||||||
|
if (ActionLoggingEnabled()) { \
|
||||||
|
blog(level, msg, ##__VA_ARGS__); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
// Returns true if log level is set to "verbose"
|
||||||
EXPORT bool VerboseLoggingEnabled();
|
EXPORT bool VerboseLoggingEnabled();
|
||||||
|
// Returns true if log level is set to "action" or "verbose"
|
||||||
|
EXPORT bool ActionLoggingEnabled();
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -5,22 +5,22 @@
|
|||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
AdvSSNameDialog::AdvSSNameDialog(QWidget *parent) : QDialog(parent)
|
NameDialog::NameDialog(QWidget *parent)
|
||||||
|
: QDialog(parent),
|
||||||
|
_label(new QLabel(this)),
|
||||||
|
_userText(new QLineEdit(this))
|
||||||
|
|
||||||
{
|
{
|
||||||
setModal(true);
|
setModal(true);
|
||||||
setWindowModality(Qt::WindowModality::WindowModal);
|
setWindowModality(Qt::WindowModality::WindowModal);
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
setFixedWidth(555);
|
setFixedWidth(555);
|
||||||
setMinimumHeight(100);
|
setMinimumHeight(100);
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
auto layout = new QVBoxLayout;
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
label = new QLabel(this);
|
layout->addWidget(_label);
|
||||||
layout->addWidget(label);
|
layout->addWidget(_userText);
|
||||||
label->setText("Set Text");
|
|
||||||
|
|
||||||
userText = new QLineEdit(this);
|
|
||||||
layout->addWidget(userText);
|
|
||||||
|
|
||||||
QDialogButtonBox *buttonbox = new QDialogButtonBox(
|
QDialogButtonBox *buttonbox = new QDialogButtonBox(
|
||||||
QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
@@ -30,43 +30,44 @@ AdvSSNameDialog::AdvSSNameDialog(QWidget *parent) : QDialog(parent)
|
|||||||
connect(buttonbox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
connect(buttonbox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsWhitespace(char ch)
|
static bool isWhitespace(char ch)
|
||||||
{
|
{
|
||||||
return ch == ' ' || ch == '\t';
|
return ch == ' ' || ch == '\t';
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CleanWhitespace(std::string &str)
|
static void cleanWhitespace(std::string &str)
|
||||||
{
|
{
|
||||||
while (str.size() && IsWhitespace(str.back()))
|
while (str.size() && isWhitespace(str.back())) {
|
||||||
str.erase(str.end() - 1);
|
str.erase(str.end() - 1);
|
||||||
while (str.size() && IsWhitespace(str.front()))
|
}
|
||||||
|
while (str.size() && isWhitespace(str.front())) {
|
||||||
str.erase(str.begin());
|
str.erase(str.begin());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AdvSSNameDialog::AskForName(QWidget *parent, const QString &title,
|
bool NameDialog::AskForName(QWidget *parent, const QString &title,
|
||||||
const QString &text,
|
const QString &prompt, std::string &userTextInput,
|
||||||
std::string &userTextInput,
|
const QString &placeHolder, int maxSize, bool clean)
|
||||||
const QString &placeHolder, int maxSize,
|
|
||||||
bool clean)
|
|
||||||
{
|
{
|
||||||
if (maxSize <= 0 || maxSize > 32767) {
|
if (maxSize <= 0 || maxSize > 32767) {
|
||||||
maxSize = 170;
|
maxSize = 170;
|
||||||
}
|
}
|
||||||
|
|
||||||
AdvSSNameDialog dialog(parent);
|
NameDialog dialog(parent);
|
||||||
dialog.setWindowTitle(title);
|
dialog.setWindowTitle(title);
|
||||||
|
|
||||||
dialog.label->setText(text);
|
dialog._label->setVisible(!prompt.isEmpty());
|
||||||
dialog.userText->setMaxLength(maxSize);
|
dialog._label->setText(prompt);
|
||||||
dialog.userText->setText(placeHolder);
|
dialog._userText->setMaxLength(maxSize);
|
||||||
dialog.userText->selectAll();
|
dialog._userText->setText(placeHolder);
|
||||||
|
dialog._userText->selectAll();
|
||||||
|
|
||||||
if (dialog.exec() != DialogCode::Accepted) {
|
if (dialog.exec() != DialogCode::Accepted) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
userTextInput = dialog.userText->text().toUtf8().constData();
|
userTextInput = dialog._userText->text().toUtf8().constData();
|
||||||
if (clean) {
|
if (clean) {
|
||||||
CleanWhitespace(userTextInput);
|
cleanWhitespace(userTextInput);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,23 +8,23 @@
|
|||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
// Based on OBS's NameDialog
|
// Based on OBS's NameDialog
|
||||||
class AdvSSNameDialog : public QDialog {
|
class NameDialog : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AdvSSNameDialog(QWidget *parent);
|
NameDialog(QWidget *parent);
|
||||||
|
|
||||||
// Returns true if user clicks OK, false otherwise
|
// Returns true if user clicks OK, false otherwise
|
||||||
// userTextInput returns string that user typed into dialog
|
// userTextInput returns string that user typed into dialog
|
||||||
EXPORT static bool AskForName(QWidget *parent, const QString &title,
|
EXPORT static bool AskForName(QWidget *parent, const QString &title,
|
||||||
const QString &text,
|
const QString &prompt,
|
||||||
std::string &userTextInput,
|
std::string &userTextInput,
|
||||||
const QString &placeHolder = QString(""),
|
const QString &placeHolder = QString(""),
|
||||||
int maxSize = 170, bool clean = true);
|
int maxSize = 170, bool clean = true);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QLabel *label;
|
QLabel *_label;
|
||||||
QLineEdit *userText;
|
QLineEdit *_userText;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ namespace advss {
|
|||||||
const char *obs_module_text(const char *text)
|
const char *obs_module_text(const char *text)
|
||||||
{
|
{
|
||||||
if (!advss::switcher) {
|
if (!advss::switcher) {
|
||||||
return "";
|
assert(false);
|
||||||
|
return "obs_module_text called too early";
|
||||||
}
|
}
|
||||||
return advss::switcher->Translate(text);
|
return advss::switcher->Translate(text);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,31 @@
|
|||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
|
static std::vector<std::function<void()>> &getPluginInitSteps()
|
||||||
|
{
|
||||||
|
static std::vector<std::function<void()>> steps;
|
||||||
|
return steps;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::function<void()>> &getPluginPostLoadSteps()
|
||||||
|
{
|
||||||
|
static std::vector<std::function<void()>> steps;
|
||||||
|
return steps;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::function<void()>> &getPluginCleanupSteps()
|
||||||
|
{
|
||||||
|
static std::vector<std::function<void()>> steps;
|
||||||
|
return steps;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::mutex mutex;
|
||||||
|
|
||||||
|
void SavePluginSettings(obs_data_t *obj)
|
||||||
|
{
|
||||||
|
GetSwitcher()->SaveSettings(obj);
|
||||||
|
}
|
||||||
|
|
||||||
void LoadPluginSettings(obs_data_t *obj)
|
void LoadPluginSettings(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
GetSwitcher()->LoadSettings(obj);
|
GetSwitcher()->LoadSettings(obj);
|
||||||
@@ -35,17 +60,44 @@ void RunPostLoadSteps()
|
|||||||
|
|
||||||
void AddPluginInitStep(std::function<void()> step)
|
void AddPluginInitStep(std::function<void()> step)
|
||||||
{
|
{
|
||||||
GetSwitcher()->AddPluginInitStep(step);
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
getPluginInitSteps().emplace_back(step);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddPluginPostLoadStep(std::function<void()> step)
|
void AddPluginPostLoadStep(std::function<void()> step)
|
||||||
{
|
{
|
||||||
GetSwitcher()->AddPluginPostLoadStep(step);
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
getPluginPostLoadSteps().emplace_back(step);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddPluginCleanupStep(std::function<void()> step)
|
void AddPluginCleanupStep(std::function<void()> step)
|
||||||
{
|
{
|
||||||
GetSwitcher()->AddPluginCleanupStep(step);
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
getPluginCleanupSteps().emplace_back(step);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RunPluginInitSteps()
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
for (const auto &step : getPluginInitSteps()) {
|
||||||
|
step();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RunPluginPostLoadSteps()
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
for (const auto &step : getPluginPostLoadSteps()) {
|
||||||
|
step();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RunPluginCleanupSteps()
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
for (const auto &step : getPluginCleanupSteps()) {
|
||||||
|
step();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StopPlugin()
|
void StopPlugin()
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
|
void SavePluginSettings(obs_data_t *);
|
||||||
EXPORT void LoadPluginSettings(obs_data_t *);
|
EXPORT void LoadPluginSettings(obs_data_t *);
|
||||||
|
|
||||||
EXPORT void AddSaveStep(std::function<void(obs_data_t *)>);
|
EXPORT void AddSaveStep(std::function<void(obs_data_t *)>);
|
||||||
@@ -16,6 +17,9 @@ EXPORT void RunPostLoadSteps();
|
|||||||
EXPORT void AddPluginInitStep(std::function<void()>);
|
EXPORT void AddPluginInitStep(std::function<void()>);
|
||||||
EXPORT void AddPluginPostLoadStep(std::function<void()>);
|
EXPORT void AddPluginPostLoadStep(std::function<void()>);
|
||||||
EXPORT void AddPluginCleanupStep(std::function<void()>);
|
EXPORT void AddPluginCleanupStep(std::function<void()>);
|
||||||
|
void RunPluginInitSteps();
|
||||||
|
extern "C" EXPORT void RunPluginPostLoadSteps();
|
||||||
|
void RunPluginCleanupSteps();
|
||||||
|
|
||||||
EXPORT void StopPlugin();
|
EXPORT void StopPlugin();
|
||||||
EXPORT void StartPlugin();
|
EXPORT void StartPlugin();
|
||||||
|
|||||||
70
lib/utils/resource-table-hotkey-handler.cpp
Normal file
70
lib/utils/resource-table-hotkey-handler.cpp
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
#include "resource-table-hotkey-handler.hpp"
|
||||||
|
|
||||||
|
#include <QKeyEvent>
|
||||||
|
#include <QWidget>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
void RegisterHotkeyFunction(QWidget *widget, Qt::Key key,
|
||||||
|
std::function<void()> func)
|
||||||
|
{
|
||||||
|
ResourceTabHotkeyHandler::Instance()->RegisterHandler(widget, key,
|
||||||
|
func);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeregisterHotkeyFunctions(QWidget *widget)
|
||||||
|
{
|
||||||
|
ResourceTabHotkeyHandler::Instance()->Deregister(widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
ResourceTabHotkeyHandler *ResourceTabHotkeyHandler::Instance()
|
||||||
|
{
|
||||||
|
static ResourceTabHotkeyHandler handler;
|
||||||
|
return &handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResourceTabHotkeyHandler::RegisterHandler(QWidget *widget, Qt::Key key,
|
||||||
|
std::function<void()> func)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(_mutex);
|
||||||
|
_callbacks.emplace(widget, CallbackData{key, func});
|
||||||
|
widget->installEventFilter(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResourceTabHotkeyHandler::Deregister(QWidget *widget)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(_mutex);
|
||||||
|
_callbacks.erase(widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ResourceTabHotkeyHandler::eventFilter(QObject *obj, QEvent *event)
|
||||||
|
{
|
||||||
|
if (event->type() != QEvent::KeyPress) {
|
||||||
|
return QObject::eventFilter(obj, event);
|
||||||
|
}
|
||||||
|
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
|
||||||
|
auto pressedKey = keyEvent->key();
|
||||||
|
|
||||||
|
std::lock_guard<std::mutex> lock(_mutex);
|
||||||
|
auto it = _callbacks.find(obj);
|
||||||
|
if (it == _callbacks.end()) {
|
||||||
|
return QObject::eventFilter(obj, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto current = it;
|
||||||
|
while (current != _callbacks.end() && current->first == it->first) {
|
||||||
|
auto &[_, cbData] = *current;
|
||||||
|
if (pressedKey != cbData.key) {
|
||||||
|
++current;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
cbData.func();
|
||||||
|
++current;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QObject::eventFilter(obj, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
37
lib/utils/resource-table-hotkey-handler.hpp
Normal file
37
lib/utils/resource-table-hotkey-handler.hpp
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "export-symbol-helper.hpp"
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <mutex>
|
||||||
|
#include <QEvent>
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
EXPORT void RegisterHotkeyFunction(QWidget *, Qt::Key,
|
||||||
|
std::function<void()> func);
|
||||||
|
EXPORT void DeregisterHotkeyFunctions(QWidget *);
|
||||||
|
|
||||||
|
class ResourceTabHotkeyHandler : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static ResourceTabHotkeyHandler *Instance();
|
||||||
|
void RegisterHandler(QWidget *, Qt::Key, std::function<void()> func);
|
||||||
|
void Deregister(QWidget *);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
struct CallbackData {
|
||||||
|
Qt::Key key;
|
||||||
|
std::function<void()> func;
|
||||||
|
};
|
||||||
|
|
||||||
|
ResourceTabHotkeyHandler() : QObject(){};
|
||||||
|
|
||||||
|
std::multimap<QObject *, CallbackData> _callbacks;
|
||||||
|
std::mutex _mutex;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
157
lib/utils/resource-table.cpp
Normal file
157
lib/utils/resource-table.cpp
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
#include "resource-table.hpp"
|
||||||
|
#include "plugin-state-helpers.hpp"
|
||||||
|
#include "resource-table-hotkey-handler.hpp"
|
||||||
|
#include "ui-helpers.hpp"
|
||||||
|
|
||||||
|
#include <QGridLayout>
|
||||||
|
#include <QHeaderView>
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
ResourceTable::ResourceTable(QTabWidget *parent, const QString &help,
|
||||||
|
const QString &addToolTip,
|
||||||
|
const QString &removeToolTip,
|
||||||
|
const QStringList &headers,
|
||||||
|
const std::function<void()> &openSettings)
|
||||||
|
: QWidget(parent),
|
||||||
|
_table(new QTableWidget()),
|
||||||
|
_add(new QPushButton()),
|
||||||
|
_remove(new QPushButton()),
|
||||||
|
_help(new QLabel(help))
|
||||||
|
{
|
||||||
|
_add->setMaximumWidth(22);
|
||||||
|
_add->setProperty("themeID",
|
||||||
|
QVariant(QString::fromUtf8("addIconSmall")));
|
||||||
|
_add->setFlat(true);
|
||||||
|
_add->setToolTip(addToolTip);
|
||||||
|
|
||||||
|
_remove->setMaximumWidth(22);
|
||||||
|
_remove->setProperty("themeID",
|
||||||
|
QVariant(QString::fromUtf8("removeIconSmall")));
|
||||||
|
_remove->setFlat(true);
|
||||||
|
_remove->setToolTip(removeToolTip);
|
||||||
|
|
||||||
|
_help->setWordWrap(true);
|
||||||
|
_help->setAlignment(Qt::AlignCenter);
|
||||||
|
|
||||||
|
_table->setColumnCount(headers.size());
|
||||||
|
_table->horizontalHeader()->setSectionResizeMode(
|
||||||
|
QHeaderView::ResizeMode::Interactive);
|
||||||
|
_table->setHorizontalHeaderLabels(headers);
|
||||||
|
_table->verticalHeader()->hide();
|
||||||
|
_table->setCornerButtonEnabled(false);
|
||||||
|
_table->setShowGrid(false);
|
||||||
|
_table->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||||
|
_table->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
|
||||||
|
auto helpAndTableLayout = new QGridLayout();
|
||||||
|
helpAndTableLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
helpAndTableLayout->addWidget(_table, 0, 0);
|
||||||
|
helpAndTableLayout->addWidget(_help, 0, 0, Qt::AlignCenter);
|
||||||
|
|
||||||
|
auto controlLayout = new QHBoxLayout;
|
||||||
|
controlLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
controlLayout->addWidget(_add);
|
||||||
|
controlLayout->addWidget(_remove);
|
||||||
|
controlLayout->addStretch();
|
||||||
|
|
||||||
|
auto layout = new QVBoxLayout();
|
||||||
|
layout->addLayout(helpAndTableLayout);
|
||||||
|
layout->addLayout(controlLayout);
|
||||||
|
setLayout(layout);
|
||||||
|
|
||||||
|
QWidget::connect(_add, SIGNAL(clicked()), this, SLOT(Add()));
|
||||||
|
QWidget::connect(_remove, SIGNAL(clicked()), this, SLOT(Remove()));
|
||||||
|
QWidget::connect(_table, &QTableWidget::cellDoubleClicked,
|
||||||
|
[openSettings]() { openSettings(); });
|
||||||
|
|
||||||
|
RegisterHotkeyFunction(this, Qt::Key_F2, openSettings);
|
||||||
|
RegisterHotkeyFunction(this, Qt::Key_Delete, [this]() { Remove(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
ResourceTable::~ResourceTable()
|
||||||
|
{
|
||||||
|
DeregisterHotkeyFunctions(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResourceTable::SetHelpVisible(bool visible) const
|
||||||
|
{
|
||||||
|
_help->setVisible(visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResourceTable::HighlightAddButton(bool enable)
|
||||||
|
{
|
||||||
|
_add->disconnect(_highlightConnection);
|
||||||
|
if (enable && HighlightUIElementsEnabled()) {
|
||||||
|
_highlightConnection = PulseWidget(_add, QColor(Qt::green));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResourceTable::resizeEvent(QResizeEvent *)
|
||||||
|
{
|
||||||
|
const auto columnCount = _table->columnCount();
|
||||||
|
const auto columnSize = (_table->width() - 1) / columnCount;
|
||||||
|
for (int i = 0; i < columnCount; ++i) {
|
||||||
|
_table->horizontalHeader()->resizeSection(i, columnSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddItemTableRow(QTableWidget *table, const QStringList &cellLabels)
|
||||||
|
{
|
||||||
|
int row = table->rowCount();
|
||||||
|
table->setRowCount(row + 1);
|
||||||
|
|
||||||
|
int col = 0;
|
||||||
|
for (const auto &cellLabel : cellLabels) {
|
||||||
|
auto *item = new QTableWidgetItem(cellLabel);
|
||||||
|
item->setToolTip(cellLabel);
|
||||||
|
table->setItem(row, col, item);
|
||||||
|
col++;
|
||||||
|
}
|
||||||
|
|
||||||
|
table->sortByColumn(0, Qt::AscendingOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateItemTableRow(QTableWidget *table, int row,
|
||||||
|
const QStringList &cellLabels)
|
||||||
|
{
|
||||||
|
int col = 1; // Skip the name cell
|
||||||
|
for (const auto &cellLabel : cellLabels) {
|
||||||
|
auto item = table->item(row, col);
|
||||||
|
item->setText(cellLabel);
|
||||||
|
item->setToolTip(cellLabel);
|
||||||
|
col++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenameItemTableRow(QTableWidget *table, const QString &oldName,
|
||||||
|
const QString &newName)
|
||||||
|
{
|
||||||
|
for (int row = 0; row < table->rowCount(); row++) {
|
||||||
|
auto item = table->item(row, 0);
|
||||||
|
if (!item) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item->text() == oldName) {
|
||||||
|
item->setText(newName);
|
||||||
|
table->sortByColumn(0, Qt::AscendingOrder);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoveItemTableRow(QTableWidget *table, const QString &name)
|
||||||
|
{
|
||||||
|
for (int row = 0; row < table->rowCount(); ++row) {
|
||||||
|
auto item = table->item(row, 0);
|
||||||
|
if (item && item->text() == name) {
|
||||||
|
table->removeRow(row);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
table->sortByColumn(0, Qt::AscendingOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
50
lib/utils/resource-table.hpp
Normal file
50
lib/utils/resource-table.hpp
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "export-symbol-helper.hpp"
|
||||||
|
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QString>
|
||||||
|
#include <QTableWidget>
|
||||||
|
|
||||||
|
class QResizeEvent;
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
class ADVSS_EXPORT ResourceTable : public QWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ResourceTable(QTabWidget *parent, const QString &help,
|
||||||
|
const QString &addToolTip, const QString &removeToolTip,
|
||||||
|
const QStringList &headers,
|
||||||
|
const std::function<void()> &openSettings);
|
||||||
|
virtual ~ResourceTable();
|
||||||
|
|
||||||
|
QTableWidget *Table() const { return _table; }
|
||||||
|
void SetHelpVisible(bool) const;
|
||||||
|
void HighlightAddButton(bool);
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
virtual void Add() {}
|
||||||
|
virtual void Remove() {}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void resizeEvent(QResizeEvent *event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTableWidget *_table;
|
||||||
|
QPushButton *_add;
|
||||||
|
QPushButton *_remove;
|
||||||
|
QLabel *_help;
|
||||||
|
|
||||||
|
QMetaObject::Connection _highlightConnection;
|
||||||
|
};
|
||||||
|
|
||||||
|
EXPORT void AddItemTableRow(QTableWidget *table, const QStringList &cells);
|
||||||
|
EXPORT void UpdateItemTableRow(QTableWidget *table, int row,
|
||||||
|
const QStringList &cells);
|
||||||
|
EXPORT void RenameItemTableRow(QTableWidget *table, const QString &oldName,
|
||||||
|
const QString &newName);
|
||||||
|
EXPORT void RemoveItemTableRow(QTableWidget *table, const QString &name);
|
||||||
|
|
||||||
|
} // namespace advss
|
||||||
@@ -181,6 +181,12 @@ std::string SceneSelection::ToString(bool resolve) const
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SceneSelection::ResolveVariables()
|
||||||
|
{
|
||||||
|
_scene = GetScene();
|
||||||
|
_type = Type::SCENE;
|
||||||
|
}
|
||||||
|
|
||||||
SceneSelection SceneSelectionWidget::CurrentSelection()
|
SceneSelection SceneSelectionWidget::CurrentSelection()
|
||||||
{
|
{
|
||||||
SceneSelection s;
|
SceneSelection s;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public:
|
|||||||
EXPORT Type GetType() const { return _type; }
|
EXPORT Type GetType() const { return _type; }
|
||||||
EXPORT OBSWeakSource GetScene(bool advance = true) const;
|
EXPORT OBSWeakSource GetScene(bool advance = true) const;
|
||||||
EXPORT std::string ToString(bool resolve = false) const;
|
EXPORT std::string ToString(bool resolve = false) const;
|
||||||
|
EXPORT void ResolveVariables();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OBSWeakSource _scene;
|
OBSWeakSource _scene;
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
namespace advss {
|
namespace advss {
|
||||||
|
|
||||||
Section::Section(const int animationDuration, QWidget *parent)
|
Section::Section(const int animationDuration, QWidget *parent)
|
||||||
: QWidget(parent), _animationDuration(animationDuration)
|
: QWidget(parent),
|
||||||
|
_animationDuration(animationDuration)
|
||||||
{
|
{
|
||||||
_toggleButton = new QToolButton(this);
|
_toggleButton = new QToolButton(this);
|
||||||
_headerLine = new QFrame(this);
|
_headerLine = new QFrame(this);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#include "export-symbol-helper.hpp"
|
#include "export-symbol-helper.hpp"
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <obs.hpp>
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
22
lib/utils/single-char-selection.cpp
Normal file
22
lib/utils/single-char-selection.cpp
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#include "single-char-selection.hpp"
|
||||||
|
|
||||||
|
namespace advss {
|
||||||
|
|
||||||
|
SingleCharSelection::SingleCharSelection(QWidget *parent) : QLineEdit(parent)
|
||||||
|
{
|
||||||
|
setMaxLength(1);
|
||||||
|
setMaximumWidth(50);
|
||||||
|
connect(this, &QLineEdit::textChanged, this,
|
||||||
|
&SingleCharSelection::CharChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SingleCharSelection::HandleTextChanged(const QString &text)
|
||||||
|
{
|
||||||
|
if (text.length() == 1) {
|
||||||
|
emit CharChanged(text);
|
||||||
|
} else if (text.length() > 1) {
|
||||||
|
setText(text.left(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // 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