From 7f372e3602ec217759150c3ba6e961c3d8a5c886 Mon Sep 17 00:00:00 2001 From: Alexander Chalikiopoulos Date: Tue, 20 Aug 2024 11:07:37 +0200 Subject: [PATCH] add optional inputs for DPF --- Source/Heavy/DPFExporter.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Source/Heavy/DPFExporter.h b/Source/Heavy/DPFExporter.h index e4a7f89ad..50a2d502a 100644 --- a/Source/Heavy/DPFExporter.h +++ b/Source/Heavy/DPFExporter.h @@ -6,6 +6,8 @@ class DPFExporter : public ExporterBase { public: + Value makerNameValue; + Value projectLicenseValue; Value midiinEnableValue = Value(var(0)); Value midioutEnableValue = Value(var(0)); @@ -25,6 +27,8 @@ class DPFExporter : public ExporterBase { : ExporterBase(editor, exportingView) { Array properties; + properties.add(new PropertiesPanel::EditableComponent("Maker Name (optional)", makerNameValue)); + properties.add(new PropertiesPanel::EditableComponent("Project License (optional)", projectLicenseValue)); properties.add(new PropertiesPanel::ComboComponent("Export type", exportTypeValue, { "Binary", "Source code", "Source + GUI code" })); properties.add(new PropertiesPanel::ComboComponent("Plugin type", pluginTypeValue, { "Effect", "Instrument", "Custom" })); @@ -68,6 +72,8 @@ class DPFExporter : public ExporterBase { stateTree.setProperty("inputPatchValue", getValue(inputPatchValue), nullptr); stateTree.setProperty("projectNameValue", getValue(projectNameValue), nullptr); stateTree.setProperty("projectCopyrightValue", getValue(projectCopyrightValue), nullptr); + stateTree.setProperty("makerNameValue", getValue(makerNameValue), nullptr); + stateTree.setProperty("projectLicenseValue", getValue(projectLicenseValue), nullptr); stateTree.setProperty("midiinEnableValue", getValue(midioutEnableValue), nullptr); stateTree.setProperty("lv2EnableValue", getValue(lv2EnableValue), nullptr); stateTree.setProperty("vst2EnableValue", getValue(vst2EnableValue), nullptr); @@ -86,6 +92,8 @@ class DPFExporter : public ExporterBase { inputPatchValue = tree.getProperty("inputPatchValue"); projectNameValue = tree.getProperty("projectNameValue"); projectCopyrightValue = tree.getProperty("projectCopyrightValue"); + makerNameValue = tree.getProperty("makerNameValue"); + projectLicenseValue = tree.getProperty("projectLicenseValue"); midiinEnableValue = tree.getProperty("midiinEnableValue"); midioutEnableValue = tree.getProperty("midioutEnableValue"); lv2EnableValue = tree.getProperty("lv2EnableValue"); @@ -128,6 +136,9 @@ class DPFExporter : public ExporterBase { args.add("\"" + copyright + "\""); } + auto makerName = getValue(makerNameValue); + auto projectLicense = getValue(projectLicenseValue); + int exportType = getValue(exportTypeValue); int midiin = getValue(midiinEnableValue); int midiout = getValue(midioutEnableValue); @@ -161,8 +172,16 @@ class DPFExporter : public ExporterBase { var metaDPF(new DynamicObject()); metaDPF.getDynamicObject()->setProperty("project", true); metaDPF.getDynamicObject()->setProperty("description", "Rename Me"); - metaDPF.getDynamicObject()->setProperty("maker", "Wasted Audio"); - metaDPF.getDynamicObject()->setProperty("license", "ISC"); + if (makerName.isNotEmpty()){ + metaDPF.getDynamicObject()->setProperty("maker", makerName); + } else { + metaDPF.getDynamicObject()->setProperty("maker", "Wasted Audio"); + } + if (projectLicense.isNotEmpty()){ + metaDPF.getDynamicObject()->setProperty("license", projectLicense); + } else { + metaDPF.getDynamicObject()->setProperty("license", "ISC"); + } metaDPF.getDynamicObject()->setProperty("midi_input", midiin); metaDPF.getDynamicObject()->setProperty("midi_output", midiout); metaDPF.getDynamicObject()->setProperty("plugin_formats", formats);