Exemple #1
0
        public IJobProcessor GetMuxer(MuxerType type, MeGUISettings settings)
        {
            IMuxing muxer = GetMuxer(type);

            if (muxer == null)
            {
                return(null);
            }
            return(muxer.GetMuxer(settings));
        }
Exemple #2
0
        public baseMuxWindow(MainForm mainForm, IMuxing muxer) : this()
        {
            this.mainForm = mainForm;
            this.settings = mainForm.Settings;
            this.muxer    = muxer;

            muxProvider = mainForm.MuxProvider;
            cbType.Items.Add("Standard");
            cbType.Items.AddRange(muxProvider.GetSupportedDevices((ContainerType)cbContainer.SelectedItem).ToArray());
            cbType.SelectedIndex = 0;
        }
Exemple #3
0
        public List <ContainerType> GetContainersInCommon(IMuxing iMuxing)
        {
            List <ContainerType> supportedOutputTypes    = GetSupportedContainers();
            List <ContainerType> nextSupportedInputTypes = iMuxing.GetSupportedContainerInputTypes();
            List <ContainerType> commonContainers        = new List <ContainerType>();

            foreach (ContainerType eligibleType in supportedOutputTypes)
            {
                if (nextSupportedInputTypes.Contains(eligibleType))
                {
                    commonContainers.Add(eligibleType);
                }
            }
            return(commonContainers);
        }
Exemple #4
0
        /// <summary>
        /// Step in the recursive stage which chooses, of all the MuxableTypes which
        /// *could* be handled, whether they should be. That means, it generates a
        /// mux path which involves muxing in each of the 2^n combinations of inputs
        /// at this stage.
        ///
        /// I'm not sure if this step is actually necessary. The only possible
        /// use I can think of is if you have a specific muxpath rule which says
        /// that only one file can be muxed in at a time, or only some specific
        /// combination of files can be muxed in at a time.
        ///           -- berrinam
        /// </summary>
        /// <param name="currentMuxPath"></param>
        /// <param name="muxer"></param>
        /// <param name="decidedHandledTypes"></param>
        /// <param name="undecidedPossibleHandledTypes"></param>
        /// <param name="unhandledInputTypes"></param>
        /// <param name="desiredContainerType"></param>
        /// <returns></returns>
        private MuxPath getShortestMuxPath(MuxPath currentMuxPath, IMuxing muxer, List <MuxableType> decidedHandledTypes,
                                           List <MuxableType> undecidedPossibleHandledTypes, List <MuxableType> unhandledInputTypes, ContainerType desiredContainerType)
        {
            if (undecidedPossibleHandledTypes.Count == 0)
            {
                MuxPathLeg mpl = new MuxPathLeg();
                mpl.muxerInterface      = muxer;
                mpl.handledInputTypes   = new List <MuxableType>(decidedHandledTypes);
                mpl.unhandledInputTypes = new List <MuxableType>(unhandledInputTypes);
                MuxPath newMuxPath = currentMuxPath.Clone();
                newMuxPath.Add(mpl);
                if (decidedHandledTypes.Count == 0)
                {
                    return(null);
                }
                return(getShortestMuxPath(newMuxPath, unhandledInputTypes, desiredContainerType));
            }
            else
            {
                List <MuxPath> allMuxPaths = new List <MuxPath>();
                MuxableType    type        = undecidedPossibleHandledTypes[0];
                undecidedPossibleHandledTypes.RemoveAt(0);

                decidedHandledTypes.Add(type);
                MuxPath shortestMuxPath = getShortestMuxPath(currentMuxPath, muxer, decidedHandledTypes, undecidedPossibleHandledTypes, unhandledInputTypes, desiredContainerType);
                if (shortestMuxPath != null)
                {
                    allMuxPaths.Add(shortestMuxPath);
                }
                decidedHandledTypes.Remove(type);

                unhandledInputTypes.Add(type);
                shortestMuxPath = getShortestMuxPath(currentMuxPath, muxer, decidedHandledTypes, undecidedPossibleHandledTypes, unhandledInputTypes, desiredContainerType);
                if (shortestMuxPath != null)
                {
                    allMuxPaths.Add(shortestMuxPath);
                }
                unhandledInputTypes.Remove(type);

                undecidedPossibleHandledTypes.Add(type);

                return(comparer.GetBestMuxPath(allMuxPaths));
            }
        }
