///
/// TimedMetadata.swift
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

import NitroModules

/**
 * Represents an instance of `TimedMetadata`, backed by a C++ struct.
 */
public typealias TimedMetadata = margelo.nitro.video.TimedMetadata

public extension TimedMetadata {
  private typealias bridge = margelo.nitro.video.bridge.swift

  /**
   * Create a new instance of `TimedMetadata`.
   */
  init(metadata: [TimedMetadataObject]) {
    self.init({ () -> bridge.std__vector_TimedMetadataObject_ in
      var __vector = bridge.create_std__vector_TimedMetadataObject_(metadata.count)
      for __item in metadata {
        __vector.push_back(__item)
      }
      return __vector
    }())
  }

  var metadata: [TimedMetadataObject] {
    @inline(__always)
    get {
      return self.__metadata.map({ __item in __item })
    }
    @inline(__always)
    set {
      self.__metadata = { () -> bridge.std__vector_TimedMetadataObject_ in
        var __vector = bridge.create_std__vector_TimedMetadataObject_(newValue.count)
        for __item in newValue {
          __vector.push_back(__item)
        }
        return __vector
      }()
    }
  }
}
