Exemplo n.º 1
0
        public MLTProject(string pFullPath, VideoInfoProvider pVideoInfoCache)
        {
            VideoInfoProvider = pVideoInfoCache;
            ID = Guid.NewGuid();
            Directory.CreateDirectory(Path.Combine(Settings.TempDirectory, ID.ToString()));

            _objProjectFile = new FileInfo(pFullPath);

            Config = new MeltConfig(this, VideoInfoProvider);
            if (TargetExists)
            {
                _objTargetInfo = VideoInfoProvider.Get(TargetPath);
            }
            if (SourceExists)
            {
                _objSourceInfo = VideoInfoProvider.Get(SourcePath);
            }

            Job = new MeltJob(this); // -- ToDo: pass null or the config for the job, not the project itself
            Job.ProgressChanged += (object sender, System.EventArgs e) => {
                ProjectChanged?.Invoke(sender, this);
            };
            Job.StatusChanged += (object sender, JobStatus e) => {
                Log.Info("Project was changed - notify everyone");
                switch (e)
                {
                case JobStatus.Failed:
                case JobStatus.Success:
                    Reload();
                    break;

                case JobStatus.Paused:
                case JobStatus.Running:
                case JobStatus.Scheduled:
                case JobStatus.UnScheduled:
                    break;
                }
                ProjectChanged?.Invoke(sender, this);
            };
        }
Exemplo n.º 2
0
 internal MeltRunner(MeltConfig pConfig)
 {
     Config   = pConfig;
     Handlers = MeltHelper.GetHandlers();
 }