コード例 #1
0
ファイル: StandardEffects.cs プロジェクト: pusp/o2platform
        public static EffectDefinition CreateAlphaSetter(byte newAlpha)
        {
            var alphaSetterDefinition = new EffectDefinition(AlphaSetterEffect);
            alphaSetterDefinition.Parameters.Add(new Parameter("Alpha", newAlpha));

            return alphaSetterDefinition;
        }
コード例 #2
0
        public static EffectDefinition CreateAlphaSetter(byte newAlpha)
        {
            EffectDefinition alphaSetterDefinition = new EffectDefinition(DxtSubObjects.DxtAlphaSetter);

            alphaSetterDefinition.Parameters.Add(new Parameter("Alpha", newAlpha));

            return(alphaSetterDefinition);
        }
コード例 #3
0
ファイル: StandardEffects.cs プロジェクト: pusp/o2platform
        public static EffectDefinition CreateBlurEffect(double startRadius, double duration, double endRadius)
        {
            var blurEffectDefinition = new EffectDefinition(BlurEffect);
            blurEffectDefinition.Parameters.Add(
                new Parameter(EffectParameters.BlurPixelRadius, startRadius, duration, endRadius));

            return blurEffectDefinition;
        }
コード例 #4
0
        public static EffectDefinition CreateAlphaSetter(byte newAlpha)
        {
            var alphaSetterDefinition = new EffectDefinition(AlphaSetterEffect);

            alphaSetterDefinition.Parameters.Add(new Parameter("Alpha", newAlpha));

            return(alphaSetterDefinition);
        }
コード例 #5
0
        public static EffectDefinition CreateBlurEffect(double startRadius, double duration, double endRadius)
        {
            var blurEffectDefinition = new EffectDefinition(BlurEffect);

            blurEffectDefinition.Parameters.Add(
                new Parameter(EffectParameters.BlurPixelRadius, startRadius, duration, endRadius));

            return(blurEffectDefinition);
        }
コード例 #6
0
        public static EffectDefinition CreateBlurEffect(double startRadius, double duration, double endRadius)
        {
            EffectDefinition blurEffectDefinition = new EffectDefinition(DxtSubObjects.sIEBlurGuid);

            blurEffectDefinition.Parameters.Add(
                new Parameter(EffectParameters.BlurPixelRadius, startRadius, duration, endRadius));

            return(blurEffectDefinition);
        }
コード例 #7
0
ファイル: EffectDefinitions.cs プロジェクト: njmube/public
        public static EffectDefinition CreateEaseOutEffect()
        {
            var definition = new EffectDefinition(WMTFX);
              definition.Parameters.Add(new Parameter("InternalName", "Simple3D"));
              definition.Parameters.Add(new Parameter("InitialScaleA", 1.5));
              definition.Parameters.Add(new Parameter("ScaleA", 0.5));
              definition.Parameters.Add(new Parameter("ExponentialProgressDuration", 0.01));

              return definition;
        }
コード例 #8
0
ファイル: EffectDefinitions.cs プロジェクト: njmube/public
        public static EffectDefinition PanLeft()
        {
            var definition = new EffectDefinition(WMTFX);
              definition.Parameters.Add(new Parameter("InternalName", "Simple3D"));
              definition.Parameters.Add(new Parameter("InitialScaleA", 1.00));
              definition.Parameters.Add(new Parameter("ScaleA", 1.00));
              definition.Parameters.Add(new Parameter("MoveA", "left"));
              definition.Parameters.Add(new Parameter("MoveSpeedA", 0.4));

              return definition;
        }
コード例 #9
0
ファイル: EffectDefinitions.cs プロジェクト: njmube/public
        public static EffectDefinition FlipOut()
        {
            var definition = new EffectDefinition(WMTFX);
              definition.Parameters.Add(new Parameter("InternalName", "Simple3D"));
              definition.Parameters.Add(new Parameter("InitialScaleA", 1.00));
              definition.Parameters.Add(new Parameter("ScaleA", 1.0));
              definition.Parameters.Add(new Parameter("RotateA", "out"));
              definition.Parameters.Add(new Parameter("ExponentialProgressScale", 1));

              return definition;
        }
コード例 #10
0
ファイル: StandardEffects.cs プロジェクト: pusp/o2platform
        public static EffectDefinition CreateAlphaSetterRamp(double alphaRamp)
        {
            if ((alphaRamp < 0) || (alphaRamp > 1))
            {
                throw new SplicerException("The alpha ramp value must be a percentage between 0 and 1");
            }

            var alphaSetterDefinition = new EffectDefinition(AlphaSetterEffect);
            alphaSetterDefinition.Parameters.Add(new Parameter("AlphaRamp", alphaRamp));

            return alphaSetterDefinition;
        }
