Add temp var for last recording save path

This commit is contained in:
WarmUpTill 2025-12-11 17:22:37 +01:00 committed by WarmUpTill
parent 12e38274f5
commit 7c6d657fdd
2 changed files with 14 additions and 0 deletions

View File

@ -2186,6 +2186,8 @@ AdvSceneSwitcher.tempVar.run.process.none.description="When not waiting for the
AdvSceneSwitcher.tempVar.recording.durationSeconds="Recording duration"
AdvSceneSwitcher.tempVar.recording.durationSeconds.description="Recording duration in seconds.\nThis value does not change while the recording is paused and will be reset to zero if the recording is stopped."
AdvSceneSwitcher.tempVar.recording.lastSavePath="Last save path"
AdvSceneSwitcher.tempVar.recording.lastSavePath.description="The file path of the last saved recording."
AdvSceneSwitcher.tempVar.video.patternCount="Pattern count"
AdvSceneSwitcher.tempVar.video.patternCount.description="The number of times the given pattern has been found in a given video input frame."

View File

@ -31,6 +31,10 @@ static int currentRecordingDurationInSeconds = 0;
bool MacroConditionRecord::CheckCondition()
{
char *lastSavePath = obs_frontend_get_last_recording();
SetTempVarValue("lastSavePath", lastSavePath ? lastSavePath : "");
bfree(lastSavePath);
switch (_condition) {
case Condition::STOP:
return !obs_frontend_recording_active();
@ -74,6 +78,14 @@ void MacroConditionRecord::SetCondition(Condition condition)
void MacroConditionRecord::SetupTempVars()
{
MacroCondition::SetupTempVars();
AddTempvar(
"lastSavePath",
obs_module_text(
"AdvSceneSwitcher.tempVar.recording.lastSavePath"),
obs_module_text(
"AdvSceneSwitcher.tempVar.recording.lastSavePath.description"));
switch (_condition) {
case Condition::DURATION:
AddTempvar(