/// <summary> /// Plays back a conference, or at least a series of streams. /// </summary> /// <param name="venue">Venue to play back into (may be a unicast location).</param> /// <param name="streams">Database IDs of the streams to record.</param> /// <param name="playbackStopped">An Eventhandler to call when playback has /// stopped due to reaching the end of all the streams.</param> public void Play(IPEndPoint venue, int[] streams) { try { lock (this) { CheckForIPv6(venue); CheckVenueNotInUse(venue); // Start a ConferencePlayer eventLog.WriteEntry(string.Format(CultureInfo.CurrentCulture, Strings.PlayingARecordedConference, venue, streams.Length), EventLogEntryType.Information, ArchiveServiceEventLog.ID.Starting); ConferencePlayer player = new ConferencePlayer(); // Unicast playback sessions shouldn't receive the inbound data. The reason for this is that // multiple sessions would conflict at the port level, because they're all trying to receive // data on the same port. bool multicast = MSR.LST.Net.Utility.IsMulticast(venue); player.Play(venue, streams, multicast); sessions.Add(venue, player); } } catch (Exception ex) { eventLog.WriteEntry(ex.ToString(), EventLogEntryType.Error, ArchiveServiceEventLog.ID.Error); throw; } }
private void OnPlaybackStopped(object sender, EventArgs ea) { lock (this) { // Ensure hte conferencePlayer has stopped ConferencePlayer player = (ConferencePlayer)sender; player.StopPlaying(); sessions.Remove(player.Venue); } }
public void StopPlaying(IPEndPoint venue) { lock (this) { ConferencePlayer player = (ConferencePlayer)sessions[venue]; if (player != null) { player.StopPlaying(); sessions.Remove(venue); } } }
/// <summary> /// Gets the current point in time, in ticks, of where playback is in the course of the recording. /// </summary> public long GetCurrentTime(IPEndPoint venue) { lock (this) { ConferencePlayer player = (ConferencePlayer)sessions[venue]; if (player == null) { throw new ArgumentException(Strings.VenueDoesNotCorrelate); } return(player.CurrentTime); } }
/// <summary> /// Jumps to a specific time in a recording. /// </summary> public void JumpTo(IPEndPoint venue, long timeToJumpTo) { lock (this) { ConferencePlayer player = (ConferencePlayer)sessions[venue]; if (player == null) { throw new ArgumentException(Strings.VenueDoesNotCorrelate); } player.JumpTo(timeToJumpTo); } }
/// <summary> /// Gets the current point in time, in ticks, of where playback is in the course of the recording. /// </summary> public long GetCurrentTime(IPEndPoint venue) { lock (this) { ConferencePlayer player = (ConferencePlayer)sessions[venue]; if (player == null) { throw new ArgumentException("The venue provided does not correlate to an ongoing playback." + " Perhaps playback has already been stopped."); } return(player.CurrentTime); } }
/// <summary> /// Jumps to a specific time in a recording. /// </summary> public void JumpTo(IPEndPoint venue, long timeToJumpTo) { lock (this) { ConferencePlayer player = (ConferencePlayer)sessions[venue]; if (player == null) { throw new ArgumentException("The venue provided does not correlate to an ongoing playback." + " Perhaps playback has already been stopped."); } player.JumpTo(timeToJumpTo); } }
/// <summary> /// Plays back a conference, or at least a series of streams. /// </summary> /// <param name="venue">Venue to play back into (may be a unicast location).</param> /// <param name="streams">Database IDs of the streams to record.</param> /// <param name="playbackStopped">An Eventhandler to call when playback has /// stopped due to reaching the end of all the streams.</param> public void Play( IPEndPoint venue, int[] streams ) { try { lock(this) { CheckForIPv6(venue); CheckVenueNotInUse(venue); // Start a ConferencePlayer eventLog.WriteEntry(string.Format(CultureInfo.CurrentCulture, Strings.PlayingARecordedConference, venue, streams.Length), EventLogEntryType.Information, ArchiveServiceEventLog.ID.Starting); ConferencePlayer player = new ConferencePlayer(); // Unicast playback sessions shouldn't receive the inbound data. The reason for this is that // multiple sessions would conflict at the port level, because they're all trying to receive // data on the same port. bool multicast = MSR.LST.Net.Utility.IsMulticast(venue); player.Play(venue, streams, multicast); sessions.Add(venue, player); } } catch (Exception ex) { eventLog.WriteEntry(ex.ToString(), EventLogEntryType.Error, ArchiveServiceEventLog.ID.Error); throw; } }