Exemplo n.º 1
0
        ISignalStack ISignalHandler.GetValuesAt(int position, ISignalStack collectorStack, uint loopLength, bool recursive)
        {
            //propagate a request for all available values at position down to all children then return the collector stack

            //create an empty collectorStack if not available
            if (collectorStack == null)
            {
                collectorStack = new WaveStack();
            }

            //adjust position to this object's offset
            position = SignalHelper.AbsoluteToRelativePosition(position, _offset, loopLength);

            //propagate the call down to every children
            foreach (ISignalContent child in contents)
            {
                //propagate the call only if the object is NOT a container or if recursive is true
                if (recursive || !(child is ISignalContainer))
                {
                    child.GetValuesAt(position, collectorStack, loopLength, recursive);
                }
            }

            return(collectorStack);
        }
Exemplo n.º 2
0
        ISignalStack ISignalHandler.GetValuesAt(int position, ISignalStack collectorStack, uint loopLength, bool recursive)
        {
            //create an empty collectorStack if not available
            if (collectorStack == null)
            {
                collectorStack = new WaveStack();
            }                                                                                 //[TO-DO] !! Is there some way to define default collector class elsewhere/pass it through parameters?
            //			!! Perhaps some way to remove this conditional?

            //if this wave corresponds to target position, add its value to the stack
            if ((this as ISignalHandler).HasValuesAt(position, loopLength))
            {
                collectorStack.AddValue(_waveValue);
            }

            //return a reference to used collection stack
            return(collectorStack);
        }