Created
February 3, 2025 17:17
-
-
Save gotno/35dcbd38fb338b48d587e989dedc65a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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