Ejemplo n.º 1
0
        void UpdateSettings()
        {
            if (OscTXmap.allTXmaps != null)
            {
                foreach (OscTXmap.TXmap tm in OscTXmap.allTXmaps)
                {
                    if (_txSymbol == tm.txSymbol)
                    {
                        _udpPort   = tm.portNumber;
                        _ipAddress = tm.address;
                        break;
                    }
                }
            }

            _client = OscMaster.GetSharedClient(_ipAddress, _udpPort);

            if (_dataSource != null && !string.IsNullOrEmpty(_propertyName))
            {
                _propertyInfo = _dataSource.GetType().GetProperty(_propertyName);
            }
            else
            {
                _propertyInfo = null;
            }
        }
Ejemplo n.º 2
0
        void OnDisable()
        {
            if (string.IsNullOrEmpty(_currentAddress)) return;

            var server = OscMaster.GetSharedServer(_currentPort);
            server.MessageDispatcher.RemoveCallback(_currentAddress, OnDataReceive);

            _currentAddress = null;
        }
Ejemplo n.º 3
0
        void UpdateSettings()
        {
            try
            {
                _client = OscMaster.GetSharedClient(_ipAddress, _udpPort);

                SendMessage("SetConnected"); //let IPSetter know the client is connected
            }
            catch
            {
                SendMessage("InvalidClient"); //let IPSetter know that the client is invalid
            }
        }
Ejemplo n.º 4
0
        void UpdateSettings()
        {
            _client = OscMaster.GetSharedClient(_ipAddress, _udpPort);

            if (_dataSource != null && !string.IsNullOrEmpty(_propertyName))
            {
                _propertyInfo = _dataSource.GetType().GetProperty(_propertyName);
            }
            else
            {
                _propertyInfo = null;
            }
        }
Ejemplo n.º 5
0
        private void OnEnable()
        {
            if (string.IsNullOrEmpty(_oscAddress))
            {
                _currentAddress = null;
                return;
            }

            var server = OscMaster.GetSharedServer(_udpPort);

            server.MessageDispatcher.AddCallback(_oscAddress, OnDataReceive);

            _currentPort    = _udpPort;
            _currentAddress = _oscAddress;

            switch (_dataType)
            {
            case DataType.Int:
            case DataType.Vector2Int:
            case DataType.Vector3Int:
                if (_intQueue == null)
                {
                    _intQueue = new Queue <int>(4);
                }
                break;

            case DataType.Float:
            case DataType.Vector2:
            case DataType.Vector3:
            case DataType.Vector4:
                if (_floatQueue == null)
                {
                    _floatQueue = new Queue <float>(4);
                }
                break;

            case DataType.String:
                if (_stringQueue == null)
                {
                    _stringQueue = new Queue <string>();
                }
                break;

            case DataType.None:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 6
0
        void RegisterCallback()
        {
            if (string.IsNullOrEmpty(_oscAddress))
            {
                _currentAddress = null;
                return;
            }

            var server = OscMaster.GetSharedServer(_udpPort);

            server.MessageDispatcher.AddCallback(_oscAddress, OnDataReceive);

            _currentPort    = _udpPort;
            _currentAddress = _oscAddress;
        }
Ejemplo n.º 7
0
        void OnEnable()
        {
            if (OscRXmap.allPortMaps != null)
            {
                foreach (OscRXmap.PortMap pm in OscRXmap.allPortMaps)
                {
                    if (_portSymbol == pm.portSymbol)
                    {
                        _udpPort = pm.portNumber;

                        break;
                    }
                }
            }

            if (string.IsNullOrEmpty(_oscAddress))
            {
                _currentAddress = null;
                return;
            }

            var server = OscMaster.GetSharedServer(_udpPort);
            server.MessageDispatcher.AddCallback(_oscAddress, OnDataReceive);

            _currentPort = _udpPort;
            _currentAddress = _oscAddress;

            switch (_dataType)
            {
                case DataType.Int:
                case DataType.Vector2Int:
                case DataType.Vector3Int:
                    if (_intQueue == null) _intQueue = new Queue<int>(4);
                    break;

                case DataType.Float:
                case DataType.Vector2:
                case DataType.Vector3:
                case DataType.Vector4:
                    if (_floatQueue == null) _floatQueue = new Queue<float>(4);
                    break;

                case DataType.String:
                    if (_stringQueue == null) _stringQueue = new Queue<string>();
                    break;
            }
        }
Ejemplo n.º 8
0
        void OnDisable()
        {
            if (string.IsNullOrEmpty(_currentAddress))
            {
                return;
            }

            OscServer server;

            if (_useMultcast)
            {
                server = OscMaster.GetSharedServer(_currentPort);
            }
            else
            {
                server = OscMaster.GetSharedServer(_currentPort, _multicast);
            }
            server.MessageDispatcher.RemoveCallback(_currentAddress, OnDataReceive);

            _currentAddress = null;
        }