Compare commits

...

6 Commits
1.8.2 ... 1.8.3

Author SHA1 Message Date
WarmUpTill
5156c66b26 add warning if translation cannot be found (#99)
* add warning if translation cannot be found

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

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

* slightly adjust sequence check for cooldown

* add UI implementation for cooldown feature
2021-01-07 18:58:35 +01:00
WarmUpTill
bf97975fa8 link to Transition Table instead of Transition Matrix plugin (#96) 2021-01-06 12:25:45 +01:00
WarmUpTill
4e971f59a9 add option to allow scene sequence to be interrupted (#93) 2021-01-02 14:32:18 +01:00
12 changed files with 637 additions and 297 deletions

View File

@@ -24,6 +24,8 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="Kann nur so gen
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Nicht wechseln"
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Wechsle zu einer Szene auf dem Zufall-Tab"
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Wechsle zu:"
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="Nach einem automatisierten Szenenwechsel wechsle nicht mehr für"
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="In diesem Zeitraum werden potentielle erfüllte Bedingungen ignoriert!"
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Ausführliches Logging"
AdvSceneSwitcher.generalTab.generalBehavior.automaticallyStop="Stoppe Streamen/Aufnehmen auf Szene"
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Deaktiviere UI Tipps"
@@ -53,7 +55,7 @@ AdvSceneSwitcher.generalTab.priority.audio="Audio"
AdvSceneSwitcher.transitionTab.title="Szenenübergänge"
AdvSceneSwitcher.transitionTab.transitionOverride="Szenenübergänge, die im Szenenwechsler konfiguriert werden, haben Vorrang vor Übergangsüberschreibung"
AdvSceneSwitcher.transitionTab.transitionForAToB="Szenenübergänge für automatisierte Szenenwechsel von Szene A zu Szene B"
AdvSceneSwitcher.transitionTab.transitionForAToB.description="<html><head/><body><p>Diese Einstellungen beeinflussen <span style=\"font-style:italic;\">nur</span> vom Szenenwechsler ausgelöste Szenenübergänge - Siehe <a href=\"https://obsproject.com/forum/resources/obs-transition-matrix.751/\"><span style=\" text-decoration: underline; color:#268bd2;\">Transition Matrix</span></a> um alle zu konfigurieren.<br/>Einstellungen auf diesem Tab haben Vorrang vor denen welche auf den übrigen Tabs konfiguriert wurden.</p></body></html>"
AdvSceneSwitcher.transitionTab.transitionForAToB.description="<html><head/><body><p>Diese Einstellungen beeinflussen <span style=\"font-style:italic;\">nur</span> vom Szenenwechsler ausgelöste Szenenübergänge - Siehe <a href=\"https://obsproject.com/forum/resources/transition-table.1174/\"><span style=\" text-decoration: underline; color:#268bd2;\">Transition Table</span></a> um auch manuelle Szenenübergänge zu konfigurieren.<br/>Einstellungen auf diesem Tab haben Vorrang vor denen welche auf den übrigen Tabs konfiguriert wurden.</p></body></html>"
AdvSceneSwitcher.transitionTab.defaultTransition="Ändere den Szenenübergang wenn eine Szene aktiv ist"
AdvSceneSwitcher.transitionTab.entry="Wechsle von {{scenes}} zu {{scenes2}} mit {{transitions}}"
AdvSceneSwitcher.transitionTab.defaultTransitionEntry="Wenn {{scenes}} aktiv ist ändere den Szenenübergang zu {{transitions}}"
@@ -175,13 +177,17 @@ AdvSceneSwitcher.sceneSequenceTab.loadTitle="Wähle eine Datei aus von der Szene
AdvSceneSwitcher.sceneSequenceTab.loadFail="Laden der Einstellungen ist fehlgeschlagen!"
AdvSceneSwitcher.sceneSequenceTab.loadSuccess="Laden der Einstellungen war erfolgreich!"
AdvSceneSwitcher.sceneSequenceTab.fileType="Text Dateien (*.txt)"
AdvSceneSwitcher.sceneSequenceTab.entry="Wenn {{startScenes}} aktiv ist wechsle zu {{scenes}} nach {{delay}} {{delayUnits}} mit {{transitions}}"
AdvSceneSwitcher.sceneSequenceTab.interruptible="kann unterbrochen werden"
AdvSceneSwitcher.sceneSequenceTab.interruptibleHint="Andere Szenenwechselmethoden können diese Sequenz unterbrechen"
AdvSceneSwitcher.sceneSequenceTab.entry="Wenn {{startScenes}} aktiv ist wechsle zu {{scenes}} nach {{delay}} {{delayUnits}} mit {{transitions}} {{interruptible}}"
; Audio Tab
AdvSceneSwitcher.audioTab.title="Audio"
AdvSceneSwitcher.audioTab.condition.above="über"
AdvSceneSwitcher.audioTab.condition.below="unter"
AdvSceneSwitcher.audioTab.entry="Wenn die Lautstärke von {{audioSources}} {{condition}} {{volumeWidget}} ist für {{duration}} wechsle zu {{scenes}} mit {{transitions}}"
AdvSceneSwitcher.audioTab.multiMatchfallbackCondition="Wenn mehrere Einträge zutreffen ..."
AdvSceneSwitcher.audioTab.multiMatchfallback="... für {{duration}} wechsle zu {{scenes}} mit {{transitions}}"
; Hotkey
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Starte den Erweiteren Szenenwechsler"

View File

@@ -24,6 +24,8 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="Will only ever
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Don't switch"
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Switch to any scene in Random tab"
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Switch to:"
AdvSceneSwitcher.generalTab.generalBehavior.cooldown="After a match do not switch scenes for"
AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="During this time potential matches will be ignored!"
AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Enable verbose logging"
AdvSceneSwitcher.generalTab.generalBehavior.automaticallyStop="Automatically stop streaming/recording on scene"
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Disable UI hints"
@@ -53,7 +55,7 @@ AdvSceneSwitcher.generalTab.priority.audio="Audio"
AdvSceneSwitcher.transitionTab.title="Transition"
AdvSceneSwitcher.transitionTab.transitionOverride="Scene transitions defined in the scene switcher take priority over Transition Overrides defined per scene"
AdvSceneSwitcher.transitionTab.transitionForAToB="Use transition for automated scene switch from scene A to scene B"
AdvSceneSwitcher.transitionTab.transitionForAToB.description="<html><head/><body><p>These settings <span style=\"font-style:italic;\">only</span> affect transitions caused by the scene switcher - Check out <a href=\"https://obsproject.com/forum/resources/obs-transition-matrix.751/\"><span style=\" text-decoration: underline; color:#268bd2;\">Transition Matrix</span></a> if you want to configure this for manual scene changes.<br/>Settings defined here take priority over transition settings configured elsewhere in the scene switcher.</p></body></html>"
AdvSceneSwitcher.transitionTab.transitionForAToB.description="<html><head/><body><p>These settings <span style=\"font-style:italic;\">only</span> affect transitions caused by the scene switcher - Check out <a href=\"https://obsproject.com/forum/resources/transition-table.1174/\"><span style=\" text-decoration: underline; color:#268bd2;\">Transition Table</span></a> if you want to configure this for manual scene changes.<br/>Settings defined here take priority over transition settings configured elsewhere in the scene switcher.</p></body></html>"
AdvSceneSwitcher.transitionTab.defaultTransition="Change transition if scene is active"
AdvSceneSwitcher.transitionTab.entry="Switch from {{scenes}} to {{scenes2}} using {{transitions}}"
AdvSceneSwitcher.transitionTab.defaultTransitionEntry="When scene {{scenes}} is active change default scene transition to {{transitions}}"
@@ -175,13 +177,17 @@ AdvSceneSwitcher.sceneSequenceTab.loadTitle="Select a file to read Scene Sequenc
AdvSceneSwitcher.sceneSequenceTab.loadFail="Advanced Scene Switcher failed to import settings!"
AdvSceneSwitcher.sceneSequenceTab.loadSuccess="Advanced Scene Switcher settings imported successfully!"
AdvSceneSwitcher.sceneSequenceTab.fileType="Text files (*.txt)"
AdvSceneSwitcher.sceneSequenceTab.entry="When {{startScenes}} is active switch to {{scenes}} after {{delay}} {{delayUnits}} using {{transitions}}"
AdvSceneSwitcher.sceneSequenceTab.interruptible="interruptible"
AdvSceneSwitcher.sceneSequenceTab.interruptibleHint="Other switching methods are allowed to interrupt this scene sequence"
AdvSceneSwitcher.sceneSequenceTab.entry="When {{startScenes}} is active switch to {{scenes}} after {{delay}} {{delayUnits}} using {{transitions}} {{interruptible}}"
; Audio Tab
AdvSceneSwitcher.audioTab.title="Audio"
AdvSceneSwitcher.audioTab.condition.above="above"
AdvSceneSwitcher.audioTab.condition.below="below"
AdvSceneSwitcher.audioTab.entry="When the volume of {{audioSources}} is {{condition}} {{volumeWidget}} for {{duration}} switch to {{scenes}} using {{transitions}}"
AdvSceneSwitcher.audioTab.multiMatchfallbackCondition="If multiple entries match ..."
AdvSceneSwitcher.audioTab.multiMatchfallback="... for {{duration}} switch to {{scenes}} using {{transitions}}"
; Hotkey
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Start the Advanced Scene Switcher"

View File

@@ -171,7 +171,7 @@ AdvSceneSwitcher.sceneSequenceTab.loadTitle="从文件加载序列 ..."
AdvSceneSwitcher.sceneSequenceTab.loadFail="导入失败"
AdvSceneSwitcher.sceneSequenceTab.loadSuccess="导入失败成功"
AdvSceneSwitcher.sceneSequenceTab.fileType="文本文件 (*.txt)"
AdvSceneSwitcher.sceneSequenceTab.entry="当场景 {{startScenes}} 被激活 {{delay}} {{delayUnits}}后使用转场特效 {{transitions}} 切换到场景 {{scenes}}"
AdvSceneSwitcher.sceneSequenceTab.entry="当场景 {{startScenes}} 被激活 {{delay}} {{delayUnits}}后使用转场特效 {{transitions}} 切换到场景 {{scenes}} {{interruptible}}"
; Audio Tab
AdvSceneSwitcher.audioTab.title="音频"

View File

@@ -152,69 +152,6 @@
<string>AdvSceneSwitcher.generalTab.generalBehavior</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_50">
<item>
<widget class="QCheckBox" name="autoStartSceneCheckBox">
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.automaticallyStart1</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="autoStartType">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_65">
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.automaticallyStart2</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="autoStartScenes">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_55">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="2">
@@ -310,7 +247,7 @@
</item>
</layout>
</item>
<item row="4" column="0">
<item row="6" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_52">
<item>
<widget class="QCheckBox" name="verboseLogging">
@@ -334,7 +271,101 @@
</item>
</layout>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="7" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_48">
<item>
<widget class="QCheckBox" name="uiHintsDisable">
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_52">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="5" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_50">
<item>
<widget class="QCheckBox" name="autoStartSceneCheckBox">
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.automaticallyStart1</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="autoStartType">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_65">
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.automaticallyStart2</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="autoStartScenes">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_55">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_33">
<item>
<widget class="QCheckBox" name="autoStopSceneCheckBox">
@@ -375,23 +406,23 @@
</layout>
</item>
<item row="1" column="0">
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_48">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="uiHintsDisable">
<widget class="QLabel" name="label">
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints</string>
<string>AdvSceneSwitcher.generalTab.generalBehavior.cooldown</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_52">
<widget class="QDoubleSpinBox" name="cooldownTime">
<property name="suffix">
<string>s</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -2830,151 +2861,178 @@
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QListWidget" name="audioSwitches">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sortingEnabled">
<bool>false</bool>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_22">
<item>
<widget class="QListWidget" name="audioSwitches">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_53">
<item>
<widget class="QPushButton" name="audioAdd">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</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="audioRemove">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</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_114">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line_38">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_115">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="audioUp">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>../../../forms/images/up.svg</normaloff>../../../forms/images/up.svg</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="themeID" stdset="0">
<string>upArrowIconSmall</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="audioDown">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>../../../forms/images/down.svg</normaloff>../../../forms/images/down.svg</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="themeID" stdset="0">
<string>downArrowIconSmall</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_56">
<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>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_53">
<item>
<widget class="QPushButton" name="audioAdd">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</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="audioRemove">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</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_114">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line_38">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_115">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="audioUp">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>../../../forms/images/up.svg</normaloff>../../../forms/images/up.svg</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="themeID" stdset="0">
<string>upArrowIconSmall</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="audioDown">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>../../../forms/images/down.svg</normaloff>../../../forms/images/down.svg</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="themeID" stdset="0">
<string>downArrowIconSmall</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_56">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<widget class="QGroupBox" name="audioFallback">
<property name="title">
<string>AdvSceneSwitcher.audioTab.multiMatchfallbackCondition</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23">
<item>
<layout class="QHBoxLayout" name="audioFallbackLayout"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>

View File

@@ -3,6 +3,7 @@
#include <QtGui/qstandarditemmodel.h>
#include <QPropertyAnimation>
#include <QGraphicsColorizeEffect>
#include <QMessageBox>
#include <obs-module.h>
#include <obs-frontend-api.h>
@@ -28,8 +29,19 @@ AdvSceneSwitcher::AdvSceneSwitcher(QWidget *parent)
loadUI();
}
bool translationAvailable()
{
return !!strcmp(obs_module_text("AdvSceneSwitcher.pluginName"),
"AdvSceneSwitcher.pluginName");
}
void AdvSceneSwitcher::loadUI()
{
if (!translationAvailable()) {
DisplayMessage("Failed to find plug-in's 'data' directory.\n"
"Please check installation instructions!");
}
#if __APPLE__
setMinimumHeight(700);
#endif
@@ -55,6 +67,13 @@ void AdvSceneSwitcher::loadUI()
/********************************************************************************
* UI helpers
********************************************************************************/
void AdvSceneSwitcher::DisplayMessage(QString msg)
{
QMessageBox Msgbox;
Msgbox.setWindowTitle("Advanced Scene Switcher");
Msgbox.setText(msg);
Msgbox.exec();
}
void addSelectionEntry(QComboBox *sel, const char *description,
const char *tooltip = "")
@@ -481,6 +500,8 @@ void SwitcherData::Thread()
checkNoMatchSwitch(match, scene, transition, sleep);
checkSwitchCooldown(match);
// After this point we will call frontend functions
// obs_frontend_set_current_scene() and
// obs_frontend_set_current_transition()

View File

@@ -1,5 +1,4 @@
#include <QFileDialog>
#include <QMessageBox>
#include "headers/advanced-scene-switcher.hpp"
#include "headers/utility.hpp"
@@ -83,6 +82,14 @@ void AdvSceneSwitcher::on_noMatchSwitchScene_currentTextChanged(
UpdateNonMatchingScene(text);
}
void AdvSceneSwitcher::on_cooldownTime_valueChanged(double i)
{
if (loading)
return;
std::lock_guard<std::mutex> lock(switcher->m);
switcher->cooldown = i;
}
void AdvSceneSwitcher::on_checkInterval_valueChanged(int value)
{
if (loading)
@@ -341,10 +348,8 @@ void AdvSceneSwitcher::on_importSettings_clicked()
file.fileName().toUtf8().constData());
if (!obj) {
QMessageBox Msgbox;
Msgbox.setText(obs_module_text(
DisplayMessage(obs_module_text(
"AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail"));
Msgbox.exec();
return;
}
@@ -365,10 +370,8 @@ void AdvSceneSwitcher::on_importSettings_clicked()
obs_data_release(obj);
QMessageBox Msgbox;
Msgbox.setText(obs_module_text(
DisplayMessage(obs_module_text(
"AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess"));
Msgbox.exec();
close();
}
@@ -471,6 +474,8 @@ void SwitcherData::saveGeneralSettings(obs_data_t *obj)
switcher->switchIfNotMatching);
obs_data_set_double(obj, "noMatchDelay", switcher->noMatchDelay);
obs_data_set_double(obj, "cooldown", switcher->cooldown);
obs_data_set_bool(obj, "active", !switcher->stop);
obs_data_set_int(obj, "startup_behavior", switcher->startupBehavior);
@@ -548,6 +553,8 @@ void SwitcherData::loadGeneralSettings(obs_data_t *obj)
GetWeakSourceByName(nonMatchingScene.c_str());
switcher->noMatchDelay = obs_data_get_double(obj, "noMatchDelay");
switcher->cooldown = obs_data_get_double(obj, "cooldown");
switcher->stop = !obs_data_get_bool(obj, "active");
switcher->startupBehavior =
(StartupBehavior)obs_data_get_int(obj, "startup_behavior");
@@ -680,6 +687,26 @@ void SwitcherData::checkNoMatchSwitch(bool &match, OBSWeakSource &scene,
}
}
void SwitcherData::checkSwitchCooldown(bool &match)
{
if (!match || cooldown == 0.) {
return;
}
auto now = std::chrono::high_resolution_clock::now();
auto timePassed = std::chrono::duration_cast<std::chrono::milliseconds>(
now - lastMatchTime);
if (timePassed.count() > cooldown * 1000) {
lastMatchTime = now;
return;
}
match = false;
if (verbose)
blog(LOG_INFO, "cooldown active - ignoring match");
}
void AdvSceneSwitcher::setupGeneralTab()
{
populateSceneSelection(ui->noMatchSwitchScene, false);
@@ -703,6 +730,10 @@ void AdvSceneSwitcher::setupGeneralTab()
"AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip"));
ui->checkInterval->setValue(switcher->interval);
ui->cooldownTime->setValue(switcher->cooldown);
ui->cooldownTime->setToolTip(obs_module_text(
"AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint"));
ui->autoStopSceneCheckBox->setChecked(switcher->autoStopEnable);
ui->autoStopScenes->setCurrentText(
GetWeakSourceName(switcher->autoStopScene).c_str());

View File

@@ -56,6 +56,7 @@ public:
void setupAudioTab();
void setTabOrder();
void DisplayMessage(QString msg);
static void populateSceneSelection(QComboBox *sel,
bool addPrevious = false,
bool addSelect = true);
@@ -88,6 +89,7 @@ public slots:
void on_noMatchSwitch_clicked();
void on_noMatchRandomSwitch_clicked();
void on_noMatchDelay_valueChanged(double i);
void on_cooldownTime_valueChanged(double i);
void on_startupBehavior_currentIndexChanged(int index);
void on_noMatchSwitchScene_currentTextChanged(const QString &text);
void on_checkInterval_valueChanged(int value);
@@ -183,6 +185,7 @@ public slots:
void on_audioRemove_clicked();
void on_audioUp_clicked();
void on_audioDown_clicked();
void on_audioFallback_toggled(bool on);
void on_priorityUp_clicked();
void on_priorityDown_clicked();

View File

@@ -44,6 +44,13 @@ struct AudioSwitch : virtual SceneSwitcherEntry {
friend void swap(AudioSwitch &first, AudioSwitch &second);
};
struct AudioSwitchFallback : virtual SceneSwitcherEntry {
const char *getType() { return "audio_fallback"; }
bool enable = false;
double duration = 0;
unsigned int matchCount = 0;
};
class AudioSwitchWidget : public SwitchWidget {
Q_OBJECT
@@ -71,3 +78,18 @@ private:
AudioSwitch *switchData;
};
class AudioSwitchFallbackWidget : public SwitchWidget {
Q_OBJECT
public:
AudioSwitchFallbackWidget(AudioSwitchFallback *s);
private slots:
void DurationChanged(double dur);
private:
QDoubleSpinBox *duration;
AudioSwitchFallback *switchData;
};

View File

@@ -15,6 +15,8 @@ struct SceneSequenceSwitch : SceneSwitcherEntry {
OBSWeakSource startScene = nullptr;
double delay = 0;
int delayMultiplier = 1;
bool interruptible = false;
unsigned int matchCount = 0;
const char *getType() { return "sequence"; }
bool initialized();
@@ -25,11 +27,13 @@ struct SceneSequenceSwitch : SceneSwitcherEntry {
inline SceneSequenceSwitch(OBSWeakSource startScene_,
OBSWeakSource scene_,
OBSWeakSource transition_, double delay_,
int delayMultiplier_, bool usePreviousScene_)
int delayMultiplier_, bool interruptible_,
bool usePreviousScene_)
: SceneSwitcherEntry(scene_, transition_, usePreviousScene_),
startScene(startScene_),
delay(delay_),
delayMultiplier(delayMultiplier_)
delayMultiplier(delayMultiplier_),
interruptible(interruptible_)
{
}
};
@@ -50,11 +54,13 @@ private slots:
void DelayChanged(double delay);
void DelayUnitsChanged(int idx);
void StartSceneChanged(const QString &text);
void InterruptibleChanged(int state);
private:
QDoubleSpinBox *delay;
QComboBox *delayUnits;
QComboBox *startScenes;
QCheckBox *interruptible;
SceneSequenceSwitch *switchData;
};

View File

@@ -68,6 +68,9 @@ struct SwitcherData {
double noMatchCount = 0;
StartupBehavior startupBehavior = PERSIST;
double cooldown = 0.;
std::chrono::high_resolution_clock::time_point lastMatchTime;
std::deque<WindowSwitch> windowSwitches;
std::vector<std::string> ignoreIdleWindows;
std::string lastTitle;
@@ -108,6 +111,7 @@ struct SwitcherData {
QDateTime liveTime;
std::deque<AudioSwitch> audioSwitches;
AudioSwitchFallback audioFallback;
std::vector<int> functionNamesByPriority = std::vector<int>{
default_priority_0, default_priority_1, default_priority_2,
@@ -185,8 +189,11 @@ struct SwitcherData {
OBSWeakSource &transition);
void checkAudioSwitch(bool &match, OBSWeakSource &scene,
OBSWeakSource &transition);
void checkAudioSwitchFallback(OBSWeakSource &scene,
OBSWeakSource &transition);
void checkNoMatchSwitch(bool &match, OBSWeakSource &scene,
OBSWeakSource &transition, int &sleep);
void checkSwitchCooldown(bool &match);
void saveWindowTitleSwitches(obs_data_t *obj);
void saveScreenRegionSwitches(obs_data_t *obj);

View File

@@ -1,3 +1,5 @@
#include <float.h>
#include "headers/advanced-scene-switcher.hpp"
#include "headers/volume-control.hpp"
#include "headers/utility.hpp"
@@ -72,12 +74,43 @@ void AdvSceneSwitcher::on_audioDown_clicked()
switcher->audioSwitches[index + 1]);
}
void AdvSceneSwitcher::on_audioFallback_toggled(bool on)
{
if (loading || !switcher)
return;
std::lock_guard<std::mutex> lock(switcher->m);
switcher->audioFallback.enable = on;
}
void SwitcherData::checkAudioSwitchFallback(OBSWeakSource &scene,
OBSWeakSource &transition)
{
bool durationReached =
((unsigned long long)audioFallback.matchCount * interval) /
1000.0 >=
audioFallback.duration;
if (durationReached) {
scene = (audioFallback.usePreviousScene) ? previousScene
: audioFallback.scene;
transition = audioFallback.transition;
if (verbose)
audioFallback.logMatch();
}
audioFallback.matchCount++;
}
void SwitcherData::checkAudioSwitch(bool &match, OBSWeakSource &scene,
OBSWeakSource &transition)
{
if (AudioSwitch::pause)
return;
bool fallbackChecked = false; // false if one or no match
for (AudioSwitch &s : audioSwitches) {
if (!s.initialized())
continue;
@@ -96,6 +129,9 @@ void SwitcherData::checkAudioSwitch(bool &match, OBSWeakSource &scene,
volumeThresholdreached = ((double)s.peak + 60) * 1.7 <
s.volumeThreshold;
// reset for next check
s.peak = -FLT_MAX;
if (volumeThresholdreached) {
s.matchCount++;
} else {
@@ -103,19 +139,56 @@ void SwitcherData::checkAudioSwitch(bool &match, OBSWeakSource &scene,
}
bool durationReached =
(s.matchCount * (unsigned int)interval) / 1000.0 >=
((unsigned long long)s.matchCount * interval) /
1000.0 >=
s.duration;
if (volumeThresholdreached && durationReached && audioActive) {
if (match) {
checkAudioSwitchFallback(scene, transition);
fallbackChecked = true;
break;
}
scene = (s.usePreviousScene) ? previousScene : s.scene;
transition = s.transition;
match = true;
if (verbose)
s.logMatch();
break;
if (!audioFallback.enable)
break;
}
}
if (!fallbackChecked)
audioFallback.matchCount = 0;
}
void saveAudioFallback(obs_data_t *obj, AudioSwitchFallback &audioFallback)
{
obs_source_t *fallbackSceneSource =
obs_weak_source_get_source(audioFallback.scene);
obs_source_t *fallbackTransition =
obs_weak_source_get_source(audioFallback.transition);
const char *fallbackSceneName =
obs_source_get_name(fallbackSceneSource);
const char *fallbackTransitionName =
obs_source_get_name(fallbackTransition);
obs_data_set_bool(obj, "audioFallbackEnable", audioFallback.enable);
obs_data_set_string(obj, "audioFallbackScene",
audioFallback.usePreviousScene ? previous_scene_name
: fallbackSceneName);
obs_data_set_string(obj, "audioFallbackTransition",
fallbackTransitionName);
obs_data_set_double(obj, "audioFallbackDuration",
audioFallback.duration);
obs_source_release(fallbackSceneSource);
obs_source_release(fallbackTransition);
}
void SwitcherData::saveAudioSwitches(obs_data_t *obj)
@@ -159,6 +232,25 @@ void SwitcherData::saveAudioSwitches(obs_data_t *obj)
}
obs_data_set_array(obj, "audioSwitches", audioArray);
obs_data_array_release(audioArray);
saveAudioFallback(obj, audioFallback);
}
void loadAudioFallback(obs_data_t *obj, AudioSwitchFallback &audioFallback)
{
const char *fallbackSceneName =
obs_data_get_string(obj, "audioFallbackScene");
const char *fallbackTransitionName =
obs_data_get_string(obj, "audioFallbackTransition");
audioFallback.enable = obs_data_get_bool(obj, "audioFallbackEnable");
audioFallback.duration =
obs_data_get_double(obj, "audioFallbackDuration");
audioFallback.scene = GetWeakSourceByName(fallbackSceneName);
audioFallback.transition =
GetWeakTransitionByName(fallbackTransitionName);
audioFallback.usePreviousScene =
strcmp(fallbackSceneName, previous_scene_name) == 0;
}
void SwitcherData::loadAudioSwitches(obs_data_t *obj)
@@ -190,6 +282,8 @@ void SwitcherData::loadAudioSwitches(obs_data_t *obj)
obs_data_release(array_obj);
}
obs_data_array_release(audioArray);
loadAudioFallback(obj, audioFallback);
}
void AdvSceneSwitcher::setupAudioTab()
@@ -205,6 +299,11 @@ void AdvSceneSwitcher::setupAudioTab()
if (switcher->audioSwitches.size() == 0)
addPulse = PulseWidget(ui->audioAdd, QColor(Qt::green));
AudioSwitchFallbackWidget *fb =
new AudioSwitchFallbackWidget(&switcher->audioFallback);
ui->audioFallbackLayout->addWidget(fb);
ui->audioFallback->setChecked(switcher->audioFallback.enable);
}
void AudioSwitch::setVolumeLevel(void *data,
@@ -216,26 +315,32 @@ void AudioSwitch::setVolumeLevel(void *data,
UNUSED_PARAMETER(inputPeak);
AudioSwitch *s = static_cast<AudioSwitch *>(data);
s->peak = peak[0];
for (int i = 1; i < MAX_AUDIO_CHANNELS; i++)
if (peak[i] > s->peak)
s->peak = peak[i];
}
obs_volmeter_t *AddVolmeterToSource(AudioSwitch *entry, obs_weak_source *source)
{
obs_volmeter_t *volmeter = obs_volmeter_create(OBS_FADER_LOG);
obs_volmeter_add_callback(volmeter, AudioSwitch::setVolumeLevel, entry);
obs_source_t *as = obs_weak_source_get_source(source);
if (!obs_volmeter_attach_source(volmeter, as)) {
const char *name = obs_source_get_name(as);
blog(LOG_WARNING, "failed to attach volmeter to source %s",
name);
}
obs_source_release(as);
return volmeter;
}
void AudioSwitch::resetVolmeter()
{
obs_volmeter_remove_callback(volmeter, setVolumeLevel, this);
obs_volmeter_destroy(volmeter);
volmeter = obs_volmeter_create(OBS_FADER_LOG);
obs_volmeter_add_callback(volmeter, setVolumeLevel, this);
obs_source_t *as = obs_weak_source_get_source(audioSource);
if (!obs_volmeter_attach_source(volmeter, as)) {
const char *name = obs_source_get_name(as);
blog(LOG_WARNING, "failed to attach volmeter to source %s",
name);
}
obs_source_release(as);
volmeter = AddVolmeterToSource(this, audioSource);
}
bool AudioSwitch::initialized()
@@ -259,15 +364,7 @@ AudioSwitch::AudioSwitch(OBSWeakSource scene_, OBSWeakSource transition_,
condition(condition_),
duration(duration_)
{
volmeter = obs_volmeter_create(OBS_FADER_LOG);
obs_volmeter_add_callback(volmeter, setVolumeLevel, this);
obs_source_t *as = obs_weak_source_get_source(audioSource);
if (!obs_volmeter_attach_source(volmeter, as)) {
const char *name = obs_source_get_name(as);
blog(LOG_WARNING, "failed to attach volmeter to source %s",
name);
}
obs_source_release(as);
volmeter = AddVolmeterToSource(this, audioSource);
}
AudioSwitch::AudioSwitch(const AudioSwitch &other)
@@ -278,15 +375,7 @@ AudioSwitch::AudioSwitch(const AudioSwitch &other)
condition(other.condition),
duration(other.duration)
{
volmeter = obs_volmeter_create(OBS_FADER_LOG);
obs_volmeter_add_callback(volmeter, setVolumeLevel, this);
obs_source_t *as = obs_weak_source_get_source(other.audioSource);
if (!obs_volmeter_attach_source(volmeter, as)) {
const char *name = obs_source_get_name(as);
blog(LOG_WARNING, "failed to attach volmeter to source %s",
name);
}
obs_source_release(as);
volmeter = AddVolmeterToSource(this, other.audioSource);
}
AudioSwitch::AudioSwitch(AudioSwitch &&other)
@@ -494,3 +583,42 @@ void AudioSwitchWidget::DurationChanged(double dur)
std::lock_guard<std::mutex> lock(switcher->m);
switchData->duration = dur;
}
AudioSwitchFallbackWidget::AudioSwitchFallbackWidget(AudioSwitchFallback *s)
: SwitchWidget(s)
{
duration = new QDoubleSpinBox();
duration->setMinimum(0.0);
duration->setMaximum(99.000000);
duration->setSuffix("s");
QWidget::connect(duration, SIGNAL(valueChanged(double)), this,
SLOT(DurationChanged(double)));
if (s) {
duration->setValue(s->duration);
}
QHBoxLayout *mainLayout = new QHBoxLayout;
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
{"{{scenes}}", scenes},
{"{{duration}}", duration},
{"{{transitions}}", transitions}};
placeWidgets(
obs_module_text("AdvSceneSwitcher.audioTab.multiMatchfallback"),
mainLayout, widgetPlaceholders);
setLayout(mainLayout);
switchData = s;
loading = false;
}
void AudioSwitchFallbackWidget::DurationChanged(double dur)
{
if (loading || !switchData)
return;
std::lock_guard<std::mutex> lock(switcher->m);
switchData->duration = dur;
}

