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
//! Sound constants for macOS user notifications.
//!
//! Look under `/System/Library/Sounds/` for the full list of available sounds.
use NSString;
/// `/System/Library/Sounds/Basso.aiff`
pub static DEFAULT: &str = "";
/// `/System/Library/Sounds/Basso.aiff`
pub static BASSO: &str = "Basso";
/// `/System/Library/Sounds/Blow.aiff`
pub static BLOW: &str = "Blow";
/// `/System/Library/Sounds/Bottle.aiff`
pub static BOTTLE: &str = "Bottle";
/// `/System/Library/Sounds/Frog.aiff`
pub static FROG: &str = "Frog";
/// `/System/Library/Sounds/Funk.aiff`
pub static FUNK: &str = "Funk";
/// `/System/Library/Sounds/Glass.aiff`
pub static GLASS: &str = "Glass";
/// `/System/Library/Sounds/Hero.aiff`
pub static HERO: &str = "Hero";
/// `/System/Library/Sounds/Morse.aiff`
pub static MORSE: &str = "Morse";
/// `/System/Library/Sounds/Ping.aiff`
pub static PING: &str = "Ping";
/// `/System/Library/Sounds/Sosumi.aiff`
pub static SOSUMI: &str = "Sosumi";
/// `/System/Library/Sounds/Submarine.aiff`
pub static SUBMARINE: &str = "Submarine";
/// `/System/Library/Sounds/Purr.aiff`
pub static PURR: &str = "Purr";
/// `/System/Library/Sounds/Pop.aiff`
pub static POP: &str = "Pop";
/// `/System/Library/Sounds/Tink.aiff`
pub static TINK: &str = "Tink";
/// All built-in macOS system sounds. These correspond to `.aiff` files
/// that ship with every macOS install in `/System/Library/Sounds/`.
pub static SYSTEM_SOUNDS: & = &;
pub
// /// Which sound to play when a notification is delivered.
// ///
// /// The named variants correspond to the `.aiff` files that ship with every macOS install under `/System/Library/Sounds/`.
// /// They are not part of the `UNNotificationSound` API itself;
// /// they are referenced by name via `UNNotificationSound::soundNamed`.
// #[derive(Clone, Debug, PartialEq, Eq, Hash)]
// pub enum Sound {
// /// Play the default system notification sound.
// Default,
// /// `/System/Library/Sounds/Basso.aiff`
// Basso,
// /// `/System/Library/Sounds/Blow.aiff`
// Blow,
// /// `/System/Library/Sounds/Bottle.aiff`
// Bottle,
// /// `/System/Library/Sounds/Frog.aiff`
// Frog,
// /// `/System/Library/Sounds/Funk.aiff`
// Funk,
// /// `/System/Library/Sounds/Glass.aiff`
// Glass,
// /// `/System/Library/Sounds/Hero.aiff`
// Hero,
// /// `/System/Library/Sounds/Morse.aiff`
// Morse,
// /// `/System/Library/Sounds/Ping.aiff`
// Ping,
// /// `/System/Library/Sounds/Pop.aiff`
// Pop,
// /// `/System/Library/Sounds/Purr.aiff`
// Purr,
// /// `/System/Library/Sounds/Sosumi.aiff`
// Sosumi,
// /// `/System/Library/Sounds/Submarine.aiff`
// Submarine,
// /// `/System/Library/Sounds/Tink.aiff`
// Tink,
// /// A named sound from the app bundle or system library.
// ///
// /// Use this for custom sound files bundled with your app, or any
// /// sound not covered by the variants above.
// Custom(String),
// }
// impl Sound {
// /// Returns the sound name passed to `UNNotificationSound::soundNamed`, or
// /// `None` for [`Sound::Default`] which uses `UNNotificationSound::defaultSound` instead.
// pub fn sound_name(&self) -> Option<&str> {
// match self {
// Sound::Default => None,
// Sound::Basso => Some("Basso"),
// Sound::Blow => Some("Blow"),
// Sound::Bottle => Some("Bottle"),
// Sound::Frog => Some("Frog"),
// Sound::Funk => Some("Funk"),
// Sound::Glass => Some("Glass"),
// Sound::Hero => Some("Hero"),
// Sound::Morse => Some("Morse"),
// Sound::Ping => Some("Ping"),
// Sound::Pop => Some("Pop"),
// Sound::Purr => Some("Purr"),
// Sound::Sosumi => Some("Sosumi"),
// Sound::Submarine => Some("Submarine"),
// Sound::Tink => Some("Tink"),
// Sound::Custom(name) => Some(name.as_str()),
// }
// }
// pub(crate) fn unnotificationsound(
// name: &str,
// ) -> Option<objc2::rc::Retained<objc2_user_notifications::UNNotificationSound>> {
// Some(objc2_user_notifications::UNNotificationSound::soundNamed(
// &NSString::from_str(name),
// ))
// }
// pub(crate) fn to_unnotificationsound(
// &self,
// ) -> Option<objc2::rc::Retained<objc2_user_notifications::UNNotificationSound>> {
// let name = self.sound_name()?;
// Some(objc2_user_notifications::UNNotificationSound::soundNamed(
// &NSString::from_str(name),
// ))
// }
// }
// impl From<&str> for Sound {
// fn from(value: &str) -> Self {
// match value {
// "default" | "Default" => Sound::Default,
// "basso" | "Basso" => Sound::Basso,
// "blow" | "Blow" => Sound::Blow,
// "bottle" | "Bottle" => Sound::Bottle,
// "frog" | "Frog" => Sound::Frog,
// "funk" | "Funk" => Sound::Funk,
// "glass" | "Glass" => Sound::Glass,
// "hero" | "Hero" => Sound::Hero,
// "morse" | "Morse" => Sound::Morse,
// "ping" | "Ping" => Sound::Ping,
// "pop" | "Pop" => Sound::Pop,
// "purr" | "Purr" => Sound::Purr,
// "sosumi" | "Sosumi" => Sound::Sosumi,
// "submarine" | "Submarine" => Sound::Submarine,
// "tink" | "Tink" => Sound::Tink,
// other => Sound::Custom(other.to_string()),
// }
// }
// }
// impl From<String> for Sound {
// fn from(value: String) -> Self {
// Sound::from(value.as_str())
// }
// }