objc2_shazam_kit/generated/SHMatchedMediaItem.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11 /// How far in seconds is this match from the start of the reference audio
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/shazamkit/shmediaitemmatchoffset?language=objc)
14 #[cfg(feature = "SHMediaItem")]
15 pub static SHMediaItemMatchOffset: &'static SHMediaItemProperty;
16}
17
18extern "C" {
19 /// How much the match differs in frequency from reference material
20 ///
21 /// See also [Apple's documentation](https://developer.apple.com/documentation/shazamkit/shmediaitemfrequencyskew?language=objc)
22 #[cfg(feature = "SHMediaItem")]
23 pub static SHMediaItemFrequencySkew: &'static SHMediaItemProperty;
24}
25
26extern "C" {
27 /// The value ranges from 0.0 to 1.0, where 1.0 indicates the highest level of confidence.
28 ///
29 /// See also [Apple's documentation](https://developer.apple.com/documentation/shazamkit/shmediaitemconfidence?language=objc)
30 #[cfg(feature = "SHMediaItem")]
31 pub static SHMediaItemConfidence: &'static SHMediaItemProperty;
32}
33
34extern_class!(
35 /// An object that represents the metadata for a matched reference signature.
36 ///
37 /// To access properties for custom media items, use subscripting. For more information, see ``SHMediaItem``.
38 ///
39 /// See also [Apple's documentation](https://developer.apple.com/documentation/shazamkit/shmatchedmediaitem?language=objc)
40 #[unsafe(super(SHMediaItem, NSObject))]
41 #[derive(Debug, PartialEq, Eq, Hash)]
42 #[cfg(feature = "SHMediaItem")]
43 pub struct SHMatchedMediaItem;
44);
45
46#[cfg(feature = "SHMediaItem")]
47unsafe impl Send for SHMatchedMediaItem {}
48
49#[cfg(feature = "SHMediaItem")]
50unsafe impl Sync for SHMatchedMediaItem {}
51
52#[cfg(feature = "SHMediaItem")]
53extern_conformance!(
54 unsafe impl NSCoding for SHMatchedMediaItem {}
55);
56
57#[cfg(feature = "SHMediaItem")]
58extern_conformance!(
59 unsafe impl NSCopying for SHMatchedMediaItem {}
60);
61
62#[cfg(feature = "SHMediaItem")]
63unsafe impl CopyingHelper for SHMatchedMediaItem {
64 type Result = Self;
65}
66
67#[cfg(feature = "SHMediaItem")]
68extern_conformance!(
69 unsafe impl NSObjectProtocol for SHMatchedMediaItem {}
70);
71
72#[cfg(feature = "SHMediaItem")]
73extern_conformance!(
74 unsafe impl NSSecureCoding for SHMatchedMediaItem {}
75);
76
77#[cfg(feature = "SHMediaItem")]
78impl SHMatchedMediaItem {
79 extern_methods!(
80 /// A multiple for the difference in frequency between the matched audio and the query audio.
81 ///
82 /// A value of `0.0` indicates that the query and matched audio are at the same frequency. Other values indicate that the query audio is playing at a different frequency. For example, if the original recording plays at `100` Hz, a value of `0.05` indicates that the query recording plays at `105` Hz.
83 ///
84 /// No match returns if the frequency skew is too large.
85 #[unsafe(method(frequencySkew))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn frequencySkew(&self) -> c_float;
88
89 /// The timecode in the reference recording that matches the start of the query, in seconds.
90 ///
91 /// The value can be negative if the query signature contains unrecognizable data before the data that corresponds to the start of the matched reference item.
92 #[unsafe(method(matchOffset))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn matchOffset(&self) -> NSTimeInterval;
95
96 /// The updated timecode in the reference recording that matches the current playback position of the query audio, in seconds.
97 #[unsafe(method(predictedCurrentMatchOffset))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn predictedCurrentMatchOffset(&self) -> NSTimeInterval;
100
101 /// The level of confidence in the match result.
102 ///
103 /// The value ranges from 0.0 to 1.0, where 1.0 indicates the highest level of confidence.
104 #[unsafe(method(confidence))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn confidence(&self) -> c_float;
107 );
108}
109
110/// Methods declared on superclass `SHMediaItem`.
111#[cfg(feature = "SHMediaItem")]
112impl SHMatchedMediaItem {
113 extern_methods!(
114 /// Creates a media item object with a dictionary of properties and their associated values.
115 ///
116 /// - Parameters:
117 /// - properties: A dictionary that contains the media item properties and their associated values.
118 ///
119 /// # Safety
120 ///
121 /// `properties` generic should be of the correct type.
122 #[unsafe(method(mediaItemWithProperties:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn mediaItemWithProperties(
125 properties: &NSDictionary<SHMediaItemProperty, AnyObject>,
126 ) -> Retained<Self>;
127
128 #[unsafe(method(new))]
129 #[unsafe(method_family = new)]
130 pub unsafe fn new() -> Retained<Self>;
131
132 #[unsafe(method(init))]
133 #[unsafe(method_family = init)]
134 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
135 );
136}