Esempio n. 1
0
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_effects != null)
                {
                    foreach (IEffect effect in _effects)
                    {
                        effect.Dispose();
                    }
                    _effects = null;
                }

                if (_file != null)
                {
                    _file.Dispose();
                    _file = null;
                }
            }

            if (_timelineSource != null)
            {
                Marshal.ReleaseComObject(_timelineSource);
                _timelineSource = null;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a des track, wraps it into an ITrack, adds it to a collection and
        /// returns the new ITrack wrapper.
        /// </summary>
        /// <param name="desTimeline"></param>
        /// <param name="desComposition"></param>
        /// <param name="tracks"></param>
        /// <param name="name"></param>
        /// <param name="priority"></param>
        /// <returns></returns>
        internal static ITrack AddTrackToCollection(ITrackContainer container, IAMTimeline desTimeline,
                                                    IAMTimelineComp desComposition,
                                                    AddOnlyCollection <ITrack> tracks, string name, int priority)
        {
            priority = ReorderPriorities(tracks, priority);

            ITrack track = new Track(container, desTimeline, CreateTrack(desTimeline, desComposition, name, priority),
                                     name, priority);

            tracks.Add(track);

            return(track);
        }
Esempio n. 3
0
        protected void DisposeComposition(bool disposing)
        {
            if (disposing)
            {
                if (_compositions != null)
                {
                    foreach (IComposition composition in _compositions)
                    {
                        var disposable = composition as IDisposable;
                        if (disposable != null)
                        {
                            disposable.Dispose();
                        }
                    }

                    _compositions = null;
                }

                if (_tracks != null)
                {
                    foreach (ITrack track in _tracks)
                    {
                        track.Dispose();
                    }

                    _tracks = null;
                }

                if (_transitions != null)
                {
                    foreach (ITransition transition in _transitions)
                    {
                        transition.Dispose();
                    }

                    _transitions = null;
                }

                if (_effects != null)
                {
                    foreach (IEffect effect in _effects)
                    {
                        effect.Dispose();
                    }

                    _effects = null;
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Creates a des effect, wraps it into an IEffect, adds it to a collection
        /// and returns the new IEffect wrapper.
        /// </summary>
        /// <param name="desTimeline"></param>
        /// <param name="desEffectable"></param>
        /// <param name="effects"></param>
        /// <param name="name"></param>
        /// <param name="priority"></param>
        /// <param name="offset"></param>
        /// <param name="duration"></param>
        /// <param name="effectDefinition"></param>
        /// <returns></returns>
        internal static IEffect AddEffectToCollection(IEffectContainer container, IAMTimeline desTimeline,
                                                      IAMTimelineEffectable desEffectable,
                                                      AddOnlyCollection <IEffect> effects, string name, int priority,
                                                      double offset, double duration, EffectDefinition effectDefinition)
        {
            priority = ReorderPriorities(effects, priority);

            IAMTimelineObj desEffect =
                InsertEffect(desTimeline, desEffectable, name, priority, offset, duration, effectDefinition);

            IEffect effect = new Effect(container, desEffect, name, priority, offset, duration, effectDefinition);

            effects.Add(effect);

            return(effect);
        }
Esempio n. 5
0
        /// <summary>
        /// Creates a des transition, wraps it into an ITransition, adds it to a collection
        /// and returns a new ITransition wrapper.
        /// </summary>
        /// <param name="desTimeline"></param>
        /// <param name="transable"></param>
        /// <param name="transitions"></param>
        /// <param name="name"></param>
        /// <param name="offset"></param>
        /// <param name="duration"></param>
        /// <param name="transitionDefinition"></param>
        /// <param name="swapInputs"></param>
        /// <returns></returns>
        internal static ITransition AddTransitionToCollection(ITransitionContainer container, IAMTimeline desTimeline,
                                                              IAMTimelineTransable transable,
                                                              AddOnlyCollection <ITransition> transitions, string name,
                                                              double offset, double duration,
                                                              TransitionDefinition transitionDefinition, bool swapInputs)
        {
            CheckForTransitionOveralp(container, offset, duration);

            IAMTimelineObj desTransition =
                InsertTransition(desTimeline, transable, name, offset, duration, transitionDefinition, swapInputs);

            ITransition transition =
                new Transition(container, desTransition, name, offset, duration, swapInputs, transitionDefinition);

            transitions.Add(transition);

            return(transition);
        }
Esempio n. 6
0
        /// <summary>
        /// Creates a des composition, wraps it into an IComposition, adds it to a collecton
        /// and returns the new IComposition wrapper.
        /// </summary>
        /// <param name="timeline"></param>
        /// <param name="desComposition"></param>
        /// <param name="compositions"></param>
        /// <param name="name"></param>
        /// <param name="priority"></param>
        /// <returns></returns>
        internal static IComposition AddCompositionToCollection(ICompositionContainer container, IAMTimeline timeline,
                                                                IAMTimelineComp desComposition,
                                                                AddOnlyCollection <IComposition> compositions,
                                                                string name,
                                                                int priority)
        {
            priority = ReorderPriorities(compositions, priority);

            IComposition composition = new Composition(container,
                                                       timeline,
                                                       CreateComposition(timeline, desComposition, name, priority),
                                                       name,
                                                       priority);

            compositions.Add(composition);

            return(composition);
        }
Esempio n. 7
0
        private static int ReorderPriorities <T>(AddOnlyCollection <T> collection, int newPriority) where T : IPriority
        {
            if (newPriority < 0)
            {
                return(collection.Count);
            }
            else
            {
                foreach (IPriority priority in collection)
                {
                    if (priority.Priority >= newPriority)
                    {
                        ((IPrioritySetter)priority).SetPriority(priority.Priority + 1);
                    }
                }

                return(newPriority);
            }
        }
Esempio n. 8
0
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_groups != null)
                {
                    foreach (IGroup group in _groups)
                    {
                        group.Dispose();
                    }

                    _groups = null;
                }
            }

            if (_timeline != null)
            {
                Marshal.ReleaseComObject(_timeline);
                _timeline = null;
            }
        }
Esempio n. 9
0
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_clips != null)
                {
                    foreach (IClip clip in _clips)
                    {
                        clip.Dispose();
                    }
                    _clips = null;
                }

                if (_effects != null)
                {
                    foreach (IEffect effect in _effects)
                    {
                        effect.Dispose();
                    }
                    _effects = null;
                }

                if (_transitions != null)
                {
                    foreach (ITransition transition in _transitions)
                    {
                        transition.Dispose();
                    }
                    _transitions = null;
                }
            }

            if (_track != null)
            {
                Marshal.ReleaseComObject(_track);
                _track = null;
            }
        }
