protected override Type GetPlayerUIContributorType(IPlayer player, MediaWorkflowStateType stateType) { // First check if the player provides an own UI contributor. IUIContributorPlayer uicPlayer = player as IUIContributorPlayer; if (uicPlayer != null) { return(uicPlayer.UIContributorType); } // Return the more specific player types first if (player is IImagePlayer) { return(typeof(ImagePlayerUIContributor)); } if (player is IDVDPlayer) { return(typeof(DVDVideoPlayerUIContributor)); } if ((player is IVideoPlayer)) { return(typeof(DefaultVideoPlayerUIContributor)); } if ((player is IAudioPlayer)) { return(typeof(DefaultAudioPlayerUIContributor)); } return(null); }
public void EnterModelContext(NavigationContext oldContext, NavigationContext newContext) { _mediaWorkflowStateType = GetMediaWorkflowStateType(newContext); StartTimer(); _messageQueue.Start(); UpdatePlayerContributor(false); }
protected override Type GetPlayerUIContributorType(IPlayer player, MediaWorkflowStateType stateType) { if (!(player is IAudioPlayer)) return null; // TODO: Specific UI contributor implementations for specific players return typeof(DefaultAudioPlayerUIContributor); }
public override void Initialize(MediaWorkflowStateType stateType, IPlayer player) { base.Initialize(stateType, player); _retroPlayer = player as LibRetroPlayer; _contextMenuItems = new ItemsList(); _stateIndexItems = new ItemsList(); }
public void ExitModelContext(NavigationContext oldContext, NavigationContext newContext) { _mediaWorkflowStateType = MediaWorkflowStateType.None; StopTimer(); _messageQueue.Shutdown(); UpdatePlayerContributor(false); RestoreBackground(); }
protected override Type GetPlayerUIContributorType(IPlayer player, MediaWorkflowStateType stateType) { if (!(player is IAudioPlayer)) { return(null); } // TODO: Specific UI contributor implementations for specific players return(typeof(DefaultAudioPlayerUIContributor)); }
public virtual void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _mediaWorkflowStateType = stateType; _subtitlePlayer = player as ISubtitlePlayer; _chapterPlayer = player as IChapterPlayer; _titlePlayer = player as ITitlePlayer; _subtitleMenuItems = new ItemsList(); _chapterMenuItems = new ItemsList(); _titleMenuItems = new ItemsList(); }
public override void Initialize(MediaWorkflowStateType stateType, IPlayer player) { base.Initialize(stateType, player); _player = player as LiveTvPlayer; if (_player != null) { _player.OnBeginZap += OnBeginZap; _player.OnEndZap += OnEndZap; } }
public virtual void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _mediaWorkflowStateType = stateType; _tagSource = player as ITagSource; CurrentStreamLogo = WebradioHome.CurrentStreamLogo; // Only for Fanart ///////////// ATimer.Elapsed += OnTimedEvent; ATimer.Interval = 15000; ATimer.Start(); //////////////////////////////// }
protected override Type GetPlayerUIContributorType(IPlayer player, MediaWorkflowStateType stateType) { if (!(player is IAudioPlayer)) return null; // First check if the player provides an own UI contributor. IUIContributorPlayer uicPlayer = player as IUIContributorPlayer; if (uicPlayer != null) return uicPlayer.UIContributorType; // TODO: Specific UI contributor implementations for specific players return typeof(DefaultAudioPlayerUIContributor); }
protected IPlayerContext GetPlayerContext(MediaWorkflowStateType stateType) { IPlayerContextManager playerContextManager = ServiceRegistration.Get <IPlayerContextManager>(); if (stateType == MediaWorkflowStateType.CurrentlyPlaying) { // The "currently playing" screen is always bound to the "current player" return(playerContextManager.CurrentPlayerContext); } if (stateType == MediaWorkflowStateType.FullscreenContent) { // The "fullscreen content" screen is always bound to the "primary player" return(playerContextManager.PrimaryPlayerContext); } return(null); }
protected void SetPlayerUIContributor(Type playerUIContributorType, MediaWorkflowStateType stateType, IPlayer player, bool doUpdateScreen) { IPlayerUIContributor oldPlayerUIContributor; lock (_syncObj) oldPlayerUIContributor = PlayerUIContributor; try { if (oldPlayerUIContributor != null && playerUIContributorType == oldPlayerUIContributor.GetType()) { // Player UI contributor is already correct, but maybe must be initialized if (oldPlayerUIContributor.MediaWorkflowStateType != stateType || _oldPlayer != player) { oldPlayerUIContributor.Initialize(stateType, player); } _backgroundDisabled = oldPlayerUIContributor.BackgroundDisabled; _screenName = oldPlayerUIContributor.Screen; _oldPlayer = player; return; } IPlayerUIContributor playerUIContributor = InstantiatePlayerUIContributor(playerUIContributorType); if (playerUIContributor != null) { playerUIContributor.Initialize(stateType, player); _backgroundDisabled = playerUIContributor.BackgroundDisabled; _screenName = playerUIContributor.Screen; } else { _backgroundDisabled = false; _screenName = null; } lock (_syncObj) PlayerUIContributor = playerUIContributor; if (oldPlayerUIContributor != null) { oldPlayerUIContributor.Dispose(); } } finally { if (doUpdateScreen) { UpdateScreen(); } } }
protected override Type GetPlayerUIContributorType(IPlayer player, MediaWorkflowStateType stateType) { if (!(player is IAudioPlayer)) { return(null); } // First check if the player provides an own UI contributor. IUIContributorPlayer uicPlayer = player as IUIContributorPlayer; if (uicPlayer != null) { return(uicPlayer.UIContributorType); } // TODO: Specific UI contributor implementations for specific players return(typeof(DefaultAudioPlayerUIContributor)); }
protected void UpdatePlayerContributor(bool doUpdateScreen) { MediaWorkflowStateType stateType = _mediaWorkflowStateType; if (stateType == MediaWorkflowStateType.None) { SetPlayerUIContributor(null, MediaWorkflowStateType.None, null, doUpdateScreen); } else { IPlayerContext pc = GetPlayerContext(_mediaWorkflowStateType); IPlayer player = pc == null ? null : pc.CurrentPlayer; Type playerUIContributorType = GetPlayerUIContributorType(player, stateType); SetPlayerUIContributor(playerUIContributorType, stateType, player, doUpdateScreen); } Update(); }
public void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _playerContext = stateType == MediaWorkflowStateType.CurrentlyPlaying ? PlayerChoice.CurrentPlayer : PlayerChoice.PrimaryPlayer; _mediaWorkflowStateType = stateType; _player = player as IImagePlayer; _imageWidthProperty = new WProperty(typeof(int), null); _imageHeightProperty = new WProperty(typeof(int), null); _cameraMakeProperty = new WProperty(typeof(string), string.Empty); _cameraModelProperty = new WProperty(typeof(string), string.Empty); _imageExposureBiasProperty = new WProperty(typeof(double), null); _imageExposureTimeProperty = new WProperty(typeof(string), string.Empty); _imageFlashModeProperty = new WProperty(typeof(string), string.Empty); _imageFNumberProperty = new WProperty(typeof(string), string.Empty); _imageDimensionsProperty = new WProperty(typeof(string), string.Empty); _imageISOSpeedProperty = new WProperty(typeof(string), string.Empty); _imageMeteringModeProperty = new WProperty(typeof(string), string.Empty); }
protected override Type GetPlayerUIContributorType(IPlayer player, MediaWorkflowStateType stateType) { // First check if the player provides an own UI contributor. IUIContributorPlayer uicPlayer = player as IUIContributorPlayer; if (uicPlayer != null) return uicPlayer.UIContributorType; // Return the more specific player types first if (player is IImagePlayer) return typeof(ImagePlayerUIContributor); if (player is IDVDPlayer) return typeof(DVDVideoPlayerUIContributor); if ((player is IVideoPlayer)) return typeof(DefaultVideoPlayerUIContributor); return null; }
public void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _mediaWorkflowStateType = stateType; }
public void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _playerContext = stateType == MediaWorkflowStateType.CurrentlyPlaying ? PlayerChoice.CurrentPlayer : PlayerChoice.PrimaryPlayer; _mediaWorkflowStateType = stateType; _player = player as IImagePlayer; _imageWidthProperty = new WProperty(typeof(int), null); _imageHeightProperty = new WProperty(typeof(int), null); _cameraMakeProperty = new WProperty(typeof(string), string.Empty); _cameraModelProperty = new WProperty(typeof(string), string.Empty); _imageExposureBiasProperty = new WProperty(typeof(double), null); _imageExposureTimeProperty = new WProperty(typeof(string), string.Empty); _imageFlashModeProperty = new WProperty(typeof(string), string.Empty); _imageFNumberProperty = new WProperty(typeof(string), string.Empty); _imageDimensionsProperty = new WProperty(typeof(string), string.Empty); _imageISOSpeedProperty = new WProperty(typeof(string), string.Empty); _imageMeteringModeProperty = new WProperty(typeof(string), string.Empty); _imageCountryProperty = new WProperty(typeof(string), string.Empty); _imageStateProperty = new WProperty(typeof(string), string.Empty); _imageCityProperty = new WProperty(typeof(string), string.Empty); }
public void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _mediaWorkflowStateType = stateType; }
public void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _playerContext = stateType == MediaWorkflowStateType.CurrentlyPlaying ? PlayerChoice.CurrentPlayer : PlayerChoice.PrimaryPlayer; _mediaWorkflowStateType = stateType; _player = player as IImagePlayer; }
public virtual void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _mediaWorkflowStateType = stateType; _tagSource = player as ITagSource; CurrentStreamLogo = WebradioHome.CurrentStreamLogo; // Only for Fanart ///////////// ATimer.Elapsed += OnTimedEvent; ATimer.Interval = 15000; ATimer.Start(); //////////////////////////////// }
public void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _playerContext = stateType == MediaWorkflowStateType.CurrentlyPlaying ? PlayerChoice.CurrentPlayer : PlayerChoice.PrimaryPlayer; _mediaWorkflowStateType = stateType; _player = player as IImagePlayer; }
public void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _mediaWorkflowStateType = stateType; _player = player as IChapterPlayer; _chapterMenuItems = new ItemsList(); }
public override void Initialize(MediaWorkflowStateType stateType, IPlayer player) { base.Initialize(stateType, player); _player = player as LiveRadioPlayer; }
public virtual void Initialize(MediaWorkflowStateType stateType, IPlayer player) { _mediaWorkflowStateType = stateType; _subtitlePlayer = player as ISubtitlePlayer; _chapterPlayer = player as IChapterPlayer; _titlePlayer = player as ITitlePlayer; _subtitleMenuItems = new ItemsList(); _chapterMenuItems = new ItemsList(); _titleMenuItems = new ItemsList(); }
public void ExitModelContext(NavigationContext oldContext, NavigationContext newContext) { _mediaWorkflowStateType = MediaWorkflowStateType.None; StopTimer(); _messageQueue.Shutdown(); UpdatePlayerContributor(false); RestoreBackground(); }
protected void SetPlayerUIContributor(Type playerUIContributorType, MediaWorkflowStateType stateType, IPlayer player, bool doUpdateScreen) { IPlayerUIContributor oldPlayerUIContributor; lock (_syncObj) oldPlayerUIContributor = PlayerUIContributor; try { if (oldPlayerUIContributor != null && playerUIContributorType == oldPlayerUIContributor.GetType()) { // Player UI contributor is already correct, but maybe must be initialized if (oldPlayerUIContributor.MediaWorkflowStateType != stateType || _oldPlayer != player) oldPlayerUIContributor.Initialize(stateType, player); _backgroundDisabled = oldPlayerUIContributor.BackgroundDisabled; _screenName = oldPlayerUIContributor.Screen; _oldPlayer = player; return; } IPlayerUIContributor playerUIContributor = InstantiatePlayerUIContributor(playerUIContributorType); if (playerUIContributor != null) { playerUIContributor.Initialize(stateType, player); _backgroundDisabled = playerUIContributor.BackgroundDisabled; _screenName = playerUIContributor.Screen; } else { _backgroundDisabled = false; _screenName = null; } lock (_syncObj) PlayerUIContributor = playerUIContributor; if (oldPlayerUIContributor != null) oldPlayerUIContributor.Dispose(); } finally { if (doUpdateScreen) UpdateScreen(); } }
public void ChangeModelContext(NavigationContext oldContext, NavigationContext newContext, bool push) { _mediaWorkflowStateType = GetMediaWorkflowStateType(newContext); UpdatePlayerContributor(false); }
protected IPlayerContext GetPlayerContext(MediaWorkflowStateType stateType) { IPlayerContextManager playerContextManager = ServiceRegistration.Get<IPlayerContextManager>(); if (stateType == MediaWorkflowStateType.CurrentlyPlaying) // The "currently playing" screen is always bound to the "current player" return playerContextManager.CurrentPlayerContext; if (stateType == MediaWorkflowStateType.FullscreenContent) // The "fullscreen content" screen is always bound to the "primary player" return playerContextManager.PrimaryPlayerContext; return null; }
/// <summary> /// Returns the type of the player UI contributor implementation to be used for the given <paramref name="player"/> and /// media workflow <paramref name="stateType"/>. /// Actually, the code to determine the correct player UI contributor should be implemented to be generic and extendible /// (and we should avoid to hard code the determination in sub classes). But we need a piece of code to execute specific /// checks. I don't want to make them too generic because the checks could be very specific. For example, it might be that /// the single cases are not disjoint. For example if a player supports two specific player interfaces. /// In such a case, we might need intelligent code here. /// </summary> /// <param name="player">The player for that the player UI contributor should be instantiated.</param> /// <param name="stateType">The media workflow state type, we need the UI contributor for.</param> /// <returns>Type of the player UI contributor to use.</returns> protected abstract Type GetPlayerUIContributorType(IPlayer player, MediaWorkflowStateType stateType);
/// <summary> /// Returns the type of the player UI contributor implementation to be used for the given <paramref name="player"/> and /// media workflow <paramref name="stateType"/>. /// Actually, the code to determine the correct player UI contributor should be implemented to be generic and extendible /// (and we should avoid to hard code the determination in sub classes). But we need a piece of code to execute specific /// checks. I don't want to make them too generic because the checks could be very specific. For example, it might be that /// the single cases are not disjoint. For example if a player supports two specific player interfaces. /// In such a case, we might need intelligent code here. /// </summary> /// <param name="player">The player for that the player UI contributor should be instantiated.</param> /// <param name="stateType">The media workflow state type, we need the UI contributor for.</param> /// <returns>Type of the player UI contributor to use.</returns> protected abstract Type GetPlayerUIContributorType(IPlayer player, MediaWorkflowStateType stateType);
public override void Initialize(MediaWorkflowStateType stateType, IPlayer player) { base.Initialize(stateType, player); _dvdPlayer = player as IDVDPlayer; }
public override void Initialize(MediaWorkflowStateType stateType, IPlayer player) { base.Initialize(stateType, player); _dvdPlayer = player as IDVDPlayer; }
public void ChangeModelContext(NavigationContext oldContext, NavigationContext newContext, bool push) { _mediaWorkflowStateType = GetMediaWorkflowStateType(newContext); UpdatePlayerContributor(false); }
public void EnterModelContext(NavigationContext oldContext, NavigationContext newContext) { _mediaWorkflowStateType = GetMediaWorkflowStateType(newContext); StartTimer(); _messageQueue.Start(); UpdatePlayerContributor(false); }