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

import NitroModules

/// See ``HybridSoundSpec``
public protocol HybridSoundSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func startRecorder(uri: String?, audioSets: AudioSet?, meteringEnabled: Bool?) throws -> Promise<String>
  func pauseRecorder() throws -> Promise<String>
  func resumeRecorder() throws -> Promise<String>
  func stopRecorder() throws -> Promise<String>
  func startPlayer(uri: String?, httpHeaders: Dictionary<String, String>?) throws -> Promise<String>
  func stopPlayer() throws -> Promise<String>
  func pausePlayer() throws -> Promise<String>
  func resumePlayer() throws -> Promise<String>
  func seekToPlayer(time: Double) throws -> Promise<String>
  func setVolume(volume: Double) throws -> Promise<String>
  func setPlaybackSpeed(playbackSpeed: Double) throws -> Promise<String>
  func setSubscriptionDuration(sec: Double) throws -> Void
  func addRecordBackListener(callback: @escaping (_ recordingMeta: RecordBackType) -> Void) throws -> Void
  func removeRecordBackListener() throws -> Void
  func addPlayBackListener(callback: @escaping (_ playbackMeta: PlayBackType) -> Void) throws -> Void
  func removePlayBackListener() throws -> Void
  func addPlaybackEndListener(callback: @escaping (_ playbackEndMeta: PlaybackEndType) -> Void) throws -> Void
  func removePlaybackEndListener() throws -> Void
  func mmss(secs: Double) throws -> String
  func mmssss(milisecs: Double) throws -> String
}

public extension HybridSoundSpec_protocol {
  /// Default implementation of ``HybridObject.toString``
  func toString() -> String {
    return "[HybridObject Sound]"
  }
}

/// See ``HybridSoundSpec``
open class HybridSoundSpec_base {
  private weak var cxxWrapper: HybridSoundSpec_cxx? = nil
  public init() { }
  public func getCxxWrapper() -> HybridSoundSpec_cxx {
  #if DEBUG
    guard self is any HybridSoundSpec else {
      fatalError("`self` is not a `HybridSoundSpec`! Did you accidentally inherit from `HybridSoundSpec_base` instead of `HybridSoundSpec`?")
    }
  #endif
    if let cxxWrapper = self.cxxWrapper {
      return cxxWrapper
    } else {
      let cxxWrapper = HybridSoundSpec_cxx(self as! any HybridSoundSpec)
      self.cxxWrapper = cxxWrapper
      return cxxWrapper
    }
  }
}

/**
 * A Swift base-protocol representing the Sound HybridObject.
 * Implement this protocol to create Swift-based instances of Sound.
 * ```swift
 * class HybridSound : HybridSoundSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridSoundSpec = HybridSoundSpec_protocol & HybridSoundSpec_base
