Esempio n. 1
0
 public bool Combination(params int[] keyCodes)
 {
     Action = "combination";
     ClearParams();
     ParamInt.AddRange(keyCodes);
     return(SendRequest() == null ? false : true);
 }
Esempio n. 2
0
 public bool RightClick()
 {
     Action = "right_click";
     ParamInt.Clear();
     ParamStrings.Clear();
     return(SendRequest() == null ? false : true);
 }
Esempio n. 3
0
 public bool Release(int key)
 {
     Action = "release";
     ClearParams();
     ParamInt.Add(key);
     return(SendRequest() == null ? false : true);
 }
Esempio n. 4
0
 public bool DoType(params int[] keyCodes)
 {
     Action = "type";
     ClearParams();
     ParamInt.AddRange(keyCodes);
     return(SendRequest() == null ? false : true);
 }
Esempio n. 5
0
 public bool Press(int key)
 {
     Action = "press";
     ClearParams();
     ParamInt.Add(key);
     return(SendRequest() == null ? false : true);
 }
Esempio n. 6
0
 public SqlCommand UpdateParamInt(ParamInt param)
 {
     return(command(string.Format(@"
                 UPDATE  ParamInt
                 SET     ParamValue = {1}
                 WHERE   ParamId = {0}
         ", param.ParamId, param.ParamValue)));
 }
Esempio n. 7
0
 public bool SetClipboard(string data)
 {
     Action = "set_clipboard";
     ParamInt.Clear();
     ParamStrings.Clear();
     ParamStrings.Add(data);
     return(SendRequest() == null ? false : true);
 }
Esempio n. 8
0
        public bool MoveBy(int x, int y)
        {
            Action = "move_by";
            ClearParams();
            ParamInt.Add(x);
            ParamInt.Add(y);

            return(SendRequest() == null ? false : true);
        }
Esempio n. 9
0
        public bool LeftClick(int x, int y)
        {
            Action = "left_click";
            ParamInt.Clear();
            ParamStrings.Clear();
            ParamInt.Add(x);
            ParamInt.Add(y);

            return(SendRequest() == null ? false : true);
        }
Esempio n. 10
0
        /// <summary>
        /// Drag mouse from a point to another point.
        /// This will move mouse to the start point, hold left click, then move mouse from the start point to the end point,
        /// then release the left click.
        /// </summary>
        /// <param name="x1"> x coordinate of the start point </param>
        /// <param name="y1"> y coordinate of the start point </param>
        /// <param name="x2"> x coordinate of the end point</param>
        /// <param name="y2"> y coordinate of the end point </param>
        /// <returns> true if success else false </returns>
        public bool Drag(int x1, int y1, int x2, int y2)
        {
            Action = "drag";
            ClearParams();
            ParamInt.Add(x1);
            ParamInt.Add(y1);
            ParamInt.Add(x2);
            ParamInt.Add(y2);

            return(SendRequest() == null ? false : true);
        }
Esempio n. 11
0
        public string DelVar(string nameSpace, string name)
        {
            Action = "del";
            ParamInt.Clear();
            ParamStrings.Clear();
            ParamStrings.Add(nameSpace);
            ParamStrings.Add(name);

            JToken result = SendRequest();

            if (result == null)
            {
                return(null);
            }

            return(result.Value <string>());
        }
Esempio n. 12
0
    protected override void _Init()
    {
        this.input             = new ParamConnection("Input", null);
        this.input.description = "The audio signal to apply the delay filter to.";
        this.genParams.Add(this.input);

        this.offset             = new ParamTimeLen("Offset", 0.25f, ParamTimeLen.TimeLenType.Seconds, ParamTimeLen.WidgetTime);
        this.offset.description = "The duration of time between duplicated voices.";
        this.genParams.Add(this.offset);

        this.dampen             = new ParamFloat("Dampen", "Attenuation", 1.0f, 0.0f, 1.0f);
        this.dampen.description = "A compounding frequency multiplier applied to the frequency of each voice generated.";
        this.genParams.Add(this.dampen);

        this.voiceCt             = new ParamInt("Voices", "Voices", 2, 2, 8);
        this.voiceCt.description = "The number of copies to create.";
        this.genParams.Add(this.voiceCt);
    }
Esempio n. 13
0
    protected override void _Init()
    {
        this.input             = new ParamConnection("Input", null);
        this.input.description = "The audio signal to apply a chorus effect to.";
        //
        this.phonicCt             = new ParamInt("Voices", "Voices", 2, 2, 8);
        this.phonicCt.description = "The number of copies to create.";
        //
        this.dampen             = new ParamFloat("Dampen", "Attenuation", 1.0f, 0.0f, 1.0f);
        this.dampen.description = "A compounding loudness multiplication factor for each voice generated.";
        //
        this.freqOff             = new ParamFloat("Freq Offset", "Offset", -0.2f, -1.0f, 1.0f);
        this.freqOff.description = "A compounding frequency multiplier applied to the frequency of each voice generated.";

        this.genParams.Add(this.input);
        this.genParams.Add(this.phonicCt);
        this.genParams.Add(this.dampen);
        this.genParams.Add(this.freqOff);
    }
Esempio n. 14
0
        /// <summary>
        /// Get color of the pixel at a specific pixel location on screen.
        /// </summary>
        /// <param name="x"> x coordinate of the pixel </param>
        /// <param name="y"> y coordinate of the pixel </param>
        /// <returns>A tuple of three integers (RGB) </returns>
        public Tuple <int, int, int> GetColor(int x, int y)
        {
            Action = "get_color";
            ClearParams();
            ParamInt.Add(x);
            ParamInt.Add(y);
            JToken result = SendRequest();

            if (result == null)
            {
                return(null);
            }
            JArray output = result.Value <JArray>();

            if (output.Count != 3)
            {
                return(null);
            }

            return(new Tuple <int, int, int>(output[0].Value <int>(), output[1].Value <int>(), output[2].Value <int>()));
        }
Esempio n. 15
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);
        }
Esempio n. 16
0
 public static void UpdateParamInt(ParamInt paramInt)
 {
     Run(DB.UpdateParamInt(paramInt));
 }