void HandleElementLoadedEvent(object element, bool hasNext) { if (element == null) { DrawingsVisible = false; if (Mode != PlayerViewOperationMode.LiveAnalysisReview) { closebutton.Visible = false; } } else { nextbutton.Sensitive = hasNext; closebutton.Visible = true; if (element is PlaylistDrawing) { PlaylistDrawing drawing = element as PlaylistDrawing; LoadImage(null, drawing.Drawing); } else if (element is PlaylistImage) { PlaylistImage image = element as PlaylistImage; LoadImage(image.Image, null); } } }
public void ViewModelFactoryBaseService_CreatePlaylistDrawingVM() { var model = new PlaylistDrawing(new FrameDrawing()); var vm = factoryService.CreateViewModel <PlaylistElementVM, IPlaylistElement> (model); Assert.IsTrue(vm is PlaylistDrawingVM); }
void ProcessDrawing(PlaylistDrawing drawing) { Image img; Log.Debug(String.Format("Adding still drawing with duration {0}s", drawing.Duration)); img = Drawing.Utils.RenderFrameDrawing(Config.DrawingToolkit, drawing.Width, drawing.Height, drawing.Drawing); ProcessImage(img, drawing.Duration); }
public void TestClone_CloneIgnore_PlaylistDrawing() { var playlistDrawing = new PlaylistDrawing(new FrameDrawing()); playlistDrawing.Duration = new Time(100); var playlistDrawing2 = playlistDrawing.Clone(); Assert.AreEqual(playlistDrawing.Duration, playlistDrawing2.Duration); playlistDrawing.Duration = new Time(200); playlistDrawing2 = playlistDrawing.Clone(); Assert.AreEqual(playlistDrawing.Duration, playlistDrawing2.Duration); }
public void TestLoadPlaylistEvent() { int elementLoaded = 0; MediaFileSet nfs; PlaylistPlayElement el1; player.ElementLoadedEvent += (element, hasNext) => { if (element != null) { elementLoaded++; } }; PreparePlayer(); /* Load playlist timeline event element */ nfs = Cloner.Clone(mfs); el1 = playlist.Elements [0] as PlaylistPlayElement; el1.FileSet = nfs; currentTime = el1.Play.Start; player.LoadPlaylistEvent(playlist, el1); Assert.AreEqual(1, elementLoaded); elementLoaded = 0; Assert.AreEqual(el1.CamerasConfig, player.CamerasConfig); Assert.AreEqual(el1.CamerasLayout, player.CamerasLayout); playerMock.Verify(p => p.Open(nfs [0]), Times.Once()); playerMock.Verify(p => p.Seek(el1.Play.Start, true, false), Times.Never()); playerMock.Verify(p => p.Play(), Times.Never()); playerMock.VerifySet(p => p.Rate = 1); playerMock.Raise(p => p.ReadyToSeek += null, this); playerMock.Verify(p => p.Seek(el1.Play.Start, true, false), Times.Once()); playerMock.Verify(p => p.Play(), Times.Once()); /* Load still image */ player.LoadPlaylistEvent(playlist, plImage); playerMock.ResetCalls(); player.Pause(); playerMock.Verify(p => p.Pause(), Times.Never()); Assert.IsFalse(player.Playing); player.Play(); playerMock.Verify(p => p.Play(), Times.Never()); Assert.IsTrue(player.Playing); /* Load drawings */ PlaylistDrawing dr = new PlaylistDrawing(new FrameDrawing()); player.LoadPlaylistEvent(playlist, dr); playerMock.ResetCalls(); player.Pause(); playerMock.Verify(p => p.Pause(), Times.Never()); Assert.IsFalse(player.Playing); player.Play(); playerMock.Verify(p => p.Play(), Times.Never()); Assert.IsTrue(player.Playing); /* Load video */ PlaylistVideo vid = new PlaylistVideo(mfs [0]); player.LoadPlaylistEvent(playlist, vid); Assert.AreNotEqual(mfs, player.FileSet); Assert.IsTrue(player.Playing); Assert.AreEqual(new List <CameraConfig> { new CameraConfig(0) }, player.CamerasConfig); }
void LoadFrameDrawing(PlaylistDrawing drawing) { loadedPlaylistElement = drawing; StillImageLoaded = true; }