8000 Fix issues found by SonarCloud by alexrster · Pull Request #7 · ipphone/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix issues found by SonarCloud #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions AudioLibrary.PjSIP/AudioDevice.cs
ED4F
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using AudioLibrary.Interfaces;
using AudioLibrary.PjSIP.ManagedWatcher;

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

internal int Index { get; private set; }

public Audio Audio { get; private set; }
public string Name { get; set; }
public string Name { get; private set; }
public bool PlaybackSupport { get; private set; }
public bool RecordingSupport { get; private set; }

Expand All @@ -38,13 +36,19 @@ public int Volume
{
if (PlaybackSupport) Audio.SpeakerVolume = value;
else Audio.MicVolume = value;

VolumeChanged?.Invoke(this);
}
}

public bool Mute
{
get { return Audio.MicMute; }
set { Audio.MicMute = value; }
set
{
Audio.MicMute = value;
MuteChanged?.Invoke(this);
}
}

internal AudioDevice(Audio audio, Imports.PjAudioDeviceInfo audioDeviceInfo, int index)
Expand Down
5 changes: 5 additions & 0 deletions AudioLibrary.WMME/AudioLibrary.WMME.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<NoWarn>3009,3003,3001</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -40,6 +41,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<NoWarn>3009,3003</NoWarn>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
Expand Down Expand Up @@ -72,6 +74,9 @@
<Compile Include="Native\Win32.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VolumeAudioLineControl.cs" />
<Compile Include="WaveOut.cs" />
<Compile Include="WaveOutBuffer.cs" />
<Compile Include="WaveStream.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AudioLibrary\AudioLibrary.csproj">
Expand Down
7 changes: 4 additions & 3 deletions AudioLibrary.WMME/AudioLine.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using System;
using System.Collections.Generic;
using AudioLibrary.Interfaces;
using System.Runtime.InteropServices;
using AudioLibrary.WMME.Native;
using System.Diagnostics;

namespace AudioLibrary.WMME
{
Expand Down Expand Up @@ -284,7 +285,7 @@ private void SetVolumeOnChannel(Channel channel, int newVolume)
}
catch (Exception e)
{
// TODO: Log error
Trace.TraceError("Unable to set volume on channel {0} #{1}: {2}", Name, Id, e.Message);
}
}

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

RaiseVolumeChangedEvent(this);
Expand Down
Loading
0