MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / loadSelectionDialog

Function loadSelectionDialog

src/CardinalCommon.cpp:1017–1047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1015}
1016
1017void loadSelectionDialog()
1018{
1019 app::RackWidget* const w = APP->scene->rack;
1020
1021 std::string selectionDir = asset::user("selections");
1022 system::createDirectories(selectionDir);
1023
1024 async_dialog_filebrowser(false, nullptr, selectionDir.c_str(), "Import selection", [w](char* pathC) {
1025 if (!pathC) {
1026 // No path selected
1027 return;
1028 }
1029
1030 try {
1031 w->loadSelection(pathC);
1032 }
1033 catch (Exception& e) {
1034 async_dialog_message(e.what());
1035 }
1036
1037 std::free(pathC);
1038
1039 #ifdef DISTRHO_OS_WASM
1040 syncfs();
1041 #endif
1042
1043 if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote())
1044 if (remoteDetails->autoDeploy)
1045 remoteUtils::sendFullPatchToRemote(remoteDetails);
1046 });
1047}
1048
1049void loadTemplate(const bool factory)
1050{

Callers

nothing calls this directly

Calls 7

userFunction · 0.85
c_strMethod · 0.80
async_dialog_filebrowserFunction · 0.70
async_dialog_messageFunction · 0.70
syncfsFunction · 0.70
getRemoteFunction · 0.70
sendFullPatchToRemoteFunction · 0.70

Tested by

no test coverage detected