Skip to content

Commit da2211a

Browse files
Merge pull request #2152 from Wasted-Audio/feature/heavy-dpf-json
copy meta.json on source exports
2 parents 2073e7c + 900254b commit da2211a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Source/Heavy/DPFExporter.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ class DPFExporter final : public ExporterBase {
205205
metaJson->setProperty("dpf", metaDPF);
206206
metaJson->setProperty("nosimd", nosimd);
207207

208-
args.add("-m" + createMetaJson(metaJson));
208+
auto metaJsonFile = createMetaJson(metaJson);
209+
args.add("-m" + metaJsonFile.getFullPathName());
209210

210211
args.add("-v");
211212
args.add("-gdpf");
@@ -243,6 +244,10 @@ class DPFExporter final : public ExporterBase {
243244
DPFGui.copyDirectoryTo(outputFile.getChildFile("dpf-widgets"));
244245
}
245246

247+
if (exportType == 3 || exportType == 4) {
248+
metaJsonFile.copyFileTo(outputFile.getChildFile("meta.json"));
249+
}
250+
246251
// Delay to get correct exit code
247252
Time::waitForMillisecondCounter(Time::getMillisecondCounter() + 300);
248253

Source/Heavy/DaisyExporter.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ class DaisyExporter final : public ExporterBase {
330330
}
331331

332332
metaJson->setProperty("daisy", metaDaisy);
333-
args.add("-m" + createMetaJson(metaJson));
333+
auto metaJsonFile = createMetaJson(metaJson);
334+
args.add("-m" + metaJsonFile.getFullPathName());
334335

335336
args.add("-v");
336337
args.add("-gdaisy");
@@ -360,6 +361,7 @@ class DaisyExporter final : public ExporterBase {
360361
auto sourceDir = outputFile.getChildFile("daisy").getChildFile("source");
361362

362363
bool heavyExitCode = getExitCode();
364+
metaJsonFile.copyFileTo(outputFile.getChildFile("meta.json"));
363365

364366
if (compile) {
365367
auto bin = Toolchain::dir.getChildFile("bin");

Source/Heavy/ExporterBase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,13 @@ struct ExporterBase : public Component
213213
exportButton.setBounds(getLocalBounds().removeFromBottom(23).removeFromRight(80).translated(-10, -10));
214214
}
215215

216-
static String createMetaJson(DynamicObject::Ptr const& metaJson)
216+
File createMetaJson(DynamicObject::Ptr const& metaJson)
217217
{
218218
auto const metadata = File::createTempFile(".json");
219219
Toolchain::deleteTempFileLater(metadata);
220220
String const metaString = JSON::toString(var(metaJson.get()));
221221
metadata.replaceWithText(metaString, false, false, "\n");
222-
return metadata.getFullPathName();
222+
return metadata;
223223
}
224224

225225
private:

0 commit comments

Comments
 (0)