コード例 #11
0
ファイル: Effect.cs プロジェクト: sandeshp/Splicer
 public Effect(IEffectContainer container, IAMTimelineObj timelineObj, string name, int priority, double offset,
               double duration,
               EffectDefinition effectDefinition)
 {
     _container        = container;
     _timelineObj      = timelineObj;
     _name             = name;
     _priority         = priority;
     _offset           = offset;
     _duration         = duration;
     _effectDefinition = effectDefinition;
 }
コード例 #12
0
ファイル: Effect.cs プロジェクト: pusp/o2platform
 public Effect(IEffectContainer container, IAMTimelineObj timelineObj, string name, int priority, double offset,
               double duration,
               EffectDefinition effectDefinition)
 {
     _container = container;
     _timelineObj = timelineObj;
     _name = name;
     _priority = priority;
     _offset = offset;
     _duration = duration;
     _effectDefinition = effectDefinition;
 }
コード例 #13
0
        public static EffectDefinition CreateAlphaSetterRamp(double alphaRamp)
        {
            if ((alphaRamp < 0) || (alphaRamp > 1))
            {
                throw new SplicerException("The alpha ramp value must be a percentage between 0 and 1");
            }

            var alphaSetterDefinition = new EffectDefinition(AlphaSetterEffect);

            alphaSetterDefinition.Parameters.Add(new Parameter("AlphaRamp", alphaRamp));

            return(alphaSetterDefinition);
        }
コード例 #14
0
        public static EffectDefinition CreateAudioEnvelope(double volumePercent)
        {
            if ((volumePercent < 0) || (volumePercent > 1))
            {
                throw new SplicerException("Volume percentage must be between 0 and 1");
            }

            var definition = new EffectDefinition(AudioMixerEffect);

            definition.Parameters.Add(new Parameter("Vol", volumePercent));

            return(definition);
        }
コード例 #15
0
        public IEffect AddEffect(string name, int priority, double offset, double duration,
                                 EffectDefinition effectDefinition)
        {
            OnBeforeEffectAdded();

            IEffect effect =
                TimelineUtils.AddEffectToCollection(this, _desTimeline, (IAMTimelineEffectable)_timelineComposition,
                                                    _effects,
                                                    name, priority, offset, duration, effectDefinition);

            OnAfterEffectAdded(effect);

            return(effect);
        }
コード例 #16
0
ファイル: Clip.cs プロジェクト: sandeshp/Splicer
        public IEffect AddEffect(string name, int priority, double offset, double duration,
                                 EffectDefinition effectDefinition)
        {
            OnAddingEffects();

            IEffect effect =
                TimelineBuilder.AddEffectToCollection(this, _timeline, (IAMTimelineEffectable)_timelineSource, _effects,
                                                      name,
                                                      priority, offset, duration, effectDefinition);

            OnAddedEffect(effect);

            return(effect);
        }
コード例 #17
0
        public static EffectDefinition CreateAudioEnvelope(double volumePercent, double fadeInDuration,
                                                           double fadeOutDuration, double duration)
        {
            if ((volumePercent < 0) || (volumePercent > 1))
            {
                throw new SplicerException("Volume percentage must be between 0 and 1");
            }

            if ((fadeInDuration + fadeOutDuration) > duration)
            {
                throw new SplicerException(
                          "Sum of the fade-in and fade-out durations must not exceed the total duration");
            }

            string volumeValue = volumePercent.ToString(CultureInfo.InvariantCulture);

            var definition = new EffectDefinition(AudioMixerEffect);

            var volumeParameter = new Parameter();

            volumeParameter.Name = "Vol";

            if (fadeInDuration > 0)
            {
                volumeParameter.Value = "0";
                volumeParameter.Intervals.Add(new Interval(fadeInDuration, volumeValue));
            }
            else
            {
                volumeParameter.Value = volumeValue;
            }

            if (fadeOutDuration > 0)
            {
                volumeParameter.Intervals.Add(new Interval(duration - (fadeInDuration + fadeOutDuration), volumeValue));
                volumeParameter.Intervals.Add(new Interval(duration, "0"));
            }
            else
            {
                volumeParameter.Intervals.Add(new Interval(duration, volumeValue));
            }

            definition.Parameters.Add(volumeParameter);

            return(definition);
        }
