Exemplo n.º 1
0
        /// <summary>
        /// Start a new recording (not a webcast)
        /// </summary>
        /// <returns>true on success</returns>
        public bool StartNewRecording()
        {
            bool result = false;

            try
            {
                Recording           nextRecording = this.controller.GetNextRecording();
                RemoteRecorderState state         = this.controller.GetCurrentState();

                if (state.Status != RemoteRecorderStatus.Recording &&
                    state.CurrentRecording == null &&
                    nextRecording == null)
                {
                    result = this.controller.StartNewRecording(false);
                    if (!result)
                    {
                        Trace.TraceWarning("StartNewRecording failed.");
                    }
                }
            }
            catch (Exception e)
            {
                this.HandleRRException(e, false);
            }

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Stop the current recording
        /// </summary>
        /// <returns>true on success</returns>
        public bool StopCurrentRecording()
        {
            bool result = false;

            try
            {
                RemoteRecorderState state = this.controller.GetCurrentState();
                if (state.CurrentRecording != null)
                {
                    if (state.Status != RemoteRecorderStatus.Stopped)
                    {
                        result = this.controller.StopCurrentRecording(state.CurrentRecording.Id);
                        if (!result)
                        {
                            Trace.TraceWarning("StopCurrentRecording failed.");
                        }
                    }
                }
            }
            catch (Exception e)
            {
                this.HandleRRException(e, false);
            }

            return(result);
        }
        /// <summary>
        ///     Extend the current recording
        /// </summary>
        /// <returns>true on success</returns>
        public bool ExtendCurrentRecording()
        {
            bool result = false;

            try
            {
                RemoteRecorderState cState = controller.GetCurrentState();
                if (cState.CurrentRecording != null)
                {
                    controller.ExtendCurrentRecording(cState.CurrentRecording.Id);
                    result = true;
                }
            }
            catch (Exception e)
            {
                HandleRRException(e, false);
            }

            return(result);
        }
        /// <summary>
        ///     Pause the current recording
        /// </summary>
        /// <returns>true on success</returns>
        public bool PauseCurrentRecording()
        {
            bool result = false;

            try
            {
                RemoteRecorderState cState = controller.GetCurrentState();
                if (cState.Status != RemoteRecorderStatus.Paused)
                {
                    controller.PauseCurrentRecording(cState.CurrentRecording.Id);
                    result = true;
                }
            }
            catch (Exception e)
            {
                HandleRRException(e, false);
            }

            return(result);
        }
        /// <summary>
        ///     Start the next recording
        /// </summary>
        /// <returns>true on success</returns>
        public bool StartNextRecording()
        {
            bool result = false;

            try
            {
                Recording           nextRecording = controller.GetNextRecording();
                RemoteRecorderState cState        = controller.GetCurrentState();

                if (cState.Status != RemoteRecorderStatus.Recording &&
                    cState.CurrentRecording != nextRecording)
                {
                    controller.StartNextRecording(nextRecording.Id);
                    result = true;
                }
            }
            catch (Exception e)
            {
                HandleRRException(e, false);
            }

            return(result);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Pause the current recording
        /// </summary>
        /// <returns>true on success</returns>
        public bool PauseCurrentRecording()
        {
            bool result = false;

            try
            {
                RemoteRecorderState state = this.controller.GetCurrentState();
                if (state.Status != RemoteRecorderStatus.Paused)
                {
                    result = this.controller.PauseCurrentRecording(state.CurrentRecording.Id);
                    if (!result)
                    {
                        Trace.TraceInformation("PauseCurrentRecording failed. This is expected if the recording is webcast.");
                    }
                }
            }
            catch (Exception e)
            {
                this.HandleRRException(e, false);
            }

            return(result);
        }