Example #1
0
    public virtual bool LoadXML(System.Xml.XmlElement ele)
    {
        foreach (System.Xml.XmlElement ch in ele)
        {
            ParamBase.Type ty = ParamBase.FromSerializationType(ch.Name);
            if (ty == ParamBase.Type.Invalid)
            {
                continue;
            }

            System.Xml.XmlAttribute attrName = ch.Attributes["name"];
            if (attrName == null)
            {
                continue;
            }

            string    paramName = attrName.Value;
            ParamBase pb        = this.GetParam(paramName, ty);
            if (pb == null)
            {
                continue;
            }

            pb.SetValueFromString(ch.InnerText);

            System.Xml.XmlAttribute attrViz = ch.Attributes["visible"];
            if (attrViz != null)
            {
                pb.visible = ParamBool.ConvertFromString(attrViz.Value);
            }
        }
        return(true);
    }
Example #2
0
    protected override void _Init()
    {
        this.secrTitle             = new ParamText(LLDNBase.secretTitleProperty, "Highlight");
        this.secrTitle.description = "The text on the button";
        this.secrTitle.editable    = false;
        this.genParams.Add(this.secrTitle);

        this.buttonText             = new ParamText("Button", "Press Me");
        this.buttonText.description = "The button label text.";
        this.buttonText.editable    = false;
        this.genParams.Add(this.buttonText);

        this.actionString             = new ParamText("Action", "Nothing");
        this.actionString.description = "The action to perform. This is hardcoded to Precision Keyboard.";
        this.actionString.editable    = false;
        this.genParams.Add(this.actionString);

        this.secrWidth             = new ParamFloat(LLDNBase.secretWidthProperty, "pts", 0.0f, 0.0f, 1000.0f);
        this.secrWidth.description = "The width override of the node.";
        this.secrWidth.editable    = false;
        this.genParams.Add(this.secrWidth);

        this.fontScale          = new ParamFloat("FontScale", "multiplier", 1.0f, 0.0f, 10.0f);
        this.fontScale.editable = false;
        this.genParams.Add(this.fontScale);

        this.encase          = new ParamBool("Encase", "encasement", false);
        this.encase.editable = false;
        this.genParams.Add(this.encase);

        this.icon          = new ParamText("Icon", "");
        this.icon.editable = false;
        this.genParams.Add(this.icon);
    }
Example #3
0
    protected override void _Init()
    {
        this.input             = new ParamConnection("Input", null);
        this.input.description = "The audio signal that will stuttered.";
        this.genParams.Add(this.input);

        this.stutterTime             = new ParamTimeLen("Window", 1.0f, ParamTimeLen.TimeLenType.Seconds, ParamTimeLen.WidgetTime);
        this.stutterTime.description = "The rate at which stutters happen";
        this.genParams.Add(this.stutterTime);

        this.stutterPercent             = new ParamFloat("Percent", "Percent", 0.5f, 0.0f, 1.0f);
        this.stutterPercent.description = "The percent of the window between playing the audio and stuttering with silence.";
        this.genParams.Add(this.stutterPercent);

        this.pass             = new ParamBool("Pass", "Stutter Behaviour", false);
        this.pass.trueString  = "Pass";
        this.pass.falseString = "Hold";
        this.pass.description = "If true, when the stutter is silent it will still pass the audio through instead of holding it - resulting in a gate effect.";
        this.genParams.Add(this.pass);

        this.start             = new ParamBool("Start", "Play on start?", false);
        this.start.trueString  = "Play";
        this.start.falseString = "Stut";
        this.start.description = "If true, the node starts by playing; if false, the node starts with silence.";
        this.genParams.Add(this.start);
    }
Example #4
0
    protected override void _Init()
    {
        this.secrTitle          = new ParamText(secretTitleProperty, "Comment");
        this.secrTitle.editable = false;
        this.genParams.Add(this.secrTitle);

        this.text             = new ParamText("text", "");
        this.text.description = "A comment left by the author giving some note about the Wiring - possibly specific to the region the comment was placed at.";
        this.genParams.Add(this.text);

        this.secrHeight          = new ParamFloat(secretHeightProperty, "pt", defaultHeight, 10.0f, 1000.0f);
        this.secrHeight.editable = false;
        this.genParams.Add(this.secrHeight);

        this.secrWidth          = new ParamFloat(secretWidthProperty, "pt", 0.0f, 0.0f, 1000.0f);
        this.secrWidth.editable = false;
        this.genParams.Add(this.secrWidth);

        this.fontScale          = new ParamFloat("FontScale", "multiplier", 1.0f, 0.0f, 10.0f);
        this.fontScale.editable = false;
        this.genParams.Add(this.fontScale);

        this.encase          = new ParamBool("Encase", "encasement", false);
        this.encase.editable = false;
        this.genParams.Add(this.encase);
    }
