pub unsafe trait AUAudioUnit_ViewController:
ClassType
+ Sized
+ Sealed {
// Provided methods
unsafe fn requestViewControllerWithCompletionHandler(
&self,
completion_handler: &DynBlock<dyn Fn(*mut AUViewControllerBase)>,
) { ... }
unsafe fn supportedViewConfigurations(
&self,
available_view_configurations: &NSArray<AUAudioUnitViewConfiguration>,
) -> Retained<NSIndexSet> { ... }
unsafe fn selectViewConfiguration(
&self,
view_configuration: &AUAudioUnitViewConfiguration,
) { ... }
}AUViewController only.Expand description
Category on AUAudioUnit.
Provided Methods§
Sourceunsafe fn requestViewControllerWithCompletionHandler(
&self,
completion_handler: &DynBlock<dyn Fn(*mut AUViewControllerBase)>,
)
Available on crate feature block2 and crate feature objc2-app-kit and macOS only.
unsafe fn requestViewControllerWithCompletionHandler( &self, completion_handler: &DynBlock<dyn Fn(*mut AUViewControllerBase)>, )
block2 and crate feature objc2-app-kit and macOS only.Obtains an audio unit’s view controller (and thereby a view).
Asynchronously requests the audio unit’s view controller. This method will later call the completion handler, in a thread/dispatch queue context internal to the implementation, with a view controller, or nil in the case of an audio unit without a custom view controller.
Sourceunsafe fn supportedViewConfigurations(
&self,
available_view_configurations: &NSArray<AUAudioUnitViewConfiguration>,
) -> Retained<NSIndexSet>
unsafe fn supportedViewConfigurations( &self, available_view_configurations: &NSArray<AUAudioUnitViewConfiguration>, ) -> Retained<NSIndexSet>
Parameter availableViewConfigurations: The list of all available view configurations supported by the host.
Returns: A set of indices of view configurations from the availableViewConfigurations array that the audio unit supports.
Query the list of supported view configurations.
The host can query the audio unit for all the view configurations it supports. Hosts can support multiple configurations in which they can display the user interfaces of audio units (for example: full screen, normal, live mode, etc). These configurations can be of different sizes and the host might display its own control surfaces along with the view of the audio unit. The host will call this method and pass an array of supported configurations.
The audio unit should override this method and implement its own logic to report all the view configurations it supports. The size of the view in the selected configuration should be large enough to fit the view of the audio unit, otherwise it might be truncated and a scroll bar might be necessary to navigate it.
In case an empty set is returned from this method, it is considered that the plugin only supports the largest available view configuration.
Sourceunsafe fn selectViewConfiguration(
&self,
view_configuration: &AUAudioUnitViewConfiguration,
)
unsafe fn selectViewConfiguration( &self, view_configuration: &AUAudioUnitViewConfiguration, )
Parameter viewConfiguration: The requested view configuration.
The view configuration passed to this method should be one which was indicated as supported via supportedViewConfigurations. If any other, unsupported, view configuration is passed or if supportedViewConfigurations returns an empty set, the audio unit implementation should fall back to its default (largest available) view configuration.
Request a view configuration from the audio unit.
The host can use this method to switch the audio unit’s view into a new configuration. Audio Units should override this method with the logic needed to adapt their view controller to the requested configuration.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
impl AUAudioUnit_ViewController for AUAudioUnit
objc2-audio-toolbox only.