Exemplo n.º 1
0
 public bool SupportsAudioCodec(AudioCodec codec)
 {
     if (supportsAnyInputtableAudioCodec)
     {
         return(true);
     }
     return(GetSupportedAudioCodecs().Contains(codec));
 }
Exemplo n.º 2
0
 public AudioCodecSettings(string id, AudioCodec codec, AudioEncoderType encoder, int bitrate, BitrateManagementMode mode)
 {
     this.id          = id;
     audioCodec       = codec;
     audioEncoderType = encoder;
     downmixMode      = ChannelMode.KeepOriginal;
     bitrateMode      = mode;
     this.bitrate     = bitrate;
     delay            = 0;
     delayEnabled     = false;
     autoGain         = true;
     forceDirectShow  = false;
     improveAccuracy  = true;
 }
Exemplo n.º 3
0
 public AudioCodecSettings(string id, AudioCodec codec, AudioEncoderType encoder, int bitrate, BitrateManagementMode mode)
 {
     this.id          = id;
     audioCodec       = codec;
     audioEncoderType = encoder;
     downmixMode      = ChannelMode.KeepOriginal;
     bitrateMode      = mode;
     this.bitrate     = bitrate;
     autoGain         = false;
     applyDRC         = false;
     normalize        = 100;
     preferredDecoder = AudioDecodingEngine.NicAudio;
     timeModification = TimeModificationMode.KeepOriginal;
     sampleRate       = SampleRateMode.KeepOriginal;
 }
Exemplo n.º 4
0
 public AudioTrackInfo(string language, string codec, int trackID)
 {
     base.TrackType        = TrackType.Audio;
     base.Language         = language;
     base.Codec            = codec;
     base.TrackID          = trackID;
     this.aacFlag          = -1;
     this.nbChannels       = "unknown";
     this.samplingRate     = "unknown";
     this.channelPositions = "unknown";
     this.bHasCore         = false;
     this.codecProfile     = string.Empty;
     this._bitrateMode     = BitrateManagementMode.CBR;
     this._type            = null;
     this._codec           = AudioCodec.UNKNOWN;
 }
Exemplo n.º 5
0
        private AudioType getAudioType(AudioCodec codec, ContainerType cft)
        {
            ContainerType type = null;

            if (cft != null)
            {
                type = cft;
            }
            foreach (AudioType t in ContainerManager.AudioTypes.Values)
            {
                if (t.ContainerType == type && Array.IndexOf <AudioCodec>(t.SupportedCodecs, codec) >= 0)
                {
                    return(t);
                }
            }
            return(null);
        }
Exemplo n.º 6
0
        private static AudioType getAudioType(AudioCodec codec, ContainerType cft, string filename)
        {
            string        extension = Path.GetExtension(filename).ToLower();
            ContainerType type      = null;

            if (cft != null)
            {
                type = cft;
            }
            foreach (AudioType t in ContainerManager.AudioTypes.Values)
            {
                if (t.ContainerType == type && Array.IndexOf <AudioCodec>(t.SupportedCodecs, codec) >= 0 && "." + t.Extension == extension)
                {
                    return(t);
                }
            }
            return(null);
        }
Exemplo n.º 7
0
 public AudioCodecSettings(string id, AudioCodec codec, AudioEncoderType encoder, int bitrate)
     : this(id, codec, encoder, bitrate, BitrateManagementMode.CBR)
 {
 }
Exemplo n.º 8
0
 public AudioType(string name, string filterName, string extension, ContainerType containerType, AudioCodec supportedCodec)
     : this(name, filterName, extension, containerType, new AudioCodec[] { supportedCodec })
 {
 }
Exemplo n.º 9
0
 public AudioEncoderType(string id, AudioCodec codec)
 {
     this.id    = id;
     this.codec = codec;
 }
