Skip to content

Commit 61e1b49

Browse files
Formatting
1 parent 810c6c9 commit 61e1b49

File tree

5 files changed

+37
-41
lines changed

5 files changed

+37
-41
lines changed

VBAudioRouter.Capture/ProcessAudioCapture.cs

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
using NAudio.CoreAudioApi.Interfaces;
33
using NAudio.Wave;
44
using System;
5-
using System.ComponentModel;
65
using System.Diagnostics;
7-
using System.Runtime.CompilerServices;
86
using System.Runtime.InteropServices;
97
using System.Threading;
10-
using System.Threading.Tasks;
118
using Windows.Media;
129
using Windows.Media.Audio;
1310

@@ -21,7 +18,7 @@ unsafe interface IMemoryBufferByteAccess
2118
void GetBuffer(out byte* buffer, out uint capacity);
2219
}
2320

24-
public class ProcessAudioCapture : IDisposable
21+
public sealed class ProcessAudioCapture : IDisposable
2522
{
2623
public Process Process { get; }
2724
public bool IncludeProcessTree { get; }
@@ -166,7 +163,7 @@ public interface IActivateAudioInterfaceCompletionHandler
166163
void ActivateCompleted(IActivateAudioInterfaceAsyncOperation activateOperation);
167164
}
168165

169-
public class ActivateAudioInterfaceCompletionHandler<T> : IActivateAudioInterfaceCompletionHandler where T : class
166+
public sealed class ActivateAudioInterfaceCompletionHandler<T> : IActivateAudioInterfaceCompletionHandler where T : class
170167
{
171168
AutoResetEvent _completionEvent = new(false);
172169
void IActivateAudioInterfaceCompletionHandler.ActivateCompleted(IActivateAudioInterfaceAsyncOperation activateOperation)

VBAudioRouter.Host/Program.cs

+31-32
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,44 @@
33
using System.Runtime;
44
using System.Runtime.InteropServices;
55

6-
namespace VBAudioRouter.Host
6+
namespace VBAudioRouter.Host;
7+
8+
static class Program
79
{
8-
static class Program
10+
[MTAThread]
11+
static void Main(string[] args)
912
{
10-
[MTAThread]
11-
static void Main(string[] args)
13+
GCSettings.LatencyMode = GCLatencyMode.SustainedLowLatency;
14+
using (SentrySdk.Init(o =>
15+
{
16+
o.Dsn = "https://[email protected]/6409713";
17+
// When configuring for the first time, to see what the SDK is doing:
18+
o.Debug = true;
19+
// Set traces_sample_rate to 1.0 to capture 100% of transactions for performance monitoring.
20+
// We recommend adjusting this value in production.
21+
o.TracesSampleRate = 1.0;
22+
}))
1223
{
13-
GCSettings.LatencyMode = GCLatencyMode.SustainedLowLatency;
14-
using (SentrySdk.Init(o =>
24+
try
1525
{
16-
o.Dsn = "https://[email protected]/6409713";
17-
// When configuring for the first time, to see what the SDK is doing:
18-
o.Debug = true;
19-
// Set traces_sample_rate to 1.0 to capture 100% of transactions for performance monitoring.
20-
// We recommend adjusting this value in production.
21-
o.TracesSampleRate = 1.0;
22-
}))
26+
VBAudioRouter.Program.Win32Main(args);
27+
}
28+
catch (Exception ex)
2329
{
24-
try
25-
{
26-
VBAudioRouter.Program.Win32Main(args);
27-
}
28-
catch (Exception ex)
29-
{
30-
MessageBox(IntPtr.Zero, ex.Message, "Error", MB_ICONERROR);
31-
throw;
32-
}
30+
MessageBox(IntPtr.Zero, ex.Message, "Error", MB_ICONERROR);
31+
throw;
3332
}
3433
}
34+
}
3535

36-
const int MB_OKCANCEL = 0x00000001;
37-
const int MB_ICONERROR = 0x00000010;
36+
const int MB_OKCANCEL = 0x00000001;
37+
const int MB_ICONERROR = 0x00000010;
3838

39-
[DllImport("user32.dll")]
40-
static extern void MessageBox(
41-
IntPtr hWnd,
42-
string text,
43-
string caption,
44-
uint type
45-
);
46-
}
39+
[DllImport("user32.dll")]
40+
static extern void MessageBox(
41+
IntPtr hWnd,
42+
string text,
43+
string caption,
44+
uint type
45+
);
4746
}

VBAudioRouter.Host/VBAudioRouter.Host.csproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
<PropertyGroup>
1515
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
16+
<LangVersion>latest</LangVersion>
1617
</PropertyGroup>
1718

1819
<ItemGroup>
@@ -21,11 +22,11 @@
2122
</ItemGroup>
2223

2324
<ItemGroup>
24-
<ProjectReference Include="..\VBAudioRouter.UWP\VBAudioRouter.UWP.vbproj" />
25+
<ProjectReference Include="..\VBAudioRouter.UWP\VBAudioRouter.UWP.vbproj" />
2526
</ItemGroup>
2627

2728
<ItemGroup>
28-
<PackageReference Update="Microsoft.VCRTForwarders.140" Version="1.0.7" />
29+
<PackageReference Update="Microsoft.VCRTForwarders.140" Version="1.0.7" />
2930
</ItemGroup>
3031

3132
</Project>

VBAudioRouter.Package/VBAudioRouter.Package.wapproj

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
<ProjectReference Include="..\VBAudioRouter.Host\VBAudioRouter.Host.csproj">
115115
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
116116
</ProjectReference>
117-
<ProjectReference Include="..\VBAudioRouter.UWP\VBAudioRouter.UWP.vbproj" />
118117
</ItemGroup>
119118
<ItemGroup>
120119
<SDKReference Include="Microsoft.VCLibs,Version=14.0">

VBAudioRouter.UWP/VBAudioRouter.UWP.vbproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
<DocumentationFile>VBAudioRouter.xml</DocumentationFile>
8787
<NoWarn>
8888
</NoWarn>
89-
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
89+
<UseDotNetNativeToolchain>false</UseDotNetNativeToolchain>
9090
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
9191
</PropertyGroup>
9292
<PropertyGroup>

0 commit comments

Comments
 (0)