use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKAudioFilePlayerStatus(pub NSInteger);
impl WKAudioFilePlayerStatus {
#[doc(alias = "WKAudioFilePlayerStatusUnknown")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
pub const Unknown: Self = Self(0);
#[doc(alias = "WKAudioFilePlayerStatusReadyToPlay")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
pub const ReadyToPlay: Self = Self(1);
#[doc(alias = "WKAudioFilePlayerStatusFailed")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
pub const Failed: Self = Self(2);
}
unsafe impl Encode for WKAudioFilePlayerStatus {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for WKAudioFilePlayerStatus {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
pub struct WKAudioFilePlayer;
);
extern_conformance!(
unsafe impl NSObjectProtocol for WKAudioFilePlayer {}
);
impl WKAudioFilePlayer {
extern_methods!(
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "WKAudioFilePlayerItem")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(playerWithPlayerItem:))]
#[unsafe(method_family = none)]
pub unsafe fn playerWithPlayerItem(item: &WKAudioFilePlayerItem) -> Retained<Self>;
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(play))]
#[unsafe(method_family = none)]
pub unsafe fn play(&self);
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(pause))]
#[unsafe(method_family = none)]
pub unsafe fn pause(&self);
#[cfg(feature = "WKAudioFilePlayerItem")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(replaceCurrentItemWithPlayerItem:))]
#[unsafe(method_family = none)]
pub unsafe fn replaceCurrentItemWithPlayerItem(&self, item: Option<&WKAudioFilePlayerItem>);
#[cfg(feature = "WKAudioFilePlayerItem")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(currentItem))]
#[unsafe(method_family = none)]
pub unsafe fn currentItem(&self) -> Option<Retained<WKAudioFilePlayerItem>>;
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(status))]
#[unsafe(method_family = none)]
pub unsafe fn status(&self) -> WKAudioFilePlayerStatus;
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(error))]
#[unsafe(method_family = none)]
pub unsafe fn error(&self) -> Option<Retained<NSError>>;
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(rate))]
#[unsafe(method_family = none)]
pub unsafe fn rate(&self) -> c_float;
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(setRate:))]
#[unsafe(method_family = none)]
pub unsafe fn setRate(&self, rate: c_float);
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(currentTime))]
#[unsafe(method_family = none)]
pub unsafe fn currentTime(&self) -> NSTimeInterval;
);
}
impl WKAudioFilePlayer {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(WKAudioFilePlayer, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
pub struct WKAudioFileQueuePlayer;
);
extern_conformance!(
unsafe impl NSObjectProtocol for WKAudioFileQueuePlayer {}
);
impl WKAudioFileQueuePlayer {
extern_methods!(
#[cfg(feature = "WKAudioFilePlayerItem")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(queuePlayerWithItems:))]
#[unsafe(method_family = none)]
pub unsafe fn queuePlayerWithItems(
items: &NSArray<WKAudioFilePlayerItem>,
) -> Retained<Self>;
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(advanceToNextItem))]
#[unsafe(method_family = none)]
pub unsafe fn advanceToNextItem(&self);
#[cfg(feature = "WKAudioFilePlayerItem")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(appendItem:))]
#[unsafe(method_family = none)]
pub unsafe fn appendItem(&self, item: &WKAudioFilePlayerItem);
#[cfg(feature = "WKAudioFilePlayerItem")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(removeItem:))]
#[unsafe(method_family = none)]
pub unsafe fn removeItem(&self, item: &WKAudioFilePlayerItem);
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(removeAllItems))]
#[unsafe(method_family = none)]
pub unsafe fn removeAllItems(&self);
#[cfg(feature = "WKAudioFilePlayerItem")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(items))]
#[unsafe(method_family = none)]
pub unsafe fn items(&self) -> Retained<NSArray<WKAudioFilePlayerItem>>;
);
}
impl WKAudioFileQueuePlayer {
extern_methods!(
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "WKAudioFilePlayerItem")]
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[unsafe(method(playerWithPlayerItem:))]
#[unsafe(method_family = none)]
pub unsafe fn playerWithPlayerItem(item: &WKAudioFilePlayerItem) -> Retained<Self>;
);
}
impl WKAudioFileQueuePlayer {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}