示例#1
0
        void TestParentalLevel()
        {
            int     hr;
            int     pulParentalLevel;
            IDvdCmd ppCmd;

            AllowPlay();
            hr = m_idc2.PlayChapterInTitle(1, 2, DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd);
            DsError.ThrowExceptionForHR(hr);

            Thread.Sleep(500);

            hr = m_idc2.Stop();
            DsError.ThrowExceptionForHR(hr);

            hr = m_idc2.SelectParentalLevel(3);
            DsError.ThrowExceptionForHR(hr);

            byte[] cc2 = new byte[2];
            cc2[0] = 67; //'C'
            cc2[1] = 65; //'A'
            hr     = m_idc2.SelectParentalCountry(cc2);
            DsError.ThrowExceptionForHR(hr);

            byte[] cc = new byte[3];
            hr = m_idi2.GetPlayerParentalLevel(out pulParentalLevel, cc);
            DsError.ThrowExceptionForHR(hr);

            Debug.Assert(cc[0] == 'C' && cc[1] == 'A', "TestParentalLevel");
            Debug.Assert(pulParentalLevel == 3, "TestParentalLevel2");
        }