public void Close() { if (FileDecoder == null) { return; } FileDecoder.Dispose(); FileDecoder = null; }
void PlayFile(string file) { lock (singleton) { if (AllFilesDone) { return; } try { // is this a directory of jpegs or a video file? if (Directory.Exists(file)) { // this is a directory of jpegs FileDecoder = new PlayJpegsInBatchMode(AppData, Panel, (Form)AppData.MoviePlayerParentForm, Chan); } else { FileDecoder = new DSFileDecoder(AppData, Panel, (Form)AppData.MoviePlayerParentForm, Chan); } FileDecoder.OnNewFrame += new FrameGeneratorLib.OnNewFrameEvent(fileDecoder_OnNewFrame); FileDecoder.OnEndOfFileEvent += new FrameGeneratorLib.OnEndOfFile(fileDecoder_OnEndOfFileEvent); FileDecoder.Start(file); if (OnStatusUpdate != null) { OnStatusUpdate(file, PLAY_STATUS_UPDATE.PLAYING, null); } Playing = true; } catch (Exception ex) { ((ErrorLog)AppData.Logger).Trace(ex, ErrorLog.LOG_TYPE.FATAL); } } }
void PlayFile(string file) { lock (singleton) { if (AllFilesDone) return; try { // is this a directory of jpegs or a video file? if (Directory.Exists(file)) { // this is a directory of jpegs FileDecoder = new PlayJpegsInBatchMode(AppData, Panel, (Form)AppData.MoviePlayerParentForm, Chan); } else { FileDecoder = new DSFileDecoder(AppData, Panel, (Form)AppData.MoviePlayerParentForm, Chan); } FileDecoder.OnNewFrame += new FrameGeneratorLib.OnNewFrameEvent(fileDecoder_OnNewFrame); FileDecoder.OnEndOfFileEvent += new FrameGeneratorLib.OnEndOfFile(fileDecoder_OnEndOfFileEvent); FileDecoder.Start(file); if (OnStatusUpdate != null) OnStatusUpdate(file, PLAY_STATUS_UPDATE.PLAYING, null); Playing = true; } catch (Exception ex) { ((ErrorLog)AppData.Logger).Trace(ex, ErrorLog.LOG_TYPE.FATAL); } } }
public void Close() { if (FileDecoder == null) return; FileDecoder.Dispose(); FileDecoder = null; }