/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MatterDefinition } from "../MatterDefinition.js";
import {
  ClusterElement as Cluster,
  AttributeElement as Attribute,
  FieldElement as Field,
  EventElement as Event,
  CommandElement as Command,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const MediaPlayback = Cluster(
  { name: "MediaPlayback", id: 1286, classification: "application" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 2 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "AS", constraint: "0", title: "AdvancedSeek" }),
    Field({ name: "VS", constraint: "1", title: "VariableSpeed" }),
    Field({ name: "TT", constraint: "2", title: "TextTracks" }),
    Field({ name: "AT", constraint: "3", title: "AudioTracks" }),
    Field({ name: "AA", constraint: "4", title: "AudioAdvance" })
  ),
  Attribute({ name: "CurrentState", id: 0, type: "PlaybackStateEnum", access: "R V", conformance: "M", constraint: "desc" }),
  Attribute({
    name: "StartTime",
    id: 1,
    type: "epoch-us",
    access: "R V",
    conformance: "AS",
    constraint: "desc",
    default: null,
    quality: "X"
  }),
  Attribute({
    name: "Duration",
    id: 2,
    type: "uint64",
    access: "R V",
    conformance: "AS",
    constraint: "desc",
    default: null,
    quality: "X"
  }),
  Attribute({
    name: "SampledPosition",
    id: 3,
    type: "PlaybackPositionStruct",
    access: "R V",
    conformance: "AS",
    constraint: "desc",
    default: null,
    quality: "X"
  }),
  Attribute({
    name: "PlaybackSpeed",
    id: 4,
    type: "single",
    access: "R V",
    conformance: "AS",
    constraint: "desc",
    default: 0
  }),
  Attribute({
    name: "SeekRangeEnd",
    id: 5,
    type: "uint64",
    access: "R V",
    conformance: "AS",
    constraint: "desc",
    default: null,
    quality: "X"
  }),
  Attribute({
    name: "SeekRangeStart",
    id: 6,
    type: "uint64",
    access: "R V",
    conformance: "AS",
    constraint: "desc",
    default: null,
    quality: "X"
  }),
  Attribute({
    name: "ActiveAudioTrack",
    id: 7,
    type: "TrackStruct",
    access: "R V",
    conformance: "AT",
    constraint: "desc",
    default: null,
    quality: "X"
  }),
  Attribute(
    {
      name: "AvailableAudioTracks",
      id: 8,
      type: "list",
      access: "R V",
      conformance: "AT",
      constraint: "desc",
      default: null,
      quality: "X"
    },
    Field({ name: "entry", type: "TrackStruct" })
  ),
  Attribute({
    name: "ActiveTextTrack",
    id: 9,
    type: "TrackStruct",
    access: "R V",
    conformance: "TT",
    constraint: "desc",
    default: null,
    quality: "X"
  }),
  Attribute(
    {
      name: "AvailableTextTracks",
      id: 10,
      type: "list",
      access: "R V",
      conformance: "TT",
      constraint: "desc",
      default: null,
      quality: "X"
    },
    Field({ name: "entry", type: "TrackStruct" })
  ),
  Event(
    { name: "StateChanged", id: 0, access: "V", conformance: "O", priority: "info" },
    Field({ name: "CurrentState", id: 0, type: "PlaybackStateEnum", conformance: "M", constraint: "desc" }),
    Field({ name: "StartTime", id: 1, type: "epoch-us", conformance: "AS", constraint: "desc" }),
    Field({ name: "Duration", id: 2, type: "uint64", conformance: "AS", constraint: "desc" }),
    Field({ name: "SampledPosition", id: 3, type: "PlaybackPositionStruct", conformance: "AS", constraint: "desc" }),
    Field({ name: "PlaybackSpeed", id: 4, type: "single", conformance: "AS", constraint: "desc" }),
    Field({ name: "SeekRangeEnd", id: 5, type: "uint64", conformance: "AS", constraint: "desc" }),
    Field({ name: "SeekRangeStart", id: 6, type: "uint64", conformance: "AS", constraint: "desc" }),
    Field({ name: "Data", id: 7, type: "octstr", conformance: "O", constraint: "max 900" }),
    Field({ name: "AudioAdvanceUnmuted", id: 8, type: "bool", conformance: "AA", constraint: "desc", default: false })
  ),
  Command({ name: "Play", id: 0, access: "O", conformance: "M", direction: "request", response: "PlaybackResponse" }),
  Command({ name: "Pause", id: 1, access: "O", conformance: "M", direction: "request", response: "PlaybackResponse" }),
  Command({ name: "Stop", id: 2, access: "O", conformance: "M", direction: "request", response: "PlaybackResponse" }),
  Command({ name: "StartOver", id: 3, access: "O", conformance: "O", direction: "request", response: "PlaybackResponse" }),
  Command({ name: "Previous", id: 4, access: "O", conformance: "O", direction: "request", response: "PlaybackResponse" }),
  Command({ name: "Next", id: 5, access: "O", conformance: "O", direction: "request", response: "PlaybackResponse" }),
  Command(
    { name: "Rewind", id: 6, access: "O", conformance: "VS", direction: "request", response: "PlaybackResponse" },
    Field({ name: "AudioAdvanceUnmuted", id: 0, type: "bool", conformance: "AA", default: false })
  ),
  Command(
    {
      name: "FastForward",
      id: 7,
      access: "O",
      conformance: "VS",
      direction: "request",
      response: "PlaybackResponse"
    },
    Field({ name: "AudioAdvanceUnmuted", id: 0, type: "bool", conformance: "AA", default: false })
  ),
  Command(
    {
      name: "SkipForward",
      id: 8,
      access: "O",
      conformance: "O",
      direction: "request",
      response: "PlaybackResponse"
    },
    Field({ name: "DeltaPositionMilliseconds", id: 0, type: "uint64", conformance: "M" })
  ),
  Command(
    {
      name: "SkipBackward",
      id: 9,
      access: "O",
      conformance: "O",
      direction: "request",
      response: "PlaybackResponse"
    },
    Field({ name: "DeltaPositionMilliseconds", id: 0, type: "uint64", conformance: "M" })
  ),
  Command(
    { name: "PlaybackResponse", id: 10, conformance: "M", direction: "response" },
    Field({ name: "Status", id: 0, type: "StatusEnum", conformance: "M", constraint: "desc" }),
    Field({ name: "Data", id: 1, type: "string", conformance: "O", constraint: "any" })
  ),
  Command(
    { name: "Seek", id: 11, access: "O", conformance: "AS", direction: "request", response: "PlaybackResponse" },
    Field({ name: "Position", id: 0, type: "uint64", conformance: "M" })
  ),
  Command(
    {
      name: "ActivateAudioTrack",
      id: 12,
      access: "O",
      conformance: "AT",
      direction: "request",
      response: "status"
    },
    Field({ name: "TrackId", id: 0, type: "string", conformance: "M", constraint: "max 32" }),
    Field({ name: "AudioOutputIndex", id: 1, type: "uint8", conformance: "AT", quality: "X" })
  ),
  Command(
    {
      name: "ActivateTextTrack",
      id: 13,
      access: "O",
      conformance: "TT",
      direction: "request",
      response: "status"
    },
    Field({ name: "TrackId", id: 0, type: "string", conformance: "M", constraint: "max 32" })
  ),
  Command({ name: "DeactivateTextTrack", id: 14, access: "O", conformance: "TT", direction: "request", response: "status" }),
  Datatype(
    { name: "PlaybackStateEnum", type: "enum8" },
    Field({ name: "Playing", id: 0, conformance: "M" }),
    Field({ name: "Paused", id: 1, conformance: "M" }),
    Field({ name: "NotPlaying", id: 2, conformance: "M" }),
    Field({ name: "Buffering", id: 3, conformance: "M" })
  ),
  Datatype(
    { name: "StatusEnum", type: "enum8" },
    Field({ name: "Success", id: 0, conformance: "M" }),
    Field({ name: "InvalidStateForCommand", id: 1, conformance: "M" }),
    Field({ name: "NotAllowed", id: 2, conformance: "M" }),
    Field({ name: "NotActive", id: 3, conformance: "M" }),
    Field({ name: "SpeedOutOfRange", id: 4, conformance: "VS" }),
    Field({ name: "SeekOutOfRange", id: 5, conformance: "AS" })
  ),
  Datatype(
    { name: "CharacteristicEnum", type: "enum8" },
    Field({ name: "ForcedSubtitles", id: 0, conformance: "M" }),
    Field({ name: "DescribesVideo", id: 1, conformance: "M" }),
    Field({ name: "EasyToRead", id: 2, conformance: "M" }),
    Field({ name: "FrameBased", id: 3, conformance: "M" }),
    Field({ name: "MainProgram", id: 4, conformance: "M" }),
    Field({ name: "OriginalContent", id: 5, conformance: "M" }),
    Field({ name: "VoiceOverTranslation", id: 6, conformance: "M" }),
    Field({ name: "Caption", id: 7, conformance: "M" }),
    Field({ name: "Subtitle", id: 8, conformance: "M" }),
    Field({ name: "Alternate", id: 9, conformance: "M" }),
    Field({ name: "Supplementary", id: 10, conformance: "M" }),
    Field({ name: "Commentary", id: 11, conformance: "M" }),
    Field({ name: "DubbedTranslation", id: 12, conformance: "M" }),
    Field({ name: "Description", id: 13, conformance: "M" }),
    Field({ name: "Metadata", id: 14, conformance: "M" }),
    Field({ name: "EnhancedAudioIntelligibility", id: 15, conformance: "M" }),
    Field({ name: "Emergency", id: 16, conformance: "M" }),
    Field({ name: "Karaoke", id: 17, conformance: "M" })
  ),
  Datatype(
    { name: "PlaybackPositionStruct", type: "struct" },
    Field({ name: "UpdatedAt", id: 0, type: "epoch-us", conformance: "M" }),
    Field({ name: "Position", id: 1, type: "uint64", conformance: "M", quality: "X" })
  ),
  Datatype(
    { name: "TrackStruct", type: "struct" },
    Field({ name: "Id", id: 0, type: "string", conformance: "M", constraint: "max 32" }),
    Field({ name: "TrackAttributes", id: 1, type: "TrackAttributesStruct", conformance: "M" })
  ),
  Datatype(
    { name: "TrackAttributesStruct", type: "struct" },
    Field({ name: "LanguageCode", id: 0, type: "string", conformance: "M", constraint: "max 32" }),
    Field(
      { name: "Characteristics", id: 1, type: "list", conformance: "O", default: null, quality: "X" },
      Field({ name: "entry", type: "CharacteristicEnum" })
    ),
    Field({
      name: "DisplayName",
      id: 2,
      type: "string",
      conformance: "O",
      constraint: "max 256",
      default: null,
      quality: "X"
    })
  )
);
MatterDefinition.children.push(MediaPlayback);
export {
  MediaPlayback
};
//# sourceMappingURL=media-playback.element.js.map
