3333 os_data ,
3434 cpu_data
3535)
36+ from ..support import utilities
3637
37-
38+ import platform
3839class SettingsFrame (wx .Frame ):
3940 """
4041 Modal-based Settings Frame
@@ -44,7 +45,7 @@ def __init__(self, parent: wx.Frame, title: str, global_constants: constants.Con
4445 self .constants : constants .Constants = global_constants
4546 self .title : str = title
4647 self .parent : wx .Frame = parent
47-
48+ self . xnu_major = int ( platform . release (). split ( "." )[ 0 ])
4849 self .hyperlink_colour = (25 , 179 , 231 )
4950
5051 self .settings = self ._settings ()
@@ -201,6 +202,10 @@ def _generate_elements(self, frame: wx.Frame = None) -> None:
201202 choice .Bind (wx .EVT_CHOICE , lambda event , variable = setting : self .settings [tab ][variable ]["override_function" ](event ))
202203 else :
203204 choice .Bind (wx .EVT_CHOICE , lambda event , variable = setting : self .on_choice (event , variable ))
205+ if "condition" in setting_info :
206+ choice .Enable (setting_info ["condition" ])
207+ if setting_info ["condition" ] is False :
208+ choice .Disable ()
204209 height += 10
205210 elif setting_info ["type" ] == "button" :
206211 button = wx .Button (panel , label = setting , pos = (width + 25 , 10 + height ), size = (200 ,- 1 ))
@@ -230,8 +235,14 @@ def _generate_elements(self, frame: wx.Frame = None) -> None:
230235
231236 if height > lowest_height_reached :
232237 lowest_height_reached = height
233-
234-
238+ def audio_check (self ):
239+ if utilities .check_kext_loaded ("com.apple.driver.AppleHDA" )!= "" or utilities .check_kext_loaded ("as.vit9696.AppleALC" ) != "" :
240+ self .constants .audio_type = "AppleHDA"
241+ return False
242+ if utilities .check_kext_loaded ("com.apple.driver.AppleHDA" ) and self .xnu_major >= os_data .os_data .tahoe :
243+ self .constants .audio_type = "AppleHDA"
244+ return False
245+ return True
235246 def _settings (self ) -> dict :
236247 """
237248 Generates a dictionary of settings to be used in the GUI
@@ -729,11 +740,12 @@ def _settings(self) -> dict:
729740 " on Monterey and newer." ,
730741 " Not recommended." ,
731742 ],
743+ "condition" :self .audio_check ()
732744 },
733745 "wrap_around 1" : {
734746 "type" : "wrap_around" ,
735747 },
736- "Allow Tahoe Old USB Exts Patch" : {
748+ "Allow Tahoe Modern USB Patch" : {
737749 "type" : "checkbox" ,
738750 "value" : self .constants .allow_usb_patch ,
739751 "variable" : "allow_usb_patch" ,
0 commit comments