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

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

  /**
   * Create a new instance of `LivePlaybackParams`.
   */
  init(minPlaybackSpeed: Double?, maxPlaybackSpeed: Double?, maxOffsetMs: Double?, minOffsetMs: Double?, targetOffsetMs: Double?) {
    self.init({ () -> bridge.std__optional_double_ in
      if let __unwrappedValue = minPlaybackSpeed {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = maxPlaybackSpeed {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = maxOffsetMs {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = minOffsetMs {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = targetOffsetMs {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }())
  }

  var minPlaybackSpeed: Double? {
    @inline(__always)
    get {
      return self.__minPlaybackSpeed.value
    }
    @inline(__always)
    set {
      self.__minPlaybackSpeed = { () -> bridge.std__optional_double_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_double_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    }
  }
  
  var maxPlaybackSpeed: Double? {
    @inline(__always)
    get {
      return self.__maxPlaybackSpeed.value
    }
    @inline(__always)
    set {
      self.__maxPlaybackSpeed = { () -> bridge.std__optional_double_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_double_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    }
  }
  
  var maxOffsetMs: Double? {
    @inline(__always)
    get {
      return self.__maxOffsetMs.value
    }
    @inline(__always)
    set {
      self.__maxOffsetMs = { () -> bridge.std__optional_double_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_double_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    }
  }
  
  var minOffsetMs: Double? {
    @inline(__always)
    get {
      return self.__minOffsetMs.value
    }
    @inline(__always)
    set {
      self.__minOffsetMs = { () -> bridge.std__optional_double_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_double_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    }
  }
  
  var targetOffsetMs: Double? {
    @inline(__always)
    get {
      return self.__targetOffsetMs.value
    }
    @inline(__always)
    set {
      self.__targetOffsetMs = { () -> bridge.std__optional_double_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_double_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    }
  }
}
