fix audio valid(), skip uninit exec switches, skip setting scene and transition for audio / exec as this is done in generic switch

This commit is contained in:
WarmUpTill
2020-10-12 21:48:08 +02:00
parent 5ad820d6cd
commit f22da7ff31
2 changed files with 4 additions and 7 deletions

View File

@@ -229,7 +229,8 @@ bool AudioSwitch::initialized()
bool AudioSwitch::valid()
{
return SceneSwitcherEntry::valid() && WeakSourceValid(audioSource);
return !initialized() ||
(SceneSwitcherEntry::valid() && WeakSourceValid(audioSource));
}
AudioSwitch::AudioSwitch(OBSWeakSource scene_, OBSWeakSource transition_,
@@ -351,9 +352,6 @@ AudioSwitchWidget::AudioSwitchWidget(AudioSwitch *s) : SwitchWidget(s)
SceneSwitcher::populateAudioSelection(audioSources);
if (s) {
scenes->setCurrentText(GetWeakSourceName(s->scene).c_str());
transitions->setCurrentText(
GetWeakSourceName(s->transition).c_str());
audioSources->setCurrentText(
GetWeakSourceName(s->audioSource).c_str());
audioVolumeThreshold->setValue(s->volumeThreshold);

View File

@@ -99,6 +99,8 @@ void SwitcherData::checkExeSwitch(bool &match, OBSWeakSource &scene,
// Check for match
GetProcessList(runningProcesses);
for (ExecutableSwitch &s : executableSwitches) {
if (!s.initialized())
continue;
// True if executable switch is running (direct)
bool equals = runningProcesses.contains(s.exe);
// True if executable switch is running (regex)
@@ -214,9 +216,6 @@ ExecutableSwitchWidget::ExecutableSwitchWidget(ExecutableSwitch *s)
SceneSwitcher::populateProcessSelection(processes);
if (s) {
scenes->setCurrentText(GetWeakSourceName(s->scene).c_str());
transitions->setCurrentText(
GetWeakSourceName(s->transition).c_str());
processes->setCurrentText(s->exe);
requiresFocus->setChecked(s->inFocus);
}