Skip to content

Commit

Permalink
Fix listen port setting visibility logic
Browse files Browse the repository at this point in the history
When switching from named pipe to socket with automatic listen port selection enabled the listen port setting would still be visible.
  • Loading branch information
YorVeX committed Sep 20, 2023
1 parent 1f1b03e commit 0862f39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BeamSenderProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -993,10 +993,11 @@ public static unsafe byte ConnectionTypeSocketChangedEventHandler(obs_properties
)
{
var connectionTypePipe = !Convert.ToBoolean(ObsData.obs_data_get_bool(settings, (sbyte*)propertyConnectionTypeSocketId));
var automaticListenPort = Convert.ToBoolean(ObsData.obs_data_get_bool(settings, (sbyte*)propertyAutomaticListenPortId));
ObsData.obs_data_set_bool(settings, (sbyte*)propertyConnectionTypePipeId, Convert.ToByte(connectionTypePipe));
ObsProperties.obs_property_set_visible(ObsProperties.obs_properties_get(properties, (sbyte*)propertyAutomaticListenPortId), Convert.ToByte(!connectionTypePipe));
ObsProperties.obs_property_set_visible(ObsProperties.obs_properties_get(properties, (sbyte*)propertyNetworkInterfaceListId), Convert.ToByte(!connectionTypePipe));
ObsProperties.obs_property_set_visible(ObsProperties.obs_properties_get(properties, (sbyte*)propertyListenPortId), Convert.ToByte(!connectionTypePipe));
ObsProperties.obs_property_set_visible(ObsProperties.obs_properties_get(properties, (sbyte*)propertyListenPortId), Convert.ToByte(!connectionTypePipe && !automaticListenPort));
var senderProperties = GetProperties(properties);
Module.Log($"{senderProperties.UniquePrefix} Connection type changed to: " + (connectionTypePipe ? "pipe" : "socket"), ObsLogLevel.Debug);
senderProperties.EventHandlerNeedSenderRestartCheck("ConnectionTypeSocketChangedEventHandler");
Expand Down

0 comments on commit 0862f39

Please sign in to comment.