1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
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!(
/// A mutable MIDIUMPEndpoint object.
///
///
/// It is not necessary to create a MIDIUMPEndpoint or other MIDI endpoint in order to
/// use UMP natively. Any standard MIDI endpoint created with a specified MIDIProtocolID
/// is assumed to use all 16 UMP groups for the same unspecified function and to neither
/// transmit nor receive jitter-reduction timestamps.
///
/// This API is not realtime-safe, all interaction with the mutable endpoint should be done on the
/// main thread.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpmutableendpoint?language=objc)
#[unsafe(super(MIDIUMPEndpoint, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "MIDIUMPEndpoint", feature = "objc2"))]
pub struct MIDIUMPMutableEndpoint;
);
#[cfg(all(feature = "MIDIUMPEndpoint", feature = "objc2"))]
extern_conformance!(
unsafe impl NSObjectProtocol for MIDIUMPMutableEndpoint {}
);
#[cfg(all(feature = "MIDIUMPEndpoint", feature = "objc2"))]
impl MIDIUMPMutableEndpoint {
extern_methods!(
#[cfg(all(
feature = "MIDIUMPFunctionBlock",
feature = "MIDIUMPMutableFunctionBlock",
feature = "objc2-foundation"
))]
/// The Function Blocks associated with the UMP endpoint, if any.
#[unsafe(method(mutableFunctionBlocks))]
#[unsafe(method_family = none)]
pub unsafe fn mutableFunctionBlocks(
&self,
) -> Retained<NSArray<MIDIUMPMutableFunctionBlock>>;
#[cfg(all(
feature = "MIDIUMPFunctionBlock",
feature = "MIDIUMPMutableFunctionBlock",
feature = "objc2-foundation"
))]
/// Setter for [`mutableFunctionBlocks`][Self::mutableFunctionBlocks].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setMutableFunctionBlocks:))]
#[unsafe(method_family = none)]
pub unsafe fn setMutableFunctionBlocks(
&self,
mutable_function_blocks: &NSArray<MIDIUMPMutableFunctionBlock>,
);
/// The enable state of the endpoint.
#[unsafe(method(isEnabled))]
#[unsafe(method_family = none)]
pub unsafe fn isEnabled(&self) -> bool;
#[cfg(all(
feature = "MIDIServices",
feature = "block2",
feature = "objc2-foundation"
))]
/// Initializer for creating a new MIDIUMPEndpoint.
///
///
/// Parameter `name`: The UMP endpoint name.
///
/// Parameter `deviceInfo`: The MIDI 2 device ID info for the UMP endpoint.
///
/// Parameter `productInstanceID`: The product instance ID, up to 42 characters.
///
/// Parameter `MIDIProtocol`: The MIDI protocol.
///
/// Parameter `destinationCallback`: The receive callback used to create the UMP endpoint's MIDI
/// destination associated, which can be used to observe or process
/// incoming MIDI traffic.
///
///
/// This operation will fail if the device ID information is malformed or if virtual MIDI endpoint creation
/// is not allowed (for example, on iOS, if your app doesn't list 'audio' in UIBackgroundModes).
///
/// # Safety
///
/// `destination_callback` must be a valid pointer.
#[unsafe(method(initWithName:deviceInfo:productInstanceID:MIDIProtocol:destinationCallback:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_deviceInfo_productInstanceID_MIDIProtocol_destinationCallback(
this: Allocated<Self>,
name: &NSString,
device_info: &MIDI2DeviceInfo,
product_instance_id: &NSString,
midi_protocol: MIDIProtocolID,
destination_callback: MIDIReceiveBlock,
) -> Option<Retained<Self>>;
#[cfg(feature = "objc2-foundation")]
/// Set the endpoints name.
///
///
/// Parameter `name`: A string representing the name of the endpoint.
///
/// Parameter `error`: The out-error used if an error occurs.
///
///
/// Returns: YES for success. NO in the event of a failure, in which case the error is returned in error.
///
///
/// This operation will fail if the name could not be set.
#[unsafe(method(setName:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn setName_error(&self, name: &NSString) -> Result<(), Retained<NSError>>;
#[cfg(all(
feature = "MIDIUMPFunctionBlock",
feature = "MIDIUMPMutableFunctionBlock",
feature = "objc2-foundation"
))]
/// Register or replace Function Blocks for a disabled client-created MIDIUMPEndpoint.
///
///
/// Parameter `functionBlocks`: A list of client-created Function Blocks to register.
///
/// Parameter `markAsStatic`: Whether the Function Block configuration may be updated.
///
/// Parameter `error`: The out-error used if an error occurs.
///
///
/// Returns: YES for success. NO in the event of a failure, in which case the error is returned in error.
///
///
/// This operation will fail if the array contains any disabled Function Blocks but the
/// MIDIUMPEndpoint Function Block configuration is static.
/// Returns YES if the Function Block configuration was set successfully.
#[unsafe(method(registerFunctionBlocks:markAsStatic:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn registerFunctionBlocks_markAsStatic_error(
&self,
function_blocks: &NSArray<MIDIUMPMutableFunctionBlock>,
mark_as_static: bool,
) -> Result<(), Retained<NSError>>;
#[cfg(feature = "objc2-foundation")]
/// Enable a mutable UMP endpoint in the system-wide UMP endpoint cache.
///
///
/// Parameter `isEnabled`: The enable state of the UMP endpoint.
///
/// Parameter `error`: The out-error used if an error occurred.
///
///
/// Returns: YES for success. NO in the event of a failure, in which case the error is returned in error.
///
///
/// A MIDIUMPMutableEndpoint must be cache enabled before it is visible via API.
/// Note that Function Blocks may only be registered to uncached MIDIUMPMutableEndpoint
/// objects.
#[unsafe(method(setEnabled:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn setEnabled_error(&self, is_enabled: bool) -> Result<(), Retained<NSError>>;
);
}
/// Methods declared on superclass `MIDIUMPEndpoint`.
#[cfg(all(feature = "MIDIUMPEndpoint", feature = "objc2"))]
impl MIDIUMPMutableEndpoint {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "MIDIUMPEndpoint", feature = "objc2"))]
impl MIDIUMPMutableEndpoint {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}