Example #1
0
        /// <summary>
        /// Encode Progress Event Handler
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The Interop.EncodeProgressEventArgs.
        /// </param>
        private void InstanceEncodeProgress(object sender, EncodeProgressEventArgs e)
        {
            EventArgs.EncodeProgressEventArgs args = new EventArgs.EncodeProgressEventArgs
            {
                AverageFrameRate  = e.AverageFrameRate,
                CurrentFrameRate  = e.CurrentFrameRate,
                EstimatedTimeLeft = e.EstimatedTimeLeft,
                PercentComplete   = e.FractionComplete * 100,
                Task        = e.Pass,
                ElapsedTime = DateTime.Now - this.startTime,
            };

            this.InvokeEncodeStatusChanged(args);
        }
Example #2
0
 /// <summary>
 /// Invoke the Encode Status Changed Event.
 /// </summary>
 /// <param name="e">
 /// The EncodeProgressEventArgs.
 /// </param>
 public void InvokeEncodeStatusChanged(EncodeProgressEventArgs e)
 {
     EncodeProgessStatus handler = this.EncodeStatusChanged;
     if (handler != null)
     {
         handler(this, e);
     }
 }
 /// <summary>
 /// Handle Encode Progress Events
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The EncodeProgressEventArgs.
 /// </param>
 private void encodeService_EncodeStatusChanged(object sender, EncodeProgressEventArgs e)
 {
     this.Percentage = string.Format("{0} %", Math.Round(e.PercentComplete, 2).ToString(CultureInfo.InvariantCulture));
     this.PercentageValue = e.PercentComplete;
 }
        /// <summary>
        /// Encode Status has changed, update log window
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void EncodeServiceEncodeStatusChanged(object sender, EncodeProgressEventArgs e)
        {
            if (encodeLogIndex != this.encodeService.LogIndex || this.encodeService.LogIndex == -1)
            {
                this.NotifyOfPropertyChange(() => this.EncodeLog);
            }

            encodeLogIndex = this.encodeService.LogIndex;
        }
Example #5
0
        /// <summary>
        /// The Encode Status has changed Handler
        /// </summary>
        /// <param name="sender">
        /// The Sender
        /// </param>
        /// <param name="e">
        /// The Encode Progress Event Args
        /// </param>
        private void EncodeStatusChanged(object sender, EncodeProgressEventArgs e)
        {
            int percent;
            int.TryParse(
                Math.Round(e.PercentComplete).ToString(CultureInfo.InvariantCulture),
                out percent);

            Execute.OnUIThread(
                () =>
                {
                    if (this.queueProcessor.EncodeService.IsEncoding)
                    {
                        this.ProgramStatusLabel =
                            string.Format(Resources.MainViewModel_EncodeStatusChanged_StatusLabel + Resources.Main_JobsPending_addon,
                                e.PercentComplete,
                                e.CurrentFrameRate,
                                e.AverageFrameRate,
                                e.EstimatedTimeLeft,
                                e.ElapsedTime,
                                this.queueProcessor.Count);

                        if (lastEncodePercentage != percent && this.windowsSeven.IsWindowsSeven)
                        {
                            this.windowsSeven.SetTaskBarProgress(percent);
                        }

                        lastEncodePercentage = percent;
                        this.ProgressPercentage = percent;
                        this.NotifyOfPropertyChange(() => ProgressPercentage);
                    }
                    else
                    {
                        this.ProgramStatusLabel = Resources.Main_QueueFinished;
                        this.IsEncoding = false;

                        if (this.windowsSeven.IsWindowsSeven)
                        {
                            this.windowsSeven.SetTaskBarProgressToNoProgress();
                        }
                    }
                });
        }
 /// <summary>
 /// Handle the Encode Status Changed Event.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The EncodeProgressEventArgs.
 /// </param>
 private void EncodeService_EncodeStatusChanged(object sender, EncodeProgressEventArgs e)
 {
     Execute.OnUIThread(() =>
     {
         this.JobStatus =
             string.Format(
                 "Encoding: Pass {0} of {1},  {2:00.00}%, FPS: {3:000.0},  Avg FPS: {4:000.0},  Time Remaining: {5},  Elapsed: {6:hh\\:mm\\:ss}",
                 e.Task,
                 e.TaskCount,
                 e.PercentComplete,
                 e.CurrentFrameRate,
                 e.AverageFrameRate,
                 e.EstimatedTimeLeft,
                 e.ElapsedTime);
     });
 }
Example #7
0
 /// <summary>
 /// Handle the Encode Status Changed Event.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The EncodeProgressEventArgs.
 /// </param>
 private void EncodeService_EncodeStatusChanged(object sender, EncodeProgressEventArgs e)
 {
     Execute.OnUIThread(() =>
     {
         this.JobStatus =
             string.Format(
                 Resources.QueueViewModel_QueueStatusDisplay,
                 e.Task,
                 e.TaskCount,
                 e.PercentComplete,
                 e.CurrentFrameRate,
                 e.AverageFrameRate,
                 e.EstimatedTimeLeft,
                 e.ElapsedTime);
     });
 }
Example #8
0
        /// <summary>
        /// The encode service_ encode status changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void EncodeService_EncodeStatusChanged(object sender, EncodeProgressEventArgs e)
        {
            this.Task = queueProcessor.LastProcessedJob.ScannedSourcePath;

            // {0:00.00}%   FPS: {1:000.0}   Avg FPS: {2:000.0}   Time Remaining: {3}   Elapsed: {4:hh\:mm\:ss}
            this.Progress = string.Format(
                Resources.MainViewModel_EncodeStatusChanged_StatusLabel,
                e.PercentComplete,
                e.CurrentFrameRate,
                e.AverageFrameRate,
                e.EstimatedTimeLeft,
                e.ElapsedTime);
        }