import * as VScript from "http://172.16.0.12/bladerunner_sdk/vscript@2.5.2/deno/release/mod.ts";
import * as VAPI from "./mod.ts";
export const lift = {
  VideoLimitationBandwidth: (
    _raw: [VAPI.Definitions.Bandwidth],
    _socket: VScript.VSocket,
  ): VideoLimitationBandwidth => {
    return { max_bandwidth: _raw[0] };
  },
  Buffer: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) =>
    new Buffer(_raw),
  Capabilities: (
    _raw: [
      null | ([0, [number]] | [1, [number]]),
      VAPI.VideoRePlay.DelayMode,
      (
        | [
            0,
            [
              boolean,
              [0, [VAPI.Video.Standard]] | [1, [VAPI.Definitions.Bandwidth]],
            ],
          ]
        | [1, [VAPI.Video.SquareDivisionStandard]]
      ),
    ],
    _socket: VScript.VSocket,
  ): Capabilities => {
    return {
      capacity:
        _raw[0] === null
          ? null
          : VAPI.VideoPlayer.lift.AllocationMode(_raw[0], _socket),
      delay_mode: _raw[1],
      input_caliber: VAPI.VideoRePlay.lift.InputCaliber(_raw[2], _socket),
    };
  },
  DMA: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) => new DMA(_raw),
  File: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) => new File(_raw),
  GroupSelections: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) =>
    new GroupSelections(_raw),
  Http: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) => new Http(_raw),
  InputCaliber: (
    _raw:
      | [
          0,
          [
            boolean,
            [0, [VAPI.Video.Standard]] | [1, [VAPI.Definitions.Bandwidth]],
          ],
        ]
      | [1, [VAPI.Video.SquareDivisionStandard]],
    _socket: VScript.VSocket,
  ): InputCaliber => {
    switch (_raw[0]) {
      case 0:
        return {
          variant: "Single",
          value: VAPI.VideoRePlay.lift.SingleSettings(_raw[1], _socket),
        };
      case 1:
        return {
          variant: "Square_division",
          value: VAPI.VideoRePlay.lift.SquareSettings(_raw[1], _socket),
        };
    }
  },
  InputDebug: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) =>
    new InputDebug(_raw),
  MemoryCapacity: (
    _raw: [
      number,
      number,
      [null | number, null | number],
      [null | number, null | number],
      null | VAPI.Video.Standard,
    ],
    _socket: VScript.VSocket,
  ): MemoryCapacity => {
    return {
      as_pages: _raw[0],
      as_bytes: _raw[1],
      as_requested: VAPI.VideoRePlay.lift.MemoryCapacityAsRequested(
        _raw[2],
        _socket,
      ),
      as_allocated: VAPI.VideoRePlay.lift.MemoryCapacityAsAllocated(
        _raw[3],
        _socket,
      ),
      calculation_standard: _raw[4],
    };
  },
  OutputDebug: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) =>
    new OutputDebug(_raw),
  Reader: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) =>
    new Reader(_raw),
  SingleSettings: (
    _raw: [
      boolean,
      [0, [VAPI.Video.Standard]] | [1, [VAPI.Definitions.Bandwidth]],
    ],
    _socket: VScript.VSocket,
  ): SingleSettings => {
    return {
      add_blanking: _raw[0],
      constraints: VAPI.VideoRePlay.lift.VideoLimitation(_raw[1], _socket),
    };
  },
  SquareSettings: (
    _raw: [VAPI.Video.SquareDivisionStandard],
    _socket: VScript.VSocket,
  ): SquareSettings => {
    return {
      standard: _raw[0],
    };
  },
  VideoLimitationStandard: (
    _raw: [VAPI.Video.Standard],
    _socket: VScript.VSocket,
  ): VideoLimitationStandard => {
    return {
      standard: _raw[0],
    };
  },
  VideoLimitation: (
    _raw: [0, [VAPI.Video.Standard]] | [1, [VAPI.Definitions.Bandwidth]],
    _socket: VScript.VSocket,
  ): VideoLimitation => {
    switch (_raw[0]) {
      case 0:
        return {
          variant: "Standard",
          value: VAPI.VideoRePlay.lift.VideoLimitationStandard(
            _raw[1],
            _socket,
          ),
        };
      case 1:
        return {
          variant: "Bandwidth",
          value: VAPI.VideoRePlay.lift.VideoLimitationBandwidth(
            _raw[1],
            _socket,
          ),
        };
    }
  },
  Writer: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) =>
    new Writer(_raw),
  MemoryCapacityAsAllocated: (
    _raw: [null | number, null | number],
    _socket: VScript.VSocket,
  ): MemoryCapacityAsAllocated => {
    return {
      frames: _raw[0],
      time:
        _raw[1] === null
          ? null
          : VScript.VAPIHelpers.liftNanoseconds(_raw[1], _socket),
    };
  },
  MemoryCapacityAsRequested: (
    _raw: [null | number, null | number],
    _socket: VScript.VSocket,
  ): MemoryCapacityAsRequested => {
    return {
      frames: _raw[0],
      time:
        _raw[1] === null
          ? null
          : VScript.VAPIHelpers.liftNanoseconds(_raw[1], _socket),
    };
  },
  BufferCurrentDelay: (
    _raw: [null | number, null | number],
    _socket: VScript.VSocket,
  ): BufferCurrentDelay => {
    return {
      as_frames: _raw[0],
      as_time:
        _raw[1] === null
          ? null
          : VScript.VAPIHelpers.liftNanoseconds(_raw[1], _socket),
    };
  },
} as const;
export const lower = {
  VideoLimitationBandwidth: (
    _x: { max_bandwidth: VAPI.Definitions.Bandwidth },
    _socket: VScript.VSocket,
  ): [VAPI.Definitions.Bandwidth] => [_x.max_bandwidth],
  Buffer: (_x: Buffer) => _x.raw.kwl,
  Capabilities: (
    _x: {
      capacity: null | VAPI.VideoPlayer.AllocationMode;
      delay_mode: VAPI.VideoRePlay.DelayMode;
      input_caliber: VAPI.VideoRePlay.InputCaliber;
    },
    _socket: VScript.VSocket,
  ): [
    null | ([0, [number]] | [1, [number]]),
    VAPI.VideoRePlay.DelayMode,
    (
      | [
          0,
          [
            boolean,
            [0, [VAPI.Video.Standard]] | [1, [VAPI.Definitions.Bandwidth]],
          ],
        ]
      | [1, [VAPI.Video.SquareDivisionStandard]]
    ),
  ] => [
    _x.capacity === null
      ? null
      : VAPI.VideoPlayer.lower.AllocationMode(_x.capacity, _socket),
    _x.delay_mode,
    VAPI.VideoRePlay.lower.InputCaliber(_x.input_caliber, _socket),
  ],
  DMA: (_x: DMA) => _x.raw.kwl,
  File: (_x: File) => _x.raw.kwl,
  GroupSelections: (_x: GroupSelections) => _x.raw.kwl,
  Http: (_x: Http) => _x.raw.kwl,
  InputCaliber: (
    _x:
      | { variant: "Single"; value: VAPI.VideoRePlay.SingleSettings }
      | { variant: "Square_division"; value: VAPI.VideoRePlay.SquareSettings },
    _socket: VScript.VSocket,
  ):
    | [
        0,
        [
          boolean,
          [0, [VAPI.Video.Standard]] | [1, [VAPI.Definitions.Bandwidth]],
        ],
      ]
    | [1, [VAPI.Video.SquareDivisionStandard]] => {
    switch (_x.variant) {
      case "Single":
        return [0, VAPI.VideoRePlay.lower.SingleSettings(_x.value, _socket)];
      case "Square_division":
        return [1, VAPI.VideoRePlay.lower.SquareSettings(_x.value, _socket)];
    }
  },
  InputDebug: (_x: InputDebug) => _x.raw.kwl,
  MemoryCapacity: (
    _x: {
      as_pages: VAPI.Primitives.Unsigned16;
      as_bytes: VAPI.Primitives.Unsigned64;
      as_requested: VAPI.VideoRePlay.MemoryCapacityAsRequested;
      as_allocated: VAPI.VideoRePlay.MemoryCapacityAsAllocated;

      /**
                  This standard is used to calculate the required memory. It
                  is derived from the (add_blanking, video_limitation,
                  Frames, Time) settings
                */
      calculation_standard: null | VAPI.Video.Standard;
    },
    _socket: VScript.VSocket,
  ): [
    number,
    number,
    [null | number, null | number],
    [null | number, null | number],
    null | VAPI.Video.Standard,
  ] => [
    _x.as_pages,
    _x.as_bytes,
    VAPI.VideoRePlay.lower.MemoryCapacityAsRequested(_x.as_requested, _socket),
    VAPI.VideoRePlay.lower.MemoryCapacityAsAllocated(_x.as_allocated, _socket),
    _x.calculation_standard,
  ],
  OutputDebug: (_x: OutputDebug) => _x.raw.kwl,
  Reader: (_x: Reader) => _x.raw.kwl,
  SingleSettings: (
    _x: {
      add_blanking: boolean;
      constraints: VAPI.VideoRePlay.VideoLimitation;
    },
    _socket: VScript.VSocket,
  ): [
    boolean,
    [0, [VAPI.Video.Standard]] | [1, [VAPI.Definitions.Bandwidth]],
  ] => [
    _x.add_blanking,
    VAPI.VideoRePlay.lower.VideoLimitation(_x.constraints, _socket),
  ],
  SquareSettings: (
    _x: { standard: VAPI.Video.SquareDivisionStandard },
    _socket: VScript.VSocket,
  ): [VAPI.Video.SquareDivisionStandard] => [_x.standard],
  VideoLimitationStandard: (
    _x: { standard: VAPI.Video.Standard },
    _socket: VScript.VSocket,
  ): [VAPI.Video.Standard] => [_x.standard],
  VideoLimitation: (
    _x:
      | { variant: "Standard"; value: VAPI.VideoRePlay.VideoLimitationStandard }
      | {
          variant: "Bandwidth";
          value: VAPI.VideoRePlay.VideoLimitationBandwidth;
        },
    _socket: VScript.VSocket,
  ): [0, [VAPI.Video.Standard]] | [1, [VAPI.Definitions.Bandwidth]] => {
    switch (_x.variant) {
      case "Standard":
        return [
          0,
          VAPI.VideoRePlay.lower.VideoLimitationStandard(_x.value, _socket),
        ];
      case "Bandwidth":
        return [
          1,
          VAPI.VideoRePlay.lower.VideoLimitationBandwidth(_x.value, _socket),
        ];
    }
  },
  Writer: (_x: Writer) => _x.raw.kwl,
  MemoryCapacityAsAllocated: (
    _x: { frames: null | number; time: null | VScript.Duration },
    _socket: VScript.VSocket,
  ): [null | number, null | number] => [
    _x.frames,
    _x.time === null
      ? null
      : VScript.VAPIHelpers.lowerNanoseconds(_x.time, _socket),
  ],
  MemoryCapacityAsRequested: (
    _x: { frames: null | number; time: null | VScript.Duration },
    _socket: VScript.VSocket,
  ): [null | number, null | number] => [
    _x.frames,
    _x.time === null
      ? null
      : VScript.VAPIHelpers.lowerNanoseconds(_x.time, _socket),
  ],
  BufferCurrentDelay: (
    _x: { as_frames: null | number; as_time: null | VScript.Duration },
    _socket: VScript.VSocket,
  ): [null | number, null | number] => [
    _x.as_frames,
    _x.as_time === null
      ? null
      : VScript.VAPIHelpers.lowerNanoseconds(_x.as_time, _socket),
  ],
} as const;
export interface VideoLimitationBandwidth {
  max_bandwidth: VAPI.Definitions.Bandwidth;
}
export class Buffer
  implements VScript.Referenceable<"VideoRePlay::Data::Buffer">
{
  readonly type_identifier = "VideoRePlay::Data::Buffer" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}
  get offset(): VScript.dKeyword<
    VScript.VSocket,
    null | ([0, [number]] | [1, [number]]),
    null | ([0, [number]] | [1, [number]]),
    null | VAPI.VideoPlayer.AllocationMode,
    null | VAPI.VideoPlayer.AllocationMode,
    VAPI.VideoRePlay.Buffer
  > {
    return new VScript.dKeyword<
      VScript.VSocket,
      null | ([0, [number]] | [1, [number]]),
      null | ([0, [number]] | [1, [number]]),
      null | VAPI.VideoPlayer.AllocationMode,
      null | VAPI.VideoPlayer.AllocationMode,
      VAPI.VideoRePlay.Buffer
    >(
      this,
      "offset" as VScript.SysName,
      {
        lift: VScript.VAPIHelpers.liftOrLowerNullable(
          VAPI.VideoPlayer.lift.AllocationMode,
        ),
        lower: VScript.VAPIHelpers.liftOrLowerNullable(
          VAPI.VideoPlayer.lower.AllocationMode,
        ),
      },
      {
        lift: VScript.VAPIHelpers.liftOrLowerNullable(
          VAPI.VideoPlayer.lift.AllocationMode,
        ),
        lower: VScript.VAPIHelpers.liftOrLowerNullable(
          VAPI.VideoPlayer.lower.AllocationMode,
        ),
      },
      (
        parent: VAPI.VideoRePlay.Buffer,
        command: null | VAPI.VideoPlayer.AllocationMode,
      ) => (
        void parent,
        void command,
        {
          criterion: "status",
          validator: (status: null | VAPI.VideoPlayer.AllocationMode) =>
            (command === null && status === null) ||
            (command !== null &&
              status !== null &&
              ((command.variant === "Frames" &&
                status.variant === "Frames" &&
                status.value.frames >= command.value.frames) ||
                (command.variant === "Time" &&
                  status.variant === "Time" &&
                  status.value.time.s() >= command.value.time.s()))),
        }
      ),
    );
  }
  get current_delay(): VScript.rKeyword<
    VScript.VSocket,
    null | [null | number, null | number],
    null | VAPI.VideoRePlay.BufferCurrentDelay,
    VAPI.VideoRePlay.Buffer
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | [null | number, null | number],
      null | VAPI.VideoRePlay.BufferCurrentDelay,
      VAPI.VideoRePlay.Buffer
    >(this, "current_delay" as VScript.SysName, {
      lift: VScript.VAPIHelpers.liftOrLowerNullable(
        VAPI.VideoRePlay.lift.BufferCurrentDelay,
      ),
      lower: VScript.VAPIHelpers.liftOrLowerNullable(
        VAPI.VideoRePlay.lower.BufferCurrentDelay,
      ),
    });
  }
}
export type BufferMode = "Frames" | "Time";
export interface Capabilities {
  capacity: null | VAPI.VideoPlayer.AllocationMode;
  delay_mode: VAPI.VideoRePlay.DelayMode;
  input_caliber: VAPI.VideoRePlay.InputCaliber;
}
export class DMA implements VScript.Referenceable<"VideoRePlay::Data::DMA"> {
  readonly type_identifier = "VideoRePlay::Data::DMA" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}
  get file() {
    return VAPI.VideoRePlay.lift.File(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 0, "file"),
    );
  }
  get http() {
    return VAPI.VideoRePlay.lift.Http(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 1, "http"),
    );
  }
}
export type DelayMode = "FrameSync_Freeze" | "FrameSync_Black" | "FramePhaser";
export type DmaTrigger = "frame" | "clip_in_files" | "clip_single_file";
export type DmaTriggerSetup = "Stop" | "Restart";
export type DmaTriggerSetupStatus = "Stop" | "Restart" | "Process" | "Done";
export class File implements VScript.Referenceable<"VideoRePlay::Data::File"> {
  readonly type_identifier = "VideoRePlay::Data::File" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}

  /**
    Trigger DMA writer
  */
  get trigger_dma_writer(): VScript.wKeyword<
    VScript.VSocket,
    VAPI.Primitives.Button,
    VAPI.Primitives.Button,
    VAPI.VideoRePlay.File
  > {
    return new VScript.wKeyword<
      VScript.VSocket,
      VAPI.Primitives.Button,
      VAPI.Primitives.Button,
      VAPI.VideoRePlay.File
    >(
      this,
      "trigger_dma_writer" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }

  /**
    Trigger DMA reader
  */
  get trigger_dma_reader(): VScript.wKeyword<
    VScript.VSocket,
    VAPI.Primitives.Button,
    VAPI.Primitives.Button,
    VAPI.VideoRePlay.File
  > {
    return new VScript.wKeyword<
      VScript.VSocket,
      VAPI.Primitives.Button,
      VAPI.Primitives.Button,
      VAPI.VideoRePlay.File
    >(
      this,
      "trigger_dma_reader" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
  get setup_dma_reader(): VScript.rwKeyword<
    VScript.VSocket,
    VAPI.VideoRePlay.DmaTrigger,
    VAPI.VideoRePlay.DmaTrigger,
    VAPI.VideoRePlay.DmaTrigger,
    VAPI.VideoRePlay.DmaTrigger,
    VAPI.VideoRePlay.File
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      VAPI.VideoRePlay.DmaTrigger,
      VAPI.VideoRePlay.DmaTrigger,
      VAPI.VideoRePlay.DmaTrigger,
      VAPI.VideoRePlay.DmaTrigger,
      VAPI.VideoRePlay.File
    >(
      this,
      "setup_dma_reader" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
}
export class GroupSelections
  implements VScript.Referenceable<"VideoRePlay::Data::GroupSelections">
{
  readonly type_identifier = "VideoRePlay::Data::GroupSelections" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}
  get group(): VScript.dKeyword<
    VScript.VSocket,
    null | VAPI.VideoRePlay.Groups,
    null | VAPI.VideoRePlay.Groups,
    null | VAPI.VideoRePlay.Groups,
    null | VAPI.VideoRePlay.Groups,
    VAPI.VideoRePlay.GroupSelections
  > {
    return new VScript.dKeyword<
      VScript.VSocket,
      null | VAPI.VideoRePlay.Groups,
      null | VAPI.VideoRePlay.Groups,
      null | VAPI.VideoRePlay.Groups,
      null | VAPI.VideoRePlay.Groups,
      VAPI.VideoRePlay.GroupSelections
    >(
      this,
      "group" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
}
export type Groups = "Group0" | "Group1" | "Group2" | "Group3";
export class Http implements VScript.Referenceable<"VideoRePlay::Data::Http"> {
  readonly type_identifier = "VideoRePlay::Data::Http" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}

  /**
    before initiate the dma download process, stop the writer/reader. If the
    job ist done, restart the writer/reader
  */
  get setup_handler(): VScript.rwKeyword<
    VScript.VSocket,
    null | VAPI.VideoRePlay.DmaTriggerSetup,
    null | VAPI.VideoRePlay.DmaTriggerSetup,
    null | VAPI.VideoRePlay.DmaTriggerSetup,
    null | VAPI.VideoRePlay.DmaTriggerSetup,
    VAPI.VideoRePlay.Http
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      null | VAPI.VideoRePlay.DmaTriggerSetup,
      null | VAPI.VideoRePlay.DmaTriggerSetup,
      null | VAPI.VideoRePlay.DmaTriggerSetup,
      null | VAPI.VideoRePlay.DmaTriggerSetup,
      VAPI.VideoRePlay.Http
    >(
      this,
      "setup_handler" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
  get handler_status(): VScript.rKeyword<
    VScript.VSocket,
    null | VAPI.VideoRePlay.DmaTriggerSetupStatus,
    null | VAPI.VideoRePlay.DmaTriggerSetupStatus,
    VAPI.VideoRePlay.Http
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | VAPI.VideoRePlay.DmaTriggerSetupStatus,
      null | VAPI.VideoRePlay.DmaTriggerSetupStatus,
      VAPI.VideoRePlay.Http
    >(this, "handler_status" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
}
export type InputCaliber =
  | { variant: "Single"; value: VAPI.VideoRePlay.SingleSettings }
  | { variant: "Square_division"; value: VAPI.VideoRePlay.SquareSettings };
export class InputDebug
  implements VScript.Referenceable<"VideoRePlay::Data::InputDebug">
{
  readonly type_identifier = "VideoRePlay::Data::InputDebug" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}
  get writer_id(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "writer_id" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get stride_line(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "stride_line" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get stride_frame(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "stride_frame" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get start_address(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "start_address" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get end_address(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "end_address" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get num_lines(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "num_lines" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get horizontal_blanking(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "horizontal_blanking" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get horizontal_error(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "horizontal_error" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get horizontal_active(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "horizontal_active" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get mode_hanc(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "mode_hanc" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get mode_vanc(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "mode_vanc" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get mode_enable(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "mode_enable" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get mode_interlaced(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "mode_interlaced" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get mode_stop(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "mode_stop" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get mode_en_cnt(): VScript.rKeyword<
    VScript.VSocket,
    number,
    VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      number,
      VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "mode_en_cnt" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get delta_time(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VScript.Duration,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VScript.Duration,
      VAPI.VideoRePlay.InputDebug
    >(this, "delta_time" as VScript.SysName, {
      lift: VScript.VAPIHelpers.liftOrLowerNullable(
        VScript.VAPIHelpers.liftSeconds,
      ),
      lower: VScript.VAPIHelpers.liftOrLowerNullable(
        VScript.VAPIHelpers.lowerSeconds,
      ),
    });
  }
  get time_from_start(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VScript.Duration,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VScript.Duration,
      VAPI.VideoRePlay.InputDebug
    >(this, "time_from_start" as VScript.SysName, {
      lift: VScript.VAPIHelpers.liftOrLowerNullable(
        VScript.VAPIHelpers.liftSeconds,
      ),
      lower: VScript.VAPIHelpers.liftOrLowerNullable(
        VScript.VAPIHelpers.lowerSeconds,
      ),
    });
  }
  get delta_start_address(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "delta_start_address" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get frame_start_address(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.InputDebug
    >(this, "frame_start_address" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get in_panic(): VScript.rKeyword<
    VScript.VSocket,
    boolean,
    boolean,
    VAPI.VideoRePlay.InputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      boolean,
      boolean,
      VAPI.VideoRePlay.InputDebug
    >(this, "in_panic" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
}
export type InputMode = "Single" | "Quad" | "UHD";
export interface MemoryCapacity {
  as_pages: VAPI.Primitives.Unsigned16;
  as_bytes: VAPI.Primitives.Unsigned64;
  as_requested: VAPI.VideoRePlay.MemoryCapacityAsRequested;
  as_allocated: VAPI.VideoRePlay.MemoryCapacityAsAllocated;

  /**
    This standard is used to calculate the required memory. It is derived
    from the (add_blanking, video_limitation, Frames, Time) settings
  */
  calculation_standard: null | VAPI.Video.Standard;
}
export class OutputDebug
  implements VScript.Referenceable<"VideoRePlay::Data::OutputDebug">
{
  readonly type_identifier = "VideoRePlay::Data::OutputDebug" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}
  get reader_id(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "reader_id" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get reader_v_idx(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "reader_v_idx" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get reader_w_idx(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "reader_w_idx" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get start_first_active_line_field_0(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "start_first_active_line_field_0" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get end_first_blanking_line_field_0(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "end_first_blanking_line_field_0" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get start_first_active_line_field_1(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "start_first_active_line_field_1" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get end_first_blanking_line_field_1(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "end_first_blanking_line_field_1" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get line_number_field_0(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "line_number_field_0" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get line_number_field_1(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "line_number_field_1" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get line_total(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "line_total" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get start_line_number_generator(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "start_line_number_generator" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get start_v_flag_generator(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "start_v_flag_generator" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get horizontal_blanking(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "horizontal_blanking" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get horizontal_active(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "horizontal_active" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get mode_hanc(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "mode_hanc" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get mode_vanc(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "mode_vanc" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get mode_video(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "mode_video" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get mode_en_cnt(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "mode_en_cnt" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get ce_sel(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "ce_sel" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get ce_sel_enable(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "ce_sel_enable" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get length_frame(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "length_frame" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get length_line(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "length_line" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get stride_line(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "stride_line" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get stride_frame(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "stride_frame" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get start_address(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "start_address" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get end_address(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "end_address" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get jump(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "jump" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get reset(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "reset" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get start_generator(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "start_generator" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get delta_frame(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | number,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | number,
      VAPI.VideoRePlay.OutputDebug
    >(this, "delta_frame" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get delta_time(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VScript.Duration,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VScript.Duration,
      VAPI.VideoRePlay.OutputDebug
    >(this, "delta_time" as VScript.SysName, {
      lift: VScript.VAPIHelpers.liftOrLowerNullable(
        VScript.VAPIHelpers.liftSeconds,
      ),
      lower: VScript.VAPIHelpers.liftOrLowerNullable(
        VScript.VAPIHelpers.lowerSeconds,
      ),
    });
  }
  get time_from_start(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VScript.Duration,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VScript.Duration,
      VAPI.VideoRePlay.OutputDebug
    >(this, "time_from_start" as VScript.SysName, {
      lift: VScript.VAPIHelpers.liftOrLowerNullable(
        VScript.VAPIHelpers.liftSeconds,
      ),
      lower: VScript.VAPIHelpers.liftOrLowerNullable(
        VScript.VAPIHelpers.lowerSeconds,
      ),
    });
  }
  get delta_start_address(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "delta_start_address" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get frame_start_address(): VScript.rKeyword<
    VScript.VSocket,
    null | number,
    null | VAPI.Primitives.Unsigned32,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      null | number,
      null | VAPI.Primitives.Unsigned32,
      VAPI.VideoRePlay.OutputDebug
    >(this, "frame_start_address" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get register_panic(): VScript.rKeyword<
    VScript.VSocket,
    boolean,
    boolean,
    VAPI.VideoRePlay.OutputDebug
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      boolean,
      boolean,
      VAPI.VideoRePlay.OutputDebug
    >(this, "register_panic" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
}
export class Reader
  implements VScript.Referenceable<"VideoRePlay::Data::Reader">
{
  readonly type_identifier = "VideoRePlay::Data::Reader" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}
  get active(): VScript.rKeyword<
    VScript.VSocket,
    boolean,
    boolean,
    VAPI.VideoRePlay.Reader
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      boolean,
      boolean,
      VAPI.VideoRePlay.Reader
    >(this, "active" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get debug() {
    return VAPI.VideoRePlay.lift.OutputDebug(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 1, "debug"),
    );
  }
}
export interface SingleSettings {
  add_blanking: boolean;
  constraints: VAPI.VideoRePlay.VideoLimitation;
}
export interface SquareSettings {
  standard: VAPI.Video.SquareDivisionStandard;
}
export interface VideoLimitationStandard {
  standard: VAPI.Video.Standard;
}
export type VideoLimitation =
  | { variant: "Standard"; value: VAPI.VideoRePlay.VideoLimitationStandard }
  | { variant: "Bandwidth"; value: VAPI.VideoRePlay.VideoLimitationBandwidth };
export class Writer
  implements VScript.Referenceable<"VideoRePlay::Data::Writer">
{
  readonly type_identifier = "VideoRePlay::Data::Writer" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}
  get active(): VScript.rKeyword<
    VScript.VSocket,
    boolean,
    boolean,
    VAPI.VideoRePlay.Writer
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      boolean,
      boolean,
      VAPI.VideoRePlay.Writer
    >(this, "active" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get debug() {
    return VAPI.VideoRePlay.lift.InputDebug(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 1, "debug"),
    );
  }
}
export interface MemoryCapacityAsAllocated {
  frames: null | number;
  time: null | VScript.Duration;
}
export interface MemoryCapacityAsRequested {
  frames: null | number;
  time: null | VScript.Duration;
}
export interface BufferCurrentDelay {
  as_frames: null | number;
  as_time: null | VScript.Duration;
}
export type DelayIssues = {
  missing_input_standard: boolean;
  missing_latched_standard: boolean;
  missing_timesource: boolean;
  out_of_memory: boolean;
  out_of_readers: boolean;
  out_of_writers: boolean;
};
export const Enums = {
  InputMode: ["Single", "Quad", "UHD"] as InputMode[],
  Groups: ["Group0", "Group1", "Group2", "Group3"] as Groups[],
  DmaTriggerSetupStatus: [
    "Stop",
    "Restart",
    "Process",
    "Done",
  ] as DmaTriggerSetupStatus[],
  DmaTriggerSetup: ["Stop", "Restart"] as DmaTriggerSetup[],
  DmaTrigger: ["frame", "clip_in_files", "clip_single_file"] as DmaTrigger[],
  DelayMode: [
    "FrameSync_Freeze",
    "FrameSync_Black",
    "FramePhaser",
  ] as DelayMode[],
  BufferMode: ["Frames", "Time"] as BufferMode[],
} as const;
