Пример #1
0
 private CommandActionMap CreateGlobalCommandActionMap()
 {
     return(new CommandActionMap
     {
         new CommandActionMapping(Command.Null, NullAction),
         new CommandActionMapping(Command.Play, Play),
         new CommandActionMapping(Command.PlayPause, PlayPause),
         new CommandActionMapping(Command.Pause, Pause),
         new CommandActionMapping(Command.UnPause, UnPause),
         new CommandActionMapping(Command.Stop, Stop),
         new CommandActionMapping(Command.TogglePause, TogglePause),
         new CommandActionMapping(Command.Queue, NullAction),
         new CommandActionMapping(Command.FastForward, FastForward),
         new CommandActionMapping(Command.Rewind, Rewind),
         new CommandActionMapping(Command.PlaySpeedRatio, NullAction),
         new CommandActionMapping(Command.NextChapter, NextChapter),
         new CommandActionMapping(Command.PreviousChapter, PreviousChapter),
         new CommandActionMapping(Command.NextTrack, NextTrack),
         new CommandActionMapping(Command.PreviousTrack, PreviousTrack),
         new CommandActionMapping(Command.NextTrackOrChapter, NextTrackOrChapter),
         new CommandActionMapping(Command.PreviousTrackOrChapter, PreviousTrackOrChapter),
         new CommandActionMapping(Command.Seek, Seek),
         new CommandActionMapping(Command.Left, NullAction),
         new CommandActionMapping(Command.Right, NullAction),
         new CommandActionMapping(Command.Up, NullAction),
         new CommandActionMapping(Command.PageUp, NullAction),
         new CommandActionMapping(Command.PageDown, NullAction),
         new CommandActionMapping(Command.FirstPage, NullAction),
         new CommandActionMapping(Command.Rewind, NullAction),
         new CommandActionMapping(Command.PlaySpeedRatio, NullAction),
         new CommandActionMapping(Command.LastPage, NullAction),
         new CommandActionMapping(Command.Select, NullAction),
         new CommandActionMapping(Command.Back, (s, a) => _navigationService.NavigateBack()),
         new CommandActionMapping(Command.Forward, (s, a) => _navigationService.NavigateForward()),
         new CommandActionMapping(Command.GotoHome, (s, a) => _navigationService.NavigateToHomePage()),
         new CommandActionMapping(Command.GotoSearch, (s, a) => _navigationService.NavigateToSearchPage()),
         new CommandActionMapping(Command.GotoSettings, (s, a) => _navigationService.NavigateToSettingsPage()),
         new CommandActionMapping(Command.GotoPage, NullAction),
         new CommandActionMapping(Command.Info, ToggleInfoPanel),
         new CommandActionMapping(Command.SkipNext, SkipForward, 60),                   // skip forward 60  seconds, boxed arguments
         new CommandActionMapping(Command.SkipPrevious, SkipBackward, 60),
         new CommandActionMapping(Command.Step, SkipForward, 60),
         new CommandActionMapping(Command.SmallStepForward, SkipForward, 10),
         new CommandActionMapping(Command.SmallStepBack, SkipBackward, 10),
         new CommandActionMapping(Command.StepForward, SkipForward, 60),
         new CommandActionMapping(Command.StepBack, SkipBackward, 60),
         new CommandActionMapping(Command.BigStepForward, SkipForward, 300),
         new CommandActionMapping(Command.BigStepBack, SkipBackward, 300),
         new CommandActionMapping(Command.FullScreen, (s, a) => _presentationManager.FullScreen()),
         new CommandActionMapping(Command.MinimizeScreen, (s, a) => _presentationManager.MinimizeScreen()),
         new CommandActionMapping(Command.RestoreScreen, (s, a) => _presentationManager.RestoreScreen()),
         new CommandActionMapping(Command.ToggleFullScreen, (s, a) => _presentationManager.Window.Dispatcher.InvokeAsync(() => _presentationManager.ToggleFullscreen())),
         new CommandActionMapping(Command.SetVolume, SetVolume),
         new CommandActionMapping(Command.VolumeUp, (s, e) => _playbackManager.VolumeStepUp()),
         new CommandActionMapping(Command.VolumeDown, (s, e) => _playbackManager.VolumeStepDown()),
         new CommandActionMapping(Command.Mute, (s, e) => _playbackManager.Mute()),
         new CommandActionMapping(Command.UnMute, (s, e) => _playbackManager.UnMute()),
         new CommandActionMapping(Command.ToggleMute, (s, e) => _playbackManager.ToggleMute()),
         new CommandActionMapping(Command.SetSubtitleStreamIndex, SetSubtitleStreamIndex),
         new CommandActionMapping(Command.NextSubtitleStream, (s, a) => _playbackManager.NextSubtitleStream()),
         new CommandActionMapping(Command.SetAudioStreamIndex, SetAudioStreamIndex),
         new CommandActionMapping(Command.NextAudioStream, (s, a) => _playbackManager.NextAudioStream()),
         new CommandActionMapping(Command.AspectRatio, NullAction),               // ToDo
         new CommandActionMapping(Command.ShowOsd, ShowOsd),
         new CommandActionMapping(Command.HideOsd, HideOSd),
         new CommandActionMapping(Command.ToggleOsd, ToggleOsd),
         new CommandActionMapping(Command.ShowInfoPanel, ShowInfoPanel),
         new CommandActionMapping(Command.HideinfoPanel, HideInfoPanel),
         new CommandActionMapping(Command.ToggleInfoPanel, ToggleInfoPanel),
         new CommandActionMapping(Command.ShowScreensaver, (s, a) => _screensaverManager.ShowScreensaver(true)),
         new CommandActionMapping(Command.ScreenDump, (s, a) => MBTScreenDump.GetAndSaveWindowsImage(_presentationManager.WindowHandle)),
         new CommandActionMapping(Command.ToggleVideoScaling, ToggleVideoScaling),
     });
 }