objc2_core_midi/generated/
MIDIUMPFunctionBlock.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-foundation")]
7use objc2_foundation::*;
8
9use crate::*;
10
11#[cfg(feature = "objc2")]
12extern_class!(
13    /// An object representing a Function Block.
14    ///
15    ///
16    /// A Function Block encapsulates one or more UMP groups with a single function, allowing
17    /// agents communicating with that UMP Endpoint to route and process UMP traffic
18    /// properly. Unless the owning MIDIUMPEndpoint has a static Function Block configuration,
19    /// any Function Block metadata may change in response to a configuration change in the
20    /// owning UMP endpoint.
21    ///
22    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpfunctionblock?language=objc)
23    #[unsafe(super(NSObject))]
24    #[derive(Debug, PartialEq, Eq, Hash)]
25    #[cfg(feature = "objc2")]
26    pub struct MIDIUMPFunctionBlock;
27);
28
29#[cfg(feature = "objc2")]
30extern_conformance!(
31    unsafe impl NSObjectProtocol for MIDIUMPFunctionBlock {}
32);
33
34#[cfg(feature = "objc2")]
35impl MIDIUMPFunctionBlock {
36    extern_methods!(
37        #[cfg(feature = "objc2-foundation")]
38        /// A string containing the Function Block's name.
39        #[unsafe(method(name))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn name(&self) -> Retained<NSString>;
42
43        #[cfg(all(feature = "MIDIMessages", feature = "MIDIUMPCI"))]
44        /// The device-unique ID for this Function Block.
45        #[unsafe(method(functionBlockID))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn functionBlockID(&self) -> MIDIUMPFunctionBlockID;
48
49        #[cfg(feature = "MIDIMessages")]
50        /// The direction of the Function Block: input, output, or bidirectional.
51        #[unsafe(method(direction))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn direction(&self) -> MIDIUMPFunctionBlockDirection;
54
55        #[cfg(feature = "MIDIMessages")]
56        /// The first Group spanned by this Function Block.
57        #[unsafe(method(firstGroup))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn firstGroup(&self) -> MIDIUMPGroupNumber;
60
61        #[cfg(feature = "MIDIMessages")]
62        /// The total number of groups spanned by this Function Block.
63        #[unsafe(method(totalGroupsSpanned))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn totalGroupsSpanned(&self) -> MIDIUInteger7;
66
67        /// The maximum number of simultaneous Sysex8 streams.
68        #[unsafe(method(maxSysEx8Streams))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn maxSysEx8Streams(&self) -> u8;
71
72        #[cfg(feature = "MIDIMessages")]
73        /// MIDI 1.0 speed information.
74        #[unsafe(method(MIDI1Info))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn MIDI1Info(&self) -> MIDIUMPFunctionBlockMIDI1Info;
77
78        #[cfg(feature = "MIDIMessages")]
79        /// A hint for UI about the primary usage of this Function Block.
80        #[unsafe(method(UIHint))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn UIHint(&self) -> MIDIUMPFunctionBlockUIHint;
83
84        #[cfg(feature = "MIDIUMPEndpoint")]
85        /// The UMP Endpoint to which this Function Block is registered.
86        ///
87        ///
88        /// If the function block does not belong to an endpoint this property will be nil.
89        #[unsafe(method(UMPEndpoint))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn UMPEndpoint(&self) -> Option<Retained<MIDIUMPEndpoint>>;
92
93        #[cfg(feature = "MIDICIDevice")]
94        /// Retrieve the MIDICIDevice class interface if the Function Block supports MIDI-CI.
95        ///
96        ///
97        /// If a Function Block was created as a MIDICIDevice object, this property will
98        /// provide an in-place MIDICIDevice interface that may be used with MIDI-CI API. If the
99        /// device was not created as a MIDICIDevice, this method returns nil.
100        #[unsafe(method(midiCIDevice))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn midiCIDevice(&self) -> Option<Retained<MIDICIDevice>>;
103
104        /// The enable state of this Function Block.
105        #[unsafe(method(isEnabled))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn isEnabled(&self) -> bool;
108
109        #[unsafe(method(init))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112    );
113}
114
115/// Methods declared on superclass `NSObject`.
116#[cfg(feature = "objc2")]
117impl MIDIUMPFunctionBlock {
118    extern_methods!(
119        #[unsafe(method(new))]
120        #[unsafe(method_family = new)]
121        pub unsafe fn new() -> Retained<Self>;
122    );
123}