mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 23:54:32 +00:00
Working Indicators
This commit is contained in:
parent
05ec90e840
commit
357335d35e
2 changed files with 18 additions and 18 deletions
|
|
@ -65,7 +65,7 @@ struct PrivacyLiveActivity: View {
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .trailing)
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .trailing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(width: isExpanded ? max(0, vm.effectiveClosedNotchHeight - (isHovering ? 0 : 12) + gestureProgress / 2) : 0, height: vm.effectiveClosedNotchHeight - (isHovering ? 0 : 12))
|
.frame(width: isExpanded ? max(0, vm.effectiveClosedNotchHeight + 30 + gestureProgress / 2) : 0, height: vm.effectiveClosedNotchHeight - (isHovering ? 0 : 12))
|
||||||
}
|
}
|
||||||
.frame(height: vm.effectiveClosedNotchHeight + (isHovering ? 8 : 0))
|
.frame(height: vm.effectiveClosedNotchHeight + (isHovering ? 8 : 0))
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,9 @@ class MicrophoneMonitor: ObservableObject {
|
||||||
// Remove property listener
|
// Remove property listener
|
||||||
if isListenerRegistered, defaultInputDevice != 0 {
|
if isListenerRegistered, defaultInputDevice != 0 {
|
||||||
var address = AudioObjectPropertyAddress(
|
var address = AudioObjectPropertyAddress(
|
||||||
mSelector: kAudioDevicePropertyDeviceIsRunning,
|
mSelector: kAudioDevicePropertyDeviceIsRunningSomewhere,
|
||||||
mScope: kAudioDevicePropertyScopeInput,
|
mScope: kAudioObjectPropertyScopeGlobal,
|
||||||
mElement: kAudioObjectPropertyElementMain
|
mElement: kAudioObjectPropertyElementMaster
|
||||||
)
|
)
|
||||||
|
|
||||||
let context = Unmanaged.passUnretained(self).toOpaque()
|
let context = Unmanaged.passUnretained(self).toOpaque()
|
||||||
|
|
@ -150,7 +150,7 @@ class MicrophoneMonitor: ObservableObject {
|
||||||
var address = AudioObjectPropertyAddress(
|
var address = AudioObjectPropertyAddress(
|
||||||
mSelector: kAudioHardwarePropertyDefaultInputDevice,
|
mSelector: kAudioHardwarePropertyDefaultInputDevice,
|
||||||
mScope: kAudioObjectPropertyScopeGlobal,
|
mScope: kAudioObjectPropertyScopeGlobal,
|
||||||
mElement: kAudioObjectPropertyElementMain
|
mElement: kAudioObjectPropertyElementMaster
|
||||||
)
|
)
|
||||||
|
|
||||||
let status = AudioObjectGetPropertyData(
|
let status = AudioObjectGetPropertyData(
|
||||||
|
|
@ -175,9 +175,9 @@ class MicrophoneMonitor: ObservableObject {
|
||||||
guard defaultInputDevice != 0 else { return false }
|
guard defaultInputDevice != 0 else { return false }
|
||||||
|
|
||||||
var address = AudioObjectPropertyAddress(
|
var address = AudioObjectPropertyAddress(
|
||||||
mSelector: kAudioDevicePropertyDeviceIsRunning,
|
mSelector: kAudioDevicePropertyDeviceIsRunningSomewhere,
|
||||||
mScope: kAudioDevicePropertyScopeInput,
|
mScope: kAudioObjectPropertyScopeGlobal,
|
||||||
mElement: kAudioObjectPropertyElementMain
|
mElement: kAudioObjectPropertyElementMaster
|
||||||
)
|
)
|
||||||
|
|
||||||
let hasProperty = AudioObjectHasProperty(defaultInputDevice, &address)
|
let hasProperty = AudioObjectHasProperty(defaultInputDevice, &address)
|
||||||
|
|
@ -190,11 +190,11 @@ class MicrophoneMonitor: ObservableObject {
|
||||||
private func setupPropertyListener() {
|
private func setupPropertyListener() {
|
||||||
guard defaultInputDevice != 0 else { return }
|
guard defaultInputDevice != 0 else { return }
|
||||||
|
|
||||||
// Try kAudioDevicePropertyDeviceIsRunning (simpler, more reliable for input devices)
|
// Use kAudioDevicePropertyDeviceIsRunningSomewhere (tracks when device is in use anywhere)
|
||||||
var address = AudioObjectPropertyAddress(
|
var address = AudioObjectPropertyAddress(
|
||||||
mSelector: kAudioDevicePropertyDeviceIsRunning,
|
mSelector: kAudioDevicePropertyDeviceIsRunningSomewhere,
|
||||||
mScope: kAudioDevicePropertyScopeInput,
|
mScope: kAudioObjectPropertyScopeGlobal,
|
||||||
mElement: kAudioObjectPropertyElementMain
|
mElement: kAudioObjectPropertyElementMaster
|
||||||
)
|
)
|
||||||
|
|
||||||
// Pass self as context
|
// Pass self as context
|
||||||
|
|
@ -220,9 +220,9 @@ class MicrophoneMonitor: ObservableObject {
|
||||||
guard defaultInputDevice != 0, isListenerRegistered else { return }
|
guard defaultInputDevice != 0, isListenerRegistered else { return }
|
||||||
|
|
||||||
var address = AudioObjectPropertyAddress(
|
var address = AudioObjectPropertyAddress(
|
||||||
mSelector: kAudioDevicePropertyDeviceIsRunning,
|
mSelector: kAudioDevicePropertyDeviceIsRunningSomewhere,
|
||||||
mScope: kAudioDevicePropertyScopeInput,
|
mScope: kAudioObjectPropertyScopeGlobal,
|
||||||
mElement: kAudioObjectPropertyElementMain
|
mElement: kAudioObjectPropertyElementMaster
|
||||||
)
|
)
|
||||||
|
|
||||||
let context = Unmanaged.passUnretained(self).toOpaque()
|
let context = Unmanaged.passUnretained(self).toOpaque()
|
||||||
|
|
@ -273,9 +273,9 @@ class MicrophoneMonitor: ObservableObject {
|
||||||
/// Check if audio device is running
|
/// Check if audio device is running
|
||||||
private func isDeviceRunning(_ deviceID: AudioDeviceID) -> Bool {
|
private func isDeviceRunning(_ deviceID: AudioDeviceID) -> Bool {
|
||||||
var address = AudioObjectPropertyAddress(
|
var address = AudioObjectPropertyAddress(
|
||||||
mSelector: kAudioDevicePropertyDeviceIsRunning,
|
mSelector: kAudioDevicePropertyDeviceIsRunningSomewhere,
|
||||||
mScope: kAudioDevicePropertyScopeInput,
|
mScope: kAudioObjectPropertyScopeGlobal,
|
||||||
mElement: kAudioObjectPropertyElementMain
|
mElement: kAudioObjectPropertyElementMaster
|
||||||
)
|
)
|
||||||
|
|
||||||
var isRunning: UInt32 = 0
|
var isRunning: UInt32 = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue