private void DoSubClip()
        {
            var selectedAssets = ReturnSelectedAssetsFromProgramsOrAssets();

            if (selectedAssets.Count > 0)
            {
                if (!selectedAssets.All(a => AssetInfo.GetAssetType(a).StartsWith(AssetInfo.Type_LiveArchive)))
                {
                    MessageBox.Show("Asset(s) should be a Live stream or archive." + Constants.endline + "Subclipping other types of assets is unpredictable.", "Format issue", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }


                Subclipping form = new Subclipping(_context, selectedAssets, this)
                {
                    EncodingJobName = "Subclipping of " + Constants.NameconvInputasset,
                    EncodingOutputAssetName = Constants.NameconvInputasset + " - Subclipped"
                };

                form.ShowDialog();
            }
        }
        private void DoSubClip()
        {
            var selectedAssets = ReturnSelectedAssetsFromProgramsOrAssets();

            if (selectedAssets.Count > 0)
            {
                Subclipping form = new Subclipping(_context, _contextdynmanifest, selectedAssets, this)
                {
                    EncodingJobName = "Subclipping of " + Constants.NameconvInputasset,
                    EncodingOutputAssetName = Constants.NameconvInputasset + " - Subclipped"
                };

                form.ShowDialog();

                //if (form.Show() == DialogResult.OK)
                //{
                //    var subclipConfig = form.GetSubclippingConfiguration();

                //    if (subclipConfig.Reencode) // reencode the clip
                //    {
                //        List<IMediaProcessor> Procs = GetMediaProcessorsByName(Constants.AzureMediaEncoderStandard);
                //        EncodingAMEStandard form2 = new EncodingAMEStandard(_context, subclipConfig)
                //        {
                //            EncodingLabel = (selectedAssets.Count > 1) ? selectedAssets.Count + " assets have been selected. " + selectedAssets.Count + " jobs will be submitted." : "Asset '" + selectedAssets.FirstOrDefault().Name + "' will be encoded.",
                //            EncodingProcessorsList = Procs,
                //            EncodingJobName = "Subclipping with reencoding of " + Constants.NameconvInputasset,
                //            EncodingOutputAssetName = Constants.NameconvInputasset + "- Subclipped with reencoding",
                //            EncodingAMEStdPresetXMLFilesUserFolder = Properties.Settings.Default.AMEStandardPresetXMLFilesCurrentFolder,
                //            EncodingAMEStdPresetXMLFilesFolder = Application.StartupPath + Constants.PathAMEStdFiles,
                //            SelectedAssets = selectedAssets
                //        };

                //        if (form2.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                //        {
                //            string taskname = "Subclipping with reencoding of " + Constants.NameconvInputasset + " with " + Constants.NameconvEncodername;
                //            LaunchJobs(
                //               form2.EncodingProcessorSelected,
                //               selectedAssets,
                //               form2.EncodingJobName,
                //               form2.JobOptions.Priority,
                //               taskname,
                //               form2.EncodingOutputAssetName,
                //               new List<string>() { form2.EncodingConfiguration },
                //               form2.JobOptions.OutputAssetsCreationOptions,
                //               form2.JobOptions.TasksOptionsSetting,
                //               form2.JobOptions.StorageSelected);
                //        }
                //    }
                //    else if (subclipConfig.CreateAssetFilter) // create a asset filter
                //    {
                //        IAsset selasset = selectedAssets.FirstOrDefault();
                //        DynManifestFilter formAF = new DynManifestFilter(_contextdynmanifest, _context, null, selasset, subclipConfig);

                //        if (formAF.ShowDialog() == DialogResult.OK)
                //        {
                //            AssetFilter myassetfilter = new AssetFilter(selasset);

                //            Filter filter = formAF.GetFilter;
                //            myassetfilter.Name = filter.Name;
                //            myassetfilter.PresentationTimeRange = filter.PresentationTimeRange;
                //            myassetfilter.Tracks = filter.Tracks;
                //            myassetfilter._context = filter._context;
                //            try
                //            {
                //                myassetfilter.Create();
                //                TextBoxLogWriteLine("Asset filter '{0}' created.", myassetfilter.Name);
                //            }
                //            catch (Exception e)
                //            {
                //                TextBoxLogWriteLine("Error when creating filter '{0}'.", myassetfilter.Name, true);
                //                TextBoxLogWriteLine(e);
                //            }
                //            DoRefreshGridFiltersV(false);
                //        }

                //    }
                //    else // no reencode or asset filter but stream copy
                //    {
                //        string taskname = "Subclipping of " + Constants.NameconvInputasset + " with " + Constants.NameconvEncodername;
                //        IMediaProcessor Proc = GetLatestMediaProcessorByName(Constants.AzureMediaEncoderStandard);

                //        LaunchJobs(
                //            Proc,
                //            selectedAssets,
                //            form.EncodingJobName,
                //            form.JobOptions.Priority,
                //            taskname,
                //            form.EncodingOutputAssetName,
                //            new List<string>() { form.GetSubclippingConfiguration().Configuration },
                //            form.JobOptions.OutputAssetsCreationOptions,
                //            form.JobOptions.TasksOptionsSetting,
                //            form.JobOptions.StorageSelected);
                //    }

            }
        }