///
/// TextTrack.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 `TextTrack`, backed by a C++ struct.
 */
public typealias TextTrack = margelo.nitro.video.TextTrack

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

  /**
   * Create a new instance of `TextTrack`.
   */
  init(id: String, label: String, language: String?, selected: Bool) {
    self.init(std.string(id), std.string(label), { () -> bridge.std__optional_std__string_ in
      if let __unwrappedValue = language {
        return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
      } else {
        return .init()
      }
    }(), selected)
  }

  var id: String {
    @inline(__always)
    get {
      return String(self.__id)
    }
    @inline(__always)
    set {
      self.__id = std.string(newValue)
    }
  }
  
  var label: String {
    @inline(__always)
    get {
      return String(self.__label)
    }
    @inline(__always)
    set {
      self.__label = std.string(newValue)
    }
  }
  
  var language: String? {
    @inline(__always)
    get {
      return { () -> String? in
        if let __unwrapped = self.__language.value {
          return String(__unwrapped)
        } else {
          return nil
        }
      }()
    }
    @inline(__always)
    set {
      self.__language = { () -> bridge.std__optional_std__string_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
        } else {
          return .init()
        }
      }()
    }
  }
  
  var selected: Bool {
    @inline(__always)
    get {
      return self.__selected
    }
    @inline(__always)
    set {
      self.__selected = newValue
    }
  }
}