コード例 #18
0
ファイル: TimelineUtils.cs プロジェクト: Yitzchok/Splicer
        /// <summary>
        /// Insert an effect into an effectable object
        /// </summary>
        /// <param name="timeline"></param>
        /// <param name="effectable"></param>
        /// <param name="offset"></param>
        /// <param name="duration"></param>
        /// <param name="effectDefinition"></param>
        /// <param name="priority"></param>
        /// <returns></returns>
        internal static IAMTimelineObj InsertEffect(IAMTimeline timeline, IAMTimelineEffectable effectable, string name,
                                                    int priority, double offset, double duration,
                                                    EffectDefinition effectDefinition)
        {
            int hr = 0;

            long unitsStart = ToUnits(offset);
            long unitsEnd   = ToUnits(offset + duration);

            IAMTimelineObj effectsObj;

            hr = timeline.CreateEmptyNode(out effectsObj, TimelineMajorType.Effect);
            DESError.ThrowExceptionForHR(hr);

            hr = effectsObj.SetSubObjectGUID(effectDefinition.EffectId);
            DESError.ThrowExceptionForHR(hr);

            if (!string.IsNullOrEmpty(name))
            {
                hr = effectsObj.SetUserName(name);
                DESError.ThrowExceptionForHR(hr);
            }

            hr = effectsObj.SetStartStop(unitsStart, unitsEnd);
            DESError.ThrowExceptionForHR(hr);

            IPropertySetter propertySetter = (IPropertySetter) new PropertySetter();

            PopulatePropertySetter(propertySetter, effectDefinition.Parameters);

            hr = effectsObj.SetPropertySetter(propertySetter);
            DESError.ThrowExceptionForHR(hr);

            hr = effectable.EffectInsBefore(effectsObj, priority);
            DESError.ThrowExceptionForHR(hr);

            return(effectsObj);
        }
コード例 #19
0
        public static EffectDefinition CreateDefaultBlur()
        {
            EffectDefinition blurEffectDefinition = new EffectDefinition(DxtSubObjects.sIEBlurGuid);

            return(blurEffectDefinition);
        }
コード例 #20
0
 public IEffect AddEffect(double offset, double duration,
                          EffectDefinition effectDefinition)
 {
     return(AddEffect(null, -1, offset, duration, effectDefinition));
 }
コード例 #21
0
 public void SetValues()
 {
     var definition = new EffectDefinition();
     definition.EffectId = StandardEffects.AudioMixerEffect;
     Assert.AreEqual(definition.EffectId, StandardEffects.AudioMixerEffect);
 }
コード例 #22
0
 public void Constructor2()
 {
     var definition = new EffectDefinition(StandardEffects.MatrixEffect);
     Assert.AreEqual(StandardEffects.MatrixEffect, definition.EffectId);
     Assert.AreEqual(0, definition.Parameters.Count);
 }
コード例 #23
0
 public void Constructor1()
 {
     var definition = new EffectDefinition();
     Assert.AreEqual(Guid.Empty, definition.EffectId);
     Assert.AreEqual(0, definition.Parameters.Count);
 }
コード例 #24
0
        public void JumpVolume()
        {
            // and audible demonstration of the difference between interpolating
            // parameter values for an effect, and jumping directly to them.

            string outputFile = "JumpVolume.wma";

            using (ITimeline timeline = new DefaultTimeline())
            {
                IGroup group = timeline.AddAudioGroup();
                ITrack track = group.AddTrack();
                IClip clip = track.AddClip("testinput.mp3", GroupMediaType.Audio, InsertPosition.Relative, 0, 0, 10);

                var effectDefinition = new EffectDefinition(StandardEffects.AudioMixerEffect);

                var volumeParameter = new Parameter("Vol", 0.0, 2, 1.0);
                volumeParameter.Intervals.Add(new Interval(IntervalMode.Jump, 2.5, "0.2"));
                volumeParameter.Intervals.Add(new Interval(IntervalMode.Jump, 3.5, "0.8"));
                volumeParameter.Intervals.Add(new Interval(IntervalMode.Jump, 4.5, "0.2"));
                volumeParameter.Intervals.Add(new Interval(IntervalMode.Jump, 5, "1.0"));
                volumeParameter.Intervals.Add(new Interval(IntervalMode.Interpolate, clip.Duration, "0.0"));

                effectDefinition.Parameters.Add(volumeParameter);

                clip.AddEffect(0, clip.Duration, effectDefinition);

                using (
                    var renderer =
                        new WindowsMediaRenderer(timeline, outputFile, WindowsMediaProfiles.MediumQualityAudio))
                {
                    renderer.Render();
                }
            }
        }
