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

Method SetRandomTimeRemaining

plugins/base/macro-condition-timer.cpp:44–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void MacroConditionTimer::SetRandomTimeRemaining()
45{
46 double min, max;
47 if (_duration.Seconds() <= _duration2.Seconds()) {
48 min = _duration.Seconds();
49 max = _duration2.Seconds();
50 } else {
51 min = _duration2.Seconds();
52 max = _duration.Seconds();
53 }
54 std::uniform_real_distribution<double> unif(min, max);
55
56 double remainingTime = unif(re);
57 _duration.SetTimeRemaining(remainingTime);
58}
59
60bool MacroConditionTimer::Save(obs_data_t *obj) const
61{

Callers

nothing calls this directly

Calls 2

SecondsMethod · 0.80
SetTimeRemainingMethod · 0.45

Tested by

no test coverage detected