コード例 #1
0
 public VolumeViewModel(IVolumeService volumeController)
 {
     _volumeController = volumeController;
     MaxVolume         = volumeController.GetMaxVolume();
     Volume            = volumeController.GetVolume();
     volumeController.VolumeChanged += VolumeController_VolumeChanged;
 }
コード例 #2
0
 public VideoPlayerViewModel(INavigationService navigationService, MediaPlayerService playerService,
                             IVideoLibrary videoLibrary, IVolumeService volumeController, IBrightnessService brightnessController,
                             IOrientationService orientationService, IStatusBarService statusBarService)
 {
     App.DebugLog("");
     this.navigationService          = navigationService;
     this.playerService              = playerService;
     this.videoLibrary               = videoLibrary;
     this.volumeController           = volumeController;
     this.brightnessController       = brightnessController;
     this.orientationService         = orientationService;
     this.statusBarService           = statusBarService;
     PlayPauseCommand                = new DelegateCommand(TogglePlayPause);
     ToggleFavoriteCommand           = new DelegateCommand(ToggleFavorite);
     ToggleControlsVisibilityCommand = new DelegateCommand(ToggleControlsVisibility);
     ToggleAudioTracksCommand        = new DelegateCommand(ToggleAudioTracks);
     ToggleSubtitlesCommand          = new DelegateCommand(ToggleSubtitles);
     ToggleMediaInfoCommand          = new DelegateCommand(ToggleMediaInfo);
     SelectSubtitlesCommand          = new DelegateCommand <object>(SelectSubtitles, (e) => canChangeSubtitles);
     SelectAudioTrackCommand         = new DelegateCommand <object>(SelectAudioTrack, (e) => canChangeAudioTrack);
     MaxVolume = volumeController.GetMaxVolume();
     Volume    = volumeController.GetVolume();
     volumeController.VolumeChanged += VolumeController_VolumeChanged;
     Brightness     = Settings.VideoBrightness;
     favoriteScenes = new FavoritesCollection(favoriteSceneDuration);
 }
コード例 #3
0
        private async void VolumeController_VolumeChanged(object sender, VolumeChangedEventArgs e)
        {
            await Task.Delay(500);

            Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
            {
                Volume = _volumeController.GetVolume();
            });
        }
コード例 #4
0
ファイル: VolumeController.cs プロジェクト: joeybrown/potbot
 public IActionResult GetServiceTemperature()
 {
   var volume = _volumeService.GetVolume();
   _logger.LogInformation($"Volume requested. Returning {volume}", volume);
   return Ok(volume);
 }