mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Safer way of detecing platform
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
<PropertyGroup Condition="'$(RuntimeIdentifier)|$(Configuration)' == 'win-x64|Debug'">
|
||||
<DefineConstants>WindowsDebug</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="**\*.xaml.cs">
|
||||
<DependentUpon>%(Filename)</DependentUpon>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
using ReactiveUI;
|
||||
using RedBookPlayer.Models.Discs;
|
||||
@@ -119,7 +120,6 @@ namespace RedBookPlayer.Models.Hardware
|
||||
_filterStage = new FilterStage();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the output with a given image
|
||||
/// </summary>
|
||||
@@ -367,13 +367,10 @@ namespace RedBookPlayer.Models.Hardware
|
||||
{
|
||||
_source = new PlayerSource(ProviderRead);
|
||||
|
||||
#if LINUX
|
||||
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
_soundOut = new Linux.AudioBackend(_source);
|
||||
#elif MACOS
|
||||
_soundOut = new Mac.AudioBackend(_source);
|
||||
#elif WINDOWS
|
||||
else if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
_soundOut = new Windows.AudioBackend(_source);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -2,19 +2,11 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
|
||||
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
|
||||
<DefineConstants>LINUX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'osx-x64'">
|
||||
<DefineConstants>MAC</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
|
||||
<DefineConstants>WINDOWS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Aaru.CommonTypes" Version="5.3.0" />
|
||||
<PackageReference Include="Aaru.Decoders" Version="5.3.0" />
|
||||
|
||||
Reference in New Issue
Block a user