Esempio n. 10
0
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_effects != null)
                {
                    foreach (IEffect effect in _effects)
                    {
                        effect.Dispose();
                    }
                    _effects = null;
                }

                if (_file != null)
                {
                    _file.Dispose();
                    _file = null;
                }
            }

            if (_timelineSource != null)
            {
                Marshal.ReleaseComObject(_timelineSource);
                _timelineSource = null;
            }
        }
Esempio n. 11
0
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_clips != null)
                {
                    foreach (IClip clip in _clips)
                    {
                        clip.Dispose();
                    }
                    _clips = null;
                }

                if (_effects != null)
                {
                    foreach (IEffect effect in _effects)
                    {
                        effect.Dispose();
                    }
                    _effects = null;
                }

                if (_transitions != null)
                {
                    foreach (ITransition transition in _transitions)
                    {
                        transition.Dispose();
                    }
                    _transitions = null;
                }
            }

            if (_track != null)
            {
                Marshal.ReleaseComObject(_track);
                _track = null;
            }
        }
Esempio n. 12
0
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_groups != null)
                {
                    foreach (IGroup group in _groups)
                    {
                        group.Dispose();
                    }

                    _groups = null;
                }
            }

            if (_timeline != null)
            {
                Marshal.ReleaseComObject(_timeline);
                _timeline = null;
            }
        }
Esempio n. 13
0
        protected void DisposeComposition(bool disposing)
        {
            if (disposing)
            {
                if (_compositions != null)
                {
                    foreach (IComposition composition in _compositions)
                    {
                        var disposable = composition as IDisposable;
                        if (disposable != null) disposable.Dispose();
                    }

                    _compositions = null;
                }

                if (_tracks != null)
                {
                    foreach (ITrack track in _tracks)
                    {
                        track.Dispose();
                    }

                    _tracks = null;
                }

                if (_transitions != null)
                {
                    foreach (ITransition transition in _transitions)
                    {
                        transition.Dispose();
                    }

                    _transitions = null;
                }

                if (_effects != null)
                {
                    foreach (IEffect effect in _effects)
                    {
                        effect.Dispose();
                    }

                    _effects = null;
                }
            }
        }