public void AddAndRemoveHandler() { bool eventTriggered = false; using (ITimeline timeline = new DefaultTimeline()) { IGroup audioGroup = timeline.AddAudioGroup(); ITrack track = audioGroup.AddTrack(); track.AddClip("testinput.mp3", GroupMediaType.Audio, InsertPosition.Absoloute, 0, 0, -1); using (NullRenderer renderer = new NullRenderer(timeline)) { EventHandler handler = new EventHandler(delegate { eventTriggered = true; }); renderer.RenderCompleted += handler; renderer.RenderCompleted -= handler; renderer.BeginRender(null, null); renderer.Cancel(); Assert.IsFalse(eventTriggered); } } }
public void CancelBeforeStart() { using (ITimeline timeline = new DefaultTimeline()) { IGroup audioGroup = timeline.AddAudioGroup(); ITrack track = audioGroup.AddTrack(); track.AddClip("testinput.mp3", GroupMediaType.Audio, InsertPosition.Absolute, 0, 0, -1); using (var renderer = new NullRenderer(timeline)) { renderer.Cancel(); } } }
public void CancelBeforeStart() { using (ITimeline timeline = new DefaultTimeline()) { IGroup audioGroup = timeline.AddAudioGroup(); ITrack track = audioGroup.AddTrack(); track.AddClip("..\\..\\testinput.mp3", GroupMediaType.Audio, InsertPosition.Absolute, 0, 0, -1); using (var renderer = new NullRenderer(timeline)) { renderer.Cancel(); } } }
public void CancelRender() { bool eventTriggered = false; using (ITimeline timeline = new DefaultTimeline()) { IGroup audioGroup = timeline.AddAudioGroup(); ITrack track = audioGroup.AddTrack(); track.AddClip("..\\..\\testinput.mp3", GroupMediaType.Audio, InsertPosition.Absolute, 0, 0, -1); using (var renderer = new NullRenderer(timeline)) { renderer.RenderCompleted += delegate { eventTriggered = true; }; renderer.BeginRender(null, null); renderer.Cancel(); Assert.AreEqual(RendererState.Canceled, renderer.State); Assert.IsTrue(eventTriggered); } } }
public void AddAndRemoveHandler() { bool eventTriggered = false; using (ITimeline timeline = new DefaultTimeline()) { IGroup audioGroup = timeline.AddAudioGroup(); ITrack track = audioGroup.AddTrack(); track.AddClip("testinput.mp3", GroupMediaType.Audio, InsertPosition.Absolute, 0, 0, -1); using (var renderer = new NullRenderer(timeline)) { EventHandler handler = delegate { eventTriggered = true; }; renderer.RenderCompleted += handler; renderer.RenderCompleted -= handler; renderer.BeginRender(null, null); renderer.Cancel(); Assert.IsFalse(eventTriggered); } } }
public void CancelRender() { bool eventTriggered = false; using (ITimeline timeline = new DefaultTimeline()) { IGroup audioGroup = timeline.AddAudioGroup(); ITrack track = audioGroup.AddTrack(); track.AddClip("testinput.mp3", GroupMediaType.Audio, InsertPosition.Absolute, 0, 0, -1); using (var renderer = new NullRenderer(timeline)) { renderer.RenderCompleted += delegate { eventTriggered = true; }; renderer.BeginRender(null, null); renderer.Cancel(); Assert.AreEqual(RendererState.Canceled, renderer.State); Assert.IsTrue(eventTriggered); } } }