Skip to content

Commit

Permalink
Added intercom cockpit effect as optional
Browse files Browse the repository at this point in the history
Added F4 Expansion radio
  • Loading branch information
ciribob committed May 15, 2024
1 parent 7206c60 commit ccfd647
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 3 deletions.
8 changes: 6 additions & 2 deletions DCS-SR-Client/Audio/Providers/ClientAudioProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class ClientAudioProvider : AudioProvider

private float ambientCockpitEffectVolume = 1.0f;
private bool ambientCockpitEffectEnabled = true;
private bool ambientCockpitIntercomEffectEnabled = true;

private ProfileSettingsStore settingsStore = GlobalSettingsStore.Instance.ProfileSettingsStore;
private double lastLoaded = 0;
Expand Down Expand Up @@ -136,8 +137,9 @@ public JitterBufferAudio AddClientAudioSamples(ClientAudio audio)
//adjust for LOS + Distance + Volume
AdjustVolumeForLoss(audio);

//Add cockpit effect - but not for Intercom
if(ambientCockpitEffectEnabled && audio.Modulation != (short)Modulation.INTERCOM)
//Add cockpit effect - but not for Intercom unless you specifically opt in
if((ambientCockpitEffectEnabled && audio.Modulation != (short)Modulation.INTERCOM )
|| (ambientCockpitEffectEnabled && audio.Modulation == (short)Modulation.INTERCOM && ambientCockpitIntercomEffectEnabled))
AddCockpitAmbientAudio(audio);
}
else
Expand Down Expand Up @@ -238,6 +240,8 @@ private void ReLoadSettings()
ambientCockpitEffectEnabled = settingsStore.GetClientSettingBool(ProfileSettingsKeys.AmbientCockpitNoiseEffect);
ambientCockpitEffectVolume =
settingsStore.GetClientSettingFloat(ProfileSettingsKeys.AmbientCockpitNoiseEffectVolume);
ambientCockpitIntercomEffectEnabled =
settingsStore.GetClientSettingBool(ProfileSettingsKeys.AmbientCockpitIntercomNoiseEffect);
}

}
Expand Down
Binary file added DCS-SR-Client/AudioEffects/Ambient/F4.wav
Binary file not shown.
1 change: 1 addition & 0 deletions DCS-SR-Client/DCS-SR-Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@
<Content Include="AudioEffects\Ambient\F16.wav">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="AudioEffects\Ambient\F4.wav" />
<Content Include="AudioEffects\Ambient\F5.wav">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
9 changes: 9 additions & 0 deletions DCS-SR-Client/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions DCS-SR-Client/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@
<data name="AmbientEffectToggle" xml:space="preserve">
<value>Enable Ambient Cockpit Effects</value>
</data>
<data name="AmbientEffectIntercomToggle" xml:space="preserve">
<value>Enable Ambient Intercom Effects</value>
</data>
<data name="AmbientEffectVolume" xml:space="preserve">
<value>Ambient Cockpit Effect Volume</value>
</data>
Expand Down
2 changes: 2 additions & 0 deletions DCS-SR-Client/Settings/ProfileSettingsStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public enum ProfileSettingsKeys
AMCollisionVolume,
AmbientCockpitNoiseEffect,
AmbientCockpitNoiseEffectVolume,
AmbientCockpitIntercomNoiseEffect,
}

public class ProfileSettingsStore
Expand Down Expand Up @@ -141,6 +142,7 @@ public string CurrentProfileName

{ProfileSettingsKeys.AmbientCockpitNoiseEffect.ToString(), "true"},
{ProfileSettingsKeys.AmbientCockpitNoiseEffectVolume.ToString(), "1.0"}, //relative volume as the incoming volume is variable
{ProfileSettingsKeys.AmbientCockpitIntercomNoiseEffect.ToString(), "false"},
};


Expand Down
31 changes: 30 additions & 1 deletion DCS-SR-Client/UI/ClientWindow/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1951,6 +1951,7 @@
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>


Expand Down Expand Up @@ -2536,12 +2537,40 @@


<Label Grid.Row="18"
Grid.Column="0"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Content="{x:Static p:Resources.AmbientEffectIntercomToggle}" />

<ToggleButton Name="AmbientIntercomEffectToggle"
Grid.Row="18"
Grid.Column="1"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Click="AmbientCockpitEffectIntercomToggle_OnClick">
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="Content" Value="{x:Static p:Resources.ValueON}" />
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Content" Value="{x:Static p:Resources.ValueON}" />
</Trigger>
<Trigger Property="IsChecked" Value="False">
<Setter Property="Content" Value="{x:Static p:Resources.ValueOFF}" />
</Trigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
</ToggleButton>


<Label Grid.Row="19"
Grid.Column="0"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Content="{x:Static p:Resources.AmbientEffectVolume}" />

<StackPanel Grid.Row="18"
<StackPanel Grid.Row="19"
Grid.Column="1" Margin="10">

<Slider x:Name="AmbientCockpitEffectVolume"
Expand Down
6 changes: 6 additions & 0 deletions DCS-SR-Client/UI/ClientWindow/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ private void ReloadProfileSettings()


AmbientCockpitEffectToggle.IsChecked = _globalSettings.ProfileSettingsStore.GetClientSettingBool(ProfileSettingsKeys.AmbientCockpitNoiseEffect);
AmbientIntercomEffectToggle.IsChecked = _globalSettings.ProfileSettingsStore.GetClientSettingBool(ProfileSettingsKeys.AmbientCockpitIntercomNoiseEffect);

AmbientCockpitEffectVolume.IsEnabled = false;
AmbientCockpitEffectVolume.ValueChanged += (sender, e) =>
Expand Down Expand Up @@ -2136,5 +2137,10 @@ private void AmbientCockpitEffectToggle_OnClick(object sender, RoutedEventArgs e
{
_globalSettings.ProfileSettingsStore.SetClientSettingBool(ProfileSettingsKeys.AmbientCockpitNoiseEffect, (bool)AmbientCockpitEffectToggle.IsChecked);
}

private void AmbientCockpitEffectIntercomToggle_OnClick(object sender, RoutedEventArgs e)
{
_globalSettings.ProfileSettingsStore.SetClientSettingBool(ProfileSettingsKeys.AmbientCockpitNoiseEffect, (bool)AmbientIntercomEffectToggle.IsChecked);
}
}
}
13 changes: 13 additions & 0 deletions Scripts/DCS-SRS/Scripts/DCS-SimpleRadioStandalone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6308,6 +6308,19 @@ function SR.exportRadioF4(_data)
_data.radios[3].encKey = ky28_key
_data.radios[3].enc = is_encrypted
_data.radios[3].encMode = 2


-- Expansion Radio - Server Side Controlled
_data.radios[4].name = "AN/ARC-186(V)"
_data.radios[4].freq = 124.8 * 1000000 --116,00-151,975 MHz
_data.radios[4].modulation = 0
_data.radios[4].secFreq = 121.5 * 1000000
_data.radios[4].volume = 1.0
_data.radios[4].freqMin = 116 * 1000000
_data.radios[4].freqMax = 151.975 * 1000000
_data.radios[4].expansion = true
_data.radios[4].volMode = 1
_data.radios[4].freqMode = 1

_data.intercomHotMic = intercom_hot_mic

Expand Down

0 comments on commit ccfd647

Please sign in to comment.