Example #1
0
        public void addRatingItem(string pSegmentName, int pNumStars)
        {
            ItemsRating lRatingItem = new ItemsRating(pSegmentName, pNumStars);

            if (NumberOfItemsForStars.ContainsKey(pSegmentName))
            {
                NumberOfItemsForStars.Remove(pSegmentName);
            }
            NumberOfItemsForStars.Add(pSegmentName, lRatingItem);
        }
Example #2
0
        private void loadFrameOverlayData(string[] row, int pVideoWidth, int pVideoHeight)
        {
            FrameEvent   = false;
            PauseRequest = false;

            double FrameTime             = Convert.ToDouble(row[0]);
            double lOverlayFrameDuration = Convert.ToDouble(row[1]);

            if (!mParent.VideoUserOptions.SlowMo)
            {
                FrameNumber     = (int)(FrameTime * (double)mParent.FPS);
                OverlayDuration = (int)(lOverlayFrameDuration * (double)mParent.FPS);
            }
            else
            {
                FrameNumber     = (int)(FrameTime * (double)mParent.FPS * mParent.SlowMoRatio);
                OverlayDuration = (int)(lOverlayFrameDuration * (double)mParent.FPS * mParent.SlowMoRatio);
            }


            double lXPositionRatio = (float)Convert.ToDouble(row[2]);
            double lYPositionRatio = (float)Convert.ToDouble(row[3]);
            double lWidthRatio     = (float)Convert.ToDouble(row[4]);
            double lHeightRatio    = (float)Convert.ToDouble(row[5]);

            mLeft        = pVideoWidth * lXPositionRatio;
            mTop         = pVideoHeight * lYPositionRatio;
            mImageWidth  = pVideoWidth * lWidthRatio;
            mImageHeight = pVideoHeight * lHeightRatio;

            string lCaptionString = row[6];

            if (lCaptionString.CompareTo(ProjectConstants.TRAINING_EVENT_STRING) == 0)
            {
                FrameEvent     = true;
                FrameEventName = row[7];
                return;
            }
            else if (lCaptionString.CompareTo(ProjectConstants.TRAINING_IMAGE_CAPTION_STRING) == 0)
            {
                CaptionType = ProjectConstants.TRAINING_IMAGE_CAPTION_OPTION;
                string lImagePath = ProjectConstants.STEP_ICONS_MEDIA_PATH + @"\" + row[7];
                OverlayImage = Image.FromFile(lImagePath);
            }
            else if (lCaptionString.CompareTo(ProjectConstants.TRAINING_OBJECT_CAPTION_STRING) == 0)
            {
                CaptionType = ProjectConstants.TRAINING_IMAGE_CAPTION_OPTION;
                string      lKey    = row[15];
                ItemsRating lRating = mParent.getRatingItem(lKey);
                if (lRating != null)
                {
                    OverlayImage = lRating.getImage((int)mImageWidth, (int)mImageHeight, row);
                }
                else
                {
                    OverlayImage = Image.FromFile(ProjectConstants.STEP_ICONS_MEDIA_PATH + @"\" + ProjectConstants.TRAINING_BLANK_SCORING_IMAGE_FILENAME);
                }
            }
            else if (lCaptionString.CompareTo(ProjectConstants.TRAINING_PAUSE_CAPTION_STRING) == 0)
            {
                CaptionType  = ProjectConstants.TRAINING_PAUSE_CAPTION_OPTION;
                PauseRequest = true;
            }
            else
            {
                CaptionType = ProjectConstants.TRAINING_TEXT_CAPTION_OPTION;
                OverlayText = row[7];
                int       lFSize     = (int)(Convert.ToDouble(row[11]) * pVideoWidth);
                FontStyle lFontStyle = new FontStyle();
                if (Convert.ToBoolean(row[13].ToLower()))
                {
                    lFontStyle = FontStyle.Bold;
                }
                if (Convert.ToBoolean(row[14].ToLower()))
                {
                    lFontStyle = lFontStyle | FontStyle.Italic;
                }

                FontOverlay = new Font(row[10], lFSize, lFontStyle,
                                       System.Drawing.GraphicsUnit.Point);

                string lTextColor = row[12];
                switch (lTextColor)
                {
                case "White": TextColor = System.Drawing.Brushes.White;
                    break;

                case "Red": TextColor = System.Drawing.Brushes.Red;
                    break;

                case "Green": TextColor = System.Drawing.Brushes.Green;
                    break;

                case "Blue": TextColor = System.Drawing.Brushes.Blue;
                    break;

                case "Black": TextColor = System.Drawing.Brushes.Black;
                    break;

                default:
                    TextColor = System.Drawing.Brushes.White;
                    break;
                }
            }

            if (row.Length > 9 && row[8].CompareTo("") != 0)
            {
                Flashing = Convert.ToBoolean(row[8].ToLower());
            }
            if (row.Length > 10 && row[9].CompareTo("") != 0)
            {
                Moving = Convert.ToBoolean(row[9].ToLower());
            }
        }
 public void addRatingItem(string pSegmentName, int pNumStars)
 {
     ItemsRating lRatingItem = new ItemsRating(pSegmentName, pNumStars);
     if (NumberOfItemsForStars.ContainsKey(pSegmentName))
         NumberOfItemsForStars.Remove(pSegmentName);
     NumberOfItemsForStars.Add(pSegmentName,lRatingItem);
 }