Ejemplo n.º 1
0
 private static extern DVBError CDVBFrontend_GetChannel( IntPtr pData, out Channel_C rChannel );
Ejemplo n.º 2
0
 private static extern DVBError CDVBFrontend_SetChannel( IntPtr pData, Channel_C rChannel, bool bPowerOnly );
Ejemplo n.º 3
0
        /// <summary>
        /// Wählt eine Quellgruppe an.
        /// </summary>
        /// <param name="group">Die Daten zur Quellgruppe.</param>
        /// <returns>Gesetzt, wenn es sich um eine DVB-C Quellgruppe handelt.</returns>
        private bool SendChannel( CableGroup group )
        {
            // Not us
            if (group == null)
                return false;

            // Validate
            if (FrontendType != FrontendType.Cable)
                throw new DVBException( "Expected " + FrontendType.ToString() + " Channel" );

            // Helper
            var channel =
                new Channel_C
                {
                    Frequency = group.Frequency,
                    SymbolRate = group.SymbolRate,
                };

            // Spectrum inversion
            switch (group.SpectrumInversion)
            {
                case SpectrumInversions.On: channel.Inversion = SpectrumInversion.On; break;
                case SpectrumInversions.Off: channel.Inversion = SpectrumInversion.Off; break;
                case SpectrumInversions.Auto: channel.Inversion = SpectrumInversion.Auto; break;
                default: channel.Inversion = SpectrumInversion.Auto; break;
            }

            // Modulation
            switch (group.Modulation)
            {
                case CableModulations.QAM16: channel.Qam = Qam.Qam16; break;
                case CableModulations.QAM32: channel.Qam = Qam.Qam32; break;
                case CableModulations.QAM64: channel.Qam = Qam.Qam64; break;
                case CableModulations.QAM128: channel.Qam = Qam.Qam128; break;
                case CableModulations.QAM256: channel.Qam = Qam.Qam256; break;
                default: channel.Qam = Qam.Qam64; break;
            }

            // Check supported modes
            switch (group.Bandwidth)
            {
                case Bandwidths.Six: channel.Bandwidth = BandwidthType.Six; break;
                case Bandwidths.Seven: channel.Bandwidth = BandwidthType.Seven; break;
                case Bandwidths.Eight: channel.Bandwidth = BandwidthType.Eight; break;
                case Bandwidths.NotDefined: channel.Bandwidth = BandwidthType.None; break;
                default: channel.Bandwidth = BandwidthType.Auto; break;
            }

            // Process
            CheckChannel( CDVBFrontend_SetChannel( m_Class.ClassPointer, channel, false ) );

            // Check up for synchronisation
            Channel_C val1, val2;

            // Get channel twice
            CheckChannel( CDVBFrontend_GetChannel( m_Class.ClassPointer, out val1 ) );
            CheckChannel( CDVBFrontend_GetChannel( m_Class.ClassPointer, out val2 ) );

            // Did it
            return true;
        }
Ejemplo n.º 4
0
 private static extern DVBError CDVBFrontend_GetChannel(IntPtr pData, out Channel_C rChannel);
Ejemplo n.º 5
0
 private static extern DVBError CDVBFrontend_SetChannel(IntPtr pData, Channel_C rChannel, bool bPowerOnly);
Ejemplo n.º 6
0
        /// <summary>
        /// Wählt eine Quellgruppe an.
        /// </summary>
        /// <param name="group">Die Daten zur Quellgruppe.</param>
        /// <returns>Gesetzt, wenn es sich um eine DVB-C Quellgruppe handelt.</returns>
        private bool SendChannel(CableGroup group)
        {
            // Not us
            if (group == null)
            {
                return(false);
            }

            // Validate
            if (FrontendType != FrontendType.Cable)
            {
                throw new DVBException("Expected " + FrontendType.ToString() + " Channel");
            }

            // Helper
            var channel =
                new Channel_C
            {
                Frequency  = group.Frequency,
                SymbolRate = group.SymbolRate,
            };

            // Spectrum inversion
            switch (group.SpectrumInversion)
            {
            case SpectrumInversions.On: channel.Inversion = SpectrumInversion.On; break;

            case SpectrumInversions.Off: channel.Inversion = SpectrumInversion.Off; break;

            case SpectrumInversions.Auto: channel.Inversion = SpectrumInversion.Auto; break;

            default: channel.Inversion = SpectrumInversion.Auto; break;
            }

            // Modulation
            switch (group.Modulation)
            {
            case CableModulations.QAM16: channel.Qam = Qam.Qam16; break;

            case CableModulations.QAM32: channel.Qam = Qam.Qam32; break;

            case CableModulations.QAM64: channel.Qam = Qam.Qam64; break;

            case CableModulations.QAM128: channel.Qam = Qam.Qam128; break;

            case CableModulations.QAM256: channel.Qam = Qam.Qam256; break;

            default: channel.Qam = Qam.Qam64; break;
            }

            // Check supported modes
            switch (group.Bandwidth)
            {
            case Bandwidths.Six: channel.Bandwidth = BandwidthType.Six; break;

            case Bandwidths.Seven: channel.Bandwidth = BandwidthType.Seven; break;

            case Bandwidths.Eight: channel.Bandwidth = BandwidthType.Eight; break;

            case Bandwidths.NotDefined: channel.Bandwidth = BandwidthType.None; break;

            default: channel.Bandwidth = BandwidthType.Auto; break;
            }

            // Process
            CheckChannel(CDVBFrontend_SetChannel(m_Class.ClassPointer, channel, false));

            // Check up for synchronisation
            Channel_C val1, val2;

            // Get channel twice
            CheckChannel(CDVBFrontend_GetChannel(m_Class.ClassPointer, out val1));
            CheckChannel(CDVBFrontend_GetChannel(m_Class.ClassPointer, out val2));

            // Did it
            return(true);
        }