Ejemplo n.º 1
0
        public float GetElementAsFloat(int index)
        {
            if (index >= _typeTags.Count)
            {
                return(0);
            }
            var tag  = _typeTags[index];
            var offs = _offsets[index];

            if (tag == 'f')
            {
                return(OscDataTypes.ReadFloat(_sharedBuffer, offs));
            }
            if (tag == 'i')
            {
                return(OscDataTypes.ReadInt(_sharedBuffer, offs));
            }
            return(0);
        }
Ejemplo n.º 2
0
        public float GetElementAsFloat(int index)
        {
            if (index >= _typeTags.Count)
            {
                return(0);
            }
            var tag  = _typeTags[index];
            var offs = _offsets[index];

            switch (tag)
            {
            case 'f':
                return(OscDataTypes.ReadFloat(_sharedBuffer, offs));

            case 'i':
                return(OscDataTypes.ReadInt(_sharedBuffer, offs));

            default:
                return(0);
            }
        }
Ejemplo n.º 3
0
        public string GetElementAsString(int index)
        {
            if (index >= _typeTags.Count)
            {
                return("");
            }
            var tag  = _typeTags[index];
            var offs = _offsets[index];

            if (tag == 's')
            {
                return(OscDataTypes.ReadString(_sharedBuffer, offs));
            }
            if (tag == 'i')
            {
                return(OscDataTypes.ReadInt(_sharedBuffer, offs).ToString());
            }
            if (tag == 'f')
            {
                return(OscDataTypes.ReadFloat(_sharedBuffer, offs).ToString());
            }
            return("");
        }
Ejemplo n.º 4
0
        public string GetElementAsString(int index)
        {
            if (index >= _typeTags.Count)
            {
                return("");
            }
            var tag  = _typeTags[index];
            var offs = _offsets[index];

            switch (tag)
            {
            case 's':
                return(OscDataTypes.ReadString(_sharedBuffer, offs));

            case 'i':
                return(OscDataTypes.ReadInt(_sharedBuffer, offs).ToString());

            case 'f':
                return(OscDataTypes.ReadFloat(_sharedBuffer, offs).ToString());

            default:
                return("");
            }
        }