private int GetCurrentDuration(AxUMediaControlLib.AxUMediaPlayer XPlayer) { lock(this) { int TPTime = 0; TPTime = XPlayer.TotalTime_Sec; return TPTime; } }
private void RemovePlayer(AxUMediaControlLib.AxUMediaPlayer PlayBackPlayer) { PlayBackPlayers.Remove(PlayBackPlayer); }
private int GetCurrentPosition(AxUMediaControlLib.AxUMediaPlayer XPlayer) { lock(this) { int CPTime = 0; CPTime= XPlayer.CurrentPlaybackTime_Sec; return CPTime; } }
private void AddPlayer(AxUMediaControlLib.AxUMediaPlayer PlayBackPlayer, bool LoadCurrentPreview) { int CurrentPosition = 0; //Loads the Current Recording from the PreviewWindow to PlayBackPlayer if(LoadCurrentPreview) { OCL.Recording R = (OCL.Recording) CameraAngles[CurrentCameraIndex]; OCL.VideoStorageServer VSS2 = R.CurrentVideoStorageServer; OCL.VideoStorageServerType VST2 = VSS2.CurrentVideoStorageServerType; CurrentPosition = GetCurrentPosition(PreviewPlayer); PlayBackPlayer.UseTCP(); PlayBackPlayer.UseMediaServer(VSS2.ControlAddress + ":5119"); PlayBackPlayer.UseFile(VSS2.StorageDirectory + @"\" + R.Description); //Adds PlayBackPlayer to the arraylist of PlayBackPlayers PlayBackPlayers.Add(PlayBackPlayer); //Synchronizes new player with PreviewPlayer and all other Players this.Play(); SynchronizedTime = CurrentPosition; System.Threading.Thread WorkerThread = new System.Threading.Thread(new System.Threading.ThreadStart(PresentationSync)); WorkerThread.Start(); } else { //Adds PlayBackPlayer to the arraylist of PlayBackPlayers PlayBackPlayers.Add(PlayBackPlayer); } }
public void OpenRecordingSession(OCL.RecordingSession RS, OCL.User AccessingUser,AxUMediaControlLib.AxUMediaPlayer Preview_Player, AxUMediaControlLib.AxUMediaPlayer PlayBack_Player) { pLUser = AccessingUser; PreviewPlayer = Preview_Player; PlayBackPlayers = new ArrayList(); if(PlayBack_Player != null) PlayBackPlayers.Add(PlayBack_Player); TStatusChecker = new System.Timers.Timer(500); TStatusChecker.Elapsed +=new System.Timers.ElapsedEventHandler(TStatusChecker_Elapsed); CameraAngles = new ArrayList(); CurrentRecordingSession = RS; PresentationViews = RS.CurrentRecordings(pLUser); if(RS.IsPresentation) { foreach(OCL.Recording CurrentRecording in PresentationViews) { OCL.VideoStorageServer VSS = CurrentRecording.CurrentVideoStorageServer; OCL.VideoStorageServerType VST = VSS.CurrentVideoStorageServerType; if(CurrentRecording.IsPrimaryCamera) { CurrentCameraIndex = CameraAngles.Count; CameraAngles.Add(CurrentRecording); try { if(VST.Description == "Windows Media Server") { try { PreviewPlayer.Stop(); } catch(Exception Err) { string sPeek = Err.Message; } PreviewPlayer.UseTCP(); PreviewPlayer.UseMediaServer(VSS.ControlAddress + ":5119"); PreviewPlayer.UseFile(VSS.StorageDirectory + @"\" + CurrentRecording.Description); } } catch(Exception Err) { MessageBox.Show(Err.Message,"Error occurred while loading media"); return; } } else if(CurrentRecording.IsDesktopCapture) { try { if(PlayBackPlayers.Count != 1) { throw new Exception("Functional Error: Not enough cameras are available to display Presentation"); } if(VST.Description == "Windows Media Server") { try { ((AxUMediaControlLib.AxUMediaPlayer)PlayBackPlayers[0]).Stop(); } catch(Exception Err) { string sPeek = Err.Message; } ((AxUMediaControlLib.AxUMediaPlayer)PlayBackPlayers[0]).UseTCP(); ((AxUMediaControlLib.AxUMediaPlayer)PlayBackPlayers[0]).UseMediaServer(VSS.ControlAddress + ":5119"); ((AxUMediaControlLib.AxUMediaPlayer)PlayBackPlayers[0]).UseFile(VSS.StorageDirectory + @"\" + CurrentRecording.Description); } } catch(Exception Err) { MessageBox.Show(Err.Message,"Error occurred while loading media"); return; } } else { CameraAngles.Add(CurrentRecording); } } } else { CurrentCameraIndex = 0; bool bFirstPass = true; foreach(OCL.Recording CurrentRecording in PresentationViews) { OCL.VideoStorageServer VSS = CurrentRecording.CurrentVideoStorageServer; OCL.VideoStorageServerType VST = VSS.CurrentVideoStorageServerType; if(bFirstPass) { bFirstPass = false; CurrentCameraIndex = CameraAngles.Count; CameraAngles.Add(CurrentRecording); try { if(VST.Description == "Windows Media Server") { try { PreviewPlayer.Stop(); } catch(Exception Err) { string sPeek = Err.Message; } PreviewPlayer.UseTCP(); PreviewPlayer.UseMediaServer(VSS.ControlAddress + ":5119"); PreviewPlayer.UseFile(VSS.StorageDirectory + @"\" + CurrentRecording.Description); } } catch(Exception Err) { MessageBox.Show(Err.Message,"Error occurred while loading media"); return; } } else CameraAngles.Add(CurrentRecording); } } this.Play(); TStatusChecker.Enabled = true; return; }
public void OpenScene(OCL.Scene SC, OCL.User AccessingUser, AxUMediaControlLib.AxUMediaPlayer Preview_Player) { pLUser = AccessingUser; PreviewPlayer = Preview_Player; PlayBackPlayers = new ArrayList(); TStatusChecker = new System.Timers.Timer(500); TStatusChecker.Elapsed +=new System.Timers.ElapsedEventHandler(TStatusChecker_Elapsed); CameraAngles = new ArrayList(); }
public void OpenRecordingSession(OCL.RecordingSession RS, OCL.User AccessingUser,AxUMediaControlLib.AxUMediaPlayer Preview_Player) { AxUMediaControlLib.AxUMediaPlayer NullPlayer = null; OpenRecordingSession(RS,AccessingUser,Preview_Player,NullPlayer); }
private void AcquireStatus(AxUMediaControlLib.AxUMediaPlayer XPlayer,out int CPosition, out int TDuration,out string CPositionString,out string TDurationString) { try { CPosition = XPlayer.CurrentPlaybackTime_Sec; TDuration = XPlayer.TotalTime_Sec; CPositionString = GetTimeFromSeconds(CPosition); TDurationString = GetTimeFromSeconds(TDuration); } catch(Exception Err) { string peekError = Err.Message; CPosition = 0; TDuration = 0; CPositionString = ""; TDurationString = ""; return; } }