-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af68f78
commit a8830db
Showing
8 changed files
with
502 additions
and
4 deletions.
There are no files selected for viewing
142 changes: 142 additions & 0 deletions
142
extras/hise_dialogs/Scripts/ScriptProcessors/CleanDspNetworkFiles/Interface.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
Content.makeFrontInterface(700, 650); | ||
|
||
const var mp = Content.addMultipageDialog("mp", 0, 0); | ||
|
||
mp.set("text", "Clean DSP network files"); | ||
mp.set("width", 700); | ||
mp.set("height", 650); | ||
mp.set("Font", "Lato"); | ||
mp.set("FontSize", 19); | ||
|
||
mp.set("DialogWidth", 700); | ||
mp.set("DialogHeight", 650); | ||
|
||
const var fp = mp.addPage(); | ||
|
||
mp.add(fp, mp.types.MarkdownText, { Text: "This tool will cleanup code files from Faust / SNEX or external C++ files. Please select the file types you want to clean:" }); | ||
|
||
mp.setElementProperty(fp, mp.ids.Style, "gap: 15px; margin: 0px 40px;"); | ||
|
||
|
||
mp.add(fp, mp.types.Button, { ID: "CleanSNEX", Text: "SNEX Files", NoLabel: true}); | ||
mp.add(fp, mp.types.Button, { ID: "CleanFaust", Text: "Faust Files", NoLabel: true}); | ||
mp.add(fp, mp.types.Button, { ID: "CleanCpp", Text: "C++ Files", NoLabel: true}); | ||
mp.add(fp, mp.types.Button, { ID: "CleanNetworks", Text: "Scriptnode networks", NoLabel: true}); | ||
|
||
mp.add(fp, mp.types.JavascriptFunction, { EventTrigger: "OnSubmit", Code: "state.SkipSNEX = !state.CleanSNEX;"}); | ||
|
||
mp.add(fp, mp.types.MarkdownText, { Text: "Click next to select the files you want to delete in the next step." }); | ||
|
||
|
||
var listIds = {}; | ||
|
||
function setItems(id, state) | ||
{ | ||
var list = []; | ||
|
||
var networkRoot = FileSystem.getFolder(FileSystem.AudioFiles).getParentDirectory().getChildFile("DspNetworks"); | ||
|
||
|
||
|
||
var rootDir; | ||
var wildcard = "*"; | ||
|
||
if(id == "setItemNetworks") | ||
{ | ||
rootDir = networkRoot.getChildFile("Networks"); | ||
} | ||
if(id == "setItemSNEX") | ||
{ | ||
rootDir = networkRoot.getChildFile("CodeLibrary/faust"); | ||
} | ||
if(id == "setItemFaust") | ||
{ | ||
rootDir = networkRoot.getChildFile("CodeLibrary/faust"); | ||
} | ||
if(id == "setItemCpp") | ||
{ | ||
rootDir = networkRoot.getChildFile("ThirdParty"); | ||
wildcard = "*.h"; | ||
} | ||
|
||
var fileList = FileSystem.findFiles(rootDir, wildcard, false); | ||
|
||
for(f in fileList) | ||
{ | ||
list.push(f.toString(3)); | ||
} | ||
|
||
mp.setElementProperty(listIds[id], "Items", list); | ||
|
||
} | ||
|
||
function clearFunction(id) | ||
{ | ||
var x = mp.getState()[id.replace("clear", "list")]; | ||
|
||
Console.print("DELETE: " + trace(x)); | ||
} | ||
|
||
inline function addPage(id) | ||
{ | ||
local p = mp.addPage(); | ||
|
||
mp.add(p, mp.types.MarkdownText, { Text: "**Cleaning " + id + " files**\n---\nPlease select the files you want to delete, then press Next to perform the operation."}); | ||
|
||
mp.add(p, mp.types.JavascriptFunction, { "ID": "setItem" + id, Code: mp.bindCallback("setItems", setItems, SyncNotification)}); | ||
|
||
local tl = mp.add(p, mp.types.TagList, { ID: "list" + id, Text: "Files", Items: ""}); | ||
|
||
mp.add(p, mp.types.Skip, { "ID": "Clean" + id, SkipIfTrue: true }); | ||
|
||
listIds["setItem" + id] = tl; | ||
listIds["clear" + id] = tl; | ||
|
||
|
||
|
||
mp.add(p, mp.types.MarkdownText, { Text: "\n---\n> This is not undoable so proceed with caution!"}); | ||
|
||
mp.add(p, mp.types.JavascriptFunction, { ID: "clear" + id, EventTrigger: "OnSubmit", Code: mp.bindCallback("clearFile", clearFunction, AsyncNotification)}); | ||
|
||
return p; | ||
} | ||
|
||
|
||
addPage("SNEX"); | ||
addPage("Faust"); | ||
addPage("Cpp"); | ||
addPage("Networks"); | ||
|
||
const var outro = mp.addPage(); | ||
|
||
|
||
|
||
|
||
mp.add(outro, mp.types.MarkdownText, { Text: "Press Finish to close the tool" }); | ||
|
||
mp.show(true); | ||
|
||
|
||
function onNoteOn() | ||
{ | ||
local s = mp.exportAsMonolith(""); | ||
Console.print(s); | ||
|
||
} | ||
function onNoteOff() | ||
{ | ||
|
||
} | ||
function onController() | ||
{ | ||
|
||
} | ||
function onTimer() | ||
{ | ||
|
||
} | ||
function onControl(number, value) | ||
{ | ||
|
||
} | ||
|
39 changes: 39 additions & 0 deletions
39
extras/hise_dialogs/XmlPresetBackups/CleanDspNetworkFiles.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<Processor Type="SynthChain" ID="CleanDspNetworkFiles" Bypassed="0" Gain="1.0" | ||
Balance="0.0" VoiceLimit="64.0" KillFadeTime="20.0" IconColour="0" | ||
packageName="" BuildVersion="650"> | ||
<ChildProcessors> | ||
<Processor Type="MidiProcessorChain" ID="Midi Processor" Bypassed="0"> | ||
<ChildProcessors> | ||
<Processor Type="ScriptProcessor" ID="Interface" Bypassed="0"> | ||
<ChildProcessors/> | ||
<Content/> | ||
<UIData Source="CleanDspNetworkFilesUIData"/> | ||
</Processor> | ||
</ChildProcessors> | ||
</Processor> | ||
<Processor Type="ModulatorChain" ID="GainModulation" Bypassed="0" Intensity="1.0"> | ||
<ChildProcessors/> | ||
</Processor> | ||
<Processor Type="ModulatorChain" ID="PitchModulation" Bypassed="1" Intensity="0.0"> | ||
<ChildProcessors/> | ||
</Processor> | ||
<Processor Type="EffectChain" ID="FX" Bypassed="0"> | ||
<ChildProcessors/> | ||
</Processor> | ||
</ChildProcessors> | ||
<RoutingMatrix NumSourceChannels="2" Channel0="0" Send0="-1" Channel1="1" Send1="-1"/> | ||
<macro_controls> | ||
<macro name="Macro 1" value="0.0" midi_cc="-1"/> | ||
<macro name="Macro 2" value="0.0" midi_cc="-1"/> | ||
<macro name="Macro 3" value="0.0" midi_cc="-1"/> | ||
<macro name="Macro 4" value="0.0" midi_cc="-1"/> | ||
<macro name="Macro 5" value="0.0" midi_cc="-1"/> | ||
<macro name="Macro 6" value="0.0" midi_cc="-1"/> | ||
<macro name="Macro 7" value="0.0" midi_cc="-1"/> | ||
<macro name="Macro 8" value="0.0" midi_cc="-1"/> | ||
</macro_controls> | ||
<MidiAutomation/> | ||
<MPEData Enabled="0"/> | ||
</Processor> |
7 changes: 7 additions & 0 deletions
7
.../hise_dialogs/XmlPresetBackups/CleanDspNetworkFilesUIData/CleanDspNetworkFilesDesktop.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<ContentProperties DeviceType="Desktop"> | ||
<Component type="ScriptMultipageDialog" id="mp" x="0" y="0" width="700" | ||
height="650" DialogWidth="700" DialogHeight="650" text="Clean DSP network files" | ||
Font="Lato" FontSize="19"/> | ||
</ContentProperties> |
Oops, something went wrong.