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

Function CardinalModuleWidget__saveSelectionDialog

src/CardinalModuleWidget.cpp:48–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46namespace app {
47
48static void CardinalModuleWidget__saveSelectionDialog(RackWidget* const w)
49{
50 std::string selectionDir = asset::user("selections");
51 system::createDirectories(selectionDir);
52
53 async_dialog_filebrowser(true, "selection.vcvs", selectionDir.c_str(),
54 #ifdef DISTRHO_OS_WASM
55 "Save selection",
56 #else
57 "Save selection as...",
58 #endif
59 [w](char* pathC) {
60 if (!pathC) {
61 // No path selected
62 return;
63 }
64
65 std::string path = pathC;
66 std::free(pathC);
67
68 // Automatically append .vcvs extension
69 if (system::getExtension(path) != ".vcvs")
70 path += ".vcvs";
71
72 w->saveSelection(path);
73 });
74}
75
76}
77}

Callers 1

Calls 3

userFunction · 0.85
c_strMethod · 0.80
async_dialog_filebrowserFunction · 0.70

Tested by

no test coverage detected