Beispiel #1
0
        /// <summary>
        /// Exports the external audio media to a destination <see cref="Presentation"/>
        /// - part of technical construct to have <see cref="Export"/> return <see cref="ExternalAudioMedia"/>
        /// </summary>
        /// <param name="destPres">The destination presentation</param>
        /// <returns>The exported external audio media</returns>
        protected override Media ExportProtected(Presentation destPres)
        {
            ExternalAudioMedia exported = (ExternalAudioMedia)base.ExportProtected(destPres);

            exported.Src       = Src;
            exported.ClipBegin = ClipBegin.Copy();
            exported.ClipEnd   = ClipEnd.Copy();
            return(exported);
        }
Beispiel #2
0
        ///<summary>
        ///
        ///</summary>
        ///<returns></returns>
        protected override Media CopyProtected()
        {
            ExternalAudioMedia copy = (ExternalAudioMedia)base.CopyProtected();

            copy.Src       = Src;
            copy.ClipBegin = ClipBegin.Copy();
            copy.ClipEnd   = ClipEnd.Copy();
            return(copy);
        }
        /// <summary>
        /// Exports the clip to a destination <see cref="Presentation"/>
        /// </summary>
        /// <param name="destPres">The destination <see cref="Presentation"/></param>
        /// <returns>The exported clip</returns>
        public WavClip Export(Presentation destPres)
        {
            Time clipEnd = null;

            if (!IsClipEndTiedToEOM)
            {
                clipEnd = ClipEnd.Copy();
            }
            WavClip newClip = new WavClip(DataProvider.Export(destPres), ClipBegin, clipEnd);

            newClip.m_cachedDuration  = m_cachedDuration.Copy();
            newClip.m_cachedPcmFormat = new AudioLibPCMFormat();
            newClip.m_cachedPcmFormat.CopyFrom(m_cachedPcmFormat);
            return(newClip);
        }
        /// <summary>
        /// Creates a copy of the wav clip
        /// </summary>
        /// <returns>The copy</returns>
        public WavClip Copy()
        {
            Time clipEnd = null;

            if (!IsClipEndTiedToEOM)
            {
                clipEnd = ClipEnd.Copy();
            }
            //TODO: Check that sharing DataProvider with the copy is not a problem
            // REMARK: FileDataProviders: once created, binary content (including RIFF header) is never changed.
            // therefore, OPEN-only FileStream access should work concurrently (i.e. FileShare.Read)
            WavClip newClip = new WavClip(DataProvider, ClipBegin, clipEnd);

            newClip.m_cachedDuration  = m_cachedDuration.Copy();
            newClip.m_cachedPcmFormat = new AudioLibPCMFormat();
            newClip.m_cachedPcmFormat.CopyFrom(m_cachedPcmFormat);
            return(newClip);
        }
Beispiel #5
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 #6
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);
        }