Example #1
0
 /// <summary>
 /// Event triggered when the player state changes
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="e">event args</param>
 private void _player_EvtPlayerStateChanged(object sender, PlayerStateChangedEventArgs e)
 {
     if (EvtPlayerStateChanged != null)
     {
         var delegates = EvtPlayerStateChanged.GetInvocationList();
         foreach (var del in delegates)
         {
             var playerstateChanged = (PlayerStateChanged)del;
             playerstateChanged.BeginInvoke(sender, e, null, null);
         }
     }
 }
Example #2
0
        /// <summary>
        /// The play state of the animation manager changed.  If the
        /// scanner is not running, start the idle timer if configured)
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void animationManager_EvtPlayerStateChanged(object sender, PlayerStateChangedEventArgs e)
        {
            if (!CoreGlobals.AppPreferences.HideScannerOnIdle || _isPaused || PreviewMode)
            {
                return;
            }

            try
            {
                var newState = _animationManager.GetPlayerState();
                Log.Debug(ScannerForm.Name + ": PlayerState changed from " + e.OldState.ToString() + " to " + newState.ToString());
                switch (newState)
                {
                    case PlayerState.Timeout:
                        _idleTimer.Start();
                        break;

                    case PlayerState.Running:
                        _idleTimer.Stop();
                        Windows.SetOpacity(ScannerForm, 1.0);
                        Windows.SetVisible(ScannerForm, true);
                        break;
                }
            }
            catch (Exception ex)
            {
                Log.Debug(ex.ToString());
            }
        }
Example #3
0
 /// <summary>
 /// Event triggered when the player state changes
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="e">event args</param>
 private void _player_EvtPlayerStateChanged(object sender, PlayerStateChangedEventArgs e)
 {
     if (EvtPlayerStateChanged != null)
     {
         var delegates = EvtPlayerStateChanged.GetInvocationList();
         foreach (var del in delegates)
         {
             var playerstateChanged = (PlayerStateChanged)del;
             playerstateChanged.BeginInvoke(sender, e, null, null);
         }
     }
 }