Skip to content

Commit 604cf9f

Browse files
authored
Fix issues found by SonarCloud (#7)
* Fix issues found by SonarCloud Remove unnecessary locks * Show call duration * Update exe file metadata
1 parent 3466dc2 commit 604cf9f

42 files changed

Lines changed: 909 additions & 1424 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AudioLibrary.PjSIP/AudioDevice.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
1+
using System;
52
using AudioLibrary.Interfaces;
63
using AudioLibrary.PjSIP.ManagedWatcher;
74

@@ -15,8 +12,9 @@ internal class AudioDevice : IAudioDevice
1512
public event Action<IAudioDevice> MuteChanged;
1613

1714
internal int Index { get; private set; }
15+
1816
public Audio Audio { get; private set; }
19-
public string Name { get; set; }
17+
public string Name { get; private set; }
2018
public bool PlaybackSupport { get; private set; }
2119
public bool RecordingSupport { get; private set; }
2220

@@ -38,13 +36,19 @@ public int Volume
3836
{
3937
if (PlaybackSupport) Audio.SpeakerVolume = value;
4038
else Audio.MicVolume = value;
39+
40+
VolumeChanged?.Invoke(this);
4141
}
4242
}
4343

4444
public bool Mute
4545
{
4646
get { return Audio.MicMute; }
47-
set { Audio.MicMute = value; }
47+
set
48+
{
49+
Audio.MicMute = value;
50+
MuteChanged?.Invoke(this);
51+
}
4852
}
4953

5054
internal AudioDevice(Audio audio, Imports.PjAudioDeviceInfo audioDeviceInfo, int index)

AudioLibrary.WMME/AudioLibrary.WMME.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2929
<PlatformTarget>AnyCPU</PlatformTarget>
3030
<Prefer32Bit>false</Prefer32Bit>
31+
<NoWarn>3009,3003,3001</NoWarn>
3132
</PropertyGroup>
3233
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3334
<DebugType>pdbonly</DebugType>
@@ -40,6 +41,7 @@
4041
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4142
<PlatformTarget>AnyCPU</PlatformTarget>
4243
<Prefer32Bit>false</Prefer32Bit>
44+
<NoWarn>3009,3003</NoWarn>
4345
</PropertyGroup>
4446
<PropertyGroup>
4547
<SignAssembly>false</SignAssembly>
@@ -72,6 +74,9 @@
7274
<Compile Include="Native\Win32.cs" />
7375
<Compile Include="Properties\AssemblyInfo.cs" />
7476
<Compile Include="VolumeAudioLineControl.cs" />
77+
<Compile Include="WaveOut.cs" />
78+
<Compile Include="WaveOutBuffer.cs" />
79+
<Compile Include="WaveStream.cs" />
7580
</ItemGroup>
7681
<ItemGroup>
7782
<ProjectReference Include="..\AudioLibrary\AudioLibrary.csproj">

AudioLibrary.WMME/AudioLine.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using AudioLibrary.Interfaces;
44
using System.Runtime.InteropServices;
55
using AudioLibrary.WMME.Native;
6+
using System.Diagnostics;
67

78
namespace AudioLibrary.WMME
89
{
@@ -284,7 +285,7 @@ private void SetVolumeOnChannel(Channel channel, int newVolume)
284285
}
285286
catch (Exception e)
286287
{
287-
// TODO: Log error
288+
Trace.TraceError("Unable to set volume on channel {0} #{1}: {2}", Name, Id, e.Message);
288289
}
289290
}
290291

@@ -329,7 +330,7 @@ internal void ReloadValues()
329330
}
330331
catch (Exception e)
331332
{
332-
// TODO: log error
333+
Trace.TraceError("Unable to reload values on audio line {0} #{1}: {2}", Name, Id, e.Message);
333334
}
334335

335336
RaiseVolumeChangedEvent(this);

0 commit comments

Comments
 (0)