MCPcopy Create free account
hub / github.com/DISTRHO/DPF / main

Function main

distrho/src/DistrhoPluginExport.cpp:112–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110// --------------------------------------------------------------------------------------------------------------------
111
112int main(int argc, char* argv[])
113{
114 if (argc <= 1)
115 return 1;
116
117 // Dummy plugin to get data from
118 d_nextBufferSize = 512;
119 d_nextSampleRate = 44100.0;
120 d_nextPluginIsDummy = true;
121 PluginExporter plugin(nullptr, nullptr, nullptr, nullptr);
122 d_nextBufferSize = 0;
123 d_nextSampleRate = 0.0;
124 d_nextPluginIsDummy = false;
125
126 String license(plugin.getLicense());
127
128 if (license.isEmpty())
129 {}
130 // License as URL, use as-is
131 else if (license.contains("://"))
132 {}
133 // License contains quotes, use as-is
134 else if (license.contains('"'))
135 {}
136 // Regular license string, convert to URL as much as we can
137 else
138 {
139 const String uplicense(license.asUpper());
140
141 // for reference, see https://spdx.org/licenses/
142
143 // common licenses
144 /**/ if (uplicense == "AGPL-1.0-ONLY" ||
145 uplicense == "AGPL1" ||
146 uplicense == "AGPLV1")
147 {
148 license = "http://spdx.org/licenses/AGPL-1.0-only.html";
149 }
150 else if (uplicense == "AGPL-1.0-OR-LATER" ||
151 uplicense == "AGPL1+" ||
152 uplicense == "AGPLV1+")
153 {
154 license = "http://spdx.org/licenses/AGPL-1.0-or-later.html";
155 }
156 else if (uplicense == "AGPL-3.0-ONLY" ||
157 uplicense == "AGPL3" ||
158 uplicense == "AGPLV3")
159 {
160 license = "http://spdx.org/licenses/AGPL-3.0-only.html";
161 }
162 else if (uplicense == "AGPL-3.0-OR-LATER" ||
163 uplicense == "AGPL3+" ||
164 uplicense == "AGPLV3+")
165 {
166 license = "http://spdx.org/licenses/AGPL-3.0-or-later.html";
167 }
168 else if (uplicense == "APACHE-2.0" ||
169 uplicense == "APACHE2" ||

Callers

nothing calls this directly

Calls 4

d_stderrFunction · 0.85
generate_au_plistFunction · 0.85
getLicenseMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected