/// <summary>
 /// Sets the smpte frame rate.
 /// </summary>
 /// <param name="frameRate">The frame rate.</param>
 public void SetSmpteFrameRate(SmpteFrameRate frameRate)
 {
     if (frameRate != SmpteFrameRate.Unknown)
     {
         this.currentSmpteFrameRate = frameRate;
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="PlayerControl"/> class.
        /// </summary>
        public PlayerControl()
        {
            InitializeComponent();
            this.timer = new DispatcherTimer {
                Interval = new TimeSpan(0, 0, 1)
            };
            this.timer.Tick   += this.Timer_Tick;
            this.positionTimer = new DispatcherTimer {
                Interval = TimeSpan.FromMilliseconds(UtilityHelper.PositionUpdateIntervalMillis)
            };
            this.positionTimer.Tick   += this.PositionTimer_Tick;
            this.currentSmpteFrameRate = SmpteFrameRate.Smpte2997NonDrop;
            this.externalManifestFiles = new List <Uri>();

            if (!DesignerProperties.IsInDesignMode)
            {
                this.logger = ServiceLocator.Current.GetInstance(typeof(ILogger)) as ILogger;
                this.codecPrivateDataParser = ServiceLocator.Current.GetInstance(typeof(ICodecPrivateDataParser)) as ICodecPrivateDataParser;

                var configurationSerive = ServiceLocator.Current.GetInstance <IConfigurationService>();
                if (configurationSerive != null)
                {
                    this.ShowFragmentBoundariesButton.Visibility = configurationSerive.GetSnapToFragmentBoundaries()
                        ? Visibility.Visible
                        : this.ShowFragmentBoundariesButton.Visibility;

                    this.currentSmpteFrameRate = configurationSerive.GetDefaultFrameRate();
                }
            }
        }
        /// <summary>
        /// Raises the FrameRateParsed event.
        /// </summary>
        /// <param name="frameRate">The frame rate included on the event args data.</param>
        private void OnFrameRateParsed(SmpteFrameRate frameRate)
        {
            EventHandler <DataEventArgs <SmpteFrameRate> > handler = this.FrameRateParsed;

            if (handler != null)
            {
                handler(this, new DataEventArgs <SmpteFrameRate>(frameRate));
            }
        }