use core::ptr::NonNull;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use crate::*;
#[cfg(feature = "MIDIServices")]
pub type MIDISetupRef = MIDIObjectRef;
extern "C-unwind" {
#[cfg(feature = "MIDIServices")]
#[deprecated = "No longer supported"]
pub fn MIDISetupCreate(out_setup: NonNull<MIDISetupRef>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "MIDIServices")]
#[deprecated = "No longer supported"]
pub fn MIDISetupDispose(setup: MIDISetupRef) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "MIDIServices")]
#[deprecated = "No longer supported"]
pub fn MIDISetupInstall(setup: MIDISetupRef) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "MIDIServices")]
#[deprecated = "No longer supported"]
pub fn MIDISetupGetCurrent(out_setup: NonNull<MIDISetupRef>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(all(feature = "MIDIServices", feature = "objc2-core-foundation"))]
#[deprecated = "No longer supported"]
pub fn MIDISetupToData(setup: MIDISetupRef, out_data: NonNull<*const CFData>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(all(feature = "MIDIServices", feature = "objc2-core-foundation"))]
#[deprecated = "No longer supported"]
pub fn MIDISetupFromData(data: &CFData, out_setup: NonNull<MIDISetupRef>) -> OSStatus;
}
#[cfg(all(feature = "MIDIServices", feature = "objc2-core-foundation"))]
#[inline]
pub unsafe extern "C-unwind" fn MIDIDeviceNewEntity(
device: MIDIDeviceRef,
name: &CFString,
protocol: MIDIProtocolID,
embedded: bool,
num_source_endpoints: ItemCount,
num_destination_endpoints: ItemCount,
new_entity: NonNull<MIDIEntityRef>,
) -> OSStatus {
extern "C-unwind" {
fn MIDIDeviceNewEntity(
device: MIDIDeviceRef,
name: &CFString,
protocol: MIDIProtocolID,
embedded: Boolean,
num_source_endpoints: ItemCount,
num_destination_endpoints: ItemCount,
new_entity: NonNull<MIDIEntityRef>,
) -> OSStatus;
}
unsafe {
MIDIDeviceNewEntity(
device,
name,
protocol,
embedded as _,
num_source_endpoints,
num_destination_endpoints,
new_entity,
)
}
}
#[cfg(all(feature = "MIDIServices", feature = "objc2-core-foundation"))]
#[deprecated]
#[inline]
pub unsafe extern "C-unwind" fn MIDIDeviceAddEntity(
device: MIDIDeviceRef,
name: &CFString,
embedded: bool,
num_source_endpoints: ItemCount,
num_destination_endpoints: ItemCount,
new_entity: NonNull<MIDIEntityRef>,
) -> OSStatus {
extern "C-unwind" {
fn MIDIDeviceAddEntity(
device: MIDIDeviceRef,
name: &CFString,
embedded: Boolean,
num_source_endpoints: ItemCount,
num_destination_endpoints: ItemCount,
new_entity: NonNull<MIDIEntityRef>,
) -> OSStatus;
}
unsafe {
MIDIDeviceAddEntity(
device,
name,
embedded as _,
num_source_endpoints,
num_destination_endpoints,
new_entity,
)
}
}
extern "C-unwind" {
#[cfg(feature = "MIDIServices")]
pub fn MIDIDeviceRemoveEntity(device: MIDIDeviceRef, entity: MIDIEntityRef) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "MIDIServices")]
pub fn MIDIEntityAddOrRemoveEndpoints(
entity: MIDIEntityRef,
num_source_endpoints: ItemCount,
num_destination_endpoints: ItemCount,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "MIDIServices")]
pub fn MIDISetupAddDevice(device: MIDIDeviceRef) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "MIDIServices")]
pub fn MIDISetupRemoveDevice(device: MIDIDeviceRef) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "MIDIServices")]
pub fn MIDISetupAddExternalDevice(device: MIDIDeviceRef) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "MIDIServices")]
pub fn MIDISetupRemoveExternalDevice(device: MIDIDeviceRef) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "objc2-core-foundation")]
#[deprecated = "No longer supported"]
pub fn MIDIGetSerialPortOwner(
port_name: &CFString,
out_driver_name: NonNull<*const CFString>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "objc2-core-foundation")]
#[deprecated = "No longer supported"]
pub fn MIDISetSerialPortOwner(port_name: &CFString, driver_name: &CFString) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "objc2-core-foundation")]
#[deprecated = "No longer supported"]
pub fn MIDIGetSerialPortDrivers(out_driver_names: NonNull<*const CFArray>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(all(feature = "MIDIServices", feature = "objc2-core-foundation"))]
pub fn MIDIExternalDeviceCreate(
name: &CFString,
manufacturer: &CFString,
model: &CFString,
out_device: NonNull<MIDIDeviceRef>,
) -> OSStatus;
}