Exemplo n.º 10
0
        /// <summary>
        /// creates a project
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void queueButton_Click(object sender, System.EventArgs e)
        {
            if (dialogMode)
            {
                return;
            }

            if (!configured)
            {
                MessageBox.Show("You must select the input and output file to continue",
                                "Configuration incomplete", MessageBoxButtons.OK);
                return;
            }

            if (!Drives.ableToWriteOnThisDrive(Path.GetPathRoot(output.Filename)))
            {
                MessageBox.Show("MeGUI cannot write on the disc " + Path.GetPathRoot(output.Filename) + "\n" +
                                "Please, select another output path to save your project...", "Configuration Incomplete", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            JobChain prepareJobs = null;
            string   videoInput  = input.Filename;

            // create pgcdemux job if needed
            if (Path.GetExtension(input.Filename).ToUpperInvariant().Equals(".IFO"))
            {
                if (iFile.VideoInfo.PGCCount > 1 || iFile.VideoInfo.AngleCount > 0)
                {
                    // pgcdemux must be used as either multiple PGCs or a multi-angle disc are found
                    string tempFile = Path.Combine(Path.GetDirectoryName(output.Filename), Path.GetFileNameWithoutExtension(output.Filename) + "_1.VOB");
                    prepareJobs = new SequentialChain(new PgcDemuxJob(videoInput, tempFile, iFile.VideoInfo.PGCNumber, iFile.VideoInfo.AngleNumber));
                    videoInput  = tempFile;

                    string filesToOverwrite = string.Empty;
                    for (int i = 1; i < 10; i++)
                    {
                        string file = Path.Combine(Path.GetDirectoryName(output.Filename), Path.GetFileNameWithoutExtension(output.Filename) + "_" + i + ".VOB");
                        if (File.Exists(file))
                        {
                            filesToOverwrite += file + "\n";
                        }
                    }
                    if (!String.IsNullOrEmpty(filesToOverwrite))
                    {
                        DialogResult dr = MessageBox.Show("The pgc demux files already exist: \n" + filesToOverwrite + "\n" +
                                                          "Do you want to overwrite these files?", "Configuration Incomplete",
                                                          MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                        if (dr == DialogResult.No)
                        {
                            return;
                        }
                    }
                }
                else
                {
                    // change from _0.IFO to _1.VOB for the indexer
                    videoInput = input.Filename.Substring(0, input.Filename.Length - 5) + "1.VOB";
                    if (!File.Exists(videoInput))
                    {
                        MessageBox.Show("The file following file cannot be found: \n" + videoInput, "Configuration Incomplete", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
            }
            else if (Path.GetExtension(input.Filename).ToUpperInvariant().Equals(".MPLS") && IndexerUsed != IndexType.DGI && IndexerUsed != IndexType.DGM)
            {
                // blu-ray playlist without DGI/DGM used - therefore eac3to must be used first

                string strTempMKVFile = Path.Combine(Path.GetDirectoryName(output.Filename), Path.GetFileNameWithoutExtension(output.Filename) + ".mkv");
                if (File.Exists(strTempMKVFile))
                {
                    DialogResult dr = MessageBox.Show("The demux file already exist: \n" + strTempMKVFile + "\n" +
                                                      "Do you want to overwrite this file?", "Configuration Incomplete",
                                                      MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (dr == DialogResult.No)
                    {
                        return;
                    }
                }

                StringBuilder sb = new StringBuilder();
                sb.Append(string.Format("{0}:\"{1}\" ", iFile.VideoInfo.Track.TrackID, strTempMKVFile));

                foreach (AudioTrackInfo oStreamControl in AudioTracks.CheckedItems)
                {
                    bool       bCoreOnly  = false;
                    AudioCodec audioCodec = oStreamControl.AudioCodec;
                    if (oStreamControl.HasCore && !MainForm.Instance.Settings.Eac3toDefaultToHD)
                    {
                        // audio file can be demuxed && should be touched (core needed)
                        if (audioCodec == AudioCodec.THDAC3)
                        {
                            oStreamControl.Codec      = "AC-3";
                            oStreamControl.AudioType  = AudioType.AC3;
                            oStreamControl.AudioCodec = AudioCodec.AC3;
                            bCoreOnly = true;
                            oStreamControl.HasCore = false;
                        }
                        else if (audioCodec == AudioCodec.DTS)
                        {
                            oStreamControl.Codec      = "DTS";
                            oStreamControl.AudioType  = AudioType.DTS;
                            oStreamControl.AudioCodec = AudioCodec.DTS;
                            oStreamControl.HasCore    = false;
                            bCoreOnly = true;
                        }
                    }

                    // core must be extracted (workaround for an eac3to issue)
                    // http://bugs.madshi.net/view.php?id=450
                    if (audioCodec == AudioCodec.EAC3)
                    {
                        bCoreOnly = true;
                    }

                    string strSourceFileName = Path.Combine(Path.GetDirectoryName(input.Filename), Path.GetFileNameWithoutExtension(strTempMKVFile));

                    oStreamControl.SourceFileName = strSourceFileName;

                    sb.Append(string.Format("{0}:\"{1}\" ", oStreamControl.TrackID, Path.Combine(Path.GetDirectoryName(output.Filename), oStreamControl.DemuxFileName)));
                    if (bCoreOnly)
                    {
                        sb.Append("-core ");
                    }
                }

                HDStreamsExJob oJob = new HDStreamsExJob(new List <string>()
                {
                    input.Filename
                }, Path.GetDirectoryName(output.Filename), null, sb.ToString(), 2);
                prepareJobs = new SequentialChain(oJob);
                videoInput  = strTempMKVFile;
            }

            switch (IndexerUsed)
            {
            case IndexType.D2V:
            {
                prepareJobs = new SequentialChain(prepareJobs, new SequentialChain(generateD2VIndexJob(videoInput)));
                MainForm.Instance.Jobs.AddJobsWithDependencies(prepareJobs, true);
                if (this.closeOnQueue.Checked)
                {
                    this.Close();
                }
                break;
            }

            case IndexType.DGI:
            {
                prepareJobs = new SequentialChain(prepareJobs, new SequentialChain(generateDGNVIndexJob(videoInput)));
                MainForm.Instance.Jobs.AddJobsWithDependencies(prepareJobs, true);
                if (this.closeOnQueue.Checked)
                {
                    this.Close();
                }
                break;
            }

            case IndexType.DGM:
            {
                prepareJobs = new SequentialChain(prepareJobs, new SequentialChain(generateDGMIndexJob(videoInput)));
                MainForm.Instance.Jobs.AddJobsWithDependencies(prepareJobs, true);
                if (this.closeOnQueue.Checked)
                {
                    this.Close();
                }
                break;
            }

            case IndexType.FFMS:
            {
                FFMSIndexJob job = generateFFMSIndexJob(videoInput);
                if (job.DemuxMode > 0 && job.AudioTracks.Count > 0 &&
                    (txtContainerInformation.Text.Trim().ToUpperInvariant().Equals("MATROSKA") ||
                     txtContainerInformation.Text.Trim().ToUpperInvariant().Equals("BLU-RAY PLAYLIST")))
                {
                    job.DemuxMode        = 0;
                    job.AudioTracksDemux = job.AudioTracks;
                    job.AudioTracks      = new List <AudioTrackInfo>();
                    if (txtContainerInformation.Text.Trim().ToUpperInvariant().Equals("MATROSKA"))
                    {
                        MkvExtractJob extractJob = new MkvExtractJob(videoInput, Path.GetDirectoryName(this.output.Filename), job.AudioTracksDemux);
                        prepareJobs = new SequentialChain(prepareJobs, new SequentialChain(extractJob));
                    }
                }
                prepareJobs = new SequentialChain(prepareJobs, new SequentialChain(job));
                MainForm.Instance.Jobs.AddJobsWithDependencies(prepareJobs, true);
                if (this.closeOnQueue.Checked)
                {
                    this.Close();
                }
                break;
            }

            case IndexType.LSMASH:
            {
                LSMASHIndexJob job = generateLSMASHIndexJob(videoInput);
                if (job.DemuxMode > 0 && job.AudioTracks.Count > 0 &&
                    (txtContainerInformation.Text.Trim().ToUpperInvariant().Equals("MATROSKA") ||
                     txtContainerInformation.Text.Trim().ToUpperInvariant().Equals("BLU-RAY PLAYLIST")))
                {
                    job.DemuxMode        = 0;
                    job.AudioTracksDemux = job.AudioTracks;
                    job.AudioTracks      = new List <AudioTrackInfo>();
                    if (txtContainerInformation.Text.Trim().ToUpperInvariant().Equals("MATROSKA"))
                    {
                        MkvExtractJob extractJob = new MkvExtractJob(videoInput, Path.GetDirectoryName(this.output.Filename), job.AudioTracksDemux);
                        prepareJobs = new SequentialChain(prepareJobs, new SequentialChain(extractJob));
                    }
                }
                prepareJobs = new SequentialChain(prepareJobs, new SequentialChain(job));
                MainForm.Instance.Jobs.AddJobsWithDependencies(prepareJobs, true);
                if (this.closeOnQueue.Checked)
                {
                    this.Close();
                }
                break;
            }
            }
        }
Exemplo n.º 11
0
 public AudioCodecSettings(string id, AudioCodec codec, AudioEncoderType encoder, int bitrate, BitrateManagementMode mode)
 {
     this.id = id;
     audioCodec = codec;
     audioEncoderType = encoder;
     downmixMode = ChannelMode.KeepOriginal;
     bitrateMode = mode;
     this.bitrate = bitrate;
     delay = 0;
     delayEnabled = false;
     autoGain = true;
     forceDirectShow = false;
     applyDRC = false;
     sampleRateType = 0;
     normalize = 100;
 }
Exemplo n.º 12
0
 public AudioCodecSettings(string id, AudioCodec codec, AudioEncoderType encoder, int bitrate)
     : this(id, codec, encoder, bitrate, BitrateManagementMode.CBR)
 {
 }
Exemplo n.º 13
0
 public AudioType(string name, string filterName, string extension, ContainerType containerType, AudioCodec[] supportedCodecs)
     : base(name, filterName, extension, containerType)
 {
     this.supportedCodecs = supportedCodecs;
 }
Exemplo n.º 14
0
 public AudioType(string name, string filterName, string extension, ContainerType containerType, AudioCodec supportedCodec)
     : this(name, filterName, extension, containerType, new AudioCodec[] { supportedCodec })
 {
 }
Exemplo n.º 15
0
 public AudioEncoderType(string id, AudioCodec codec)
 {
     this.id = id;
     this.codec = codec;
 }