add option to only match if file content changed (#80)

This commit is contained in:
WarmUpTill
2020-12-12 16:31:07 +01:00
committed by GitHub
parent 084c263260
commit faca5f8863
3 changed files with 57 additions and 29 deletions

View File

@@ -10,19 +10,23 @@ struct FileSwitch : SceneSwitcherEntry {
bool remote = false;
bool useRegex = false;
bool useTime = false;
bool onlyMatchIfChanged = false;
QDateTime lastMod;
size_t lastHash = 0;
const char *getType() { return "file"; }
inline FileSwitch(OBSWeakSource scene_, OBSWeakSource transition_,
const char *file_, const char *text_, bool remote_,
bool useRegex_, bool useTime_)
bool useRegex_, bool useTime_,
bool onlyMatchIfChanged_)
: SceneSwitcherEntry(scene_, transition_),
file(file_),
text(text_),
remote(remote_),
useRegex(useRegex_),
useTime(useTime_),
onlyMatchIfChanged(onlyMatchIfChanged_),
lastMod()
{
}
@@ -39,4 +43,4 @@ static inline QString MakeFileSwitchName(const QString &scene,
const QString &transition,
const QString &fileName,
const QString &text, bool useRegex,
bool useTime);
bool useTime, bool onlyMatchIfChanged);