Ejemplo n.º 1
0
		/// <summary>
		/// Opens Next PlayListItem in the PlayList
		/// </summary>
		/// <param name="KeepInSyncWithCurrentlyPlayListItem"></param>
		/// <returns></returns>
		public bool LoadNextPlayListItem(bool KeepInSyncWithCurrentlyPlayListItem,int CurrentPlayTime,out int CurrentView,out int TotalViews)
		{
			CurrentView = 0;
			TotalViews = 0;
			//m_StartPlaying = false;
			if(PlayList.Count > 1)
			{
				m_CurrentPlayListIndex++;
				CurrentView = m_CurrentPlayListIndex + 1;
				TotalViews = PlayList.Count;
				if(m_CurrentPlayListIndex > PlayList.Count - 1)
				{
					m_CurrentPlayListIndex = 0;
					CurrentView = 1;
				}
				WMPLib.WMPPlayState PP = WMPLib.WMPPlayState.wmppsPlaying;

				switch(this.CurrentPlayerType)
				{
					case PlayerType.CarverLabPlayer:
						throw new NotSupportedException("Player type not supported.");
//						this.axUMediaPlayer1.Stop();
//						break;
					case PlayerType.WindowMediaPlayer:	
						PP = this.axWMPlayer1.playState;
						this.axWMPlayer1.Ctlcontrols.stop();						
						break;
				}				

				OysterPlaybackControls.PlayListItem PLI = PlayList.Item(m_CurrentPlayListIndex);
	
					this.Open(PLI.Name,PLI.PlaybackTransportType,PLI.PlaybackMediaType,PLI.URL,PLI.Address,PLI.Port);
				Application.DoEvents();
				
//				}
				LastURL = PLI.URL;
				LastPlayListItem = PLI;
				System.Threading.Thread.SpinWait(500);
//				if(this.IsUMPlayer)
//				{
//					this.axUMediaPlayer1.Seek(CurrentPlayTime);					
//				}
//				else
				{
					this.axWMPlayer1.Ctlcontrols.currentPosition = CurrentPlayTime;						
				}
				if(KeepInSyncWithCurrentlyPlayListItem)
				{
					if(m_PtrSurface != null)
					{
						foreach(string ss in m_PtrSurface.PlaybackControlList)
						{
							OysterPlaybackControls.PlaybackCtrl ctrl = m_PtrSurface.PlaybackControlList[ss];
//							if(ctrl.IsUMPlayer)
//							{
//								ctrl.axUMediaPlayer1.Seek(CurrentPlayTime);
//							}
//							else
							{
								ctrl.axWMPlayer1.Ctlcontrols.play();
								ctrl.axWMPlayer1.Ctlcontrols.currentPosition = CurrentPlayTime;
							}
						}
					}					
//					Application.DoEvents();					
//					TSetThreads();					

				}
				if(m_bMuted)
				{
				
//					if(this.IsUMPlayer)
//					{					
//						this.axUMediaPlayer1.AdjustVolume(-90000);
//					}
//					else
					{
						this.axWMPlayer1.settings.mute = true;
					}
				}
				this.playbackControls1.SwitchToPlayButton();
				//AREObj.Reset();
				return true;
			}
			return false;
		}
Ejemplo n.º 2
0
		public void OpenPlayList()
		{			
			if(PlayList.Count != 0)
			{
				m_CurrentPlayListIndex = 0;
				OysterPlaybackControls.PlayListItem PLI = PlayList.Item(m_CurrentPlayListIndex);
				this.Open(PLI.Name,PLI.PlaybackTransportType,PLI.PlaybackMediaType,PLI.URL,PLI.Address,PLI.Port);
				LastURL = PLI.URL;
				LastPlayListItem = PLI;
				//				if(m_PtrSurface != null)
				//					m_PtrSurface.Play();				
			}
		}