示例#1
0
        /// <summary>
        /// Stop the playback.
        /// </summary>
        internal void StopPlayBack()
        {
            if (archiver != null && Conference.ActiveVenue != null)
            {
                IPEndPoint remoteVenue; // find the remote venue, which is different from out venue in unicast playback
                if (MSR.LST.Net.Utility.IsMulticast(Conference.ActiveVenue.EndPoint))
                {
                    remoteVenue = Conference.ActiveVenue.EndPoint;
                }
                else
                {
                    remoteVenue = new IPEndPoint(Conference.RtpSession.MulticastInterface,
                        Conference.ActiveVenue.EndPoint.Port);
                }

                archiver.StopPlaying(remoteVenue);
                archiver = null;
            }

            this.archiverState = ArchiverState.Stopped;

            // Reset the status message to participants
            this.DisplayParticipantCount();
        }
示例#2
0
        /// <summary>
        /// Stop the current recording.
        /// </summary>
        internal void StopRecording()
        {
            try
            {
                if (this.archiverState == ArchiverState.Recording)
                {
                    if (archiver != null && Conference.ActiveVenue != null)
                    {
                        int refs = archiver.StopRecording(Conference.ActiveVenue.EndPoint);
                        archiver = null;

                        if (refs > 0)
                        {
                            MessageBox.Show(this, "Recording will continue, as other participants have requested this recording as well."
                                + "\n  When the recording participant leaves, recording has stopped.",
                                "Recording not stopped.");
                        }
                        else if (refs == 0)
                        {
                            MessageBox.Show(this,
                                "Recording has stopped. To ensure proper playback after the initial recording, make sure \n"
                                + "all participants leave the venue before choosing to play back the recording.",
                                "Recording Stopped", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else // refs < 0 (i.e. error)
                        {
                            MessageBox.Show(this, "Warning: Recording was already stopped!  Either there was an error on the server, or the"
                                + "\n venue had been empty for some amount of time and recording automatically stopped.",
                                "Recording stopped prematurely.", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }

                    this.archiverState = ArchiverState.Stopped;
                }
            }
            catch (Exception ex)
            {
                archiverState = ArchiverState.Stopped;

                MessageBox.Show(this,
                    "The Archive Service is currently unavailable\n" +
                    "or may have encountered an unexpected error.\n" +
                    "Please contact your server's administrator.\n\nException:\n" + ex.ToString(),
                    "Archive Service Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            SetArchiverMenuStatus();
        }
示例#3
0
        /// <summary>
        /// Play back an archive in the appropriate venue
        /// </summary>
        /// <param name="Streams">Streams ID to play back</param>
        /// <param name="selectedConference">Selected Conference</param>
        /// <returns>The IP adress where the archive is played back</returns>
        internal System.Net.IPEndPoint PlayArchive(int[] streams, ArchiveService.Conference selectedConference)
        {
            // TODO: Move PlayArchive out of BarUI

            // IP adresse where the archive is played back
            System.Net.IPEndPoint archivePlayBackIP = null;

            // TODO: Make sure we cannot get to an infinite loop by removing test on sender
            // if ( sender != this && (this.archiverState == ArchiverState.Stopped) )

            if (this.archiverState == ArchiverState.Stopped)
            {
                if (Conference.ActiveVenue == null) // Join a venue to playback to (generally unicast)
                {
                    // We've established a venue to join to, so do it
                    JoinVenue(GetPlayBackVenue(), false);
                }

                // We're definitely in a venue now
                Debug.Assert(Conference.ActiveVenue != null);

                // We're in a venue - playback to it
                if (MSR.LST.Net.Utility.IsMulticast(Conference.ActiveVenue.EndPoint))
                {
                    // Multicast playback - send directly to the multicast group
                    archivePlayBackIP = Conference.ActiveVenue.EndPoint;
                    archiver.Play(Conference.ActiveVenue.EndPoint, streams);
                }
                else
                {
                    // Unicast playback - send data directly to the local IP
                    archivePlayBackIP = new IPEndPoint(Conference.RtpSession.MulticastInterface,
                        Conference.ActiveVenue.EndPoint.Port);
                    archiver.Play(archivePlayBackIP, streams);
                }

                DisplayPlayBackInfo(selectedConference);

                this.archiverState = ArchiverState.Playing;
            }

            SetArchiverMenuStatus();
            return archivePlayBackIP;
        }
示例#4
0
        /// <summary>
        /// Start a new recording of a conference.
        /// </summary>
        /// <param name="ConferenceName">Name of the recorded conference</param>
        internal void StartRecording(string ConferenceName)
        {
            if (this.archiverState == ArchiverState.Stopped)
            {
                GetNewArchiver();
                archiver.Record(ConferenceName, Conference.ActiveVenue.Name, Conference.ActiveVenue.EndPoint);
                this.archiverState = ArchiverState.Recording;
            }

            SetArchiverMenuStatus();
        }
示例#5
0
        /// <summary>
        /// Creates a new IArchiveServer object to make remote calls to.
        /// </summary>
        internal void GetNewArchiver()
        {
            if (archiveServiceDefault != null)
            {
                try
                {
                    object factoryObj = Activator.GetObject(typeof(IArchiveServer), GetArchiveUri() + "/ArchiveServer");
                    this.archiver = (IArchiveServer)factoryObj;
                }
                catch (Exception ex)
                {
                    archiverState = ArchiverState.Unavailable;
                    MessageBox.Show(this,
                        "The Archive Service is currently unavailable\n" +
                        "or may have encountered an unexpected error.\n" +
                        "Please contact your server's administrator.\n\nException:\n" + ex.ToString(),
                        "Archive Service Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            SetArchiverMenuStatus();
        }
示例#6
0
        private void GetArchiveService()
        {
            // Get list of registered archivers, and select the one that is enabled, if any
            string[] keys = archiversRegKey.GetValueNames();
            archiveServiceDefault = null;

            // Find the default Archive Service, if there is one
            if (keys != null)
            {
                foreach (string key in keys)
                {
                    // See whether or not it is enabled based on the value of the key/value pair
                    if (bool.Parse((string)archiversRegKey.GetValue(key)))
                    {
                        archiveServiceDefault = key;
                        break;
                    }
                }
            }

            // If we found a default, use it
            if (archiveServiceDefault != null)
            {
                archiverState = ArchiverState.Stopped;
                GetNewArchiver();
            }
            else
            {
                archiverState = ArchiverState.Unavailable;
                // Disable the archiver menu
                SetArchiverMenuStatus();
            }
        }
示例#7
0
        /// <summary>
        /// Stop the current recording.
        /// </summary>
        internal void StopRecording()
        {
            try
            {
                if (this.archiverState == ArchiverState.Recording)
                {
                    if (archiver != null && Conference.ActiveVenue != null)
                    {
                        int refs = archiver.StopRecording(Conference.ActiveVenue.EndPoint);
                        archiver = null;

                        if (refs > 0)
                        {
                            RtlAwareMessageBox.Show(this, Strings.RecordingNotStoppedText,
                                Strings.RecordingNotStoppedTitle, MessageBoxButtons.OK, MessageBoxIcon.None,
                                MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                        }
                        else if (refs == 0)
                        {
                            RtlAwareMessageBox.Show(this, Strings.RecordingStoppedText, Strings.RecordingStoppedTitle,
                                MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1,
                                (MessageBoxOptions)0);
                        }
                        else // refs < 0 (i.e. error)
                        {
                            RtlAwareMessageBox.Show(this, Strings.RecordingStoppedPrematurelyText,
                                Strings.RecordingStoppedPrematurelyTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning,
                                MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                        }
                    }

                    this.archiverState = ArchiverState.Stopped;
                }
            }
            catch (Exception ex)
            {
                archiverState = ArchiverState.Stopped;

                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture, 
                    Strings.ArchiveServiceErrorText, ex.ToString()), Strings.ArchiveServiceErrorTitle, 
                    MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 
                    (MessageBoxOptions)0);
            }

            SetArchiverMenuStatus();
        }
示例#8
0
        /// <summary>
        /// Start a new recording of a conference.
        /// </summary>
        /// <param name="ConferenceName">Name of the recorded conference</param>
        internal void StartRecording(string ConferenceName)
        {

            // For now, we disallow recording of encrypted venues
            Venue venue = Conference.ActiveVenue as Venue;
            if (venue == null)
                return; // shouldn't happen

            if (venue.PWStatus == PasswordStatus.STRONG_PASSWORD)
            {
                RtlAwareMessageBox.Show(this, Strings.NoArchivingEncryptedVenues,
                                Strings.RecordingError, MessageBoxButtons.OK, MessageBoxIcon.Error,
                                MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                return;
            }


            if (this.archiverState == ArchiverState.Stopped)
            {
                GetNewArchiver();
                archiver.Record(ConferenceName, Conference.ActiveVenue.Name, Conference.ActiveVenue.EndPoint);
                this.archiverState = ArchiverState.Recording;
            }

            SetArchiverMenuStatus();
        }
示例#9
0
        /// <summary>
        /// Creates a new IArchiveServer object to make remote calls to.
        /// </summary>
        internal void GetNewArchiver()
        {
            if (archiveServiceDefault != null)
            {
                try
                {
                    object factoryObj = Activator.GetObject(typeof(IArchiveServer), GetArchiveUri() + "/ArchiveServer");
                    this.archiver = (IArchiveServer)factoryObj;
                }
                catch (Exception ex)
                {
                    archiverState = ArchiverState.Unavailable;

                    RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture, 
                        Strings.ArchiveServiceErrorText, ex.ToString()), Strings.ArchiveServiceErrorTitle, 
                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 
                        (MessageBoxOptions)0);
                }
            }

            SetArchiverMenuStatus();
        }