Skip to content

Commit

Permalink
Patch: Restore return value to add_to_graph
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Sep 8, 2024
1 parent 175b7ed commit afee359
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion source/src/python/patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,17 @@ void init_python_patch(py::module &m)

.def("play", [](PatchRef patch) { return patch->get_graph()->play(patch); })
.def("stop", [](PatchRef patch) { patch->get_graph()->stop(patch); })
.def("add_to_graph", [](PatchRef patch) { return patch->get_graph()->add_patch(patch); })
.def("add_to_graph", [](PatchRef patch) {
try
{
patch->get_graph()->add_patch(patch);
return true;
}
catch (const cpu_usage_above_limit_exception &e)
{
return false;
}
})
.def("trigger", [](Patch &patch) { patch.trigger(); })
.def("trigger", [](Patch &patch, std::string name) { patch.trigger(name); })
.def("trigger", [](Patch &patch, std::string name, float value) { patch.trigger(name, value); })
Expand Down

0 comments on commit afee359

Please sign in to comment.