Пример #1
0
        private async Task <bool> DoExport(IProgress <ExportProgressStatus> progress)
        {
            _data.ConfigureExport(_data.ActiveProfile);

            var exportProgressStatus = new ExportProgressStatus();
            var overallProgressSteps = _data.ActiveProfile.SequenceFiles.Count * 2d;             //There are basically 2 steps for each. Render and export.
            var overallProgressStep  = 0;

            exportProgressStatus.OverallProgressMessage = "Overall Progress";
            progress.Report(exportProgressStatus);

            await Task.Run(async() =>
            {
                foreach (var sequenceFile in _data.ActiveProfile.SequenceFiles)
                {
                    if (_cancelled)
                    {
                        break;
                    }
                    exportProgressStatus.TaskProgressMessage = string.Format("Loading {0}", Path.GetFileNameWithoutExtension(sequenceFile));;
                    progress.Report(exportProgressStatus);

                    //Load our sequence
                    var sequence = SequenceService.Instance.Load(sequenceFile);
                    exportProgressStatus.TaskProgressMessage = string.Format("Loading any media for {0}", sequence.Name);
                    progress.Report(exportProgressStatus);
                    //Load it's media
                    LoadMedia(sequence);
                    //Render it
                    RenderSequence(sequence, progress);
                    //Update over all progress with next step
                    overallProgressStep++;
                    exportProgressStatus.OverallProgressValue = (int)(overallProgressStep / overallProgressSteps * 100);
                    exportProgressStatus.TaskProgressMessage  = string.Format("Exporting {0}", sequence.Name);
                    progress.Report(exportProgressStatus);

                    //Begin export step.
                    await Export(sequence, progress);
                    overallProgressStep++;
                    exportProgressStatus.OverallProgressValue = (int)(overallProgressStep / overallProgressSteps * 100);
                    progress.Report(exportProgressStatus);
                }

                exportProgressStatus.TaskProgressMessage    = "";
                exportProgressStatus.TaskProgressValue      = 0;
                exportProgressStatus.OverallProgressMessage = "Completed";
                progress.Report(exportProgressStatus);
            });

            return(true);
        }
Пример #2
0
        private void ConfigureSummary()
        {
            _data.ConfigureExport(_data.ActiveProfile);
            chkSaveConfig.Checked   = false;
            comboConfigName.Visible = false;
            lblSequenceCount.Text   = _data.ActiveProfile.SequenceFiles.Count().ToString();
            lblTimingValue.Text     = string.Format("{0} ms", _data.ActiveProfile.Interval);
            lblFormatName.Text      = _data.ActiveProfile.Format;
            lblOutputFolder.Text    = _data.ActiveProfile.OutputFolder;
            string audioOption = "Not included.";

            lblAudioOutputFolder.Visible = lblAudioDestination.Visible = _data.ActiveProfile.IncludeAudio;
            if (_data.ActiveProfile.IncludeAudio)
            {
                audioOption = _data.ActiveProfile.RenameAudio ? "Rename to match sequence name." : "Include as is.";
                lblAudioOutputFolder.Text = _data.ActiveProfile.AudioOutputFolder;
            }

            lblAudioOption.Text = audioOption;
            if (_data.ActiveProfile.IsFalconFormat && _data.ActiveProfile.CreateUniverseFile)
            {
                lblUniverseFolder.Text    = _data.ActiveProfile.FalconOutputFolder;
                lblUniverseFolder.Visible = lblUniverse.Visible = true;
            }
            else
            {
                lblUniverseFolder.Visible = lblUniverse.Visible = false;
            }
            if (!_data.Export.AllSelectedControllersSupportUniverses && _data.ActiveProfile.CreateUniverseFile)
            {
                lblUniverseFileWarning.Visible = true;
                lblUniverseFileWarning.Text    = "Not all controllers selected for export support universes.\n" +
                                                 "These controllers will not be included in the universes file.\n" +
                                                 "Some manual FPP output configuration will be required.";
            }
            else
            {
                lblUniverseFileWarning.Visible = false;
            }
        }