mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 09:05:57 -05:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5156c66b26 | ||
|
|
346240473a | ||
|
|
17c4fefb37 | ||
|
|
2b90493ae9 | ||
|
|
bf97975fa8 | ||
|
|
4e971f59a9 |
@@ -24,6 +24,8 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="Kann nur so gen
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Nicht wechseln"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Nicht wechseln"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Wechsle zu einer Szene auf dem Zufall-Tab"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Wechsle zu einer Szene auf dem Zufall-Tab"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Wechsle zu:"
|
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.verboseLogging="Ausführliches Logging"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.automaticallyStop="Stoppe Streamen/Aufnehmen auf Szene"
|
AdvSceneSwitcher.generalTab.generalBehavior.automaticallyStop="Stoppe Streamen/Aufnehmen auf Szene"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Deaktiviere UI Tipps"
|
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Deaktiviere UI Tipps"
|
||||||
@@ -53,7 +55,7 @@ AdvSceneSwitcher.generalTab.priority.audio="Audio"
|
|||||||
AdvSceneSwitcher.transitionTab.title="Szenenübergänge"
|
AdvSceneSwitcher.transitionTab.title="Szenenübergänge"
|
||||||
AdvSceneSwitcher.transitionTab.transitionOverride="Szenenübergänge, die im Szenenwechsler konfiguriert werden, haben Vorrang vor Übergangsüberschreibung"
|
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="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.defaultTransition="Ändere den Szenenübergang wenn eine Szene aktiv ist"
|
||||||
AdvSceneSwitcher.transitionTab.entry="Wechsle von {{scenes}} zu {{scenes2}} mit {{transitions}}"
|
AdvSceneSwitcher.transitionTab.entry="Wechsle von {{scenes}} zu {{scenes2}} mit {{transitions}}"
|
||||||
AdvSceneSwitcher.transitionTab.defaultTransitionEntry="Wenn {{scenes}} aktiv ist ändere den Szenenübergang zu {{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.loadFail="Laden der Einstellungen ist fehlgeschlagen!"
|
||||||
AdvSceneSwitcher.sceneSequenceTab.loadSuccess="Laden der Einstellungen war erfolgreich!"
|
AdvSceneSwitcher.sceneSequenceTab.loadSuccess="Laden der Einstellungen war erfolgreich!"
|
||||||
AdvSceneSwitcher.sceneSequenceTab.fileType="Text Dateien (*.txt)"
|
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
|
; Audio Tab
|
||||||
AdvSceneSwitcher.audioTab.title="Audio"
|
AdvSceneSwitcher.audioTab.title="Audio"
|
||||||
AdvSceneSwitcher.audioTab.condition.above="über"
|
AdvSceneSwitcher.audioTab.condition.above="über"
|
||||||
AdvSceneSwitcher.audioTab.condition.below="unter"
|
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.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
|
; Hotkey
|
||||||
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Starte den Erweiteren Szenenwechsler"
|
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Starte den Erweiteren Szenenwechsler"
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip="Will only ever
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Don't switch"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.dontSwitch="Don't switch"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Switch to any scene in Random tab"
|
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Switch to any scene in Random tab"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Switch to:"
|
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.verboseLogging="Enable verbose logging"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.automaticallyStop="Automatically stop streaming/recording on scene"
|
AdvSceneSwitcher.generalTab.generalBehavior.automaticallyStop="Automatically stop streaming/recording on scene"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Disable UI hints"
|
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Disable UI hints"
|
||||||
@@ -53,7 +55,7 @@ AdvSceneSwitcher.generalTab.priority.audio="Audio"
|
|||||||
AdvSceneSwitcher.transitionTab.title="Transition"
|
AdvSceneSwitcher.transitionTab.title="Transition"
|
||||||
AdvSceneSwitcher.transitionTab.transitionOverride="Scene transitions defined in the scene switcher take priority over Transition Overrides defined per scene"
|
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="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.defaultTransition="Change transition if scene is active"
|
||||||
AdvSceneSwitcher.transitionTab.entry="Switch from {{scenes}} to {{scenes2}} using {{transitions}}"
|
AdvSceneSwitcher.transitionTab.entry="Switch from {{scenes}} to {{scenes2}} using {{transitions}}"
|
||||||
AdvSceneSwitcher.transitionTab.defaultTransitionEntry="When scene {{scenes}} is active change default scene transition to {{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.loadFail="Advanced Scene Switcher failed to import settings!"
|
||||||
AdvSceneSwitcher.sceneSequenceTab.loadSuccess="Advanced Scene Switcher settings imported successfully!"
|
AdvSceneSwitcher.sceneSequenceTab.loadSuccess="Advanced Scene Switcher settings imported successfully!"
|
||||||
AdvSceneSwitcher.sceneSequenceTab.fileType="Text files (*.txt)"
|
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
|
; Audio Tab
|
||||||
AdvSceneSwitcher.audioTab.title="Audio"
|
AdvSceneSwitcher.audioTab.title="Audio"
|
||||||
AdvSceneSwitcher.audioTab.condition.above="above"
|
AdvSceneSwitcher.audioTab.condition.above="above"
|
||||||
AdvSceneSwitcher.audioTab.condition.below="below"
|
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.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
|
; Hotkey
|
||||||
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Start the Advanced Scene Switcher"
|
AdvSceneSwitcher.hotkey.startSwitcherHotkey="Start the Advanced Scene Switcher"
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ AdvSceneSwitcher.sceneSequenceTab.loadTitle="从文件加载序列 ..."
|
|||||||
AdvSceneSwitcher.sceneSequenceTab.loadFail="导入失败"
|
AdvSceneSwitcher.sceneSequenceTab.loadFail="导入失败"
|
||||||
AdvSceneSwitcher.sceneSequenceTab.loadSuccess="导入失败成功"
|
AdvSceneSwitcher.sceneSequenceTab.loadSuccess="导入失败成功"
|
||||||
AdvSceneSwitcher.sceneSequenceTab.fileType="文本文件 (*.txt)"
|
AdvSceneSwitcher.sceneSequenceTab.fileType="文本文件 (*.txt)"
|
||||||
AdvSceneSwitcher.sceneSequenceTab.entry="当场景 {{startScenes}} 被激活 {{delay}} {{delayUnits}}后使用转场特效 {{transitions}} 切换到场景 {{scenes}}"
|
AdvSceneSwitcher.sceneSequenceTab.entry="当场景 {{startScenes}} 被激活 {{delay}} {{delayUnits}}后使用转场特效 {{transitions}} 切换到场景 {{scenes}} {{interruptible}}"
|
||||||
|
|
||||||
; Audio Tab
|
; Audio Tab
|
||||||
AdvSceneSwitcher.audioTab.title="音频"
|
AdvSceneSwitcher.audioTab.title="音频"
|
||||||
|
|||||||
@@ -152,69 +152,6 @@
|
|||||||
<string>AdvSceneSwitcher.generalTab.generalBehavior</string>
|
<string>AdvSceneSwitcher.generalTab.generalBehavior</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_5">
|
<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">
|
<item row="0" column="0">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="2">
|
<item row="0" column="2">
|
||||||
@@ -310,7 +247,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="6" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_52">
|
<layout class="QHBoxLayout" name="horizontalLayout_52">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="verboseLogging">
|
<widget class="QCheckBox" name="verboseLogging">
|
||||||
@@ -334,7 +271,101 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</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">
|
<layout class="QHBoxLayout" name="horizontalLayout_33">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="autoStopSceneCheckBox">
|
<widget class="QCheckBox" name="autoStopSceneCheckBox">
|
||||||
@@ -375,23 +406,23 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="Line" name="line_6">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_48">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="uiHintsDisable">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints</string>
|
<string>AdvSceneSwitcher.generalTab.generalBehavior.cooldown</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<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">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -2830,151 +2861,178 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QListWidget" name="audioSwitches">
|
<widget class="QGroupBox" name="groupBox_4">
|
||||||
<property name="sizePolicy">
|
<property name="title">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<string/>
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="sortingEnabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
</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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_53">
|
<widget class="QGroupBox" name="audioFallback">
|
||||||
<item>
|
<property name="title">
|
||||||
<widget class="QPushButton" name="audioAdd">
|
<string>AdvSceneSwitcher.audioTab.multiMatchfallbackCondition</string>
|
||||||
<property name="maximumSize">
|
</property>
|
||||||
<size>
|
<property name="flat">
|
||||||
<width>22</width>
|
<bool>false</bool>
|
||||||
<height>22</height>
|
</property>
|
||||||
</size>
|
<property name="checkable">
|
||||||
</property>
|
<bool>true</bool>
|
||||||
<property name="flat">
|
</property>
|
||||||
<bool>true</bool>
|
<layout class="QVBoxLayout" name="verticalLayout_23">
|
||||||
</property>
|
<item>
|
||||||
<property name="themeID" stdset="0">
|
<layout class="QHBoxLayout" name="audioFallbackLayout"/>
|
||||||
<string notr="true">addIconSmall</string>
|
</item>
|
||||||
</property>
|
</layout>
|
||||||
</widget>
|
</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>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <QtGui/qstandarditemmodel.h>
|
#include <QtGui/qstandarditemmodel.h>
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
#include <QGraphicsColorizeEffect>
|
#include <QGraphicsColorizeEffect>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include <obs-module.h>
|
#include <obs-module.h>
|
||||||
#include <obs-frontend-api.h>
|
#include <obs-frontend-api.h>
|
||||||
@@ -28,8 +29,19 @@ AdvSceneSwitcher::AdvSceneSwitcher(QWidget *parent)
|
|||||||
loadUI();
|
loadUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool translationAvailable()
|
||||||
|
{
|
||||||
|
return !!strcmp(obs_module_text("AdvSceneSwitcher.pluginName"),
|
||||||
|
"AdvSceneSwitcher.pluginName");
|
||||||
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::loadUI()
|
void AdvSceneSwitcher::loadUI()
|
||||||
{
|
{
|
||||||
|
if (!translationAvailable()) {
|
||||||
|
DisplayMessage("Failed to find plug-in's 'data' directory.\n"
|
||||||
|
"Please check installation instructions!");
|
||||||
|
}
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
setMinimumHeight(700);
|
setMinimumHeight(700);
|
||||||
#endif
|
#endif
|
||||||
@@ -55,6 +67,13 @@ void AdvSceneSwitcher::loadUI()
|
|||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* UI helpers
|
* 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,
|
void addSelectionEntry(QComboBox *sel, const char *description,
|
||||||
const char *tooltip = "")
|
const char *tooltip = "")
|
||||||
@@ -481,6 +500,8 @@ void SwitcherData::Thread()
|
|||||||
|
|
||||||
checkNoMatchSwitch(match, scene, transition, sleep);
|
checkNoMatchSwitch(match, scene, transition, sleep);
|
||||||
|
|
||||||
|
checkSwitchCooldown(match);
|
||||||
|
|
||||||
// After this point we will call frontend functions
|
// After this point we will call frontend functions
|
||||||
// obs_frontend_set_current_scene() and
|
// obs_frontend_set_current_scene() and
|
||||||
// obs_frontend_set_current_transition()
|
// obs_frontend_set_current_transition()
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
#include "headers/advanced-scene-switcher.hpp"
|
#include "headers/advanced-scene-switcher.hpp"
|
||||||
#include "headers/utility.hpp"
|
#include "headers/utility.hpp"
|
||||||
@@ -83,6 +82,14 @@ void AdvSceneSwitcher::on_noMatchSwitchScene_currentTextChanged(
|
|||||||
UpdateNonMatchingScene(text);
|
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)
|
void AdvSceneSwitcher::on_checkInterval_valueChanged(int value)
|
||||||
{
|
{
|
||||||
if (loading)
|
if (loading)
|
||||||
@@ -341,10 +348,8 @@ void AdvSceneSwitcher::on_importSettings_clicked()
|
|||||||
file.fileName().toUtf8().constData());
|
file.fileName().toUtf8().constData());
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
QMessageBox Msgbox;
|
DisplayMessage(obs_module_text(
|
||||||
Msgbox.setText(obs_module_text(
|
|
||||||
"AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail"));
|
"AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadFail"));
|
||||||
Msgbox.exec();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -365,10 +370,8 @@ void AdvSceneSwitcher::on_importSettings_clicked()
|
|||||||
|
|
||||||
obs_data_release(obj);
|
obs_data_release(obj);
|
||||||
|
|
||||||
QMessageBox Msgbox;
|
DisplayMessage(obs_module_text(
|
||||||
Msgbox.setText(obs_module_text(
|
|
||||||
"AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess"));
|
"AdvSceneSwitcher.generalTab.saveOrLoadsettings.loadSuccess"));
|
||||||
Msgbox.exec();
|
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,6 +474,8 @@ void SwitcherData::saveGeneralSettings(obs_data_t *obj)
|
|||||||
switcher->switchIfNotMatching);
|
switcher->switchIfNotMatching);
|
||||||
obs_data_set_double(obj, "noMatchDelay", switcher->noMatchDelay);
|
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_bool(obj, "active", !switcher->stop);
|
||||||
obs_data_set_int(obj, "startup_behavior", switcher->startupBehavior);
|
obs_data_set_int(obj, "startup_behavior", switcher->startupBehavior);
|
||||||
|
|
||||||
@@ -548,6 +553,8 @@ void SwitcherData::loadGeneralSettings(obs_data_t *obj)
|
|||||||
GetWeakSourceByName(nonMatchingScene.c_str());
|
GetWeakSourceByName(nonMatchingScene.c_str());
|
||||||
switcher->noMatchDelay = obs_data_get_double(obj, "noMatchDelay");
|
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->stop = !obs_data_get_bool(obj, "active");
|
||||||
switcher->startupBehavior =
|
switcher->startupBehavior =
|
||||||
(StartupBehavior)obs_data_get_int(obj, "startup_behavior");
|
(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()
|
void AdvSceneSwitcher::setupGeneralTab()
|
||||||
{
|
{
|
||||||
populateSceneSelection(ui->noMatchSwitchScene, false);
|
populateSceneSelection(ui->noMatchSwitchScene, false);
|
||||||
@@ -703,6 +730,10 @@ void AdvSceneSwitcher::setupGeneralTab()
|
|||||||
"AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip"));
|
"AdvSceneSwitcher.generalTab.generalBehavior.onNoMetDelayTooltip"));
|
||||||
ui->checkInterval->setValue(switcher->interval);
|
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->autoStopSceneCheckBox->setChecked(switcher->autoStopEnable);
|
||||||
ui->autoStopScenes->setCurrentText(
|
ui->autoStopScenes->setCurrentText(
|
||||||
GetWeakSourceName(switcher->autoStopScene).c_str());
|
GetWeakSourceName(switcher->autoStopScene).c_str());
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public:
|
|||||||
void setupAudioTab();
|
void setupAudioTab();
|
||||||
void setTabOrder();
|
void setTabOrder();
|
||||||
|
|
||||||
|
void DisplayMessage(QString msg);
|
||||||
static void populateSceneSelection(QComboBox *sel,
|
static void populateSceneSelection(QComboBox *sel,
|
||||||
bool addPrevious = false,
|
bool addPrevious = false,
|
||||||
bool addSelect = true);
|
bool addSelect = true);
|
||||||
@@ -88,6 +89,7 @@ public slots:
|
|||||||
void on_noMatchSwitch_clicked();
|
void on_noMatchSwitch_clicked();
|
||||||
void on_noMatchRandomSwitch_clicked();
|
void on_noMatchRandomSwitch_clicked();
|
||||||
void on_noMatchDelay_valueChanged(double i);
|
void on_noMatchDelay_valueChanged(double i);
|
||||||
|
void on_cooldownTime_valueChanged(double i);
|
||||||
void on_startupBehavior_currentIndexChanged(int index);
|
void on_startupBehavior_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);
|
||||||
@@ -183,6 +185,7 @@ public slots:
|
|||||||
void on_audioRemove_clicked();
|
void on_audioRemove_clicked();
|
||||||
void on_audioUp_clicked();
|
void on_audioUp_clicked();
|
||||||
void on_audioDown_clicked();
|
void on_audioDown_clicked();
|
||||||
|
void on_audioFallback_toggled(bool on);
|
||||||
|
|
||||||
void on_priorityUp_clicked();
|
void on_priorityUp_clicked();
|
||||||
void on_priorityDown_clicked();
|
void on_priorityDown_clicked();
|
||||||
|
|||||||
@@ -44,6 +44,13 @@ struct AudioSwitch : virtual SceneSwitcherEntry {
|
|||||||
friend void swap(AudioSwitch &first, AudioSwitch &second);
|
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 {
|
class AudioSwitchWidget : public SwitchWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -71,3 +78,18 @@ private:
|
|||||||
|
|
||||||
AudioSwitch *switchData;
|
AudioSwitch *switchData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class AudioSwitchFallbackWidget : public SwitchWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
AudioSwitchFallbackWidget(AudioSwitchFallback *s);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void DurationChanged(double dur);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QDoubleSpinBox *duration;
|
||||||
|
|
||||||
|
AudioSwitchFallback *switchData;
|
||||||
|
};
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ struct SceneSequenceSwitch : SceneSwitcherEntry {
|
|||||||
OBSWeakSource startScene = nullptr;
|
OBSWeakSource startScene = nullptr;
|
||||||
double delay = 0;
|
double delay = 0;
|
||||||
int delayMultiplier = 1;
|
int delayMultiplier = 1;
|
||||||
|
bool interruptible = false;
|
||||||
|
unsigned int matchCount = 0;
|
||||||
|
|
||||||
const char *getType() { return "sequence"; }
|
const char *getType() { return "sequence"; }
|
||||||
bool initialized();
|
bool initialized();
|
||||||
@@ -25,11 +27,13 @@ struct SceneSequenceSwitch : SceneSwitcherEntry {
|
|||||||
inline SceneSequenceSwitch(OBSWeakSource startScene_,
|
inline SceneSequenceSwitch(OBSWeakSource startScene_,
|
||||||
OBSWeakSource scene_,
|
OBSWeakSource scene_,
|
||||||
OBSWeakSource transition_, double delay_,
|
OBSWeakSource transition_, double delay_,
|
||||||
int delayMultiplier_, bool usePreviousScene_)
|
int delayMultiplier_, bool interruptible_,
|
||||||
|
bool usePreviousScene_)
|
||||||
: SceneSwitcherEntry(scene_, transition_, usePreviousScene_),
|
: SceneSwitcherEntry(scene_, transition_, usePreviousScene_),
|
||||||
startScene(startScene_),
|
startScene(startScene_),
|
||||||
delay(delay_),
|
delay(delay_),
|
||||||
delayMultiplier(delayMultiplier_)
|
delayMultiplier(delayMultiplier_),
|
||||||
|
interruptible(interruptible_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -50,11 +54,13 @@ private slots:
|
|||||||
void DelayChanged(double delay);
|
void DelayChanged(double delay);
|
||||||
void DelayUnitsChanged(int idx);
|
void DelayUnitsChanged(int idx);
|
||||||
void StartSceneChanged(const QString &text);
|
void StartSceneChanged(const QString &text);
|
||||||
|
void InterruptibleChanged(int state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QDoubleSpinBox *delay;
|
QDoubleSpinBox *delay;
|
||||||
QComboBox *delayUnits;
|
QComboBox *delayUnits;
|
||||||
QComboBox *startScenes;
|
QComboBox *startScenes;
|
||||||
|
QCheckBox *interruptible;
|
||||||
|
|
||||||
SceneSequenceSwitch *switchData;
|
SceneSequenceSwitch *switchData;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -68,6 +68,9 @@ struct SwitcherData {
|
|||||||
double noMatchCount = 0;
|
double noMatchCount = 0;
|
||||||
StartupBehavior startupBehavior = PERSIST;
|
StartupBehavior startupBehavior = PERSIST;
|
||||||
|
|
||||||
|
double cooldown = 0.;
|
||||||
|
std::chrono::high_resolution_clock::time_point lastMatchTime;
|
||||||
|
|
||||||
std::deque<WindowSwitch> windowSwitches;
|
std::deque<WindowSwitch> windowSwitches;
|
||||||
std::vector<std::string> ignoreIdleWindows;
|
std::vector<std::string> ignoreIdleWindows;
|
||||||
std::string lastTitle;
|
std::string lastTitle;
|
||||||
@@ -108,6 +111,7 @@ struct SwitcherData {
|
|||||||
QDateTime liveTime;
|
QDateTime liveTime;
|
||||||
|
|
||||||
std::deque<AudioSwitch> audioSwitches;
|
std::deque<AudioSwitch> audioSwitches;
|
||||||
|
AudioSwitchFallback audioFallback;
|
||||||
|
|
||||||
std::vector<int> functionNamesByPriority = std::vector<int>{
|
std::vector<int> functionNamesByPriority = std::vector<int>{
|
||||||
default_priority_0, default_priority_1, default_priority_2,
|
default_priority_0, default_priority_1, default_priority_2,
|
||||||
@@ -185,8 +189,11 @@ struct SwitcherData {
|
|||||||
OBSWeakSource &transition);
|
OBSWeakSource &transition);
|
||||||
void checkAudioSwitch(bool &match, OBSWeakSource &scene,
|
void checkAudioSwitch(bool &match, OBSWeakSource &scene,
|
||||||
OBSWeakSource &transition);
|
OBSWeakSource &transition);
|
||||||
|
void checkAudioSwitchFallback(OBSWeakSource &scene,
|
||||||
|
OBSWeakSource &transition);
|
||||||
void checkNoMatchSwitch(bool &match, OBSWeakSource &scene,
|
void checkNoMatchSwitch(bool &match, OBSWeakSource &scene,
|
||||||
OBSWeakSource &transition, int &sleep);
|
OBSWeakSource &transition, int &sleep);
|
||||||
|
void checkSwitchCooldown(bool &match);
|
||||||
|
|
||||||
void saveWindowTitleSwitches(obs_data_t *obj);
|
void saveWindowTitleSwitches(obs_data_t *obj);
|
||||||
void saveScreenRegionSwitches(obs_data_t *obj);
|
void saveScreenRegionSwitches(obs_data_t *obj);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#include <float.h>
|
||||||
|
|
||||||
#include "headers/advanced-scene-switcher.hpp"
|
#include "headers/advanced-scene-switcher.hpp"
|
||||||
#include "headers/volume-control.hpp"
|
#include "headers/volume-control.hpp"
|
||||||
#include "headers/utility.hpp"
|
#include "headers/utility.hpp"
|
||||||
@@ -72,12 +74,43 @@ void AdvSceneSwitcher::on_audioDown_clicked()
|
|||||||
switcher->audioSwitches[index + 1]);
|
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,
|
void SwitcherData::checkAudioSwitch(bool &match, OBSWeakSource &scene,
|
||||||
OBSWeakSource &transition)
|
OBSWeakSource &transition)
|
||||||
{
|
{
|
||||||
if (AudioSwitch::pause)
|
if (AudioSwitch::pause)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool fallbackChecked = false; // false if one or no match
|
||||||
|
|
||||||
for (AudioSwitch &s : audioSwitches) {
|
for (AudioSwitch &s : audioSwitches) {
|
||||||
if (!s.initialized())
|
if (!s.initialized())
|
||||||
continue;
|
continue;
|
||||||
@@ -96,6 +129,9 @@ void SwitcherData::checkAudioSwitch(bool &match, OBSWeakSource &scene,
|
|||||||
volumeThresholdreached = ((double)s.peak + 60) * 1.7 <
|
volumeThresholdreached = ((double)s.peak + 60) * 1.7 <
|
||||||
s.volumeThreshold;
|
s.volumeThreshold;
|
||||||
|
|
||||||
|
// reset for next check
|
||||||
|
s.peak = -FLT_MAX;
|
||||||
|
|
||||||
if (volumeThresholdreached) {
|
if (volumeThresholdreached) {
|
||||||
s.matchCount++;
|
s.matchCount++;
|
||||||
} else {
|
} else {
|
||||||
@@ -103,19 +139,56 @@ void SwitcherData::checkAudioSwitch(bool &match, OBSWeakSource &scene,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool durationReached =
|
bool durationReached =
|
||||||
(s.matchCount * (unsigned int)interval) / 1000.0 >=
|
((unsigned long long)s.matchCount * interval) /
|
||||||
|
1000.0 >=
|
||||||
s.duration;
|
s.duration;
|
||||||
|
|
||||||
if (volumeThresholdreached && durationReached && audioActive) {
|
if (volumeThresholdreached && durationReached && audioActive) {
|
||||||
|
if (match) {
|
||||||
|
checkAudioSwitchFallback(scene, transition);
|
||||||
|
fallbackChecked = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
scene = (s.usePreviousScene) ? previousScene : s.scene;
|
scene = (s.usePreviousScene) ? previousScene : s.scene;
|
||||||
transition = s.transition;
|
transition = s.transition;
|
||||||
match = true;
|
match = true;
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
s.logMatch();
|
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)
|
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_set_array(obj, "audioSwitches", audioArray);
|
||||||
obs_data_array_release(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)
|
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_release(array_obj);
|
||||||
}
|
}
|
||||||
obs_data_array_release(audioArray);
|
obs_data_array_release(audioArray);
|
||||||
|
|
||||||
|
loadAudioFallback(obj, audioFallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::setupAudioTab()
|
void AdvSceneSwitcher::setupAudioTab()
|
||||||
@@ -205,6 +299,11 @@ void AdvSceneSwitcher::setupAudioTab()
|
|||||||
|
|
||||||
if (switcher->audioSwitches.size() == 0)
|
if (switcher->audioSwitches.size() == 0)
|
||||||
addPulse = PulseWidget(ui->audioAdd, QColor(Qt::green));
|
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,
|
void AudioSwitch::setVolumeLevel(void *data,
|
||||||
@@ -216,26 +315,32 @@ void AudioSwitch::setVolumeLevel(void *data,
|
|||||||
UNUSED_PARAMETER(inputPeak);
|
UNUSED_PARAMETER(inputPeak);
|
||||||
AudioSwitch *s = static_cast<AudioSwitch *>(data);
|
AudioSwitch *s = static_cast<AudioSwitch *>(data);
|
||||||
|
|
||||||
s->peak = peak[0];
|
|
||||||
for (int i = 1; i < MAX_AUDIO_CHANNELS; i++)
|
for (int i = 1; i < MAX_AUDIO_CHANNELS; i++)
|
||||||
if (peak[i] > s->peak)
|
if (peak[i] > s->peak)
|
||||||
s->peak = peak[i];
|
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()
|
void AudioSwitch::resetVolmeter()
|
||||||
{
|
{
|
||||||
obs_volmeter_remove_callback(volmeter, setVolumeLevel, this);
|
obs_volmeter_remove_callback(volmeter, setVolumeLevel, this);
|
||||||
obs_volmeter_destroy(volmeter);
|
obs_volmeter_destroy(volmeter);
|
||||||
|
|
||||||
volmeter = obs_volmeter_create(OBS_FADER_LOG);
|
volmeter = AddVolmeterToSource(this, audioSource);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioSwitch::initialized()
|
bool AudioSwitch::initialized()
|
||||||
@@ -259,15 +364,7 @@ AudioSwitch::AudioSwitch(OBSWeakSource scene_, OBSWeakSource transition_,
|
|||||||
condition(condition_),
|
condition(condition_),
|
||||||
duration(duration_)
|
duration(duration_)
|
||||||
{
|
{
|
||||||
volmeter = obs_volmeter_create(OBS_FADER_LOG);
|
volmeter = AddVolmeterToSource(this, audioSource);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioSwitch::AudioSwitch(const AudioSwitch &other)
|
AudioSwitch::AudioSwitch(const AudioSwitch &other)
|
||||||
@@ -278,15 +375,7 @@ AudioSwitch::AudioSwitch(const AudioSwitch &other)
|
|||||||
condition(other.condition),
|
condition(other.condition),
|
||||||
duration(other.duration)
|
duration(other.duration)
|
||||||
{
|
{
|
||||||
volmeter = obs_volmeter_create(OBS_FADER_LOG);
|
volmeter = AddVolmeterToSource(this, other.audioSource);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioSwitch::AudioSwitch(AudioSwitch &&other)
|
AudioSwitch::AudioSwitch(AudioSwitch &&other)
|
||||||
@@ -494,3 +583,42 @@ void AudioSwitchWidget::DurationChanged(double dur)
|
|||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
switchData->duration = dur;
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
#include "headers/advanced-scene-switcher.hpp"
|
#include "headers/advanced-scene-switcher.hpp"
|
||||||
#include "headers/utility.hpp"
|
#include "headers/utility.hpp"
|
||||||
@@ -126,10 +125,8 @@ void AdvSceneSwitcher::on_sceneSequenceLoad_clicked()
|
|||||||
file.fileName().toUtf8().constData());
|
file.fileName().toUtf8().constData());
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
QMessageBox Msgbox;
|
DisplayMessage(obs_module_text(
|
||||||
Msgbox.setText(obs_module_text(
|
|
||||||
"AdvSceneSwitcher.sceneSequenceTab.loadFail"));
|
"AdvSceneSwitcher.sceneSequenceTab.loadFail"));
|
||||||
Msgbox.exec();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,13 +143,63 @@ void AdvSceneSwitcher::on_sceneSequenceLoad_clicked()
|
|||||||
|
|
||||||
obs_data_release(obj);
|
obs_data_release(obj);
|
||||||
|
|
||||||
QMessageBox Msgbox;
|
DisplayMessage(obs_module_text(
|
||||||
Msgbox.setText(obs_module_text(
|
|
||||||
"AdvSceneSwitcher.sceneSequenceTab.loadSuccess"));
|
"AdvSceneSwitcher.sceneSequenceTab.loadSuccess"));
|
||||||
Msgbox.exec();
|
|
||||||
close();
|
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,
|
void SwitcherData::checkSceneSequence(bool &match, OBSWeakSource &scene,
|
||||||
OBSWeakSource &transition,
|
OBSWeakSource &transition,
|
||||||
std::unique_lock<std::mutex> &lock)
|
std::unique_lock<std::mutex> &lock)
|
||||||
@@ -168,34 +215,19 @@ void SwitcherData::checkSceneSequence(bool &match, OBSWeakSource &scene,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (s.startScene == ws) {
|
if (s.startScene == ws) {
|
||||||
int dur = s.delay * 1000 - interval;
|
if (!match) {
|
||||||
if (dur > 0) {
|
if (s.interruptible) {
|
||||||
waitScene = currentSource;
|
matchInterruptible(switcher, s, match,
|
||||||
|
scene, transition);
|
||||||
if (verbose)
|
} else {
|
||||||
s.logSleep(dur);
|
matchUninterruptible(switcher, s,
|
||||||
|
currentSource,
|
||||||
cv.wait_for(lock,
|
lock, match, scene,
|
||||||
std::chrono::milliseconds(dur));
|
transition);
|
||||||
waitScene = nullptr;
|
}
|
||||||
}
|
}
|
||||||
obs_source_t *currentSource2 =
|
} else {
|
||||||
obs_frontend_get_current_scene();
|
s.matchCount = 0;
|
||||||
|
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
obs_source_release(currentSource);
|
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_double(array_obj, "delay", s.delay);
|
||||||
obs_data_set_int(array_obj, "delayMultiplier",
|
obs_data_set_int(array_obj, "delayMultiplier",
|
||||||
s.delayMultiplier);
|
s.delayMultiplier);
|
||||||
|
obs_data_set_bool(array_obj, "interruptible",
|
||||||
|
s.interruptible);
|
||||||
obs_data_array_push_back(sceneSequenceArray, array_obj);
|
obs_data_array_push_back(sceneSequenceArray, array_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,12 +299,14 @@ void SwitcherData::loadSceneSequenceSwitches(obs_data_t *obj)
|
|||||||
if (delayMultiplier == 0 ||
|
if (delayMultiplier == 0 ||
|
||||||
(delayMultiplier != 1 && delayMultiplier % 60 != 0))
|
(delayMultiplier != 1 && delayMultiplier % 60 != 0))
|
||||||
delayMultiplier = 1;
|
delayMultiplier = 1;
|
||||||
|
bool interruptible =
|
||||||
|
obs_data_get_bool(array_obj, "interruptible");
|
||||||
|
|
||||||
switcher->sceneSequenceSwitches.emplace_back(
|
switcher->sceneSequenceSwitches.emplace_back(
|
||||||
GetWeakSourceByName(scene1),
|
GetWeakSourceByName(scene1),
|
||||||
GetWeakSourceByName(scene2),
|
GetWeakSourceByName(scene2),
|
||||||
GetWeakTransitionByName(transition), delay,
|
GetWeakTransitionByName(transition), delay,
|
||||||
delayMultiplier,
|
delayMultiplier, interruptible,
|
||||||
(strcmp(scene2, previous_scene_name) == 0));
|
(strcmp(scene2, previous_scene_name) == 0));
|
||||||
|
|
||||||
obs_data_release(array_obj);
|
obs_data_release(array_obj);
|
||||||
@@ -321,6 +357,8 @@ SequenceWidget::SequenceWidget(SceneSequenceSwitch *s) : SwitchWidget(s)
|
|||||||
delay = new QDoubleSpinBox();
|
delay = new QDoubleSpinBox();
|
||||||
delayUnits = new QComboBox();
|
delayUnits = new QComboBox();
|
||||||
startScenes = new QComboBox();
|
startScenes = new QComboBox();
|
||||||
|
interruptible = new QCheckBox(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.sceneSequenceTab.interruptible"));
|
||||||
|
|
||||||
QWidget::connect(delay, SIGNAL(valueChanged(double)), this,
|
QWidget::connect(delay, SIGNAL(valueChanged(double)), this,
|
||||||
SLOT(DelayChanged(double)));
|
SLOT(DelayChanged(double)));
|
||||||
@@ -329,10 +367,14 @@ SequenceWidget::SequenceWidget(SceneSequenceSwitch *s) : SwitchWidget(s)
|
|||||||
QWidget::connect(startScenes,
|
QWidget::connect(startScenes,
|
||||||
SIGNAL(currentTextChanged(const QString &)), this,
|
SIGNAL(currentTextChanged(const QString &)), this,
|
||||||
SLOT(StartSceneChanged(const QString &)));
|
SLOT(StartSceneChanged(const QString &)));
|
||||||
|
QWidget::connect(interruptible, SIGNAL(stateChanged(int)), this,
|
||||||
|
SLOT(InterruptibleChanged(int)));
|
||||||
|
|
||||||
delay->setMaximum(99999.000000);
|
delay->setMaximum(99999.000000);
|
||||||
AdvSceneSwitcher::populateSceneSelection(startScenes, false);
|
AdvSceneSwitcher::populateSceneSelection(startScenes, false);
|
||||||
populateDelayUnits(delayUnits);
|
populateDelayUnits(delayUnits);
|
||||||
|
interruptible->setToolTip(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.sceneSequenceTab.interruptibleHint"));
|
||||||
|
|
||||||
if (s) {
|
if (s) {
|
||||||
switch (s->delayMultiplier) {
|
switch (s->delayMultiplier) {
|
||||||
@@ -350,6 +392,7 @@ SequenceWidget::SequenceWidget(SceneSequenceSwitch *s) : SwitchWidget(s)
|
|||||||
}
|
}
|
||||||
startScenes->setCurrentText(
|
startScenes->setCurrentText(
|
||||||
GetWeakSourceName(s->startScene).c_str());
|
GetWeakSourceName(s->startScene).c_str());
|
||||||
|
interruptible->setChecked(s->interruptible);
|
||||||
}
|
}
|
||||||
|
|
||||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||||
@@ -358,7 +401,8 @@ SequenceWidget::SequenceWidget(SceneSequenceSwitch *s) : SwitchWidget(s)
|
|||||||
{"{{scenes}}", scenes},
|
{"{{scenes}}", scenes},
|
||||||
{"{{delay}}", delay},
|
{"{{delay}}", delay},
|
||||||
{"{{delayUnits}}", delayUnits},
|
{"{{delayUnits}}", delayUnits},
|
||||||
{"{{transitions}}", transitions}};
|
{"{{transitions}}", transitions},
|
||||||
|
{"{{interruptible}}", interruptible}};
|
||||||
placeWidgets(obs_module_text("AdvSceneSwitcher.sceneSequenceTab.entry"),
|
placeWidgets(obs_module_text("AdvSceneSwitcher.sceneSequenceTab.entry"),
|
||||||
mainLayout, widgetPlaceholders);
|
mainLayout, widgetPlaceholders);
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
@@ -434,3 +478,11 @@ void SequenceWidget::StartSceneChanged(const QString &text)
|
|||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
switchData->startScene = GetWeakSourceByQString(text);
|
switchData->startScene = GetWeakSourceByQString(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SequenceWidget::InterruptibleChanged(int state)
|
||||||
|
{
|
||||||
|
if (loading || !switchData)
|
||||||
|
return;
|
||||||
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
switchData->interruptible = state;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user