diff --git a/BreadPlayer.Core/Core/CoreBreadPlayer.cs b/BreadPlayer.Core/Core/CoreBreadPlayer.cs index 23f9a8a..6d78682 100644 --- a/BreadPlayer.Core/Core/CoreBreadPlayer.cs +++ b/BreadPlayer.Core/Core/CoreBreadPlayer.cs @@ -24,19 +24,18 @@ You should have received a copy of the GNU General Public License using Windows.UI.Xaml.Media; using System.IO; using System.Runtime.InteropServices; +using Windows.Foundation.Metadata; namespace BreadPlayer.Core { public class CoreBreadPlayer : ViewModelBase, IDisposable { - #region DLLImports - [DllImport("bass.dll")] - static extern int BASS_GetConfig(int config); + #region DllImports [DllImport("bass.dll")] static extern bool BASS_SetConfig(int config, int newValue); const int BASS_CONFIG_DEV_BUFFER = 27; - int DeviceBufferLength => BASS_GetConfig(BASS_CONFIG_DEV_BUFFER); #endregion + #region Fields int handle = 0; private SyncProcedure _sync; @@ -60,8 +59,10 @@ public async Task Init() await Task.Run(() => { Bass.UpdatePeriod = 1000; - BASS_SetConfig(BASS_CONFIG_DEV_BUFFER, 200); - var bufferLength = DeviceBufferLength; + if (ApiInformation.IsApiContractPresent("Windows.Phone.PhoneContract", 1)) + { + BASS_SetConfig(BASS_CONFIG_DEV_BUFFER, 200); + } Bass.Start(); Bass.Init(); });