コード例 #1
0
        /// <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;
            }
        }
コード例 #2
0
 private void OnPlaybackStopped(object sender, EventArgs ea)
 {
     lock (this)
     {
         // Ensure hte conferencePlayer has stopped
         ConferencePlayer player = (ConferencePlayer)sender;
         player.StopPlaying();
         sessions.Remove(player.Venue);
     }
 }
コード例 #3
0
 public void StopPlaying(IPEndPoint venue)
 {
     lock (this)
     {
         ConferencePlayer player = (ConferencePlayer)sessions[venue];
         if (player != null)
         {
             player.StopPlaying();
             sessions.Remove(venue);
         }
     }
 }
コード例 #4
0
        /// <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);
            }
        }
コード例 #5
0
        /// <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);
            }
        }
コード例 #6
0
ファイル: ArchiveServer.cs プロジェクト: cucacutexice/AIGA
        /// <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);
            }
        }
コード例 #7
0
ファイル: ArchiveServer.cs プロジェクト: cucacutexice/AIGA
        /// <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);
            }
        }
コード例 #8
0
        /// <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;
            }
        }