objc2-core-midi 0.3.2

Bindings to the CoreMIDI framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-foundation")]
use objc2_foundation::*;

use crate::*;

#[cfg(feature = "objc2")]
extern_class!(
    /// An object representing a MIDI-CI Device.
    ///
    ///
    /// The client instance MIDICIDeviceManager maintains a list of discovered CI devices.
    /// MIDICIDevice objects are not constructible via API.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midicidevice?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2")]
    pub struct MIDICIDevice;
);

#[cfg(feature = "objc2")]
extern_conformance!(
    unsafe impl NSObjectProtocol for MIDICIDevice {}
);

#[cfg(feature = "objc2")]
impl MIDICIDevice {
    extern_methods!(
        #[cfg(feature = "MIDIUMPEndpoint")]
        /// The basic information describing the CI device.
        #[unsafe(method(deviceInfo))]
        #[unsafe(method_family = none)]
        pub unsafe fn deviceInfo(&self) -> Retained<MIDI2DeviceInfo>;

        #[cfg(feature = "MIDIMessages")]
        /// The MIDI unique identifier (MUID) assigned to the CI device.
        #[unsafe(method(MUID))]
        #[unsafe(method_family = none)]
        pub unsafe fn MUID(&self) -> MIDICIMUID;

        /// MIDI-CI Protocol Negotiation capability.
        #[unsafe(method(supportsProtocolNegotiation))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsProtocolNegotiation(&self) -> bool;

        /// MIDI-CI Profile Configuration capability.
        #[unsafe(method(supportsProfileConfiguration))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsProfileConfiguration(&self) -> bool;

        /// MIDI-CI Property Exchange capability.
        #[unsafe(method(supportsPropertyExchange))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsPropertyExchange(&self) -> bool;

        /// MIDI-CI Process Inquiry capability.
        #[unsafe(method(supportsProcessInquiry))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsProcessInquiry(&self) -> bool;

        /// The maximum receivable MIDI System Exclusive size for this CI device.
        #[unsafe(method(maxSysExSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn maxSysExSize(&self) -> NSUInteger;

        /// The maximum number of simultaneous Property Exchange requests, if supported.
        #[unsafe(method(maxPropertyExchangeRequests))]
        #[unsafe(method_family = none)]
        pub unsafe fn maxPropertyExchangeRequests(&self) -> NSUInteger;

        #[cfg(feature = "MIDIUMPCI")]
        /// The type of MIDI-CI device.
        #[unsafe(method(deviceType))]
        #[unsafe(method_family = none)]
        pub unsafe fn deviceType(&self) -> MIDICIDeviceType;

        #[cfg(all(feature = "MIDIUMPCIProfile", feature = "objc2-foundation"))]
        /// The MIDI-CI Profiles that are registered to the  Function Block.
        #[unsafe(method(profiles))]
        #[unsafe(method_family = none)]
        pub unsafe fn profiles(&self) -> Retained<NSArray<MIDIUMPCIProfile>>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2")]
impl MIDICIDevice {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}