public static EffectDefinition CreateAlphaSetter(byte newAlpha) { var alphaSetterDefinition = new EffectDefinition(AlphaSetterEffect); alphaSetterDefinition.Parameters.Add(new Parameter("Alpha", newAlpha)); return alphaSetterDefinition; }
public static EffectDefinition CreateAlphaSetter(byte newAlpha) { EffectDefinition alphaSetterDefinition = new EffectDefinition(DxtSubObjects.DxtAlphaSetter); alphaSetterDefinition.Parameters.Add(new Parameter("Alpha", newAlpha)); return(alphaSetterDefinition); }
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; }
public static EffectDefinition CreateAlphaSetter(byte newAlpha) { var alphaSetterDefinition = new EffectDefinition(AlphaSetterEffect); alphaSetterDefinition.Parameters.Add(new Parameter("Alpha", newAlpha)); return(alphaSetterDefinition); }
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); }
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); }
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; }
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; }
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; }
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; }
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; }
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); }
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); }
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); }
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); }
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); }
/// <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); }
public static EffectDefinition CreateDefaultBlur() { EffectDefinition blurEffectDefinition = new EffectDefinition(DxtSubObjects.sIEBlurGuid); return(blurEffectDefinition); }
public IEffect AddEffect(double offset, double duration, EffectDefinition effectDefinition) { return(AddEffect(null, -1, offset, duration, effectDefinition)); }
public void SetValues() { var definition = new EffectDefinition(); definition.EffectId = StandardEffects.AudioMixerEffect; Assert.AreEqual(definition.EffectId, StandardEffects.AudioMixerEffect); }
public void Constructor2() { var definition = new EffectDefinition(StandardEffects.MatrixEffect); Assert.AreEqual(StandardEffects.MatrixEffect, definition.EffectId); Assert.AreEqual(0, definition.Parameters.Count); }
public void Constructor1() { var definition = new EffectDefinition(); Assert.AreEqual(Guid.Empty, definition.EffectId); Assert.AreEqual(0, definition.Parameters.Count); }
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(); } } }
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; }
public static EffectDefinition CreateDefaultBlur() { var blurEffectDefinition = new EffectDefinition(BlurEffect); return blurEffectDefinition; }
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; }
public static EffectDefinition CreateDefaultBlur() { var blurEffectDefinition = new EffectDefinition(BlurEffect); return(blurEffectDefinition); }
/// <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); }
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; }
public IEffect AddEffect(double offset, double duration, EffectDefinition effectDefinition) { return AddEffect(null, -1, offset, duration, effectDefinition); }
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; }
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; }