Example #1
0
        //- saving ------------------------------------------------------------

        public void saveToFile(String filename)
        {
            EnamlData rigData = new EnamlData();

            rigData.setStringValue("version", Settings.VERSION);

            Dictionary <VSTPanel, String> plugList = new Dictionary <VSTPanel, string>();
            int count = 1;

            foreach (VSTPanel panel in panels)
            {
                String plugName = "plugin-" + count.ToString().PadLeft(3, '0');
                rigData.setStringValue("plugin-list." + plugName + ".path", panel.plugPath);
                rigData.setStringValue("plugin-list." + plugName + ".audio-out", panel.audioOut);
                rigData.setStringValue("plugin-list." + plugName + ".midi-in",
                                       ((panel.midiInDevice != null) ? panel.midiInDevice.devName : "no input"));
                plugList[panel] = plugName;
                count++;
            }
            count = 1;
            foreach (Patch patch in patches)
            {
                String patname = "patch-" + count.ToString().PadLeft(3, '0');
                rigData.setStringValue("patch-list." + patname + ".name", patch.name);
                foreach (VSTPanel panel in patch.panels.Keys)
                {
                    rigData.setIntValue("patch-list." + patname + "." + plugList[panel], patch.panels[panel]);
                }
                count++;
            }
            rigData.saveToFile(filename);
            hasChanged = false;
        }
Example #2
0
        //---------------------------------------------------------------------
        // WRITING OUT
        //---------------------------------------------------------------------

        //these should mirror the loading methods above

        public void save(Module module)
        {
            nodenum = 0;
            generateOILNames(module);

            oilcan = new EnamlData();
            oilcan.setStringValue("OILCan.version", OILCANVERSION);
            oilcan.setStringValue("module.name", module.name);

            int fnum = 0;

            foreach (FuncDefNode func in module.funcs)
            {
                saveFuncDef(fnum++, func);
            }

            oilcan.saveToFile(filename);
        }
Example #3
0
        public void save()
        {
            EnamlData data = new EnamlData();

            data.setStringValue("version", VERSION);
            data.setIntValue("global-settings.rack-window-height", rackHeight);
            data.setIntValue("global-settings.rack-window-pos.x", rackPosX);
            data.setIntValue("global-settings.rack-window-pos.y", rackPosY);
            data.setIntValue("global-settings.keyboard-window-pos.x", keyWndPosX);
            data.setIntValue("global-settings.keyboard-window-pos.y", keyWndPosY);

            data.saveToFile("Audimat.cfg");
        }
Example #4
0
        //- writing declarations ------------------------------------

        public void saveFuncDef(int fnum, FuncDefNode func)
        {
            string fname = "module.funcs." + func.OILname;

            oilcan.setStringValue(fname + ".name", func.name);
            saveTypeDecl(fname + ".return-type", func.returnType);

            string pname = fname + ".params.";
            int    pnum  = 0;

            foreach (ParamDeclNode param in func.paramList)
            {
                saveParamDecl(pname + param.OILname, param);
                pnum++;
            }

            string lname = fname + ".locals.";
            int    lnum  = 0;

            foreach (VarDeclNode local in func.locals)
            {
                saveVarDecl(lname + local.OILname, local);
                lnum++;
            }

            string bname = fname + ".body";

            saveStatementList(bname, func.body);
        }