public static OSCValue CreateOSCValue(OSCValueType valueType)
        {
            switch (valueType)
            {
            case OSCValueType.Unknown:
                return(null);

            case OSCValueType.Int:
                return(OSCValue.Int(0));

            case OSCValueType.Long:
                return(OSCValue.Long(0));

            case OSCValueType.True:
                return(OSCValue.Bool(true));

            case OSCValueType.False:
                return(OSCValue.Bool(false));

            case OSCValueType.Float:
                return(OSCValue.Float(0));

            case OSCValueType.Double:
                return(OSCValue.Double(0));

            case OSCValueType.String:
                return(OSCValue.String(""));

            case OSCValueType.Null:
                return(OSCValue.Null());

            case OSCValueType.Impulse:
                return(OSCValue.Impulse());

            case OSCValueType.Blob:
                return(OSCValue.Blob(new byte[0]));

            case OSCValueType.Char:
                return(OSCValue.Char(' '));

            case OSCValueType.Color:
                return(OSCValue.Color(Color.white));

            case OSCValueType.TimeTag:
                return(OSCValue.TimeTag(DateTime.Now));

            case OSCValueType.Midi:
                return(OSCValue.Midi(new OSCMidi(0, 0, 0, 0)));

            case OSCValueType.Array:
                return(OSCValue.Array());

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 2
0
        public override OSCValue GetValue()
        {
            long value;

            if (long.TryParse(Input.text, out value))
            {
                return(OSCValue.Long(value));
            }

            return(OSCValue.Long(0));
        }
        public void SendLong(float value)
        {
            var longValue = (long)(long.MaxValue * (double)value);

            if (longValue < 0)
            {
                longValue = long.MaxValue;
            }

            Send(_longAddress, OSCValue.Long(longValue));

            TransmitterTextLong.text = longValue.ToString();
        }
Exemplo n.º 4
0
 protected override void ValueToOSCValues(List <OSCValue> values, long value)
 {
     values.Add(OSCValue.Long(value));
 }
 protected override void FillMessage(OSCMessage message, long value) => message.AddValue(OSCValue.Long(value));