Beispiel #1
0
        private void testSplit(Time begin, Time end, Time split)
        {
            mExternalVideoMedia1.ClipEnd   = Time.MaxValue;
            mExternalVideoMedia1.ClipBegin = Time.Zero;
            mExternalVideoMedia1.ClipBegin = begin;
            mExternalVideoMedia1.ClipEnd   = end;
            ExternalVideoMedia secondPartVideo = mExternalVideoMedia1.Split(split);

            Assert.IsTrue(
                begin.IsEqualTo(mExternalVideoMedia1.ClipBegin),
                "Unexpected clip begin, was '{0}' expected '{1}'",
                mExternalVideoMedia1.ClipBegin, begin.ToString());
            Assert.IsTrue(
                split.IsEqualTo(mExternalVideoMedia1.ClipEnd),
                "Unexpected clip end, was '{0}' expected '{1}'",
                mExternalVideoMedia1.ClipBegin, begin.ToString());
            Assert.IsTrue(
                split.IsEqualTo(secondPartVideo.ClipBegin),
                "Unexpected clip begin, was '{0}' expected '{1}'",
                secondPartVideo.ClipBegin, split.ToString());
            Assert.IsTrue(
                end.IsEqualTo(secondPartVideo.ClipEnd),
                "Unexpected clip end, was '{0}' expected '{1}'",
                secondPartVideo.ClipEnd, end.ToString());
        }
Beispiel #2
0
        public override bool ValueEquals(WithPresentation other)
        {
            if (!base.ValueEquals(other))
            {
                return(false);
            }

            ExternalVideoMedia otherz = other as ExternalVideoMedia;

            if (otherz == null)
            {
                return(false);
            }

            if (Src != otherz.Src)
            {
                return(false);
            }

            if (!ClipBegin.IsEqualTo(otherz.ClipBegin))
            {
                return(false);
            }
            if (!ClipEnd.IsEqualTo(otherz.ClipEnd))
            {
                return(false);
            }

            return(true);
        }
Beispiel #3
0
        /// <summary>
        /// Exports the external video media to a destination <see cref="Presentation"/>
        /// </summary>
        /// <param name="destPres">The destination presentation</param>
        /// <returns>The exported external video media</returns>
        protected override Media ExportProtected(Presentation destPres)
        {
            ExternalVideoMedia exported = (ExternalVideoMedia)base.ExportProtected(destPres);

            exported.Src = Src;
            if (ClipBegin.IsNegative)
            {
                exported.ClipBegin = ClipBegin.Copy();
                exported.ClipEnd   = ClipEnd.Copy();
            }
            else
            {
                exported.ClipEnd   = ClipEnd.Copy();
                exported.ClipBegin = ClipBegin.Copy();
            }
            exported.Width  = Width;
            exported.Height = Height;
            return(exported);
        }
Beispiel #4
0
        ///<summary>
        ///
        ///</summary>
        ///<returns></returns>
        protected override Media CopyProtected()
        {
            ExternalVideoMedia copy = (ExternalVideoMedia)base.CopyProtected();

            copy.Src = Src;
            if (ClipBegin.IsNegative)
            {
                copy.ClipBegin = ClipBegin.Copy();
                copy.ClipEnd   = ClipEnd.Copy();
            }
            else
            {
                copy.ClipEnd   = ClipEnd.Copy();
                copy.ClipBegin = ClipBegin.Copy();
            }
            copy.Width  = Width;
            copy.Height = Height;
            return(copy);
        }
Beispiel #5
0
        /// <summary>
        /// Splits <c>this</c> at a given <see cref="Time"/>
        /// </summary>
        /// <param name="splitPoint">The <see cref="Time"/> at which to split -
        /// must be between clip begin and clip end <see cref="Time"/>s</param>
        /// <returns>
        /// A newly created <see cref="AbstractAudioMedia"/> containing the audio after <paramref localName="splitPoint"/>,
        /// <c>this</c> retains the audio before <paramref localName="splitPoint"/>.
        /// </returns>
        /// <exception cref="exception.MethodParameterIsNullException">
        /// Thrown when <paramref name="splitPoint"/> is <c>null</c>
        /// </exception>
        /// <exception cref="exception.MethodParameterIsOutOfBoundsException">
        /// Thrown when <paramref name="splitPoint"/> is not between clip begin and clip end
        /// </exception>
        protected override AbstractVideoMedia SplitProtected(Time splitPoint)
        {
            if (splitPoint == null)
            {
                throw new exception.MethodParameterIsNullException(
                          "The time at which to split can not be null");
            }
            if (splitPoint.IsLessThan(ClipBegin))
            {
                throw new exception.MethodParameterIsOutOfBoundsException(
                          "The split time can not be before ClipBegin");
            }
            if (splitPoint.IsGreaterThan(ClipEnd))
            {
                throw new exception.MethodParameterIsOutOfBoundsException(
                          "The split time can not be after ClipEnd");
            }
            ExternalVideoMedia splitAM = Copy();

            ClipEnd           = splitPoint;
            splitAM.ClipBegin = splitPoint;
            return(splitAM);
        }