Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit fa99a50

Browse files
committed
Updating SimplyCoreAudio package, etc.
1 parent 64e641c commit fa99a50

File tree

7 files changed

+50
-7
lines changed

7 files changed

+50
-7
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88
*.xcuserstate
99
*.xccheckout
1010
*.xcscmblueprint
11-
project.xcworkspace/
1211
xcuserdata/

SimplyCoreAudioDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"object": {
3+
"pins": [
4+
{
5+
"package": "SimplyCoreAudio",
6+
"repositoryURL": "https://github.com/rnine/SimplyCoreAudio.git",
7+
"state": {
8+
"branch": "develop",
9+
"revision": "df87c7a390085bebf5d71b83ae26263c08d1078c",
10+
"version": null
11+
}
12+
},
13+
{
14+
"package": "swift-atomics",
15+
"repositoryURL": "https://github.com/apple/swift-atomics.git",
16+
"state": {
17+
"branch": null,
18+
"revision": "3e95ba32cd1b4c877f6163e8eea54afc4e63bf9f",
19+
"version": "0.0.3"
20+
}
21+
}
22+
]
23+
},
24+
"version": 1
25+
}

SimplyCoreAudioDemo/Observables/ObservableAudioDevice.swift

+8-4
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ class ObservableAudioDevice: ObservableObject {
3434
didSet { device.setClockSourceID(clockSourceID) }
3535
}
3636

37-
@Published var isDefaultInputDevice: Bool = false
38-
@Published var isDefaultOutputDevice: Bool = false
39-
@Published var isDefaultSystemDevice: Bool = false
37+
@Published var isDefaultInputDevice: Bool
38+
@Published var isDefaultOutputDevice: Bool
39+
@Published var isDefaultSystemOutputDevice: Bool
4040

4141
var isDefaultDevice: Bool {
42-
isDefaultInputDevice || isDefaultOutputDevice || isDefaultSystemDevice
42+
isDefaultInputDevice || isDefaultOutputDevice || isDefaultSystemOutputDevice
4343
}
4444

4545
private let device: AudioDevice
@@ -66,6 +66,10 @@ class ObservableAudioDevice: ObservableObject {
6666

6767
nominalSampleRate = device.nominalSampleRate ?? 0
6868
clockSourceID = device.clockSourceID ?? 0
69+
70+
isDefaultInputDevice = device.isDefaultInputDevice
71+
isDefaultOutputDevice = device.isDefaultOutputDevice
72+
isDefaultSystemOutputDevice = device.isDefaultSystemOutputDevice
6973
}
7074

7175
func clockSourceName(for id: UInt32) -> String {

SimplyCoreAudioDemo/Observables/ObservableSCA.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private extension ObservableSCA {
6060
func updateDefaultSystemDevice() {
6161
if let defaultSystemDevice = simply.defaultSystemOutputDevice {
6262
for device in devices {
63-
device.isDefaultSystemDevice = device.id == defaultSystemDevice.id
63+
device.isDefaultSystemOutputDevice = device.id == defaultSystemDevice.id
6464
}
6565
}
6666
}

SimplyCoreAudioDemo/Views/DeviceDetail.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct DeviceDetail: View {
7878
.font(.subheadline).italic()
7979
}
8080

81-
if device.isDefaultSystemDevice {
81+
if device.isDefaultSystemOutputDevice {
8282
Text("(*) This is the default system device.")
8383
.font(.subheadline).italic()
8484
}

0 commit comments

Comments
 (0)