Ejemplo n.º 1
0
 /// <summary>
 /// Erzeugt eine neue Auswahl.
 /// </summary>
 public StreamSelection()
 {
     // Create helper
     MP2Tracks = new LanguageSelection();
     AC3Tracks = new LanguageSelection();
     SubTitles = new LanguageSelection();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Erzeugt eine neue Auswahl.
 /// </summary>
 public StreamSelection()
 {
     // Create helper
     MP2Tracks = new LanguageSelection();
     AC3Tracks = new LanguageSelection();
     SubTitles = new LanguageSelection();
 }
        /// <summary>
        /// Erzeugt eine Kopie diese Auswahlbeschreibung.
        /// </summary>
        /// <returns>Die gewünschte Kopie.</returns>
        public LanguageSelection Clone()
        {
            // Create core
            LanguageSelection clone = new LanguageSelection();

            // Fill
            clone.Languages.AddRange(Languages);
            clone.LanguageMode = LanguageMode;

            // Report
            return(clone);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Erzeugt eine Kopie diese Auswahlbeschreibung.
        /// </summary>
        /// <returns>Die gewünschte Kopie.</returns>
        public LanguageSelection Clone()
        {
            // Create core
            LanguageSelection clone = new LanguageSelection();

            // Fill
            clone.Languages.AddRange( Languages );
            clone.LanguageMode = LanguageMode;

            // Report
            return clone;
        }
        /// <summary>
        /// Ermittelt für eine Art von Tonspur alle aktiven Datenströme.
        /// </summary>
        /// <param name="type">Die gewünschte Art der Tonspur.</param>
        /// <param name="selected">Die aktive Auswahl der Tonspuren.</param>
        /// <param name="requested">Die gewünschten Sprachen.</param>
        private void ProcessAudioSelection( AudioTypes type, LanguageSelection selected, LanguageSelection requested )
        {
            // Get method for adding streams
            Func<string, StreamBase> addConsumer;
            if (type == AudioTypes.MP2)
                addConsumer = m_TransportStream.AddAudio;
            else
                addConsumer = m_TransportStream.AddDolby;

            // Preset mode
            selected.LanguageMode = LanguageModes.All;

            // All audio
            foreach (var audio in m_OriginalSettings.AudioTracks)
                if (type == audio.AudioType)
                {
                    // Check for primary
                    if (requested.LanguageMode == LanguageModes.Primary)
                    {
                        // Register
                        AddConsumer( audio.AudioStream, StreamTypes.Audio, addConsumer( audio.Language.ToISOLanguage() ) );

                        // Copy over
                        selected.LanguageMode = LanguageModes.Primary;

                        // Remember
                        selected.Languages.Add( audio.Language );

                        // Done
                        return;
                    }

                    // Regular test
                    if (requested.Contains( audio.Language ))
                    {
                        // Register
                        AddConsumer( audio.AudioStream, StreamTypes.Audio, addConsumer( audio.Language.ToISOLanguage() ) );

                        // Remember
                        selected.Languages.Add( audio.Language );
                    }
                    else
                    {
                        // Not all
                        selected.LanguageMode = LanguageModes.Selection;
                    }
                }

            // Clear flag if no audio is used
            if (selected.LanguageMode == LanguageModes.All)
                if (selected.Languages.Count < 1)
                    selected.LanguageMode = LanguageModes.Selection;
        }
        /// <summary>
        /// Ermittelt für eine Art von Tonspur alle aktiven Datenströme.
        /// </summary>
        /// <param name="type">Die gewünschte Art der Tonspur.</param>
        /// <param name="selected">Die aktive Auswahl der Tonspuren.</param>
        /// <param name="requested">Die gewünschten Sprachen.</param>
        private void ProcessAudioSelection(AudioTypes type, LanguageSelection selected, LanguageSelection requested)
        {
            // Get method for adding streams
            Func <string, StreamBase> addConsumer;

            if (type == AudioTypes.MP2)
            {
                addConsumer = m_TransportStream.AddAudio;
            }
            else
            {
                addConsumer = m_TransportStream.AddDolby;
            }

            // Preset mode
            selected.LanguageMode = LanguageModes.All;

            // All audio
            foreach (var audio in m_OriginalSettings.AudioTracks)
            {
                if (type == audio.AudioType)
                {
                    // Check for primary
                    if (requested.LanguageMode == LanguageModes.Primary)
                    {
                        // Register
                        AddConsumer(audio.AudioStream, StreamTypes.Audio, addConsumer(audio.Language.ToISOLanguage()));

                        // Copy over
                        selected.LanguageMode = LanguageModes.Primary;

                        // Remember
                        selected.Languages.Add(audio.Language);

                        // Done
                        return;
                    }

                    // Regular test
                    if (requested.Contains(audio.Language))
                    {
                        // Register
                        AddConsumer(audio.AudioStream, StreamTypes.Audio, addConsumer(audio.Language.ToISOLanguage()));

                        // Remember
                        selected.Languages.Add(audio.Language);
                    }
                    else
                    {
                        // Not all
                        selected.LanguageMode = LanguageModes.Selection;
                    }
                }
            }

            // Clear flag if no audio is used
            if (selected.LanguageMode == LanguageModes.All)
            {
                if (selected.Languages.Count < 1)
                {
                    selected.LanguageMode = LanguageModes.Selection;
                }
            }
        }