public VideoListRefresher(IPlaylistStoreHandler playlistStoreHandler, IVideoHandler videoHandler, ILocalVideoUtils localVideoUtils, IVideoThumnailUtility videoThumnailUtility, ICurrent current, ILightVideoListinfoHandler lightVideoListinfoHandler, ILocalSettingsContainer container)
 {
     this._playlistStoreHandler = playlistStoreHandler;
     this._videoHandler         = videoHandler;
     this._current = current;
     this._videoThumnailUtility      = videoThumnailUtility;
     this._localVideoUtils           = localVideoUtils;
     this._lightVideoListinfoHandler = lightVideoListinfoHandler;
     this._settingsContainer         = container;
 }
        public VideoListContainer(IPlaylistHandler playlistHandler, IVideoHandler videoHandler, IVideoListRefresher refresher, ICurrent current, ILogger logger)
        {
            this.videoHandler     = videoHandler;
            this.refresher        = refresher;
            this.current          = current;
            this.logger           = logger;
            this.Videos           = new ObservableCollection <IListVideoInfo>();
            this._playlistHandler = playlistHandler;

            this.current.IsTemporaryPlaylist.Subscribe(value =>
            {
                if (value)
                {
                    this.Clear();
                }
            });
        }
Exemple #3
0
        /// <summary>
        /// Returns a video handler that may be used for getting or writing frames of the video.
        /// e.g. a YuvVideoHandnler to process the video file if it is of yuv-format.
        /// </summary>
        /// <returns>a video handler to acess the video frames.</returns>
        private IVideoHandler getVideoHandler()
        {
            PluginManager pm = PluginManager.pluginManager;

               string handlerPluginName = Path.GetExtension(this.vidPath).ToLower().TrimStart(new char[] { '.' }) + "VideoHandler";

            _handler = pm.getPlugin<IVideoHandler>(handlerPluginName);
            if (_handler == null)
                throw new FileFormatException("Cant process given video file format.");
            //TODO: catch this exception. oqat shouldn't crash on a unknown file!

                //PluginManager.pluginManager.raiseEvent(EventType.panic,
                //    new ErrorEventArgs(new Exception("No such ")));

            _handler = handler.createExtraPluginInstance() as IVideoHandler;
            if ((this.vidInfo != null) && (File.Exists(vidPath)))
            {
                IVideoInfo copy = this.vidInfo.Clone() as IVideoInfo;

                _handler.setReadContext(this.vidPath, copy);
            }

            return _handler;
        }
Exemple #4
0
        public void setMetricContext(IVideo vidRef, int idProc, IVideo vidProc)
        {
            //do not set new context while macro is processing
            if (_propertyView.processing)
                return;

            flush();

            this.idRes = idProc;
            if (vidRef != null)
            {
                handRef = vidRef.getExtraHandler();

                this.rootEntry.frameCount = handRef.readVidInfo.frameCount;
            }
            if (vidProc != null)
            {
                handProc = vidProc.getExtraHandler();
                this.rootEntry.frameCount = handProc.readVidInfo.frameCount;
            }

            (propertyView as Macro_PropertyView).filterMode = false;
        }
Exemple #5
0
        public void setFilterContext(int idRef, IVideo vidRef)
        {
            //do not set new context while macro is processing
            if (_propertyView.processing)
                return;

            flush();

            this.idRes = idRef;
            handRef = vidRef.getExtraHandler();

            (propertyView as Macro_PropertyView).filterMode = true;

            this.rootEntry.frameCount = handRef.readVidInfo.frameCount;

            //RemoveClickEvent((propertyView as Macro_PropertyView).startProcessing);
        }
Exemple #6
0
        public void flush()
        {
            if (handProc != null)
            {
                handProc.flushReader();
                handProc.flushWriter();
                handProc = null;
            }

            if (handRef != null)
            {
                handRef.flushReader();
                handRef.flushWriter();
                handRef = null;
            }
            clearMacroEntryList();
            this.rootEntry.mementoName = "";
               // this.rootEntry.frameCount = 100;
        }