コード例 #25
0
ファイル: StandardEffects.cs プロジェクト: pusp/o2platform
        public static EffectDefinition CreateAudioEnvelope(double volumePercent, double fadeInDuration,
                                                           double fadeOutDuration, double duration)
        {
            if ((volumePercent < 0) || (volumePercent > 1))
            {
                throw new SplicerException("Volume percentage must be between 0 and 1");
            }

            if ((fadeInDuration + fadeOutDuration) > duration)
            {
                throw new SplicerException(
                    "Sum of the fade-in and fade-out durations must not exceed the total duration");
            }

            string volumeValue = volumePercent.ToString(CultureInfo.InvariantCulture);

            var definition = new EffectDefinition(AudioMixerEffect);

            var volumeParameter = new Parameter();
            volumeParameter.Name = "Vol";

            if (fadeInDuration > 0)
            {
                volumeParameter.Value = "0";
                volumeParameter.Intervals.Add(new Interval(fadeInDuration, volumeValue));
            }
            else
            {
                volumeParameter.Value = volumeValue;
            }

            if (fadeOutDuration > 0)
            {
                volumeParameter.Intervals.Add(new Interval(duration - (fadeInDuration + fadeOutDuration), volumeValue));
                volumeParameter.Intervals.Add(new Interval(duration, "0"));
            }
            else
            {
                volumeParameter.Intervals.Add(new Interval(duration, volumeValue));
            }

            definition.Parameters.Add(volumeParameter);

            return definition;
        }
コード例 #26
0
ファイル: StandardEffects.cs プロジェクト: pusp/o2platform
 public static EffectDefinition CreateDefaultBlur()
 {
     var blurEffectDefinition = new EffectDefinition(BlurEffect);
     return blurEffectDefinition;
 }
コード例 #27
0
ファイル: StandardEffects.cs プロジェクト: pusp/o2platform
        public static EffectDefinition CreateAudioEnvelope(double volumePercent)
        {
            if ((volumePercent < 0) || (volumePercent > 1))
            {
                throw new SplicerException("Volume percentage must be between 0 and 1");
            }

            var definition = new EffectDefinition(AudioMixerEffect);
            definition.Parameters.Add(new Parameter("Vol", volumePercent));

            return definition;
        }
コード例 #28
0
        public static EffectDefinition CreateDefaultBlur()
        {
            var blurEffectDefinition = new EffectDefinition(BlurEffect);

            return(blurEffectDefinition);
        }
コード例 #29
0
ファイル: TimelineUtils.cs プロジェクト: Yitzchok/Splicer
        /// <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,
                                                      AddOnlyList <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);
        }
コード例 #30
0
ファイル: EffectDefinitions.cs プロジェクト: njmube/public
        public static EffectDefinition RotateAndZoomOut()
        {
            var definition = new EffectDefinition(WMTFX);
              definition.Parameters.Add(new Parameter("InternalName", "Simple3D"));
              definition.Parameters.Add(new Parameter("InitialScaleA", 1.00));
              definition.Parameters.Add(new Parameter("ScaleA", "smaller"));
              definition.Parameters.Add(new Parameter("RotateA", "right"));
              definition.Parameters.Add(new Parameter("ExponentialProgressDuration", 1));

              return definition;
        }
コード例 #31
0
ファイル: Clip.cs プロジェクト: naik899/VideoMaker
 public IEffect AddEffect(double offset, double duration,
                          EffectDefinition effectDefinition)
 {
     return AddEffect(null, -1, offset, duration, effectDefinition);
 }
コード例 #32
0
ファイル: Clip.cs プロジェクト: naik899/VideoMaker
        public IEffect AddEffect(string name, int priority, double offset, double duration,
                                 EffectDefinition effectDefinition)
        {
            OnAddingEffects();

            IEffect effect =
                TimelineBuilder.AddEffectToCollection(this, _timeline, (IAMTimelineEffectable) _timelineSource, _effects,
                                                      name,
                                                      priority, offset, duration, effectDefinition);

            OnAddedEffect(effect);

            return effect;
        }
コード例 #33
0
ファイル: EffectDefinitions.cs プロジェクト: njmube/public
        public static EffectDefinition PinWheelZoomOut()
        {
            var definition = new EffectDefinition(WMTFX);
              definition.Parameters.Add(new Parameter("InternalName", "Simple3D"));
              definition.Parameters.Add(new Parameter("InitialScaleA", 1.5));
              definition.Parameters.Add(new Parameter("ScaleA", 0.5));
              definition.Parameters.Add(new Parameter("RotateA", "right"));
              definition.Parameters.Add(new Parameter("ExponentialProgressScale", 0.5));

              return definition;
        }