Skip to content

Instantly share code, notes, and snippets.

@gotno
Created February 3, 2025 17:17
Show Gist options
  • Save gotno/35dcbd38fb338b48d587e989dedc65a5 to your computer and use it in GitHub Desktop.
Save gotno/35dcbd38fb338b48d587e989dedc65a5 to your computer and use it in GitHub Desktop.
typedef std::function<void(void)> Action;
struct SceneAction : rack::widget::Widget {
static void Create(Action action) {
SceneAction* sceneAction = new SceneAction(action);
APP->scene->addChild(sceneAction);
}
Action action;
SceneAction(Action a): action(a) {}
void step() override {
action();
requestDelete();
}
};
std::string path = "patch.vcv"
SceneAction::Create([&, path]() {
APP->patch->load(path);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment