-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Panda-Sharp/develop
Develop
- Loading branch information
Showing
40 changed files
with
500 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace Yugen.DJ.Uwp.Interfaces | ||
{ | ||
public interface IWhatsNewDisplayService | ||
{ | ||
Task ShowIfAppropriateAsync(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Microsoft.Toolkit.Uwp; | ||
using Microsoft.Toolkit.Uwp.Helpers; | ||
using System; | ||
using System.Threading.Tasks; | ||
using Windows.System; | ||
using Yugen.DJ.Uwp.Interfaces; | ||
using Yugen.DJ.Uwp.Views.Dialogs; | ||
|
||
namespace Yugen.DJ.Uwp.StateTriggers | ||
{ | ||
public class WhatsNewDisplayService : IWhatsNewDisplayService | ||
{ | ||
private bool isShown = false; | ||
|
||
public async Task ShowIfAppropriateAsync() | ||
{ | ||
var dispatcherQueue = DispatcherQueue.GetForCurrentThread(); | ||
|
||
if (SystemInformation.Instance.IsAppUpdated && !isShown) | ||
{ | ||
isShown = true; | ||
await dispatcherQueue.EnqueueAsync(async () => | ||
{ | ||
var dialog = new WhatsNewDialog(); | ||
await dialog.ShowAsync(); | ||
}); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,51 @@ | ||
using Microsoft.Toolkit.Mvvm.ComponentModel; | ||
using System.Collections.ObjectModel; | ||
using Windows.Devices.Enumeration; | ||
using Yugen.Toolkit.Standard.Extensions; | ||
using Yugen.Toolkit.Uwp.Audio.Services.Abstractions; | ||
|
||
namespace Yugen.DJ.Uwp.ViewModels | ||
{ | ||
public class SettingsViewModel : ObservableObject | ||
{ | ||
private string _masterAudioDeviceInformation; | ||
private string _headphonesAudioDeviceInformation; | ||
private IAudioDeviceService _audioDeviceService; | ||
private AudioDevice _masterAudioDeviceInformation; | ||
private AudioDevice _headphonesAudioDeviceInformation; | ||
|
||
public SettingsViewModel() | ||
public SettingsViewModel(IAudioDeviceService audioDeviceService) | ||
{ | ||
_audioDeviceService = audioDeviceService; | ||
|
||
AudioDeviceInformationCollection.Add(_audioDeviceService.PrimaryDevice); | ||
AudioDeviceInformationCollection.Add(_audioDeviceService.SecondaryDevice); | ||
|
||
MasterAudioDeviceInformation = AudioDeviceInformationCollection[0]; | ||
HeadphonesAudioDeviceInformation = AudioDeviceInformationCollection[1]; | ||
} | ||
|
||
public ObservableCollection<string> AudioDeviceInformationCollection { get; set; } = | ||
new ObservableCollection<string>() | ||
{ | ||
"Primary", | ||
"Secondary" | ||
}; | ||
public ObservableCollection<AudioDevice> AudioDeviceInformationCollection { get; set; } = | ||
new ObservableCollection<AudioDevice>(); | ||
|
||
public string MasterAudioDeviceInformation | ||
public AudioDevice MasterAudioDeviceInformation | ||
{ | ||
get => _masterAudioDeviceInformation; | ||
set => SetProperty(ref _masterAudioDeviceInformation, value); | ||
set | ||
{ | ||
if (SetProperty(ref _masterAudioDeviceInformation, value)) | ||
{ | ||
_audioDeviceService.PrimaryDevice = _masterAudioDeviceInformation; | ||
} | ||
} | ||
} | ||
|
||
public string HeadphonesAudioDeviceInformation | ||
public AudioDevice HeadphonesAudioDeviceInformation | ||
{ | ||
get => _headphonesAudioDeviceInformation; | ||
set => SetProperty(ref _headphonesAudioDeviceInformation, value); | ||
set | ||
{ | ||
if (SetProperty(ref _headphonesAudioDeviceInformation, value)) | ||
{ | ||
_audioDeviceService.SecondaryDevice = _headphonesAudioDeviceInformation; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Yugen.DJ.Uwp.Views.Dialogs | ||
{ | ||
public sealed partial class AboutDialog | ||
{ | ||
public AboutDialog() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
Oops, something went wrong.