Пример #1
0
        /// <summary>
        /// Subtracts an audio position from another.
        /// </summary>
        /// <param name="a">The audio position to subtract.</param>
        /// <param name="b">The audio position to subtract from.</param>
        /// <returns>The subtract audio position.</returns>
        public static AudioPosition operator -(AudioPosition a, AudioPosition b)
        {
            AudioPosition value = new AudioPosition();

            value.AudioFileIndex = a.AudioFileIndex - b.AudioFileIndex;
            value.Position       = a.Position - b.Position;
            value.Duration       = a.Duration - b.Duration;
            return(value);
        }
Пример #2
0
        /// <summary>
        /// Compares this audio position with another.
        /// </summary>
        /// <param name="p">The audio position to compare with.</param>
        /// <returns>True if the fields matches; otherwise false.</returns>
        public bool Equals(AudioPosition p)
        {
            // If parameter is null return false:
            if (p == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return(Position == p.Position && Duration == p.Duration && AudioFileIndex == p.AudioFileIndex);
        }