MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / CheckDiskUsage

Method CheckDiskUsage

plugins/base/macro-condition-obs-stats.cpp:374–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374bool MacroConditionStats::CheckDiskUsage() const
375{
376#define MBYTE (1024ULL * 1024ULL)
377 auto path = getCurrentOutputPath();
378 auto mb = os_get_free_disk_space(path) / MBYTE;
379 switch (_condition) {
380 case Condition::ABOVE:
381 return mb > _value;
382 case Condition::EQUALS:
383 return DoubleEquals(mb, _value, 0.1);
384 case Condition::BELOW:
385 return mb < _value;
386 default:
387 break;
388 }
389 return false;
390}
391
392bool MacroConditionStats::CheckCondition()
393{

Callers

nothing calls this directly

Calls 2

getCurrentOutputPathFunction · 0.85
DoubleEqualsFunction · 0.85

Tested by

no test coverage detected