<?xml version='1.0' encoding='UTF-8'?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cd="http://www.amwa.tv/projects/rules/01/block/DM_ContentDetails/" xmlns:cmn="http://www.amwa.tv/projects/rules/01/block/DM_Common/" targetNamespace="http://www.amwa.tv/projects/rules/01/block/DM_ContentDetails/" elementFormDefault="qualified">

  <xs:import namespace="http://www.amwa.tv/projects/rules/01/block/DM_Common/" schemaLocation="DM_Common.xsd"/>

  <xs:element name="Content_Details">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Audio_Comments" type="cmn:string127" minOccurs="0" maxOccurs="1">
          <xs:annotation>
             <xs:documentation xml:lang="en">
               A description of the subjective quality of the audio in the programme including notes on any global characteristics or audio treatments.
             </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="Video_Comments" type="cmn:string127" minOccurs="0" maxOccurs="1">
          <xs:annotation>
             <xs:documentation xml:lang="en">
               A description of the subjective quality of the video in the programme including notes on any global characteristics or video treatments.
             </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="PSE_Test_Results" minOccurs="1" maxOccurs="1">
          <xs:annotation>
            <xs:documentation xml:lang="en">A set of details and results of the PSE tests that have been carried out on the content</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="PSE_Test" type="cd:PSE_Test_type" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Audio_Loudness_Details" minOccurs="1" maxOccurs="1">
          <xs:annotation>
            <xs:documentation xml:lang="en">Details of the Audio Loudness Specification that the programme maker was working to</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Audio_Loudness_Specification" type="cd:Audio_Loudness_Specification_type" minOccurs="1" maxOccurs="1">
                <xs:annotation>
                  <xs:documentation xml:lang="en">The Audio Loudness Specification to which the maker of the programme intended the finished (ready for transmission) audio content to comply</xs:documentation>
                </xs:annotation>
              </xs:element>
              <xs:choice minOccurs="1" maxOccurs="1">
                <xs:element name="Compliance_To_Specification_Is_Achieved">
                  <xs:annotation>
                    <xs:documentation xml:lang="en">The presence of this element indicates that the finished (ready for transmission) audio content complies with the indicated Audio Loudness Specification</xs:documentation>
                  </xs:annotation>
                  <xs:complexType/>
                </xs:element>
                <xs:element name="Compliance_To_Specification_Is_Not_Achieved">
                  <xs:annotation>
                    <xs:documentation xml:lang="en">The presence of this element indicates that the finished (ready for transmission) audio content does not comply with the indicated Audio Loudness Specification</xs:documentation>
                  </xs:annotation>
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="Explanation" type="cmn:string250" minOccurs="1" maxOccurs="1">
                        <xs:annotation>
                          <xs:documentation xml:lang="en">An explanation for any failure to fully comply with all provisions of the indicated Audio Loudness Specification, such as the content being "intentionally quiet"</xs:documentation>
                        </xs:annotation>
                      </xs:element>
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:choice>
              <xs:element name="Programme_Loudness_Value" type="xs:float" minOccurs="0" maxOccurs="1">
                <xs:annotation>
                  <xs:documentation xml:lang="en">The "Programme Loudness Value" in LKFS (also knows as "LUFS") as measured in accordance with the indicated Audio Loudness Specification. It will not always be possible to reproduce the measurement without further information such as which audio channels were measured, what anchor was used, or if part of the content was excluded from the measurement. This is intended to give an indication of the degree to which the content deviates from the indicated Audio Loudness Specification.</xs:documentation>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>


  <xs:complexType name="PSE_Test_type">
    <xs:sequence>
      <xs:element name="Test_Device" type="cmn:string250" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation xml:lang="en">The name of the device used to perform the test for compliance with PSE guidelines</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Test_Passed" type="xs:boolean" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation xml:lang="en">Indicates whether or not the entire content passed a flash and pattern test for compliance with Photosensitive Epilepsy (PSE) guidelines, as implemented in the Test_Device</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="Audio_Loudness_Specification_type">
    <xs:restriction base="xs:string">
      <xs:enumeration value="EBU R 128"/>
      <xs:enumeration value="EBU R 128 s1"/>
      <xs:enumeration value="ITU-R REC BS.1864"/>
      <xs:enumeration value="FreeTV OP-59"/>
      <xs:enumeration value="FreeTV OP-48"/>
      <xs:enumeration value="ATSC A/85 (Dialog Anchor)">
        <xs:annotation>
          <xs:documentation xml:lang="en">ATSC A/85:2009 with dialog used as the Anchor Element</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ATSC A/85 (Full Program mix Anchor)">
        <xs:annotation>
            <xs:documentation xml:lang="en">ATSC A/85:2009 with all elements of the soundtrack used as the Anchor Element</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ATSC A/85 (Other Anchor)">
        <xs:annotation>
          <xs:documentation xml:lang="en">ATSC A/85:2009 when the Anchor Element is not the dialog and not all elements of the soundtrack</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>
