Skip to content

Commit

Permalink
a little clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
theweavrs committed Dec 2, 2016
1 parent fc7a796 commit dfea8ac
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions BreadPlayer.Core/Core/CoreBreadPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
});
Expand Down

0 comments on commit dfea8ac

Please sign in to comment.