"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var AudioOutput_exports = {};
__export(AudioOutput_exports, {
  AudioOutput: () => AudioOutput
});
module.exports = __toCommonJS(AudioOutput_exports);
var import_MatterDefinition = require("../MatterDefinition.js");
var import_elements = require("../../elements/index.js");
/**
 * @license
 * Copyright 2022-2024 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const AudioOutput = (0, import_elements.ClusterElement)({
  name: "AudioOutput",
  id: 1291,
  classification: "application",
  pics: "AUDIOOUTPUT",
  details: "This cluster provides an interface for controlling the Output on a Video Player device such as a TV.\nThis cluster would be supported on a device with audio outputs like a Video Player device (Smart TV, TV Setup Top Box, Smart Speaker, etc).\nThis cluster provides the list of available outputs and provides commands for selecting and renaming them.\nThe cluster server for Audio Output is implemented by a device that has configurable audio output.",
  xref: { document: "cluster", section: "6.5" },
  children: [
    (0, import_elements.AttributeElement)({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 1 }),
    (0, import_elements.AttributeElement)({
      name: "FeatureMap",
      id: 65532,
      type: "FeatureMap",
      xref: { document: "cluster", section: "6.5.4" },
      children: [(0, import_elements.FieldElement)({
        name: "NU",
        constraint: "0",
        description: "NameUpdates",
        details: "Supports updates to output names"
      })]
    }),
    (0, import_elements.AttributeElement)({
      name: "OutputList",
      id: 0,
      type: "list",
      access: "R V",
      conformance: "M",
      details: "This attribute provides the list of outputs supported by the device.",
      xref: { document: "cluster", section: "6.5.6.1" },
      children: [(0, import_elements.FieldElement)({ name: "entry", type: "OutputInfoStruct" })]
    }),
    (0, import_elements.AttributeElement)({
      name: "CurrentOutput",
      id: 1,
      type: "uint8",
      access: "R V",
      conformance: "M",
      details: "This attribute contains the value of the index field of the currently selected OutputInfoStruct.",
      xref: { document: "cluster", section: "6.5.6.2" }
    }),
    (0, import_elements.CommandElement)({
      name: "SelectOutput",
      id: 0,
      access: "O",
      conformance: "M",
      direction: "request",
      response: "status",
      details: "Upon receipt, this shall change the output on the device to the output at a specific index in the Output List.\nNote that when the current output is set to an output of type HDMI, adjustments to volume via a Speaker endpoint on the same node may cause HDMI volume up/down commands to be sent to the given HDMI output.",
      xref: { document: "cluster", section: "6.5.7.1" },
      children: [(0, import_elements.FieldElement)({
        name: "Index",
        id: 0,
        type: "uint8",
        conformance: "M",
        details: "This shall indicate the index field of the OutputInfoStruct from the OutputList attribute in which to change to.",
        xref: { document: "cluster", section: "6.5.7.1.1" }
      })]
    }),
    (0, import_elements.CommandElement)({
      name: "RenameOutput",
      id: 1,
      access: "M",
      conformance: "NU",
      direction: "request",
      response: "status",
      details: "Upon receipt, this shall rename the output at a specific index in the Output List.\nUpdates to the output name shall appear in the device\u2019s settings menus. Name updates may automatically be sent to the actual device to which the output connects.",
      xref: { document: "cluster", section: "6.5.7.2" },
      children: [
        (0, import_elements.FieldElement)({ name: "Index", id: 0, type: "uint8", conformance: "M" }),
        (0, import_elements.FieldElement)({ name: "Name", id: 1, type: "string", conformance: "M" })
      ]
    }),
    (0, import_elements.DatatypeElement)({
      name: "OutputTypeEnum",
      type: "enum8",
      details: "The type of output, expressed as an enum, with the following values:",
      xref: { document: "cluster", section: "6.5.5.1" },
      children: [
        (0, import_elements.FieldElement)({ name: "Hdmi", id: 0, conformance: "M", description: "HDMI" }),
        (0, import_elements.FieldElement)({ name: "Bt", id: 1, conformance: "M" }),
        (0, import_elements.FieldElement)({ name: "Optical", id: 2, conformance: "M" }),
        (0, import_elements.FieldElement)({ name: "Headphone", id: 3, conformance: "M" }),
        (0, import_elements.FieldElement)({ name: "Internal", id: 4, conformance: "M" }),
        (0, import_elements.FieldElement)({ name: "Other", id: 5, conformance: "M" })
      ]
    }),
    (0, import_elements.DatatypeElement)({
      name: "OutputInfoStruct",
      type: "struct",
      details: "This contains information about an output.",
      xref: { document: "cluster", section: "6.5.5.2" },
      children: [
        (0, import_elements.FieldElement)({
          name: "Index",
          id: 0,
          type: "uint8",
          conformance: "M",
          details: "This field shall indicate the unique index into the list of outputs.",
          xref: { document: "cluster", section: "6.5.5.2.1" }
        }),
        (0, import_elements.FieldElement)({
          name: "OutputType",
          id: 1,
          type: "OutputTypeEnum",
          conformance: "M",
          constraint: "desc",
          details: "This field shall indicate the type of output.",
          xref: { document: "cluster", section: "6.5.5.2.2" }
        }),
        (0, import_elements.FieldElement)({
          name: "Name",
          id: 2,
          type: "string",
          conformance: "M",
          details: "The device defined and user editable output name, such as \u201CSoundbar\u201D, \u201CSpeakers\u201D. This field may be blank, but SHOULD be provided when known.",
          xref: { document: "cluster", section: "6.5.5.2.3" }
        })
      ]
    })
  ]
});
import_MatterDefinition.MatterDefinition.children.push(AudioOutput);
//# sourceMappingURL=AudioOutput.js.map
