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

Function saveAsDialog

src/CardinalCommon.cpp:1137–1163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1135
1136#ifndef HEADLESS_BEHAVIOUR
1137static void saveAsDialog(const bool uncompressed)
1138{
1139 std::string dir;
1140 if (! APP->patch->path.empty())
1141 {
1142 dir = system::getDirectory(APP->patch->path);
1143 }
1144 else
1145 {
1146 dir = asset::user("patches");
1147 system::createDirectories(dir);
1148 }
1149
1150 CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP);
1151 DISTRHO_SAFE_ASSERT_RETURN(pcontext != nullptr,);
1152
1153 CardinalBaseUI* const ui = static_cast<CardinalBaseUI*>(pcontext->ui);
1154 DISTRHO_SAFE_ASSERT_RETURN(ui != nullptr,);
1155
1156 DISTRHO_NAMESPACE::FileBrowserOptions opts;
1157 opts.saving = ui->saving = true;
1158 opts.defaultName = "patch.vcv";
1159 opts.startDir = dir.c_str();
1160 opts.title = "Save patch";
1161 ui->savingUncompressed = uncompressed;
1162 ui->openFileBrowser(opts);
1163}
1164#endif
1165
1166void saveAsDialog()

Callers 1

saveAsDialogUncompressedFunction · 0.70

Calls 4

userFunction · 0.85
c_strMethod · 0.80
openFileBrowserMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected