Skip to content

Commit

Permalink
add optional inputs for DPF
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Chalikiopoulos committed Aug 20, 2024
1 parent c3f3840 commit 7f372e3
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Source/Heavy/DPFExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

class DPFExporter : public ExporterBase {
public:
Value makerNameValue;
Value projectLicenseValue;
Value midiinEnableValue = Value(var(0));
Value midioutEnableValue = Value(var(0));

Expand All @@ -25,6 +27,8 @@ class DPFExporter : public ExporterBase {
: ExporterBase(editor, exportingView)
{
Array<PropertiesPanelProperty*> properties;
properties.add(new PropertiesPanel::EditableComponent<String>("Maker Name (optional)", makerNameValue));
properties.add(new PropertiesPanel::EditableComponent<String>("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" }));

Expand Down Expand Up @@ -68,6 +72,8 @@ class DPFExporter : public ExporterBase {
stateTree.setProperty("inputPatchValue", getValue<String>(inputPatchValue), nullptr);
stateTree.setProperty("projectNameValue", getValue<String>(projectNameValue), nullptr);
stateTree.setProperty("projectCopyrightValue", getValue<String>(projectCopyrightValue), nullptr);
stateTree.setProperty("makerNameValue", getValue<String>(makerNameValue), nullptr);
stateTree.setProperty("projectLicenseValue", getValue<String>(projectLicenseValue), nullptr);
stateTree.setProperty("midiinEnableValue", getValue<int>(midioutEnableValue), nullptr);
stateTree.setProperty("lv2EnableValue", getValue<int>(lv2EnableValue), nullptr);
stateTree.setProperty("vst2EnableValue", getValue<int>(vst2EnableValue), nullptr);
Expand All @@ -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");
Expand Down Expand Up @@ -128,6 +136,9 @@ class DPFExporter : public ExporterBase {
args.add("\"" + copyright + "\"");
}

auto makerName = getValue<String>(makerNameValue);
auto projectLicense = getValue<String>(projectLicenseValue);

int exportType = getValue<int>(exportTypeValue);
int midiin = getValue<int>(midiinEnableValue);
int midiout = getValue<int>(midioutEnableValue);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7f372e3

Please sign in to comment.