Ejemplo n.º 1
0
        /// <summary>
        /// Determines whether this channel has any data to play
        /// to allow optimisation to not read, but bump position forward
        /// </summary>
        public override bool HasData(int count)
        {
            if (count < 0)
            {
                throw new ArgumentOutOfRangeException("count", "Count must be greater than or equal to 0.");
            }

            if (_position >= _length)
            {
                return(false);
            }
            // Check whether the source stream has data.
            // source stream should be in the right poisition
            return(_sourceStream.HasData(count));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Determines whether this channel has any data to play
        /// to allow optimisation to not read, but bump position forward
        /// </summary>
        public override bool HasData(int count)
        {
            // Check whether the source stream has data.
            bool sourceHasData = sourceStream.HasData(count);

            if (sourceHasData)
            {
                if (position + count < 0)
                {
                    return(false);
                }
                return((position < length) && (volume != 0));
            }
            return(false);
        }