/// <summary> /// Returns all TargetGroup's recordings that are watchable to the AccessingUser /// </summary> /// <param name="AccessingUser"></param> /// <param name="TargetUser"></param> /// <returns>OCL.Recordings</returns> internal Recordings GetAllWatchableRecordings(OCL.User AccessingUser, OCL.Group TargetGroup) { string sSQL = ""; if(AccessingUser.mvarIsSuperUser) { sSQL = "SELECT ObjectId FROM tblGroupTokens WHERE GroupId = " + TargetGroup.ID + " AND ObjectTypeId = 2" + " AND IsVisible <> 0 " + " AND IsUsable <> 0" + " AND ObjectId <> " + ((OCL.Recording)(GetUnassignedObject(OCL.OysterUnassignedObjects.Recording))).ID; } else { sSQL = "SELECT ObjectId FROM tblGroupTokens WHERE GroupId = " + TargetGroup.ID + " AND UserId = " + AccessingUser.ID + " AND ObjectTypeId = 2" + " AND IsVisible <> 0" + " AND IsUsable <> 0" + " AND ObjectId <> " + ((OCL.Recording)(GetUnassignedObject(OCL.OysterUnassignedObjects.Recording))).ID; } System.Data.DataSet DS = RF.GetDataSet(sSQL); OCL.Recordings S = new OCL.Recordings(); if(DS.Tables[0].Rows.Count == 0) { foreach(DataRow r in DS.Tables[0].Rows) { S.Add(GetRecording(Convert.ToInt32(r[0]))); } } return S; }
/// <summary> /// Returns all TargetUser's recordings that are watchable by the AccessingUser /// </summary> /// <param name="AccessingUser"></param> /// <param name="TargetUser"></param> /// <returns>OCL.Recordings</returns> internal Recordings GetAllWatchableRecordings(OCL.User AccessingUser, OCL.User TargetUser) { string sSQL = ""; bool GetOwned = false; if(AccessingUser.mvarIsSuperUser) { sSQL = "SELECT ID FROM tblRecording WHERE ID <> " + ((OCL.Recording)(GetUnassignedObject(OCL.OysterUnassignedObjects.Recording))).ID + " AND OwnerId = " + TargetUser.ID; } else { GetOwned = true; sSQL = "SELECT DISTINCT tblGroupTokens.ObjectId FROM tblGroupTokens LEFT OUTER JOIN tblRecording " + "ON tblRecording.OwnerId = tblGroupTokens.UserId WHERE tblGroupTokens.UserId = " + AccessingUser.ID + " AND tblGroupTokens.ObjectTypeId = 2" + " AND tblGroupTokens.IsVisible <> 0" + " AND tblGroupTokens.IsUsable <> 0" + " AND tblGroupTokens.ObjectId <> " + ((OCL.Recording)(GetUnassignedObject(OCL.OysterUnassignedObjects.Recording))).ID + " AND tblRecording.OwnerId = " + TargetUser.ID; } System.Data.DataSet DS = RF.GetDataSet(sSQL); OCL.Recordings AR = new OCL.Recordings(); foreach(DataRow r in DS.Tables[0].Rows) { AR.Add(GetRecording(Convert.ToInt32(r[0]))); } if(GetOwned == true) { sSQL = "SELECT * FROM tblRecording WHERE OwnerId = " + AccessingUser.ID; DS = RF.GetDataSet(sSQL); foreach(DataRow r in DS.Tables[0].Rows) { foreach(OCL.Recording OR in AR) { if(OR.ID == Convert.ToInt32(r[0])) goto skipAdd; } AR.Add(FillRecording(r)); skipAdd:{} } } return AR; }
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; }
internal object GetAllGroupObjectsWithPermission(OCL.User AccessingUser, OCL.OysterObjectType OBT, OCL.OysterPermissions OP) { string sSQL = "SELECT DISTINCT ObjectId FROM tblGroupTokens WHERE UserId = " + AccessingUser.ID + " AND ObjectTypeId = " + Convert.ToInt32(OBT) + " AND " + GetPermissionColumnName(OP) + " = " + Convert.ToInt32(OP); DataSet DS = RF.GetDataSet(sSQL); if(DS.Tables[0].Rows.Count == 0) return null; switch(OBT) { case OCL.OysterObjectType.User: OCL.Users US = new OCL.Users(); foreach(DataRow R in DS.Tables[0].Rows) { US.Add(GetUser(Convert.ToInt32(R[0]))); } return US; case OCL.OysterObjectType.Recording: OCL.Recordings RS = new OCL.Recordings(); foreach(DataRow R in DS.Tables[0].Rows) { RS.Add(GetRecording(Convert.ToInt32(R[0]))); } return RS; case OCL.OysterObjectType.Control: OCL.Controls XS = new OCL.Controls(); foreach(DataRow R in DS.Tables[0].Rows) { XS.Add(GetControl(Convert.ToInt32(R[0]))); } return XS; case OCL.OysterObjectType.Source: OCL.Sources S = new OCL.Sources(); foreach(DataRow R in DS.Tables[0].Rows) { S.Add(GetSource(Convert.ToInt32(R[0]))); } return S; case OCL.OysterObjectType.Scene: OCL.Scenes SS = new OCL.Scenes(); foreach(DataRow R in DS.Tables[0].Rows) { SS.Add(GetScene(Convert.ToInt32(R[0]))); } return SS; case OCL.OysterObjectType.Note: OCL.Notes N = new OCL.Notes(); foreach(DataRow R in DS.Tables[0].Rows) { N.Add(GetNote(Convert.ToInt32(R[0]))); } return N; default: return null; } }
private void btnViewPresentation_Click(object sender, System.EventArgs e) { if(listView1.SelectedItems.Count == 0)return; CameraAngles = new ArrayList(); UP.Size = new System.Drawing.Size(600,388); if(listView1.SelectedItems[0].Tag is OCL.Recording) { OCL.Recording R = (OCL.Recording) listView1.SelectedItems[0].Tag; if(R.IsPresentation) { PresentationViews = OSystem.GetSessionById(R.SessionID); if(PresentationViews.Count == 1) { // Defaulting to Normal View DisplayMode(false); MessageBox.Show("This video is marked as a Presentation but only 1 video is detected... automatically switching " + "to Normal View Mode.","Unexpected error detected"); btnViewRecording_Click(btnViewRecording,new System.EventArgs()); } else if(PresentationViews.Count > 1) { foreach(OCL.Recording CurrentRecording in PresentationViews) { OCL.VideoStorageServer VSS = OSystem.GetVideoStorageServerById(CurrentRecording.VideoStorageServerID); OCL.VideoStorageServerType VST = VSS.CurrentVideoStorageServerType; if(CurrentRecording.IsPrimaryCamera) { //PlayerButtons(true); lblMediaTitle.Tag = CurrentRecording; lblMediaTitle.Text = CurrentRecording.SessionName; lblMediaTitle.ForeColor = Color.DarkGoldenrod; CurrentCameraIndex = CameraAngles.Count; CameraAngles.Add(CurrentRecording); try { if(VST.Description == "Windows Media Server") { try { UPCamera.Stop(); } catch(Exception Err) { string sPeek = Err.Message; } UPCamera.UseTCP(); UPCamera.UseMediaServer(VSS.ControlAddress + ":5119"); UPCamera.UseFile("Oyster\\" + CurrentRecording.Description); } } catch(Exception Err) { MessageBox.Show(Err.Message,"Error occurred while loading media"); return; } } else if(CurrentRecording.IsDesktopCapture) { try { if(VST.Description == "Windows Media Server") { try { UP.Stop(); } catch(Exception Err) { string sPeek = Err.Message; } UP.UseTCP(); UP.UseMediaServer(VSS.ControlAddress + ":5119"); UP.UseFile("Oyster\\" + CurrentRecording.Description); } } catch(Exception Err) { MessageBox.Show(Err.Message,"Error occurred while loading media"); return; } } else { CameraAngles.Add(CurrentRecording); } } lblCameraNumber.Text = (CurrentCameraIndex + 1) + " of " + CameraAngles.Count.ToString(); if(CameraAngles.Count == 1) { lblPreviousCamera.ForeColor = Color.DimGray; lblNextCamera.ForeColor = Color.DimGray; } else { lblPreviousCamera.ForeColor = Color.DarkGoldenrod; lblNextCamera.ForeColor = Color.DarkGoldenrod; } DisplayMode(true); UPCamera.Play(); UP.Play(); ShowViewerControls(true); UpdateNotes(); UP.AdjustVolume(-10000); UPCamera.AdjustVolume(10000); return; } } } }