Skip to content

Commit

Permalink
different way of hiding device
Browse files Browse the repository at this point in the history
  • Loading branch information
nodeful committed Nov 22, 2021
1 parent 5db8999 commit 4c6ef40
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions native/driver/Source/EQMDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,12 @@ class EQMDevice: EQMObject {
static var name = kEQMDeviceDefaultName
static var sampleRate = kDefaultSampleRate
static var running = false
static var shown = true {
static var shown = false {
didSet {
if (oldValue != shown) {
EQMDriver.propertiesUpdated(
objectId: kObjectID_Device,
changedProperties: [
AudioObjectPropertyAddress(
mSelector: kAudioDevicePropertyDeviceCanBeDefaultDevice,
mScope: kAudioObjectPropertyScopeOutput,
mElement: kAudioObjectPropertyElementMaster
),
AudioObjectPropertyAddress(
mSelector: kAudioDevicePropertyDeviceCanBeDefaultSystemDevice,
mScope: kAudioObjectPropertyScopeGlobal,
mElement: kAudioObjectPropertyElementMaster
)
]
)
}
Expand Down Expand Up @@ -274,7 +264,7 @@ class EQMDevice: EQMObject {
if address.mScope == kAudioObjectPropertyScopeInput {
return .integer(0)
} else {
return .integer(shown ? 1 : 0)
return .integer(1)
}
case kAudioDevicePropertyDeviceCanBeDefaultSystemDevice:
// This property returns whether or not the device wants to be the system
Expand Down Expand Up @@ -344,7 +334,7 @@ class EQMDevice: EQMObject {

case kAudioDevicePropertyIsHidden:
// This returns whether or not the device is visible to clients.
return .integer(0)
return .integer(shown ? 0 : 1)

case kAudioDevicePropertyPreferredChannelsForStereo:
// This property returns which two channesl to use as left/right for stereo
Expand Down

0 comments on commit 4c6ef40

Please sign in to comment.