Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public static WebPage loadPage(EnamlData silk, string path, string name, WebFolder folder)
        {
            String fullpath = path + "." + name;
            String html     = silk.getStringValue(fullpath + ".html", "");
            String template = silk.getStringValue(fullpath + ".template", "");
            String content  = silk.getStringValue(fullpath + ".content", "");

            WebPage page = new WebPage(html, folder, template, content);

            return(page);
        }
Exemplo n.º 3
0
        public Declaration loadSymbolRef(string path)
        {
            Declaration node = null;
            string      name = oilcan.getStringValue(path, "");

            if (name[0] == 'g' || name[0] == 'f')
            {
                node = globalSymbols[name];
            }
            else if (name[0] == 'p' || name[0] == 'l')
            {
                node = localSymbols[name];
            }
            return(node);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        //---------------------------------------------------------------------

        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);
        }
Exemplo n.º 6
0
        public static WebResource loadResource(EnamlData silk, string path, string name, WebFolder folder)
        {
            String respath = silk.getStringValue(path + "." + name + ".path", "");
            String resname = Path.GetFileName(respath);

            respath = Path.GetDirectoryName(respath);
            WebResource resource = new WebResource(resname, respath, folder);

            return(resource);
        }
Exemplo n.º 7
0
        //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);
        }
Exemplo n.º 8
0
        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);
        }