Skip to content

Commit

Permalink
Merge pull request #4 from ncblair/fix-gc-crash
Browse files Browse the repository at this point in the history
don't crossfade in first graph render sequence
  • Loading branch information
cannc4 authored Apr 4, 2024
2 parents b3a0327 + 2500de6 commit 0980ad4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/elem/Runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ namespace elem
auto ptr = std::dynamic_pointer_cast<RootNode<FloatType>>(it->second);
if (ptr)
{
ptr->setProperty("active", true);
ptr->activate(currentRoots.empty() ? FloatType(1) : FloatType(0));
active.insert(nodeId);
ELEM_DBG("[Success] Activated root: " << nodeIdToHex(nodeId));
}
Expand Down
6 changes: 6 additions & 0 deletions runtime/elem/builtins/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ namespace elem
return (t >= 0.5 || (std::abs(c - t) >= std::numeric_limits<FloatType>::epsilon()));
}

void activate(FloatType initialGain = FloatType(0))
{
setProperty("active", true);
currentGain.store(initialGain);
}

int setProperty(std::string const& key, js::Value const& val) override
{
if (key == "active") {
Expand Down

0 comments on commit 0980ad4

Please sign in to comment.