/// <summary>
        /// Initializes this component</summary>
        public virtual void Initialize()
        {
            foreach (CommandInfo cmdInfo in m_commandService.GetCommandInfos())
            {
                string oscAddress = '/' + m_commandService.GetCommandPath(cmdInfo);
                oscAddress = OscServices.FixPropertyAddress(oscAddress);
                m_addressesToCommands.Add(oscAddress, cmdInfo);
            }

            m_oscService.MessageReceived += OscServiceMessageReceived;
        }
Example #2
0
        /// <summary>
        /// Adds OSC addresses (one for the x-coordinate and one for the y-coordinate) for a list
        /// of DOM children that have attributes that are arrays of floats. Each array of floats
        /// represents a 2D point where the first float is the x coordinate and the second float
        /// is the y coordinate.</summary>
        /// <param name="childInfo">The child info which defines the list of children of a selected DomNode</param>
        /// <param name="childAttributeDesc">The attribute on each child that defines the array of floats</param>
        /// <param name="oscAddress">The base OSC address to use. "/x" and "/y" will be appended for
        /// the x-coordinate array and the y-coordinate array, which is how Lemur sends and receives
        /// 2-D point arrays.</param>
        /// <returns>The base OSC address, with possible changes to make it legal.</returns>
        public string Add2DPointProperty(ChildInfo childInfo, AttributePropertyDescriptor childAttributeDesc, string oscAddress)
        {
            oscAddress = OscServices.FixPropertyAddress(oscAddress);

            var xCoordDesc = new ChildListFloatingPointArrayDesc(childInfo, childAttributeDesc, 0);

            AddPropertyAddress(xCoordDesc, oscAddress + "/x");

            var yCoordDesc = new ChildListFloatingPointArrayDesc(childInfo, childAttributeDesc, 1);

            AddPropertyAddress(yCoordDesc, oscAddress + "/y");

            return(oscAddress);
        }