Example #5
0
    public virtual bool SaveXML(System.Xml.XmlElement ele)
    {
        foreach (ParamBase pb in this.genParams)
        {
            string paramType = ParamBase.ToSerializationType(pb.type);
            System.Xml.XmlElement paramEle = ele.OwnerDocument.CreateElement(paramType);
            paramEle.SetAttribute("name", pb.name);
            paramEle.InnerText = pb.GetStringValue();
            paramEle.SetAttribute("visible", ParamBool.ConvertToString(pb.visible));

            ele.AppendChild(paramEle);
        }

        return(true);
    }
Example #6
0
    protected override void _Init()
    {
        this.inputA             = new ParamConnection("A", null);
        this.inputA.description = "The audio signal to pass if the Gate is set to 'A'.";
        this.genParams.Add(this.inputA);

        this.inputB             = new ParamConnection("B", null);
        this.inputB.description = "The audio signal to pass if the Gate is set to 'B'.";
        this.genParams.Add(this.inputB);

        this.gate             = new ParamBool("Gate", "Channel", true);
        this.gate.description = "The switch to specify which audio signal to pass.";
        this.gate.SetLabels("A", "B");
        this.genParams.Add(this.gate);

        this.nickname             = new ParamNickname("Name", "NoNm");
        this.nickname.description = "A short readable name to uniquely identify the gate. The name doesn't affect the gate's function, just for labeling.";
        this.genParams.Add(this.nickname);
    }
Example #7
0
        private static iParam addParameter <T>(string paramName)
        {
            // create a new parameter and transfer the properties
            iParam param     = null;
            Type   paramType = typeof(T);

            if (paramType == typeof(ParamBool) || paramType == typeof(bool) || paramType == typeof(Boolean))
            {
                param = new ParamBool(paramName, "", null, "", "", new string[0]);
            }
            else if (paramType == typeof(ParamInt) || paramType == typeof(int))
            {
                param = new ParamInt(paramName, "", null, "", "", new string[0]);
            }
            else if (paramType == typeof(ParamDouble) || paramType == typeof(double))
            {
                param = new ParamDouble(paramName, "", null, "", "", new string[0]);
            }
            else if (paramType == typeof(ParamBoolArr) || paramType == typeof(bool[]) || paramType == typeof(Boolean[]))
            {
                param = new ParamBoolArr(paramName, "", null, "", "", new string[0]);
            }
            else if (paramType == typeof(ParamIntArr) || paramType == typeof(int[]))
            {
                param = new ParamIntArr(paramName, "", null, "", "", new string[0]);
            }
            else if (paramType == typeof(ParamDoubleArr) || paramType == typeof(double[]))
            {
                param = new ParamDoubleArr(paramName, "", null, "", "", new string[0]);
            }
            else if (paramType == typeof(ParamBoolMat) || paramType == typeof(bool[][]) || paramType == typeof(Boolean[][]))
            {
                param = new ParamBoolMat(paramName, "", null, "", "", new string[0]);
            }
            else if (paramType == typeof(ParamIntMat) || paramType == typeof(int[][]))
            {
                param = new ParamIntMat(paramName, "", null, "", "", new string[0]);
            }
            else if (paramType == typeof(ParamDoubleMat) || paramType == typeof(double[][]))
            {
                param = new ParamDoubleMat(paramName, "", null, "", "", new string[0]);
            }
            else if (paramType == typeof(ParamStringMat) || paramType == typeof(string[][]) || paramType == typeof(String[][]))
            {
                param = new ParamStringMat(paramName, "", null, "", "", new string[0]);
            }
            else if (paramType == typeof(ParamColor) || paramType == typeof(RGBColorFloat))
            {
                param = new ParamColor(paramName, "", null, "", "", new string[0]);
            }
            else
            {
                // message
                logger.Error("Unknown parameter (generic) type '" + paramType.Name + "' for parameter paramName '" + paramName + "' in globals, discarded.");

                // return without adding parameter
                return(null);
            }

            // add the parameter to the list
            paramList.Add(param);
            return(param);
        }
Example #8
0
 public override bool SetValueFromString(string str)
 {
     this.value = ParamBool.ConvertFromString(str);
     return(true);
 }