private void TryBindHotKeys() { var page = new Pages.Settings.HotKeyPage(); OverallKeyHook.AddKeyHook(page.PlayPause.Name, () => { PlayController.Default.TogglePlay(); }); OverallKeyHook.AddKeyHook(page.Previous.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.Next.Name, async() => { await PlayController.Default.PlayNext(); }); OverallKeyHook.AddKeyHook(page.VolumeUp.Name, () => { AppSettings.Current.Volume.Main += 0.05f; }); OverallKeyHook.AddKeyHook(page.VolumeDown.Name, () => { AppSettings.Current.Volume.Main -= 0.05f; }); OverallKeyHook.AddKeyHook(page.FullMini.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.AddToFav.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.Lyric.Name, () => { if (LyricWindow.IsShown) { LyricWindow.Hide(); } else { LyricWindow.Show(); } }); }
private void TryBindHotKeys() { OverallKeyHook.AddKeyHook(HotKeyType.TogglePlay, () => _controller.PlayList.CurrentInfo?.TogglePlayHandle()); OverallKeyHook.AddKeyHook(HotKeyType.PrevSong, async() => await _controller.PlayPrevAsync()); OverallKeyHook.AddKeyHook(HotKeyType.NextSong, async() => await _controller.PlayNextAsync()); OverallKeyHook.AddKeyHook(HotKeyType.VolumeUp, () => { AppSettings.Default.Volume.Main += 0.05f; AppSettings.SaveDefault(); }); OverallKeyHook.AddKeyHook(HotKeyType.VolumeDown, () => { AppSettings.Default.Volume.Main -= 0.05f; AppSettings.SaveDefault(); }); OverallKeyHook.AddKeyHook(HotKeyType.SwitchFullMiniMode, () => { TriggerMiniWindow(); }); OverallKeyHook.AddKeyHook(HotKeyType.AddCurrentToFav, () => { //TODO }); OverallKeyHook.AddKeyHook(HotKeyType.SwitchLyricWindow, () => { if (LyricWindow.IsShown) { LyricWindow.Hide(); } else { LyricWindow.Show(); } }); }
private void TryBindHotkeys() { var page = new Pages.Settings.HotKeyPage(this); OverallKeyHook.AddKeyHook(page.PlayPause.Name, () => { BtnPlay_Click(null, null); }); OverallKeyHook.AddKeyHook(page.Previous.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.Next.Name, () => { BtnNext_Click(null, null); }); OverallKeyHook.AddKeyHook(page.VolumeUp.Name, () => { PlayerConfig.Current.Volume.Main += 0.05f; }); OverallKeyHook.AddKeyHook(page.VolumeDown.Name, () => { PlayerConfig.Current.Volume.Main -= 0.05f; }); OverallKeyHook.AddKeyHook(page.FullMini.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.AddToFav.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.Lyric.Name, () => { if (LyricWindow.IsHide) { LyricWindow.Show(); } else { LyricWindow.Hide(); } }); }
private void MenuOpenHideLyric_Click(object sender, RoutedEventArgs e) { if (LyricWindow.IsShown) { LyricWindow.Hide(); } else { LyricWindow.Show(); } }
private void MenuOpenHideLyric_Click(object sender, RoutedEventArgs e) { if (ViewModel.IsLyricWindowShown) { PlayerConfig.Current.Lyric.EnableLyric = false; LyricWindow.Hide(); } else { PlayerConfig.Current.Lyric.EnableLyric = true; LyricWindow.Show(); } }