示例#1
0
        public LedManagerPresenter(ILedManagerView view,
                                   IConfigurationStorageService configurationStorageService,
                                   IBrightnessService brightnessService,
                                   IVideoMetadataService videoMetadataService)
        {
            this.configurationStorageService = configurationStorageService;
            this.brightnessService           = brightnessService;
            this.videoMetadataService        = videoMetadataService;
            this.view = view;

            this.view.NewConfiguration  += NewConfiguration;
            this.view.SaveConfiguration += SaveConfiguration;
            this.view.OpenConfiguration += OpenConfiguration;

            this.view.AddNewServer += AddNewServer;
            this.view.EditServer   += EditServer;
            this.view.RemoveServer += RemoveServer;

            this.view.PreviewBrightnessChanged += PreviewBrightnessChanged;
            this.view.BrightnessChanged        += BrightnessChanged;

            this.view.ImportVideo      += ImportVideo;
            this.view.StartTimeChanged += StartTimeChanged;

            this.view.InitializePlayback += InitializePlayback;
            this.view.Play += Play;
            this.view.Stop += Stop;

            this.view.ShowServerStatus += ShowServerStatus;

            this.view.PlaybackStatus = PlaybackStatus.NotReady;

            NewConfiguration(null, EventArgs.Empty);
        }
示例#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
        public MainPage()
        {
            InitializeComponent();
            On<Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true);
            _openWeatherMapService = new OpenWeatherMapService();

            _brightnessService = DependencyService.Get<IBrightnessService>();
        }
 public ShareCadenaCon(string Title, string Code)
 {
     this.BindingContext = this;
     this.Code           = Code;
     InitializeComponent();
     this.BarcodeImageView.BarcodeOptions = new QrCodeEncodingOptions()
     {
         Height = 1000,
         Width  = 1000
     };
     this.TxtTitle.Text     = Title;
     this.BrightnessService = DependencyService.Get <IBrightnessService>();
 }
示例#5
0
 public ImageWithCanvasService(
     int canvasWidth,
     int canvasHeight,
     IBrightnessService brightnessService,
     IImageCaptionService imageCaptionService,
     ILogger logger)
 {
     // save dependencies
     _brightnessService   = brightnessService;
     _canvasHeight        = canvasHeight;
     _canvasWidth         = canvasWidth;
     _imageCaptionService = imageCaptionService;
     _logger = logger;
 }
        public BoxViewModel(LEDBox box)
        {
            _box = box;
            _COMIndex = _box.COMIndex;
            _senderIndex = (byte)(_box.SenderIndex + 1);
            _portIndex = (byte)(_box.PortIndex + 1);
            _connectIndex = (byte)(_box.ConnectIndex + 1);
            _width = _box.Width;
            _height = _box.Height;
            _x = _box.X;
            _y = _box.Y;
            _xInPort = _box.XInPort;
            _yInPort = _box.YInPort;
            _indexLocation = GetIndexLocation(_box);

            SelectBoxCommand = new DelegateCommand<object>(SelectBox);
            _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
            _brightnessService = ServiceLocator.Current.GetInstance<IBrightnessService>();
            _readDataTimer = new Timer(ReadData, null, 0, 1000 * 30);
        }
示例#7
0
 public MainViewModel(IBrightnessService brightnessService)
 {
     this.brightnessService = brightnessService;
 }
 public BrightnessViewModel(IBrightnessService brightnessController)
 {
     _brightnessController = brightnessController;
     Brightness            = Settings.VideoBrightness;
 }
        public VideoPlayerViewModel(MediaPlayerBuilder playerService,
                                    IVideoLibrary videoLibrary, IVolumeService volumeController, IBrightnessService brightnessController,
                                    IOrientationService orientationService, IStatusBarService statusBarService, IFileService fileService)
        {
            App.DebugLog("");
            this.videoLibrary       = videoLibrary;
            this.orientationService = orientationService;
            this.statusBarService   = statusBarService;
            FilePickerVM            = new FilePickerViewModel(fileService);
            FilePickerVM.SubtitleFileTappedCommand = new Command <object>(o => SubtitleFileTapped(o));
            ToggleFavoriteCommand           = new Command(ToggleFavorite);
            ToggleControlsVisibilityCommand = new Command(ToggleControlsVisibility);
            ToggleAudioTracksCommand        = new Command(ToggleAudioTracks);
            ToggleSubtitlesCommand          = new Command(ToggleSubtitles);
            ToggleMediaInfoCommand          = new Command(ToggleMediaInfo);
            SelectSubtitlesCommand          = new Command <object>(SelectSubtitles, (e) => canChangeSubtitles);
            SelectAudioTrackCommand         = new Command <object>(SelectAudioTrack, (e) => canChangeAudioTrack);
            OpenSubtitlesFromFileCommand    = new Command(OpenSubtitlesFilePicker);

            volumeViewModel     = new VolumeViewModel(volumeController);
            brightnessViewModel = new BrightnessViewModel(brightnessController);

            favoriteScenes = new FavoritesCollection(favoriteSceneDuration);

            VlcPlayerHelper = new VlcPlayerHelper(playerService);
        }