public Module load() { Module module = null; try { globalSymbols = new Dictionary <string, Declaration>(); localSymbols = new Dictionary <string, Declaration>(); oilcan = EnamlData.loadFromFile(filename); string oilVersion = oilcan.getStringValue("OILCan.version", ""); string modname = oilcan.getStringValue("module.name", ""); module = new Module(modname); List <String> funcs = oilcan.getPathKeys("module.funcs"); foreach (String funcname in funcs) { FuncDefNode func = loadFuncDef("module.funcs." + funcname); module.funcs.Add(func); globalSymbols[funcname] = func; } } catch (ENAMLException e) { return(null); } return(module); }
public Settings() { EnamlData data = EnamlData.loadFromFile("Audimat.cfg"); string version = data.getStringValue("version", VERSION); rackHeight = data.getIntValue("global-settings.rack-window-height", VSTPanel.PANELHEIGHT); rackPosX = data.getIntValue("global-settings.rack-window-pos.x", 100); rackPosY = data.getIntValue("global-settings.rack-window-pos.y", 100); keyWndPosX = data.getIntValue("global-settings.keyboard-window-pos.x", 200); keyWndPosY = data.getIntValue("global-settings.keyboard-window-pos.y", 200); }
public static WebSite loadSilkFile(string filename) { WebSite site = new WebSite(); site.silkroot = Path.GetDirectoryName(filename); EnamlData silk = EnamlData.loadFromFile(filename); site.version = silk.getStringValue("Silk.version", ""); site.devroot = silk.getStringValue("Silk.devroot", ""); site.prodroot = silk.getStringValue("Silk.prodroot", ""); site.root = WebFolder.loadFolder(silk, "", "root", null); return(site); }
//--------------------------------------------------------------------- public static VSTRig loadFromFile(String path, ControlPanel controlPanel) { VSTRig rig = null; EnamlData rigData = EnamlData.loadFromFile(path); //load data from file if (rigData != null) { rig = new VSTRig(controlPanel); //load plugins List <String> plugs = rigData.getPathKeys("plugin-list"); Dictionary <String, VSTPanel> plugList = new Dictionary <string, VSTPanel>(); //temp dict for matching plugins to patches foreach (String plug in plugs) { String plugPath = rigData.getStringValue("plugin-list." + plug + ".path", ""); String plugAudioOut = rigData.getStringValue("plugin-list." + plug + ".audio-out", ""); String plugMidiIn = rigData.getStringValue("plugin-list." + plug + ".midi-in", ""); VSTPanel panel = rig.addPanel(plugPath); //panel.plugin.setAudioOut(plugAudioOut); panel.setMidiIn(plugMidiIn); plugList[plug] = panel; } //load patches List <String> pats = rigData.getPathKeys("patch-list"); foreach (String pat in pats) { String patchName = rigData.getStringValue("patch-list." + pat + ".name", ""); Patch patch = new Patch(patchName); foreach (String plug in plugs) { int patnum = rigData.getIntValue("patch-list." + pat + "." + plug, 0); patch.addPanel(plugList[plug], patnum); } rig.patches.Add(patch); } rig.setCurrentPatch(0); } return(rig); }
//use hard coded fields for now public static Format loadFormatFile(string filepath) { Format format = new Format(); EnamlData gosling = EnamlData.loadFromFile(filepath); string gosVersion = gosling.getStringValue("Gosling.version", ""); //read in structure data List <String> structs = gosling.getPathKeys("structs"); foreach (String structname in structs) { FStruct fs = new FStruct(format, structname); List <String> fields = gosling.getPathKeys("structs." + structname); String fieldpath = "structs." + structname + "."; foreach (String fieldname in fields) { String fline = gosling.getStringValue(fieldpath + fieldname, ""); List <String> parms = getParams(fline); FField f = loadField(fs, fieldname, parms); fs.fields.Add(f); fs.symTable.addEntry(fieldname, f); } format.structs.addEntry(structname, fs); } //read in file structure data format.fyle = new FStruct(format, "file"); List <String> ffields = gosling.getPathKeys("file"); foreach (String fieldname in ffields) { String fline = gosling.getStringValue("file." + fieldname, "").Trim(); List <String> parms = getParams(fline); FField f = loadField(format.fyle, fieldname, parms); format.fyle.fields.Add(f); format.fyle.symTable.addEntry(fieldname, f); } return(format); }