@@ -220,7 +220,7 @@ class DisplayManager {
220220 func updateAudioControlTargetDisplays( deviceName: String ) -> Int {
221221 self . audioControlTargetDisplays. removeAll ( )
222222 os_log ( " Detecting displays for audio control via audio device name matching... " , type: . info)
223- var numOfAddedDisplays : Int = 0
223+ var numOfAddedDisplays = 0
224224 for ddcCapableDisplay in self . getDdcCapableDisplays ( ) {
225225 var displayAudioDeviceName = ddcCapableDisplay. readPrefAsString ( key: . audioDeviceNameOverride)
226226 if displayAudioDeviceName == " " {
@@ -409,9 +409,9 @@ class DisplayManager {
409409 }
410410
411411 static func isVirtual( displayID: CGDirectDisplayID ) -> Bool {
412- var isVirtual : Bool = false
412+ var isVirtual = false
413413 if !DEBUG_MACOS10, #available( macOS 11 . 0 , * ) {
414- if let dictionary = ( ( CoreDisplay_DisplayCreateInfoDictionary ( displayID) ) ? . takeRetainedValue ( ) as NSDictionary ? ) {
414+ if let dictionary = ( CoreDisplay_DisplayCreateInfoDictionary ( displayID) ? . takeRetainedValue ( ) as NSDictionary ? ) {
415415 let isVirtualDevice = dictionary [ " kCGDisplayIsVirtualDevice " ] as? Bool
416416 let displayIsAirplay = dictionary [ " kCGDisplayIsAirPlay " ] as? Bool
417417 if isVirtualDevice ?? displayIsAirplay ?? false {
@@ -490,9 +490,9 @@ class DisplayManager {
490490 }
491491
492492 static func getDisplayRawNameByID( displayID: CGDirectDisplayID ) -> String {
493- let defaultName : String = " "
493+ let defaultName = " "
494494 if !DEBUG_MACOS10, #available( macOS 11 . 0 , * ) {
495- if let dictionary = ( ( CoreDisplay_DisplayCreateInfoDictionary ( displayID) ) ? . takeRetainedValue ( ) as NSDictionary ? ) , let nameList = dictionary [ " DisplayProductName " ] as? [ String : String ] , let name = nameList [ " en_US " ] ?? nameList. first? . value {
495+ if let dictionary = ( CoreDisplay_DisplayCreateInfoDictionary ( displayID) ? . takeRetainedValue ( ) as NSDictionary ? ) , let nameList = dictionary [ " DisplayProductName " ] as? [ String : String ] , let name = nameList [ " en_US " ] ?? nameList. first? . value {
496496 return name
497497 }
498498 }
@@ -505,10 +505,10 @@ class DisplayManager {
505505 static func getDisplayNameByID( displayID: CGDirectDisplayID ) -> String {
506506 let defaultName : String = NSLocalizedString ( " Unknown " , comment: " Unknown display name " )
507507 if !DEBUG_MACOS10, #available( macOS 11 . 0 , * ) {
508- if let dictionary = ( ( CoreDisplay_DisplayCreateInfoDictionary ( displayID) ) ? . takeRetainedValue ( ) as NSDictionary ? ) , let nameList = dictionary [ " DisplayProductName " ] as? [ String : String ] , var name = nameList [ Locale . current. identifier] ?? nameList [ " en_US " ] ?? nameList. first? . value {
508+ if let dictionary = ( CoreDisplay_DisplayCreateInfoDictionary ( displayID) ? . takeRetainedValue ( ) as NSDictionary ? ) , let nameList = dictionary [ " DisplayProductName " ] as? [ String : String ] , var name = nameList [ Locale . current. identifier] ?? nameList [ " en_US " ] ?? nameList. first? . value {
509509 if CGDisplayIsInHWMirrorSet ( displayID) != 0 || CGDisplayIsInMirrorSet ( displayID) != 0 {
510510 let mirroredDisplayID = CGDisplayMirrorsDisplay ( displayID)
511- if mirroredDisplayID != 0 , let dictionary = ( ( CoreDisplay_DisplayCreateInfoDictionary ( mirroredDisplayID) ) ? . takeRetainedValue ( ) as NSDictionary ? ) , let nameList = dictionary [ " DisplayProductName " ] as? [ String : String ] , let mirroredName = nameList [ Locale . current. identifier] ?? nameList [ " en_US " ] ?? nameList. first? . value {
511+ if mirroredDisplayID != 0 , let dictionary = ( CoreDisplay_DisplayCreateInfoDictionary ( mirroredDisplayID) ? . takeRetainedValue ( ) as NSDictionary ? ) , let nameList = dictionary [ " DisplayProductName " ] as? [ String : String ] , let mirroredName = nameList [ Locale . current. identifier] ?? nameList [ " en_US " ] ?? nameList. first? . value {
512512 name. append ( " | " + mirroredName)
513513 }
514514 }
0 commit comments