objc2-sound-analysis 0.3.2

Bindings to the SoundAnalysis framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    /// The base protocol to which analysis results conform
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/soundanalysis/snresult?language=objc)
    pub unsafe trait SNResult: NSObjectProtocol {}
);

extern_protocol!(
    /// The interface through which clients receive the results of an analysis request
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/soundanalysis/snresultsobserving?language=objc)
    pub unsafe trait SNResultsObserving: NSObjectProtocol {
        #[cfg(feature = "SNRequest")]
        /// Provides a new analysis result to the client with the specified time range
        ///
        /// This function will be called each time a new analysis result is available. Different types of analysis may produce results at different rates, spanning different time ranges.
        #[unsafe(method(request:didProduceResult:))]
        #[unsafe(method_family = none)]
        unsafe fn request_didProduceResult(
            &self,
            request: &ProtocolObject<dyn SNRequest>,
            result: &ProtocolObject<dyn SNResult>,
        );

        #[cfg(feature = "SNRequest")]
        /// Informs the client of an error produced during analysis
        ///
        /// If an error is produced by a request, that request will not produce any more results, and is in a terminal state. The request:didFailWithError and requestDidComplete methods are mutually exclusive.
        #[optional]
        #[unsafe(method(request:didFailWithError:))]
        #[unsafe(method_family = none)]
        unsafe fn request_didFailWithError(
            &self,
            request: &ProtocolObject<dyn SNRequest>,
            error: &NSError,
        );

        #[cfg(feature = "SNRequest")]
        /// Informs the client that the analysis request was completed normally
        ///
        /// If an analysis request completes normally, that request will not produce any more results, and is in a terminal state. The request:didFailWithError and requestDidComplete methods are mutually exclusive.
        #[optional]
        #[unsafe(method(requestDidComplete:))]
        #[unsafe(method_family = none)]
        unsafe fn requestDidComplete(&self, request: &ProtocolObject<dyn SNRequest>);
    }
);