Exemple #5
0
        public MuxWindow(IMuxing muxer, MainForm mainForm)
            : base(mainForm)
        {
            InitializeComponent();
            this.muxer = muxer;
            if (muxer.GetSupportedAudioTypes().Count == 0)
                audio.Enabled = false;
            if (muxer.GetSupportedChapterTypes().Count == 0)
                chaptersGroupbox.Enabled = false;
            if (muxer.GetSupportedSubtitleTypes().Count == 0)
                subtitles.Enabled = false;
            if (muxer.GetSupportedChapterTypes().Count == 0)
                chaptersGroupbox.Enabled = false;
            if (muxer.GetSupportedDeviceTypes().Count == 0)
                cbType.Enabled = false;
            muxedInput.Filter = muxer.GetMuxedInputFilter();

            audioTracks[0].Filter = muxer.GetAudioInputFilter();
            output.Filter = muxer.GetOutputTypeFilter();
            subtitleTracks[0].Filter = muxer.GetSubtitleInputFilter();
            vInput.Filter = muxer.GetVideoInputFilter();
            chapters.Filter = muxer.GetChapterInputFilter();
        }
Exemple #6
0
        public MuxWindow(IMuxing muxer, MainForm mainForm)
            : base(mainForm, muxer)
        {
            InitializeComponent();
            this.muxer = muxer;
            if (muxer.GetSupportedAudioTypes().Count == 0)
            {
                audio.Enabled = false;
            }
            if (muxer.GetSupportedChapterTypes().Count == 0)
            {
                chaptersGroupbox.Enabled = false;
            }
            if (muxer.GetSupportedSubtitleTypes().Count == 0)
            {
                subtitles.Enabled = false;
            }
            else if (this.muxer.MuxerType == MuxerType.MKVMERGE)
            {
                subtitleTracks[0].ShowDefaultSubtitleStream = true;
                subtitleTracks[0].ShowDelay = true;
                subtitleTracks[0].chkDefaultStream.CheckedChanged += new System.EventHandler(base.chkDefaultStream_CheckedChanged);
                subtitleTracks[0].chkDefaultStream.Checked         = true;
                subtitleTracks[0].ShowForceSubtitleStream          = true;
            }
            if (muxer.GetSupportedChapterTypes().Count == 0)
            {
                chaptersGroupbox.Enabled = false;
            }
            if (muxer.GetSupportedDeviceTypes().Count == 0)
            {
                cbType.Enabled = false;
            }
            muxedInput.Filter = muxer.GetMuxedInputFilter();

            if (this.muxer.MuxerType == MuxerType.AVIMUXGUI)
            {
                fps.Enabled = false;
            }

            audioTracks[0].Filter    = muxer.GetAudioInputFilter();
            output.Filter            = muxer.GetOutputTypeFilter();
            subtitleTracks[0].Filter = muxer.GetSubtitleInputFilter();
            vInput.Filter            = muxer.GetVideoInputFilter();
            chapters.Filter          = muxer.GetChapterInputFilter();

            base.muxButton.Click += new System.EventHandler(this.muxButton_Click);

            this.Text = "MeGUI - " + muxer.Name;

            cbType.Items.Clear();
            cbType.Items.Add("Standard");
            cbType.Items.AddRange(muxer.GetSupportedDeviceTypes().ToArray());
            this.cbType.SelectedIndex = 0;
            foreach (object o in cbType.Items) // I know this is ugly, but using the DeviceOutputType doesn't work unless we're switching to manual serialization
            {
                if (o.ToString().Equals(mainForm.Settings.AedSettings.DeviceOutputType))
                {
                    cbType.SelectedItem = o;
                    break;
                }
            }
        }