View File

@@ -1,6 +1,5 @@
#include <QFileDialog>
#include <QTextStream>
#include <QMessageBox>
#include "headers/advanced-scene-switcher.hpp"
#include "headers/utility.hpp"
@@ -126,10 +125,8 @@ void AdvSceneSwitcher::on_sceneSequenceLoad_clicked()
file.fileName().toUtf8().constData());
if (!obj) {
QMessageBox Msgbox;
Msgbox.setText(obs_module_text(
DisplayMessage(obs_module_text(
"AdvSceneSwitcher.sceneSequenceTab.loadFail"));
Msgbox.exec();
return;
}
@@ -146,13 +143,63 @@ void AdvSceneSwitcher::on_sceneSequenceLoad_clicked()
obs_data_release(obj);
QMessageBox Msgbox;
Msgbox.setText(obs_module_text(
DisplayMessage(obs_module_text(
"AdvSceneSwitcher.sceneSequenceTab.loadSuccess"));
Msgbox.exec();
close();
}
void matchInterruptible(SwitcherData *switcher, SceneSequenceSwitch &s,
bool &match, OBSWeakSource &scene,
OBSWeakSource &transition)
{
bool durationReached = s.matchCount * (switcher->interval / 1000.0) >=
s.delay;
s.matchCount++;
if (durationReached) {
match = true;
scene = (s.usePreviousScene) ? switcher->previousScene
: s.scene;
transition = s.transition;
if (switcher->verbose)
s.logMatch();
}
}
void matchUninterruptible(SwitcherData *switcher, SceneSequenceSwitch &s,
obs_source_t *currentSource,
std::unique_lock<std::mutex> &lock, bool &match,
OBSWeakSource &scene, OBSWeakSource &transition)
{
// scene was already active for the previous cycle so remove this time
int dur = s.delay * 1000 - switcher->interval;
if (dur > 0) {
switcher->waitScene = currentSource;
if (switcher->verbose)
s.logSleep(dur);
switcher->cv.wait_for(lock, std::chrono::milliseconds(dur));
switcher->waitScene = nullptr;
}
obs_source_t *currentSource2 = obs_frontend_get_current_scene();
// only switch if user hasn't changed scene manually
if (currentSource == currentSource2) {
match = true;
scene = (s.usePreviousScene) ? switcher->previousScene
: s.scene;
transition = s.transition;
if (switcher->verbose)
s.logMatch();
} else if (switcher->verbose) {
blog(LOG_INFO, "sequence canceled");
}
obs_source_release(currentSource2);
}
void SwitcherData::checkSceneSequence(bool &match, OBSWeakSource &scene,
OBSWeakSource &transition,
std::unique_lock<std::mutex> &lock)
@@ -168,34 +215,19 @@ void SwitcherData::checkSceneSequence(bool &match, OBSWeakSource &scene,
continue;
if (s.startScene == ws) {
int dur = s.delay * 1000 - interval;
if (dur > 0) {
waitScene = currentSource;
if (verbose)
s.logSleep(dur);
cv.wait_for(lock,
std::chrono::milliseconds(dur));
waitScene = nullptr;
if (!match) {
if (s.interruptible) {
matchInterruptible(switcher, s, match,
scene, transition);
} else {
matchUninterruptible(switcher, s,
currentSource,
lock, match, scene,
transition);
}
}
obs_source_t *currentSource2 =
obs_frontend_get_current_scene();
// only switch if user hasn't changed scene manually
if (currentSource == currentSource2) {
match = true;
scene = (s.usePreviousScene) ? previousScene
: s.scene;
transition = s.transition;
if (verbose)
s.logMatch();
} else if (verbose) {
blog(LOG_INFO, "sequence canceled");
}
obs_source_release(currentSource2);
break;
} else {
s.matchCount = 0;
}
}
obs_source_release(currentSource);
@@ -229,6 +261,8 @@ void SwitcherData::saveSceneSequenceSwitches(obs_data_t *obj)
obs_data_set_double(array_obj, "delay", s.delay);
obs_data_set_int(array_obj, "delayMultiplier",
s.delayMultiplier);
obs_data_set_bool(array_obj, "interruptible",
s.interruptible);
obs_data_array_push_back(sceneSequenceArray, array_obj);
}
@@ -265,12 +299,14 @@ void SwitcherData::loadSceneSequenceSwitches(obs_data_t *obj)
if (delayMultiplier == 0 ||
(delayMultiplier != 1 && delayMultiplier % 60 != 0))
delayMultiplier = 1;
bool interruptible =
obs_data_get_bool(array_obj, "interruptible");
switcher->sceneSequenceSwitches.emplace_back(
GetWeakSourceByName(scene1),
GetWeakSourceByName(scene2),
GetWeakTransitionByName(transition), delay,
delayMultiplier,
delayMultiplier, interruptible,
(strcmp(scene2, previous_scene_name) == 0));
obs_data_release(array_obj);
@@ -321,6 +357,8 @@ SequenceWidget::SequenceWidget(SceneSequenceSwitch *s) : SwitchWidget(s)
delay = new QDoubleSpinBox();
delayUnits = new QComboBox();
startScenes = new QComboBox();
interruptible = new QCheckBox(obs_module_text(
"AdvSceneSwitcher.sceneSequenceTab.interruptible"));
QWidget::connect(delay, SIGNAL(valueChanged(double)), this,
SLOT(DelayChanged(double)));
@@ -329,10 +367,14 @@ SequenceWidget::SequenceWidget(SceneSequenceSwitch *s) : SwitchWidget(s)
QWidget::connect(startScenes,
SIGNAL(currentTextChanged(const QString &)), this,
SLOT(StartSceneChanged(const QString &)));
QWidget::connect(interruptible, SIGNAL(stateChanged(int)), this,
SLOT(InterruptibleChanged(int)));
delay->setMaximum(99999.000000);
AdvSceneSwitcher::populateSceneSelection(startScenes, false);
populateDelayUnits(delayUnits);
interruptible->setToolTip(obs_module_text(
"AdvSceneSwitcher.sceneSequenceTab.interruptibleHint"));
if (s) {
switch (s->delayMultiplier) {
@@ -350,6 +392,7 @@ SequenceWidget::SequenceWidget(SceneSequenceSwitch *s) : SwitchWidget(s)
}
startScenes->setCurrentText(
GetWeakSourceName(s->startScene).c_str());
interruptible->setChecked(s->interruptible);
}
QHBoxLayout *mainLayout = new QHBoxLayout;
@@ -358,7 +401,8 @@ SequenceWidget::SequenceWidget(SceneSequenceSwitch *s) : SwitchWidget(s)
{"{{scenes}}", scenes},
{"{{delay}}", delay},
{"{{delayUnits}}", delayUnits},
{"{{transitions}}", transitions}};
{"{{transitions}}", transitions},
{"{{interruptible}}", interruptible}};
placeWidgets(obs_module_text("AdvSceneSwitcher.sceneSequenceTab.entry"),
mainLayout, widgetPlaceholders);
setLayout(mainLayout);
@@ -434,3 +478,11 @@ void SequenceWidget::StartSceneChanged(const QString &text)
std::lock_guard<std::mutex> lock(switcher->m);
switchData->startScene = GetWeakSourceByQString(text);
}
void SequenceWidget::InterruptibleChanged(int state)
{
if (loading || !switchData)
return;
std::lock_guard<std::mutex> lock(switcher->m);
switchData->interruptible = state;
}