mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 12:18:35 -05:00
Dynamically increase delay between screenshots up to one second
Otherwise users with a very low switcher interval might not be able to use the preview dialog at all
This commit is contained in:
@@ -198,12 +198,21 @@ void PreviewDialog::CheckForMatchLoop()
|
||||
if (_stop || isHidden()) {
|
||||
return;
|
||||
}
|
||||
if (!screenshot.done || !_video.ValidSelection()) {
|
||||
if (!_video.ValidSelection()) {
|
||||
_statusLabel->setText(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.video.screenshotFail"));
|
||||
_imageLabel->setPixmap(QPixmap());
|
||||
continue;
|
||||
}
|
||||
if (!screenshot.done) {
|
||||
_statusLabel->setText(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.video.screenshotFail"));
|
||||
_imageLabel->setPixmap(QPixmap());
|
||||
if (_delay < 1000) {
|
||||
_delay += 50;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (screenshot.image.width() == 0 ||
|
||||
screenshot.image.height() == 0) {
|
||||
_statusLabel->setText(obs_module_text(
|
||||
@@ -220,6 +229,8 @@ void PreviewDialog::CheckForMatchLoop()
|
||||
_areaParams.area.height);
|
||||
}
|
||||
MarkMatch(screenshot.image);
|
||||
} else {
|
||||
_statusLabel->setText("");
|
||||
}
|
||||
_imageLabel->setPixmap(QPixmap::fromImage(screenshot.image));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user